/* App — Hexember */
html, body.app { height: 100%; overflow: hidden; }
#map { position: fixed; inset: 0; background: #0b0907; }
.maplibregl-ctrl-attrib, .maplibregl-ctrl-attrib a { color: var(--faint) !important; background: transparent !important; font: 10px var(--font-mono) !important; }

.topbar { position: fixed; z-index: 10; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; gap: 14px; align-items: center; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--font-display); font-size: 28px; line-height: 1; padding: 8px 14px 8px 12px; border-radius: 999px; background: rgba(18,15,12,.78); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.brand svg { width: 20px; height: 20px; color: var(--flame); }

.search { position: relative; flex: 1; max-width: 460px; }
.search svg { z-index: 1; pointer-events: none; position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 48px; padding: 0 18px 0 44px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(18,15,12,.82); backdrop-filter: blur(14px); color: var(--text); font: 500 16px var(--font-ui); }
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,201,77,.14); }
#results { position: absolute; left: 0; right: 0; top: 56px; margin: 0; padding: 6px; list-style: none; border-radius: 18px; background: rgba(18,15,12,.96); border: 1px solid var(--line-strong); backdrop-filter: blur(18px); box-shadow: 0 30px 80px -20px #000; max-height: 50vh; overflow: auto; }
#results li { padding: 11px 14px; border-radius: 12px; cursor: pointer; display: grid; gap: 1px; }
#results li b { font-weight: 500; }
#results li span { font-size: 13px; color: var(--muted); }
#results li[aria-selected="true"], #results li:hover { background: var(--surface-2); }
#results .none { cursor: default; color: var(--muted); }

.panel { position: fixed; z-index: 9; top: 84px; right: 16px; width: min(380px, calc(100vw - 32px)); padding: 22px; border-radius: 24px;
  background: rgba(18,15,12,.82); border: 1px solid var(--line); backdrop-filter: blur(18px); box-shadow: 0 30px 80px -30px #000; max-height: calc(100svh - 110px); overflow: auto; }
.panel__big { font-family: var(--font-display); font-size: 64px; line-height: 1; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.panel__big small { font: 400 15px var(--font-ui); color: var(--muted); }
.panel__hint { color: var(--muted); margin: 0; font-size: 15px; }
.panel h1 { font-family: var(--font-display); font-weight: 400; font-size: 40px; line-height: 1.02; margin: 4px 0 14px; letter-spacing: -.01em; }
.status { display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong); font-weight: 500; font-size: 14px; margin: 0 0 20px; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.status.is-watch i { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.status.is-alert i { background: var(--ember); box-shadow: 0 0 14px var(--ember); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 20px; padding: 16px 0; border-block: 1px solid var(--line); }
.kv dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.kv dt { font-size: 10px; }
.radius { margin-bottom: 20px; }
.radius label { display: flex; justify-content: space-between; margin-bottom: 8px; }
.radius output { color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--flame); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { padding: 12px 18px; font-size: 14px; }
.note { font-size: 12.5px; color: var(--faint); margin: 16px 0 0; line-height: 1.5; }
.note + .note { margin-top: 8px; }
#watch-note { color: var(--gold); }

.legend { position: fixed; z-index: 8; left: 16px; bottom: calc(44px + env(safe-area-inset-bottom)); width: 220px; padding: 14px 16px; border-radius: 16px; background: rgba(18,15,12,.78); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.legend p { margin: 0 0 8px; font-size: 10px; }
.legend__bar { display: block; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #ffe08a, #ffc94d 25%, #ff8a2b 55%, #ff3d14 80%, #b3180f); }
.legend__ends { display: flex; justify-content: space-between; margin-top: 6px; font-size: 10px; }

.tools { position: fixed; z-index: 8; left: 16px; bottom: calc(150px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.chip { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(18,15,12,.78); backdrop-filter: blur(14px); cursor: pointer; font-size: 13.5px; font-weight: 500; transition: .2s; }
.chip[aria-pressed="true"] { background: rgba(255,138,43,.18); border-color: var(--flame); color: var(--gold); }
.chip:hover { border-color: var(--text); }
.foot { position: fixed; z-index: 7; left: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); margin: 0; font-size: 10px; color: var(--faint); }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 40px; transform: translateX(-50%); padding: 12px 18px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: 14px; }

.maplibregl-popup-content { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 14px; font: 14px var(--font-ui); padding: 12px 16px; }
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { color: var(--muted); }

@media (max-width: 720px) {
  .panel { top: auto; right: 8px; left: 8px; bottom: 8px; width: auto; max-height: 52svh; border-radius: 22px; }
  .legend, .foot { display: none; }
  .tools { bottom: auto; top: 76px; left: 16px; }
  .brand span { display: none; }
  .panel h1 { font-size: 32px; }
}

.langlink { margin-left: auto; font: 500 12px var(--font-mono); letter-spacing: .08em; text-decoration: none; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 11px; background: rgba(11,9,7,.7); backdrop-filter: blur(8px); }
.langlink:hover { color: var(--text); border-color: var(--text); }

.timebar { position: fixed; z-index: 9; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom)); width: min(640px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-radius: 18px; background: rgba(18,15,12,.88); border: 1px solid var(--line-strong); backdrop-filter: blur(14px); }
.timebar[hidden] { display: none; }
.timebar__main { flex: 1; min-width: 0; }
.timebar__main p { margin: 0; font-size: 11px; }
.timebar #tl-label { font-size: 15px; color: var(--gold); font-weight: 500; }
.timebar input[type=range] { width: 100%; margin: 8px 0 6px; accent-color: var(--flame); }
.timebar__note { color: var(--faint); font-size: 10px !important; }
.timebar__note a { color: var(--muted); }
#tl-play { width: 44px; height: 44px; padding: 0; flex: none; }
body.timetravel .foot, body.timetravel .legend { display: none; }
body.timetravel .tools { bottom: calc(130px + env(safe-area-inset-bottom)); }
@media (max-width: 720px) { body.timetravel .panel { display: none; } .timebar__note { display: none; } }

.tl-legend { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.tl-legend span { font-size: 10px; }
.tl-legend i { flex: 1; max-width: 160px; height: 6px; border-radius: 99px; background: linear-gradient(90deg, #5a2a12, #a63d10 30%, #ff8a2b 55%, #ffc94d 80%, #fff0b8); }
