:root {
  --glass: rgba(14, 15, 19, 0.72);
  --glass-strong: rgba(14, 15, 19, 0.9);
  --solid: #111216;
  --raise: rgba(255, 255, 255, 0.05);
  --raise-2: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f2f3f5;
  --text-2: #c4c8cf;
  --muted: #8b919b;
  --accent: #ff6a1a;
  --accent-2: #ffb547;
  --accent-soft: rgba(255, 106, 26, 0.16);
  --grad: linear-gradient(135deg, #ff8a1a 0%, #ff4d2e 100%);
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -8px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.25);
  --panel-w: 320px;
  --gap: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0b0d; color: var(--text); font: 13px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
#map { position: absolute; inset: 0; }
.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
svg { display: block; }
svg use, .icon-btn svg, .tool svg, .tab svg, .btn-wide svg, .fi, .about summary svg, .search .ico { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.pill { border-radius: 999px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.mt { margin-top: 18px; }

button, select, input[type=search] {
  font: inherit; color: var(--text); background: var(--raise);
  border: 1px solid transparent; border-radius: var(--r-sm); padding: 7px 11px; outline: none;
}
button { cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s; }
button:hover { background: var(--raise-2); }
button:active { transform: scale(0.97); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
select option { background: var(--solid); }

.icon-btn { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; background: transparent; border-radius: 10px; color: var(--text-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--raise-2); color: var(--text); }
.icon-btn.on { background: var(--accent-soft); color: var(--accent-2); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn.sm svg { width: 16px; height: 16px; }

/* ---------- top-left: brand + search ---------- */
#brandbar { position: absolute; top: var(--gap); left: var(--gap); z-index: 6; display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 6px; }
.brand { display: flex; align-items: center; gap: 9px; padding-right: 8px; white-space: nowrap; }
.logo { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(255, 90, 30, 0.45); }
.logo svg { width: 16px; height: 16px; fill: #fff; stroke: none; }
.logo svg use { fill: #fff; stroke: none; }
.name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.name b { font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { position: relative; display: flex; align-items: center; }
.search .ico { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.search input { width: 260px; padding: 8px 34px 8px 33px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); transition: width 0.2s, background 0.15s; }
.search input:focus { width: 320px; background: rgba(255, 255, 255, 0.08); border-color: var(--line-2); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { position: absolute; right: 10px; font: 600 10.5px 'JetBrains Mono', monospace; color: var(--muted); border: 1px solid var(--line-2); border-radius: 5px; padding: 0 5px; pointer-events: none; }
.dropdown { position: absolute; top: calc(100% + 8px); left: 0; min-width: 100%; background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: var(--r-md); display: none; overflow: hidden; z-index: 20; padding: 5px; box-shadow: var(--shadow); }
.dropdown.open { display: block; animation: pop 0.14s ease-out; }
.dropdown > div:not(.mh) { padding: 8px 10px; cursor: pointer; border-radius: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.dropdown > div:not(.mh):hover { background: var(--raise-2); color: var(--text); }
.dropdown small { color: var(--muted); margin-left: 6px; }
.dropdown .mh { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.menu-wrap { position: relative; }
.menu { left: auto; right: 0; width: 240px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* ---------- top-centre: view bar ---------- */
#viewbar { position: absolute; top: var(--gap); left: 50%; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 2px; padding: 5px; }
.sep { width: 1px; height: 20px; background: var(--line-2); margin: 0 6px; }
.seg { display: inline-flex; background: rgba(0, 0, 0, 0.25); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border-radius: 999px; background: transparent; padding: 5px 13px; font-weight: 600; font-size: 12px; color: var(--muted); }
.seg button.on { background: var(--text); color: #111; }

/* ---------- tool dock ---------- */
#tools { position: absolute; left: var(--gap); top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px; }
.tool { position: relative; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; background: transparent; border-radius: 12px; color: var(--text-2); }
.tool svg { width: 20px; height: 20px; }
.tool:hover { background: var(--raise-2); color: var(--text); }
.tool.on { background: var(--text); color: #111; }
.tool.fire.on { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(255, 80, 30, 0.45); }
.dock-sep { width: 22px; height: 1px; background: var(--line-2); margin: 3px 0; }

/* tooltip */
#tip { position: fixed; z-index: 50; pointer-events: none; background: #f2f3f5; color: #111; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transform: translateY(2px); transition: opacity 0.12s, transform 0.12s; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
#tip.show { opacity: 1; transform: none; }
#tip kbd { font: 600 10.5px 'JetBrains Mono', monospace; background: rgba(0,0,0,.08); border-radius: 4px; padding: 0 5px; margin-left: 7px; color: #555; }

/* contextual tool card */
#toolCard { position: absolute; left: calc(var(--gap) + 66px); top: 50%; transform: translate(-6px, -50%); z-index: 6; width: 240px; padding: 14px; opacity: 0; pointer-events: none; transition: opacity 0.18s, transform 0.18s; }
#toolCard.show { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
.tc-head { display: flex; flex-direction: column; margin-bottom: 4px; }
.tc-head #tcTitle { font-weight: 600; font-size: 14px; }
.tc-head #tcSub { font-size: 12px; line-height: 1.4; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--raise); color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.chips button:hover { color: var(--text); border-color: var(--line-2); }
.chips button.on { background: var(--accent-soft); border-color: rgba(255, 106, 26, 0.6); color: #ffd7bd; }
.chips .dot { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- right panel ---------- */
#panel { position: absolute; right: var(--gap); top: var(--gap); bottom: var(--gap); width: var(--panel-w); z-index: 6; display: flex; flex-direction: column; overflow: hidden; transition: transform 0.28s cubic-bezier(.2,.8,.2,1), opacity 0.2s; }
body.panel-hidden #panel { transform: translateX(calc(100% + var(--gap) + 10px)); opacity: 0; pointer-events: none; }
#panelOpen { position: absolute; right: var(--gap); top: var(--gap); z-index: 6; width: 44px; height: 44px; border-radius: 14px; display: none; color: var(--text); }
body.panel-hidden #panelOpen { display: grid; }
.tabs { display: flex; align-items: center; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line); flex: none; }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 6px; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px; border-radius: 10px; }
.tab svg { width: 15px; height: 15px; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--raise-2); color: var(--text); }
#panelClose { flex: none; margin-left: 2px; }
.tabpane { display: none; overflow-y: auto; padding: 16px 16px 20px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.tabpane.on { display: block; animation: fade 0.18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } }

.card { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.danger-card { position: relative; border-radius: var(--r-md); padding: 14px; margin-bottom: 12px; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, var(--danger, #d8d84a) 22%, transparent), rgba(255,255,255,0.03)); border: 1px solid color-mix(in srgb, var(--danger, #d8d84a) 35%, transparent); transition: background 0.3s, border-color 0.3s; }
.danger-val { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; color: var(--danger, #d8d84a); }
.danger-meter { height: 6px; border-radius: 6px; margin: 10px 0 8px; background: linear-gradient(90deg, #4fc36b, #d8d84a 30%, #ffa53a 55%, #ff5a2a 78%, #e0247a); position: relative; }
.danger-meter i { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid #111; transform: translate(-50%, -50%); left: 0; transition: left 0.3s; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.danger-sub { font-size: 12px; display: flex; justify-content: space-between; }

.wind-card { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
#dial { width: 112px; height: 112px; flex: none; cursor: grab; touch-action: none; }
#dial:active { cursor: grabbing; }
.windtxt .big { font-size: 30px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin-top: 2px; }
.windtxt .big small { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 3px; }
.windtxt #windDirTxt { margin-top: 2px; font-weight: 500; color: var(--text-2); }

.field { margin-top: 12px; }
.row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 12.5px; color: var(--text-2); }
.row span { display: inline-flex; align-items: center; gap: 7px; }
.fi { width: 14px; height: 14px; color: var(--muted); }
.row output { color: var(--text); font: 600 12px 'JetBrains Mono', monospace; background: var(--raise); padding: 1px 7px; border-radius: 6px; }

/* sliders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) 0 var(--p), rgba(255,255,255,0.12) var(--p) 100%); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,0.12); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--accent); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; margin-top: -6px; box-shadow: 0 0 0 4px rgba(255,106,26,0.25), 0 2px 6px rgba(0,0,0,.4); transition: box-shadow 0.15s; }
input[type=range]:hover::-webkit-slider-thumb { box-shadow: 0 0 0 6px rgba(255,106,26,0.3), 0 2px 6px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,106,26,0.25); }

/* switches */
.switches { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); padding: 6px 2px; border-radius: 8px; }
.switch:hover { color: var(--text); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 32px; height: 18px; border-radius: 99px; background: rgba(255,255,255,0.16); transition: background 0.18s; flex: none; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.18s; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-wide { width: 100%; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1px solid var(--line); font-weight: 600; }
.btn-wide svg { width: 16px; height: 16px; }
.btn-wide.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(255, 80, 30, 0.35); }
.btn-wide.primary:hover { filter: brightness(1.08); }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.mode-grid button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px; border: 1px solid var(--line); text-align: left; font-weight: 500; color: var(--text-2); border-radius: var(--r-md); }
.mode-grid button.on { border-color: rgba(255, 106, 26, 0.7); background: var(--accent-soft); color: var(--text); }
.mi { display: block; width: 100%; height: 26px; border-radius: 6px; }
.mi.fire { background: linear-gradient(90deg, #24201c 0 30%, #8c2108 30% 45%, #f07020 45% 75%, #fff1b0 75%); }
.mi.arrival { background: linear-gradient(90deg, #fffaaa, #ffc83c, #f07328, #be2d55, #501978); }
.mi.pot { background: linear-gradient(90deg, #28a050, #96c846, #ebd73c, #f07d23, #cd2323, #8c0078); }
.mi.fuel { background: linear-gradient(90deg, #ebd255 0 25%, #c38232 25% 50%, #28965a 50% 75%, #3273d2 75%); }

.size-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.size-grid button { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; font-weight: 600; border: 1px solid var(--line); font-size: 12.5px; }
.size-grid button small { font-weight: 400; font-size: 10px; color: var(--muted); }
.size-grid button.on { border-color: rgba(255, 106, 26, 0.7); background: var(--accent-soft); }
.area-info { margin-top: 14px; font-size: 12px; color: var(--text-2); }
.area-info .res { color: var(--muted); margin-bottom: 8px; }
.fuelbar { display: flex; height: 8px; border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.fuelbar i { display: block; height: 100%; }
.fuel-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; }
.fuel-legend span { display: flex; align-items: center; gap: 6px; }
.fuel-legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.fuel-legend i { width: 8px; height: 8px; border-radius: 2px; }
.about { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.about summary { cursor: pointer; color: var(--text-2); display: flex; align-items: center; gap: 7px; list-style: none; font-weight: 500; }
.about summary svg { width: 15px; height: 15px; }
.about p { color: var(--text-2); font-size: 12px; margin: 10px 0 0; }

/* ---------- bottom HUD (compact bar, expandable) ---------- */
#hud { position: absolute; left: 50%; bottom: var(--gap); transform: translateX(calc(-50% - (var(--panel-w) + var(--gap)) / 2 + 110px)); z-index: 6; padding: 6px; display: flex; flex-direction: column; gap: 4px; max-width: calc(100vw - var(--panel-w) - 260px); border-radius: 16px; transition: transform 0.28s cubic-bezier(.2,.8,.2,1); }
body.panel-hidden #hud { transform: translateX(calc(-50% + 110px)); }
#hud .hud-bar { display: flex; align-items: center; gap: 2px; }
.play { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; padding: 0; margin: 0 2px; background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(255, 80, 30, 0.45); }
.play svg { width: 16px; height: 16px; margin-left: 2px; }
.play.on svg { margin-left: 0; }
.play:hover { filter: brightness(1.08); background: var(--grad); }
.play.on { background: var(--text); color: #111; box-shadow: none; }
.kpi { display: flex; flex-direction: column; justify-content: center; padding: 1px 11px; min-width: 0; position: relative; line-height: 1.2; }
.kpi + .kpi, .hud-bar > .icon-btn + .kpi { border-left: 1px solid var(--line); }
.kpi span { font-size: 9.5px; color: var(--muted); font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; white-space: nowrap; }
.kpi b { font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi b .lvl { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 99px; margin-left: 5px; vertical-align: 1px; }
.kpi b small.of { color: var(--muted); font-size: 11px; font-weight: 500; }
.clock b { font: 600 15px 'JetBrains Mono', monospace; }
.kpi.burned { padding-right: 92px; }
.kpi.burned b { color: #ffb070; }
#chart { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 80px; height: 28px; }
.speed { margin-left: 6px; display: inline-flex; background: rgba(0, 0, 0, 0.25); border-radius: 999px; padding: 3px; gap: 1px; flex: none; }
.speed button { border-radius: 999px; background: transparent; padding: 4px 8px; font: 600 11.5px 'JetBrains Mono', monospace; color: var(--muted); }
.speed button.on { background: var(--raise-2); color: var(--text); }
#hudMore { flex: none; margin-left: 2px; }
#hudMore svg { transform: rotate(-90deg); transition: transform 0.2s; }
#hud.expanded #hudMore svg { transform: rotate(90deg); }
#hud .more { display: none; padding: 6px 4px 2px; border-top: 1px solid var(--line); }
#hud.expanded .more { display: flex; }
@media (max-width: 1250px) { .kpi.burned { padding-right: 12px; } #chart { display: none; } }
@media (max-width: 1100px) { .hud-bar .kpi:nth-of-type(4) { display: none; } }

/* ---------- legend, cursor, hints ---------- */
#legend { position: absolute; left: var(--gap); bottom: var(--gap); z-index: 5; padding: 10px 12px; font-size: 11.5px; width: 190px; border-radius: var(--r-md); }
#legend .t { font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
#legend .i { display: flex; gap: 8px; align-items: center; margin: 3px 0; color: var(--text-2); }
#legend .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15) inset; }
#legend .grad { height: 8px; border-radius: 5px; margin: 2px 0 4px; }
#legend .lab { display: flex; justify-content: space-between; color: var(--muted); }
#cursorInfo { position: absolute; left: calc(var(--gap) + 4px); top: 66px; z-index: 4; font: 500 10.5px 'JetBrains Mono', monospace; color: rgba(255,255,255,0.8); text-shadow: 0 1px 3px #000, 0 0 8px rgba(0,0,0,.6); white-space: nowrap; pointer-events: none; }
#hint { position: absolute; left: 50%; top: 72px; transform: translateX(-50%); z-index: 7; padding: 9px 16px; font-size: 13px; display: none; max-width: 520px; text-align: center; border-radius: 999px; color: var(--text-2); }
#hint b { color: var(--text); }
#hint.show { display: block; animation: pop 0.2s ease-out; }

#toast { position: absolute; top: 116px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
#toast div { background: var(--text); color: #111; font-weight: 500; padding: 8px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.4); animation: pop 0.2s ease-out; }

#loader { position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center; background: rgba(5, 6, 8, 0.35); }
#loader.show { display: flex; }
.loadbox { padding: 22px 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 300px; color: var(--text-2); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { width: 100%; height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width 0.2s; }

/* ---------- maplibre ---------- */
.maplibregl-ctrl-top-right { top: calc(var(--gap) - 10px); right: calc(var(--panel-w) + var(--gap) * 2 - 10px); transition: right 0.28s; }
.maplibregl-ctrl-bottom-right { right: calc(var(--panel-w) + var(--gap)); transition: right 0.28s; }
body.panel-hidden .maplibregl-ctrl-top-right { right: calc(var(--gap) + 50px); }
body.panel-hidden .maplibregl-ctrl-bottom-right { right: 0; }
.maplibregl-ctrl-group { background: var(--glass) !important; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid var(--line); border-radius: 12px !important; box-shadow: var(--shadow) !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 34px !important; height: 34px !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(0.9); }
.maplibregl-ctrl-scale { background: rgba(0,0,0,.4); color: #fff; border-color: rgba(255,255,255,.7); border-radius: 0 0 3px 3px; }
.maplibregl-ctrl-attrib.maplibregl-compact { background: rgba(0,0,0,.5); color: #ccc; }
.maplibregl-ctrl-attrib a { color: #ddd; }
.maplibregl-popup-content { background: var(--glass-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; font-size: 12px; box-shadow: var(--shadow); }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 16px; right: 4px; top: 2px; }
.insp { border-collapse: collapse; }
.insp td { padding: 3px 10px 3px 0; vertical-align: top; }
.insp td:first-child { color: var(--muted); white-space: nowrap; }
.insp tr + tr td { border-top: 1px solid var(--line); }
.maplibregl-canvas-container.tool-active canvas { cursor: crosshair; }

@media (max-width: 1100px) {
  :root { --panel-w: 290px; }
  .search input { width: 180px; }
  .search input:focus { width: 220px; }
  .metrics { grid-template-columns: 1.3fr repeat(4, 1fr); }
}
@media (max-width: 860px) {
  #viewbar { top: 70px; }
  .name, .search kbd { display: none; }
  #panel { top: auto; height: 46vh; left: var(--gap); width: auto; }
  #hud, #legend, #cursorInfo { display: none; }
  #tools { top: 130px; transform: none; flex-direction: row; flex-wrap: wrap; width: calc(100vw - 100px); max-width: 420px; }
  .dock-sep { width: 1px; height: 22px; margin: 0 3px; }
  #toolCard { top: 190px; left: var(--gap); transform: none; }
  #toolCard.show { transform: none; }
  .maplibregl-ctrl-top-right { right: var(--gap); top: 110px; }
}

.metric b small.of { color: var(--muted); font-size: 11px; font-weight: 500; }
.size-grid { grid-template-columns: repeat(3, 1fr); }
kbd.kb { font: 600 10.5px 'JetBrains Mono', monospace; background: rgba(255,255,255,.22); border-radius: 5px; padding: 1px 6px; margin-left: 4px; }
.maplibregl-canvas-container.rotating canvas { cursor: grabbing !important; }

#help { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; background: rgba(4, 5, 7, 0.55); backdrop-filter: blur(3px); }
#help.show { display: flex; animation: fade .15s ease-out; }
.help-box { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow: auto; padding: 18px 20px 20px; background: var(--glass-strong); }
.help-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 14px; }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 28px; }
.help-grid .eyebrow { margin-bottom: 6px; }
.krow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; }
.keys { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); white-space: nowrap; }
.keys kbd { font: 600 11px 'JetBrains Mono', monospace; color: var(--text); background: var(--raise-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; }
@media (max-width: 700px) { .help-grid { grid-template-columns: 1fr; } }
.seg.lang { margin-left: 2px; }
.seg.lang button { padding: 5px 9px; font-size: 11.5px; }
h1.brand { margin: 0; font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.noscript { position: relative; z-index: 100; max-width: 640px; margin: 120px auto; padding: 24px; color: #eee; background: #15171c; border-radius: 16px; font: 16px/1.6 Inter, sans-serif; }
.noscript a { color: #ffb070; }
.about-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: #ffb070; text-decoration: none; font-weight: 500; font-size: 13px; }
.about-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.about-link:hover { text-decoration: underline; }
