:root { --bg:#140b0b; --panel:#221414; --line:#3a2424; --fg:#f3e9e6; --dim:#a8928c; --red:#d62020; --acc:#ff7a1a; --ok:#2fb35a; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.35 system-ui, sans-serif; }
body { padding: 56px 0 72px; }
header { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #1d0e0e; border-bottom: 2px solid var(--red); z-index: 10; }
header .title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c00; margin-right: 8px; }
#dot.ok { background: var(--ok); }
#clock { font: 700 20px ui-monospace, monospace; }
main { padding: 8px 14px; max-width: 760px; margin: 0 auto; }
.tab { display: none; } .tab.on { display: block; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); margin: 18px 0 8px; }
button, select, input, textarea { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
button:active { transform: scale(.97); }
textarea, input:not([type]), input[type=text] { width: 100%; }
input[type=range] { width: 100%; padding: 0; min-height: 32px; accent-color: var(--acc); background: none; border: 0; }
input[type=color] { padding: 2px; width: 60px; }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; accent-color: var(--acc); }
.primary { background: var(--acc); border-color: var(--acc); color: #1a0a00; font-weight: 700; }
.danger { background: var(--red); border-color: var(--red); font-weight: 800; }
.danger.on { background: #fff; color: var(--red); animation: blink 1s infinite; }
#greenout { background: #0b3d1a; border-color: #00c853; color: #7dff9e; font-weight: 800; }
#greenout.on { background: #00ff00; color: #000; border-color: #00ff00; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .6; } }
.wide { width: 100%; margin-top: 10px; }
.row { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.grid button { min-height: 64px; font-weight: 600; }
.grid button.on { background: var(--acc); color: #1a0a00; border-color: #ffd0a0; box-shadow: 0 0 0 2px #ffb070 inset; }
.grid button.trig { background: #4a1010; border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { min-height: 40px; padding: 6px 12px; border-radius: 20px; font-size: 14px; }
.chips button.on { background: var(--ok); border-color: var(--ok); color: #031; font-weight: 700; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.card.vis { border-color: var(--acc); }
.card .head { display: flex; align-items: center; gap: 8px; }
.card .head .nm { flex: 1; font-weight: 600; }
.card .head .ty { color: var(--dim); font-size: 13px; }
.card .head button { min-height: 36px; padding: 4px 10px; }
.card details summary { color: var(--dim); font-size: 14px; padding: 6px 0; cursor: pointer; }
.prm { margin: 6px 0; }
.prm label { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); }
.switch { display: flex; align-items: center; gap: 8px; }
.hint { color: var(--dim); font-size: 13px; margin: 6px 0; }
#mapWrap { background: #000; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; touch-action: none; }
#mapCanvas { display: block; width: 100%; touch-action: none; }
#cornerSel button.on, #punkteSel button.on { background: var(--acc); color: #1a0a00; }
#punkteSel button { flex: 1; min-width: 0; font-weight: 700; }
.nudge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 280px; margin: 8px auto; }
.nudge button { min-height: 52px; font-size: 20px; }
nav { position: fixed; bottom: 0; left: 0; right: 0; height: 64px; display: flex; background: #1d0e0e; border-top: 1px solid var(--line); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
nav button { flex: 1; border: 0; border-radius: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; gap: 2px; }
nav button span { font-size: 11px; color: var(--dim); }
nav button.on span { color: var(--acc); font-weight: 700; }
nav button.on { box-shadow: 0 -3px 0 var(--acc) inset; }
#toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: #000c; padding: 8px 14px; border-radius: 8px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 20; }
#toast.on { opacity: 1; }

#pmap { width: 100%; height: 58vh; min-height: 260px; border-radius: 8px; border: 1px solid var(--line); background: #111; }
.results { display: flex; flex-direction: column; gap: 4px; }
.results button { text-align: left; font-size: 13px; min-height: 0; }
.gm { display: inline-flex; align-items: center; gap: 4px; background: rgba(20,12,12,.85); color: #fff; border: 2px solid #777; border-radius: 14px;
      padding: 3px 5px; font: 600 14px system-ui; white-space: nowrap; transform: translate(-50%, -50%); }
.gm.on { border-color: #ff7a1a; } .gm.sel { border-color: #ffd000; box-shadow: 0 0 0 2px #ffd000; }
.gu { position: relative; width: 100%; height: 100%; }
.gu span { position: absolute; left: 50%; transform: translateX(-50%); background: rgba(20,20,24,.85); color: #fff; font: 700 11px system-ui; padding: 1px 5px; border-radius: 4px; white-space: nowrap; }
.leaflet-container a.leaflet-control-zoom-in, .leaflet-container a.leaflet-control-zoom-out { color: #000; }
