/* Wala (Vigie) stylesheet, "operations room": near-black, thin lines, teal phosphor accent, amber
   selection, mono titles and figures. Order: tokens (dark, then light), base, layout, sidebar, controls, lists,
   detail panel, territories, sources, map overlays, responsive. Colours only come from tokens;
   map.js uses the same kind and severity colours for its icons. */

/* ---------- tokens ---------- */
:root {
  --bg: #07090c;
  --surface: #0c1015;
  --surface-2: #10151b;
  --surface-3: #18202a;
  --overlay: rgba(10, 14, 19, 0.94);
  --line: #1d2631;
  --line-strong: #2b3746;
  --text: #d8e1ea;
  --text-2: #9aa8b6;
  --text-3: #7a8897;
  --strong: #f2f6fa;
  --accent: #35d0ba;
  --accent-ink: #04110f;
  --accent-soft: rgba(53, 208, 186, 0.14);
  --selected: #0e2725;
  --saffron: #ffb547;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 77, 79, 0.14);
  --ok: #69c27d;
  --tint: rgba(255, 255, 255, 0.05);
  --shadow: rgba(0, 0, 0, 0.4);
  --nodata: #1a222c;
  --sev1: #e3c84a;
  --sev2: #ff9f1c;
  --sev3: #ff4d4f;
  --radius: 3px;
  --radius-sm: 2px;
  /* one family for Latin and Arabic alike; figures line up through tabular numerals, not a mono face */
  --font-ui: "Readex Pro", "Noto Sans Tifinagh", -apple-system, "Segoe UI", Roboto, sans-serif;
  /* titles: a screen serif, with Amiri carrying Arabic in the same register */
  --font-display: "IBM Plex Mono", "Readex Pro", ui-monospace, monospace;
  --font-mono: "IBM Plex Mono", "Readex Pro", ui-monospace, monospace;
  color-scheme: dark;
}

/* light: chosen, or the system's choice when nothing is saved */
:root[data-theme="light"] {
  --bg: #e9ece4;
  --surface: #f6f7f2;
  --surface-2: #fbfcf8;
  --surface-3: #e4e8dd;
  --overlay: rgba(246, 247, 242, 0.96);
  --line: #d3d8cb;
  --line-strong: #b4bba9;
  --text: #1f2421;
  --text-2: #4a524b;
  --text-3: #626b61;
  --strong: #121512;
  --accent: #1d5c96;
  --accent-ink: #ffffff;
  --accent-soft: rgba(29, 92, 150, 0.1);
  --selected: #e3ebf3;
  --saffron: #9a5b2e;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --ok: #2f7d43;
  --tint: rgba(18, 21, 18, 0.04);
  --shadow: rgba(18, 21, 18, 0.12);
  --nodata: #d5d9cf;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e9ece4;
    --surface: #f6f7f2;
    --surface-2: #fbfcf8;
    --surface-3: #e4e8dd;
    --overlay: rgba(246, 247, 242, 0.96);
    --line: #d3d8cb;
    --line-strong: #b4bba9;
    --text: #1f2421;
    --text-2: #4a524b;
    --text-3: #626b61;
    --strong: #121512;
    --accent: #1d5c96;
    --accent-ink: #ffffff;
    --accent-soft: rgba(29, 92, 150, 0.1);
    --selected: #e3ebf3;
    --saffron: #9a5b2e;
    --danger: #b42318;
    --danger-soft: #fdeceb;
    --ok: #2f7d43;
    --tint: rgba(18, 21, 18, 0.04);
    --shadow: rgba(18, 21, 18, 0.12);
    --nodata: #d5d9cf;
    color-scheme: light;
  }
}

/* site kinds: the same colours as the map icons (map.js INFRA_STYLE) */
.k-cell_4g { --kc: #12b886; }
.k-cell_5g { --kc: #0ca678; }
.k-lora { --kc: #22b8cf; }
.k-radio { --kc: #845ef7; }
.k-radar { --kc: #ff6b6b; }
.k-police { --kc: #1c7ed6; }
.k-fire_station { --kc: #e8590c; }
.k-townhall { --kc: #5c7cfa; }
.k-courthouse { --kc: #7048e8; }
.k-government { --kc: #3b5bdb; }
.k-prison { --kc: #868e96; }
.k-embassy { --kc: #1098ad; }
.k-border { --kc: #c2255c; }
.k-webcam { --kc: #f76707; }
.k-cctv { --kc: #e64980; }
.k-speed_camera { --kc: #fab005; }
.k-mast { --kc: #868e96; }
.k-mine { --kc: #a0522d; }
.k-quarry { --kc: #b08968; }
.k-t-rail-hs { --kc: #e03131; }
.k-t-rail { --kc: #ced4da; }
.k-t-tram { --kc: #22b8cf; }
.k-t-rail-build { --kc: #868e96; }
.k-t-station { --kc: #f8f9fa; }
.k-t-motorway { --kc: #f76707; }
.k-t-trunk { --kc: #fab005; }
.k-t-primary { --kc: #ffe066; }
td.road-paved { color: #2f9e44; }
td.road-near { color: #f59f00; }
td.road-far { color: #e03131; font-weight: 600; }
.k-w-pipe-water { --kc: #1c7ed6; }
.k-w-pipe-gas { --kc: #f08c00; }
.k-w-pipe-other { --kc: #868e96; }
.k-w-canal { --kc: #3bc9db; }
.k-w-dam { --kc: #4263eb; }
.k-w-tower { --kc: #74c0fc; }
.k-w-desal { --kc: #0ca678; }
.k-w-desal-build { --kc: #63e6be; }
.k-w-plant-water { --kc: #1098ad; }
.k-w-plant-waste { --kc: #8c6d3f; }
.k-w-pump { --kc: #5c7cfa; }
.k-w-well { --kc: #a5d8ff; }
.k-t-secondary { --kc: #d0bfff; }
.k-t-tertiary { --kc: #99e9f2; }
.k-t-minor { --kc: #ced4da; }
.k-t-service { --kc: #868e96; }
.k-t-track { --kc: #d9a066; }
.k-t-path { --kc: #a9e34b; }
.k-flood100 { --kc: linear-gradient(135deg, #c6dbef, #2171b5); background: var(--kc); }
/* map tools under the weather buttons, place search at the top of the map, measuring readout */
.map-tools { position: absolute; top: 7.4rem; right: 10px; z-index: 5; display: flex; flex-direction: column; gap: 4px; }
.export-menu { position: absolute; right: calc(100% + 6px); top: 2.2rem; display: flex; flex-direction: column; gap: 4px; width: 13rem;
  padding: 0.5rem; background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.place-search { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 6; width: min(24rem, 46%); }
.place-search input { width: 100%; background: var(--overlay); border: 1px solid var(--line-strong); }
.search-hits { margin: 4px 0 0; padding: 0; list-style: none; background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius); max-height: 60vh; overflow: auto; }
.search-hits li { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.4rem 0.6rem; cursor: pointer; border-top: 1px solid var(--line); }
.search-hits li:first-child { border-top: 0; }
.search-hits li:hover { background: var(--accent-soft); }
.measure-box { position: absolute; bottom: 3.2rem; left: 50%; transform: translateX(-50%); z-index: 6; padding: 0.4rem 0.8rem;
  background: var(--overlay); border: 1px solid var(--saffron); border-radius: var(--radius); color: var(--strong); font: 0.82rem var(--font-mono); }
.measuring .maplibregl-popup { display: none; }
@media (max-width: 720px) { .place-search { top: 52px; width: calc(100% - 120px); left: 10px; transform: none; } }
.k-fishing { --kc: #ff922b; }
.k-ships { --kc: #74c0fc; }
.active-layers { display: flex; flex-wrap: wrap; gap: 4px; max-height: 6.5rem; overflow: auto; }
.active-layers .chip { font-size: 0.7rem; padding: 0.15rem 0.45rem; }
.tips { position: absolute; left: 12px; bottom: 2.8rem; z-index: 6; width: min(22rem, calc(100% - 24px)); padding: 0.75rem 0.9rem;
  background: var(--overlay); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: 0 4px 18px var(--shadow); }
.tips strong { font: 600 0.78rem var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.tips ul { margin: 0.45rem 0 0.6rem; padding-inline-start: 1.1rem; display: grid; gap: 0.3rem; font-size: 0.8rem; color: var(--text); }
.layer-opacity { display: flex; align-items: center; gap: 0.5rem; padding: 0 0.4rem 0.35rem 2.6rem; }
.layer-opacity input[type="range"] { flex: 1; padding: 0; border: 0; background: transparent; accent-color: var(--accent); height: 1rem; }
table.metrics td.gap { width: 4.6rem; padding-inline-start: 0.6rem; color: var(--text-3); font-size: 0.72rem; }
.scale-mode { margin: 0.4rem 0 0.2rem; }
.scale-mode button { font-size: 0.7rem; padding: 0.15rem 0.5rem; }
.crime { margin: 0 0 0.6rem; border: 1px solid var(--line); border-radius: var(--radius); padding: 0.45rem 0.6rem; background: var(--surface-2); }
.crime > summary { cursor: pointer; font: 600 0.74rem var(--font-display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
[dir="rtl"] .crime > summary { letter-spacing: 0; }
.crime-table th.mono { text-align: end; padding-inline-start: 0.8rem; }
table.crime-table td { padding-inline-start: 0.8rem; } /* beats table.metrics td's zero side padding */
.crime-sub { margin-top: 0.8rem; font: 600 0.74rem var(--font-display); color: var(--text-2); }
.crime-grid { display: grid; gap: 0.55rem; margin: 0.5rem 0; }
.crime-label { font-size: 0.78rem; color: var(--text-2); margin-bottom: 0.15rem; }
.crime-years { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: 0.15rem 0.5rem; }
.crime-years span { display: flex; flex-direction: column; }
.crime-years small { font-size: 0.66rem; color: var(--text-3); }
.crime-years b { font-size: 0.8rem; font-weight: 500; }
.k-metal { --kc: #d6336c; }
.k-indmin { --kc: #f59f00; }
.k-energy { --kc: #1098ad; }
.k-pop { --kc: linear-gradient(135deg, #fcfdbf, #f4685c, #4a1077); background: var(--kc); }
.k-pow-plant-solar { --kc: #fab005; }
.k-pow-plant-wind { --kc: #15aabf; }
.k-pow-plant-hydro { --kc: #1971c2; }
.k-pow-plant-thermal { --kc: #495057; }
.k-pow-plant-other { --kc: #868e96; }
.k-pow-substation { --kc: #7048e8; }
.k-pow-line-400 { --kc: #e03131; }
.k-pow-line-225 { --kc: #f08c00; }
.k-pow-line-60 { --kc: #1c7ed6; }
.k-pow-line-other { --kc: #868e96; }
.layer-section { border-top: 1px solid var(--line); }
.layer-section > summary { display: flex; gap: 0.5rem; align-items: center; padding: 0.45rem 0.6rem; cursor: pointer; font-weight: 600; }
.layer-section > .layer-group-box { margin-inline-start: 0.7rem; }
.k-courts { --kc: #c2255c; }
.k-minearea { --kc: rgba(214, 92, 34, 0.55); border: 1.5px solid #d65c22; }
.k-communes { --kc: #f37819; }
.k-douars { --kc: var(--text); }
.k-borders { --kc: transparent; border: 1.5px dashed var(--text-2); }
.k-s2 { --kc: linear-gradient(135deg, #4d7c3a, #c9b27c); background: var(--kc); }
.k-today { --kc: linear-gradient(135deg, #2f6db0, #e9eef2); background: var(--kc); }
.k-night { --kc: radial-gradient(circle, #ffd56b 0 30%, #0d0f1c 60%); background: var(--kc); }
.k-relief { --kc: linear-gradient(135deg, #f1f1f1, #6b6b6b); background: var(--kc); }
.k-moist { --kc: linear-gradient(135deg, #ffc100, #41a000, #0082ff); background: var(--kc); }
.k-ph { --kc: linear-gradient(135deg, #ebe51a, #36ad31, #28b6b5); background: var(--kc); }
.k-soc { --kc: linear-gradient(135deg, #f6f3f2, #a98a82, #724032); background: var(--kc); }
.k-clay { --kc: linear-gradient(135deg, #f2dac1, #bd8247, #8f5a26); background: var(--kc); }
.k-landcover { --kc: conic-gradient(#ed022a 0 25%, #ffdb5c 0 50%, #358221 0 75%, #efcfa8 0); background: var(--kc); }
.k-ndvi { --kc: linear-gradient(135deg, #cdba9f, #a0c031, #006001); background: var(--kc); }
.k-water { --kc: linear-gradient(135deg, #b5004a, #3a00c4); background: var(--kc); }
.k-ndmi { --kc: linear-gradient(135deg, #8c5226, #f2f2cc, #0d40bf); background: var(--kc); }
.k-flood { --kc: #1a73ff; }
.k-no2 { --kc: linear-gradient(135deg, #333399, #ffcc33, #e61a1a); background: var(--kc); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; height: 100dvh; width: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
:root[lang="ar"] body { font-size: 15px; line-height: 1.6; }
a { color: var(--accent); }
h2, h3, h4 { color: var(--strong); margin: 0; font-family: var(--font-display); font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mono { font-variant-numeric: tabular-nums; font-size: 0.92em; }
.meta { color: var(--text-3); font-size: 0.78rem; margin: 0; }
.grow { flex: 1; min-width: 0; }
.right { margin-inline-start: auto; text-align: end; white-space: nowrap; }

/* ---------- layout: masthead across, then the index panel and the map sheet ---------- */
.app {
  display: grid; grid-template-columns: 23rem 1fr; grid-template-rows: auto 1fr;
  grid-template-areas: "mast mast" "side map";
  height: 100%; height: 100dvh; width: 100vw; overflow: hidden; background: var(--bg);
}
.app.folded { grid-template-columns: 0 1fr; }
aside.side {
  grid-area: side; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: var(--surface); border-inline-end: 1px solid var(--line-strong); z-index: 5; overflow: hidden;
}
.app.folded aside.side { visibility: hidden; border: 0; }
main.mapwrap { grid-area: map; position: relative; min-width: 0; min-height: 0; }
#map { position: absolute; inset: 0; }
/* the neatline: a double rule framing the map like a printed sheet */
main.mapwrap::after {
  content: ""; position: absolute; inset: 5px; z-index: 4; pointer-events: none;
  border: 3px double var(--text-2); opacity: 0.55; border-radius: 2px;
}

/* ---------- masthead: the sheet's title block ---------- */
.masthead {
  grid-area: mast; display: flex; align-items: center; gap: 1.5rem; padding: 0.55rem 1.1rem;
  background: var(--surface); border-bottom: 1px solid var(--line-strong); z-index: 6; min-width: 0;
}
.title-block { display: flex; align-items: baseline; gap: 0.6rem; min-width: 0; flex-shrink: 1; }
.title-block .brand-mark { width: 1.7rem; height: 1.7rem; color: var(--accent); align-self: center; flex-shrink: 0; }
.title-block h1 { margin: 0; font: 600 1.35rem/1 var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--strong); }
.title-block .sub {
  margin: 0; font: 400 0.74rem var(--font-mono); letter-spacing: 0.04em; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26rem;
}
:root[lang="ar"] .title-block .sub { font-style: normal; }
/* the sections, as the index of the sheet */
.index { display: flex; align-items: stretch; gap: 0.15rem; margin-inline-start: auto; }
.index [role="tab"] {
  position: relative; gap: 0.4rem; padding: 0.45rem 0.7rem; background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--text-2); font: 500 0.86rem var(--font-ui); white-space: nowrap;
}
.index [role="tab"] svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.index [role="tab"]:hover { color: var(--strong); background: var(--tint); filter: none; }
.index [role="tab"].on { color: var(--accent); }
.index [role="tab"].on::after {
  content: ""; position: absolute; left: 0.7rem; right: 0.7rem; bottom: -0.56rem; height: 2px; background: var(--accent);
}
.index .count { font-variant-numeric: tabular-nums; }
.index [role="tab"].on .count { background: var(--accent-soft); color: var(--accent); }
.sheet-controls { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.sheet-controls select { width: auto; padding: 0.3rem 0.4rem; font-size: 0.78rem; }
.api-link {
  font-size: 0.74rem; font-weight: 600; text-decoration: none; padding: 0.3rem 0.5rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.api-link:hover { background: var(--tint); }
/* account menu (auth.rs): a summary styled like the header links, its panel below it */
.account { position: relative; }
.account > summary { list-style: none; cursor: pointer; }
.account > summary::-webkit-details-marker { display: none; }
.account-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 0.4rem); z-index: 40; width: min(20rem, calc(100vw - 2rem));
  display: grid; gap: 0.5rem; padding: 0.8rem; background: var(--surface-2); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.account-panel p { margin: 0; }
.account-email { font-weight: 600; overflow-wrap: anywhere; }
.account-cmd { display: block; font-size: 0.72rem; padding: 0.45rem; background: var(--surface-3); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.account-links { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.theme-toggle { width: 2rem; height: 2rem; padding: 0; justify-content: center; }

/* feed health: one line that opens the Sources tab */
button.sources {
  flex-shrink: 0; display: flex; align-items: center; gap: 0.45rem; width: 100%;
  padding: 0.5rem 1.15rem; background: transparent; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; color: var(--text-2); font: 500 0.76rem var(--font-ui); cursor: pointer; text-align: start;
}
button.sources:hover { background: var(--tint); color: var(--text); }
.chevron { margin-inline-start: auto; color: var(--text-3); }
[dir="rtl"] .chevron { transform: scaleX(-1); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }
.dot.bad { background: var(--sev3); }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.1rem; height: 1.1rem;
  padding: 0 0.3rem; border-radius: 999px; background: var(--surface-3); color: var(--text-2);
  font-size: 0.66rem; font-weight: 600;
}
.tab-body { flex: 1; overflow-y: auto; padding: 0.95rem 1.15rem 1.5rem; display: flex; flex-direction: column; gap: 0.75rem; }

/* ---------- controls ---------- */
input, select {
  width: 100%; padding: 0.5rem 0.65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font: 0.84rem var(--font-ui);
}
input:focus, select:focus { border-color: var(--accent); outline: none; }
button, .button-link {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0.85rem;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: var(--accent); color: var(--accent-ink);
  font: 600 0.82rem var(--font-ui); cursor: pointer; text-decoration: none;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
button:hover, .button-link:hover { filter: brightness(1.08); }
button:active, .button-link:active, .item:active, .segmented button:active { transform: scale(0.985); }
.ghost { background: transparent; color: var(--text-2); border-color: var(--line-strong); }
.ghost:hover { background: var(--tint); color: var(--text); filter: none; }
.toolbar { display: flex; flex-direction: column; gap: 0.5rem; }
.row { display: flex; gap: 0.5rem; }
.row > * { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 0.3rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.linkish:hover { text-decoration: underline; filter: none; }

/* sleek scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ---------- lists ---------- */
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.75rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.item:hover { background: var(--surface-3); }
.item.sel { background: var(--selected); border-color: var(--accent); box-shadow: inset 3px 0 0 var(--saffron); }
[dir="rtl"] .item.sel { box-shadow: inset -3px 0 0 var(--saffron); }
.item .title { display: block; font-weight: 600; color: var(--strong); line-height: 1.3; text-decoration: none; }
.list.compact .item { padding: 0.45rem 0.6rem; }
.item.news { cursor: default; align-items: flex-start; }
.item.news .title:hover { text-decoration: underline; }
.summary { margin: 0.3rem 0 0; color: var(--text-2); font-size: 0.8rem; line-height: 1.4; }
.tag { display: inline-block; padding: 0 0.4rem; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: 0.72rem; }
.tag.urban { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.kind { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--kc, var(--text-3)); }
.sev { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sev1 { background: var(--sev1); }
.sev2 { background: var(--sev2); }
.sev3 { background: var(--sev3); }
.empty { margin: 0; padding: 0.9rem; color: var(--text-3); text-align: center; font-size: 0.82rem; }
.lead { margin: 0; color: var(--text-2); font-size: 0.84rem; }
.note { margin: 0; padding: 0.55rem 0.7rem; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text-2); font-size: 0.78rem; }

/* ---------- detail panel ---------- */
aside.detail {
  /* always on the physical right, by the zoom buttons: the layer panel owns the left in every language */
  position: absolute; top: 1rem; bottom: 1rem; right: 3.4rem; z-index: 8;
  width: min(340px, calc(100% - 1.5rem)); overflow-y: auto; padding: 1rem 1rem 1.3rem;
  display: flex; flex-direction: column; gap: 0.9rem;
  background: var(--overlay); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 34px var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  animation: panelSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes sheetSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}
.close {
  position: absolute; top: 0.6rem; inset-inline-end: 0.6rem; width: 2rem; height: 2rem; padding: 0;
  justify-content: center; font-size: 1.2rem; line-height: 1;
}
.panel-head { padding-inline-end: 2.2rem; }
.eyebrow { color: var(--accent); font-size: 0.76rem; font-weight: 600; }
.panel-head h2 { margin-top: 0.2rem; font-size: 1.35rem; line-height: 1.25; }
.badges { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.badge { padding: 0.15rem 0.5rem; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 0.75rem; font-weight: 600; }
.badge.sev1 { background: var(--sev1); color: #1a1a1a; }
.badge.sev2 { background: var(--sev2); color: #1a1a1a; }
.badge.sev3 { background: var(--sev3); color: #ffffff; }
.badge.urban { background: var(--accent-soft); color: var(--accent); }
.facts { margin: 0; display: grid; gap: 0.35rem; }
.fact { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.6rem; font-size: 0.82rem; }
.fact dt { color: var(--text-3); }
.fact dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.block { display: flex; flex-direction: column; gap: 0.5rem; }
.block h3, .block-title { font: 600 0.78rem var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); padding-bottom: 0.3rem; border-bottom: 1px solid var(--line); }
/* Arabic: no mono face (its wide spaces gap the words) and no letter spacing (it breaks joining) */
[dir="rtl"] { --font-display: var(--font-ui); --font-mono: var(--font-ui); }
[dir="rtl"] .block h3, [dir="rtl"] .block-title, [dir="rtl"] .title-block .sub { letter-spacing: 0; }
.counters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.counter { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border: 1px solid var(--line); border-radius: 999px; font-size: 0.74rem; color: var(--text-2); }
.counter strong { color: var(--strong); font-family: var(--font-mono); }
.live { margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.live img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.live figcaption { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.72rem; color: var(--text-3); }

/* ---------- territories ---------- */
.census { display: flex; flex-direction: column; gap: 0.7rem; }
.range { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; padding: 0; border: 0; }
.range legend { width: 100%; padding: 0; margin-bottom: 0.2rem; }
.range input { flex: 1 1 5rem; width: 6rem; }
.rank-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
ol.rank { counter-reset: rank; }
ol.rank .item::before { counter-increment: rank; content: counter(rank); min-width: 1.5rem; color: var(--text-3); font: 0.74rem var(--font-mono); }
table.metrics { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
table.metrics th { text-align: start; font-weight: 400; color: var(--text-2); padding: 0.18rem 0; }
table.metrics td { text-align: end; padding: 0.18rem 0; white-space: nowrap; }
table.metrics tr { cursor: pointer; }
table.metrics tr:hover th, table.metrics tr.active th { color: var(--strong); }
table.metrics tr.active td { color: var(--accent); font-weight: 600; }
table.parties tr.mapped { cursor: pointer; }
table.parties tr.mapped:hover th, table.parties tr.active th { color: var(--strong); font-weight: 600; }
table.parties tr.active { background: var(--accent-soft); }
.table-scroll { overflow-x: auto; flex: none; } /* in the flex-column panel, an overflow box would shrink to 0 */
table.douars { min-width: 100%; border-collapse: collapse; font-size: 0.75rem; }
table.douars th { padding: 0.25rem 0.35rem; color: var(--text-3); font-weight: 600; text-align: start; white-space: nowrap; cursor: help; }
table.douars td { padding: 0.25rem 0.35rem; border-top: 1px solid var(--line); white-space: nowrap; }
table.douars td.mono { text-align: end; }

/* ---------- sources ---------- */
.source-card {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0.9rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.source-card header { display: flex; flex-direction: column; gap: 0.15rem; }
.source-card h4 { font-size: 1rem; }
.source-card p { margin: 0; font-size: 0.82rem; color: var(--text-2); }
.source-card .fact { grid-template-columns: 5.5rem 1fr; font-size: 0.78rem; }
.status { font-size: 0.74rem; color: var(--ok); }
.status.bad { color: var(--danger); }
.outlets { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.outlets li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.15rem 0.6rem; font-size: 0.8rem; padding: 0.25rem 0; border-top: 1px solid var(--line); }

/* ---------- map overlays (physical left in every language: the zoom controls are on the right) ---------- */
.layers {
  position: absolute; top: 1rem; left: 1rem; z-index: 7; /* an open list covers the legends, never interleaves */
  max-height: calc(100% - 2rem); max-width: min(19rem, calc(100% - 5rem)); overflow: auto;
  background: var(--overlay); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 6px 24px var(--shadow); backdrop-filter: blur(6px);
}
.layers[open] { width: 18rem; }
.layers summary {
  list-style: none; display: flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.7rem;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; user-select: none;
}
.layers summary::-webkit-details-marker { display: none; }
.layers summary svg { width: 1rem; height: 1rem; color: var(--accent); }
.layers[open] summary { border-bottom: 1px solid var(--line); }
.layers > :not(summary) { margin-inline: 0.7rem; }
.layers > :last-child { margin-bottom: 0.6rem; }
.layer-group { margin: 0.65rem 0 0.15rem; color: var(--text-3); font-size: 0.74rem; font-weight: 600; }
.layer-row { display: flex; align-items: center; gap: 0.45rem; padding: 0.22rem 0.25rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; }
.layer-row:hover { background: var(--tint); }
.layer-row input { width: 0.95rem; height: 0.95rem; margin: 0; accent-color: var(--accent); }
.layer-row .meta { font-size: 0.72rem; }

.map-legend {
  position: absolute; left: 1rem; bottom: 2.1rem; z-index: 5; margin: 0;
  width: min(20rem, calc(100% - 1.5rem)); padding: 0.5rem 0.65rem; font-size: 0.75rem;
  background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 1px 0 var(--shadow);
}
.map-legend figcaption { margin-bottom: 0.35rem; font: 600 0.88rem var(--font-display); }
.scale-bar { display: grid; grid-template-columns: repeat(6, 1fr); height: 0.7rem; border-radius: 3px; overflow: hidden; }
/* the 5 class edges sit on the borders between the 6 colours */
.scale-ticks { display: grid; grid-template-columns: 0.5fr repeat(5, 1fr) 0.5fr; margin-top: 0.2rem; color: var(--text-2); font-size: 0.66rem; }
.scale-ticks span { text-align: center; white-space: nowrap; overflow: hidden; }
.scale-ticks span:first-child { grid-column: 2; }
.class-key { display: grid; grid-template-columns: repeat(2, auto); gap: 0.2rem 0.8rem; margin: 0; padding: 0; list-style: none; font-size: 0.72rem; }
.class-key li { display: flex; align-items: center; gap: 0.35rem; }
.class-key span { width: 0.7rem; height: 0.7rem; border-radius: 2px; flex: none; }
.scale-foot { margin-top: 0.35rem; display: flex; align-items: center; gap: 0.35rem; color: var(--text-3); }
.scale-foot .nodata { width: 0.9rem; height: 0.6rem; background: var(--nodata); border: 1px solid var(--line-strong); border-radius: 2px; }

.toast {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 1rem; max-width: min(28rem, calc(100% - 2rem)); padding: 0.6rem 0.8rem;
  background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius);
  box-shadow: 0 6px 24px var(--shadow); font-size: 0.84rem;
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* webcam player: period buttons over an embedded Windy player */
.player { display: flex; flex-direction: column; gap: 0.5rem; }
/* one joined control: the chosen option is the only filled one */
.segmented { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface-2); }
.segmented button { padding: 0.3rem 0.75rem; font-size: 0.76rem; background: transparent; color: var(--text-2); border-radius: 5px; }
.segmented button:hover { background: var(--tint); color: var(--text); filter: none; }
.segmented button.on { background: var(--accent); color: var(--accent-ink); }
.player iframe { width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #000; }

/* weather: icon buttons under the zoom controls, hour bar at the bottom, particle canvas */
.wx-btn {
  width: 29px; height: 29px; padding: 0; justify-content: center; border-radius: 4px;
  background: var(--overlay); color: var(--text-2); border: 1px solid var(--line); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}
.wx-btn svg { width: 18px; height: 18px; }
.wx-btn:hover { color: var(--strong); filter: none; }
.wx-btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* the colour scale sits bottom left; with weather on it moves up out of the hour bar's way */

/* elections: party swatches, vote bars */
.hidden { display: none !important; }
.swatch { display: inline-block; width: 0.7rem; height: 0.7rem; margin-inline-end: 0.35rem; border-radius: 2px; vertical-align: -0.05rem; }
.party-keys { display: grid; grid-template-columns: repeat(4, auto); gap: 0.2rem 0.6rem; margin: 0; padding: 0; list-style: none; font-size: 0.75rem; }
.votes .bar-cell { width: 40%; }
.votes .bar { display: block; height: 0.5rem; border-radius: 2px; min-width: 1px; }
.constituencies { margin-top: 0.5rem; }
.constituencies summary { cursor: pointer; font-weight: 600; }
.constituencies h4 { margin: 0.6rem 0 0.2rem; font-size: 0.8rem; }

/* ---------- phones: masthead (title, then a scrolling index), panel, map ---------- */
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 40dvh 1fr; grid-template-areas: "mast" "side" "map"; }
  .app.folded { grid-template-columns: 1fr; grid-template-rows: auto 0 1fr; }
  aside.side { border-inline-end: 0; border-bottom: 1px solid var(--line-strong); }
  .masthead { flex-wrap: wrap; gap: 0.35rem 0.6rem; padding: max(0.5rem, env(safe-area-inset-top)) 0.8rem 0; }
  .title-block .sub, .sheet-controls .api-link { display: none; }
  .title-block h1 { font-size: 1.35rem; }
  .sheet-controls { margin-inline-start: auto; }
  .sheet-controls select { font-size: 16px; }
  .index { order: 3; width: 100%; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .index::-webkit-scrollbar { display: none; }
  .index [role="tab"] { min-height: 44px; padding: 0.4rem 0.6rem; }
  .index [role="tab"].on::after { bottom: 0; }
  main.mapwrap::after { inset: 3px; }
  .tab-body {
    padding: 0.75rem 0.85rem max(1rem, env(safe-area-inset-bottom));
    gap: 0.65rem;
  }
  .item {
    min-height: 44px;
    padding: 0.65rem 0.75rem;
  }
  input, select {
    font-size: 16px; /* Prevents iOS auto-zoom on focus */
  }
  main.mapwrap { min-height: 0; }
  aside.detail {
    position: fixed;
    top: auto;
    bottom: 0;
    inset-inline: 0;
    width: 100%;
    max-height: 82dvh;
    height: auto;
    border-radius: calc(var(--radius) * 1.4) calc(var(--radius) * 1.4) 0 0;
    border-inline: 0;
    border-bottom: 0;
    padding: 1rem 1rem max(1.2rem, env(safe-area-inset-bottom));
    box-shadow: 0 -8px 32px var(--shadow);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: sheetSlideUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99;
  }
  aside.detail::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: -0.3rem auto 0.75rem;
    background: var(--line-strong);
    border-radius: 999px;
    flex-shrink: 0;
  }
  .close {
    top: 0.65rem;
    inset-inline-end: 0.65rem;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.3rem;
  }
  .layers {
    top: 0.6rem;
    left: 0.6rem;
    max-height: calc(100% - 2.5rem);
    max-width: calc(100% - 1.2rem);
  }
  .layers[open] { width: min(18.5rem, calc(100% - 1.2rem)); }
  .layer-row {
    padding: 0.4rem 0.35rem;
    min-height: 38px;
  }
  .layer-row input {
    width: 1.15rem;
    height: 1.15rem;
  }
  .wx-btn {
    width: 34px;
    height: 34px;
  }
  .wx-btn svg {
    width: 20px;
    height: 20px;
  }
  .map-legend {
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: 0.6rem;
    width: min(18rem, calc(100% - 1.2rem));
  }
  .toast {
    position: fixed;
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    width: calc(100% - 2rem);
    max-width: 24rem;
  }
}

@media (max-width: 480px) {
  .party-keys { grid-template-columns: repeat(2, 1fr); }
}

/* theme: one button that cycles auto → dark → light */
.theme-toggle { width: 2.1rem; height: 2.1rem; padding: 0; justify-content: center; font-size: 1rem; line-height: 1; }

/* 4G/5G coverage swatches: the map's disc colours */
.k-iam { --kc: #1565c0; }
.k-orange { --kc: #f57c00; }
.k-inwi { --kc: #ad1457; }
.k-5g { --kc: transparent; border: 2.5px solid var(--text-2); }
/* the key's hint reads as a note under its title, in the interface face */
.map-legend figcaption .meta { display: block; margin-top: 0.1rem; font: 0.72rem/1.35 var(--font-ui); }
.k-speed { --kc: linear-gradient(90deg, #ffffcc, #7fcdbb, #253494); background: var(--kc); border-radius: 2px; }

/* speed key: above the commune scale when both are shown */
.speed-key.stacked { bottom: 9.5rem; }
/* map popups follow the theme */
.maplibregl-popup-content {
  background: var(--overlay); color: var(--text); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px var(--shadow); padding: 0.45rem 0.65rem; font: 0.8rem var(--font-ui); font-variant-numeric: tabular-nums;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--line-strong); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--line-strong); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--line-strong); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--line-strong); }

/* satellite view in the detail panel: 3×3 tiles, the point under a crosshair */
.sat { margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.sat-grid {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr); aspect-ratio: 1;
  overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #1b2a1f;
}
.sat-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sat-mark {
  position: absolute; width: 26px; height: 26px; transform: translate(-50%, -50%); pointer-events: none;
  border: 2px solid var(--saffron); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
}
.sat-mark::before, .sat-mark::after { content: ""; position: absolute; background: var(--saffron); }
.sat-mark::before { left: 50%; top: -9px; bottom: -9px; width: 2px; transform: translateX(-50%); }
.sat-mark::after { top: 50%; left: -9px; right: -9px; height: 2px; transform: translateY(-50%); }
.sat figcaption { display: flex; flex-direction: column; gap: 0.35rem; }

/* fold tab: on the panel's edge (the map's start side), always reachable, folded or not */
.fold {
  position: absolute; top: 50%; inset-inline-start: 0; z-index: 9; transform: translateY(-50%);
  width: 1.15rem; height: 3.2rem; padding: 0; justify-content: center;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--line-strong); border-inline-start: 0;
  border-start-start-radius: 0; border-end-start-radius: 0;
}
.fold:hover { color: var(--strong); background: var(--surface-3); filter: none; }
/* the generic pressed shrink (button:active) would replace the centring transform: the tab jumped
   half its height on every click and slid back, a wiggle */
.fold, .fold:active { transform: translateY(-50%); transition: background 0.15s ease, color 0.15s ease; }
.fold svg { width: 0.8rem; height: 0.8rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
/* the arrow points where the panel will go: toward the start to fold, away to unfold */
.fold svg { transform: scaleX(1); }
[dir="rtl"] .fold svg { transform: scaleX(-1); }
.app.folded .fold svg { transform: scaleX(-1); }
[dir="rtl"] .app.folded .fold svg { transform: scaleX(1); }
/* the layer panel clears the fold tab when it sits on the same (left) side */
:root:not([dir="rtl"]) .layers { left: 1.6rem; }
@media (max-width: 768px) {
  .fold { top: 0; transform: none; width: 3.2rem; height: 1.15rem; inset-inline-start: 50%; margin-inline-start: -1.6rem;
    border: 1px solid var(--line-strong); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .fold:active { transform: none; }
  .fold svg, [dir="rtl"] .fold svg { transform: rotate(-90deg); }
  .app.folded .fold svg, [dir="rtl"] .app.folded .fold svg { transform: rotate(90deg); }
  :root:not([dir="rtl"]) .layers { left: 0.6rem; }
}

/* layer manager: presets, filter, collapsible groups with a whole-group switch */
.layer-tools { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.55rem 0 0.35rem; }
.presets { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.chip {
  padding: 0.22rem 0.6rem; font-size: 0.74rem; border-radius: 999px;
  background: transparent; color: var(--text-2); border: 1px solid var(--line-strong);
}
.chip:hover { background: var(--tint); color: var(--text); filter: none; }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip.clear { margin-inline-start: auto; border-style: dashed; }
.layer-tools .search { padding: 0.35rem 0.55rem; font-size: 0.8rem; }
.layer-group-box { border-top: 1px solid var(--line); }
.layer-group-box > summary {
  list-style: none; display: flex; align-items: center; gap: 0.45rem; padding: 0.45rem 0.25rem;
  cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--text);
}
.layer-group-box > summary::-webkit-details-marker { display: none; }
.layer-group-box > summary::after { content: "▸"; color: var(--text-3); font-size: 0.7rem; transition: transform 0.15s; }
.layer-group-box[open] > summary::after { transform: rotate(90deg); }
[dir="rtl"] .layer-group-box > summary::after { transform: scaleX(-1); }
[dir="rtl"] .layer-group-box[open] > summary::after { transform: rotate(90deg); }
.layer-group-box > summary input { width: 0.95rem; height: 0.95rem; margin: 0; accent-color: var(--accent); }
.layer-group-box > .layer-row { margin-inline-start: 1.1rem; }
.layer-group-box:last-child { margin-bottom: 0.4rem; }

/* LoRaWAN live state */
.live-status { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.65rem; border-radius: var(--radius-sm); background: var(--surface-3); font-size: 0.84rem; }
.live-status .meta { margin-inline-start: auto; }
.live-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.live-status.on { background: rgba(47, 158, 68, 0.12); }
.live-status.on .live-dot { background: #2f9e44; box-shadow: 0 0 0 3px rgba(47, 158, 68, 0.25); }

/* LoRaWAN uptime timeline: one mark per 10-minute poll over 24 h */
.uptime-bar { display: flex; gap: 1px; height: 1.4rem; align-items: stretch; }
.uptime-bar span { flex: 1 1 0; min-width: 0; background: var(--line-strong); border-radius: 1px; }
.uptime-bar span.on { background: #2f9e44; }

/* legend of the switched-on layers, bottom right above the scale; folds to its title bar or hides to one button */
.map-key, .map-key-show { position: absolute; right: 10px; bottom: 3.4rem; z-index: 5; }
.map-key {
  width: min(15rem, calc(100% - 1.5rem)); max-height: 45vh; overflow: auto; font-size: 0.75rem;
  background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 6px 24px var(--shadow); backdrop-filter: blur(6px);
}
.map-key summary { list-style: none; display: flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.4rem 0.35rem 0.6rem; cursor: pointer; font: 600 0.82rem var(--font-display); position: sticky; top: 0; background: var(--overlay); }
.map-key summary::-webkit-details-marker { display: none; }
.map-key[open] summary { border-bottom: 1px solid var(--line); }
.map-key summary button { padding: 0 0.4rem; min-height: 0; line-height: 1.3; }
.map-key .key-group { margin: 0.45rem 0.6rem 0.15rem; color: var(--text-3); font-size: 0.68rem; font-weight: 600; }
.map-key ul { margin: 0 0.6rem; padding: 0; list-style: none; display: grid; gap: 0.15rem; }
.map-key ul:last-child { margin-bottom: 0.5rem; }
.map-key li { display: flex; align-items: center; gap: 0.4rem; }
.map-key-show { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; background: var(--overlay); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.map-key-show svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .map-key, .map-key-show { bottom: 5.5rem; } .map-key { max-height: 30vh; } }
/* event category icon (map.js EVENT_STYLE); in lists the ring is the severity */
.ev-icon { width: 20px; height: 20px; flex: none; border-radius: 50%; }
.ev-icon.sev1 { box-shadow: 0 0 0 2px #e3c84a; }
.ev-icon.sev2 { box-shadow: 0 0 0 2px #ff9f1c; }
.ev-icon.sev3 { box-shadow: 0 0 0 2px #ff4d4f; }
.map-key .ev-icon { width: 16px; height: 16px; }
