/* Alerty RCB — one stylesheet for the map, the history and the analytics.
   Direction: a public bulletin board. Quiet graphite chrome, the map and the charts carry
   the colour, times in mono. Signature: the status strip under the header. */

@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Plex Sans"; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-500.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Plex Sans"; font-weight: 500; font-display: swap;
  src: url(fonts/ibm-plex-sans-latin-ext-500.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-400.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212; }
@font-face { font-family: "Plex Mono"; font-weight: 400; font-display: swap;
  src: url(fonts/ibm-plex-mono-latin-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light dark;
  --bg: light-dark(#f4f4f2, #111213);
  --surface: light-dark(#ffffff, #18191b);
  --surface-2: light-dark(#ececea, #202224);
  --line: light-dark(rgb(23 24 26 / .1), rgb(236 236 234 / .09));
  --line-strong: light-dark(rgb(23 24 26 / .18), rgb(236 236 234 / .16));
  --text: light-dark(#17181a, #ececea);
  --text-2: light-dark(#4f535a, #a9acb2);
  --muted: light-dark(#6e727a, #80848b);
  --accent: light-dark(#c4122f, #ff5d62);
  --alarm: light-dark(#c4122f, #b1132c);
  --ok: light-dark(#2f7a4f, #5cbf86);
  --land: light-dark(#e3e3df, #26282b);
  --land-hover: light-dark(#d6d6d1, #303236);
  --land-edge: light-dark(#f4f4f2, #111213);
  --bar: light-dark(#a3a6ab, #55595f);

  /* category colours: used on the map, in swatches and in category charts only */
  --air: light-dark(#c4122f, #ff5d62);
  --drill: light-dark(#b07a12, #e2ad3b);
  --water: light-dark(#2667ad, #5ea0e6);
  --weather: light-dark(#2f7f75, #57b3a6);
  --ordnance: light-dark(#8a5a2b, #c48a52);
  --fire: light-dark(#d4540c, #ff8a3d);
  --chemical: light-dark(#5d7f1f, #9cc45a);
  --other: light-dark(#8d9096, #6b6f75);

  --sans: "Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 12px;
  --ease: cubic-bezier(.2, 0, 0, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-weight: 500; margin: 0; }
.mono { font-family: var(--mono); font-size: .8125rem; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* header and navigation */
.top { display: flex; align-items: center; gap: 32px; padding: 0 24px; height: 56px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 1rem; text-decoration: none; white-space: nowrap; }
.logo .mark { width: 14px; height: 14px; border-radius: 3px; background: var(--text); position: relative; }
.logo .mark::after { content: ""; position: absolute; inset: 4px; border-radius: 1px; background: var(--surface); }
nav.tabs { display: flex; gap: 4px; height: 100%; }
nav.tabs a { display: flex; align-items: center; padding: 0 12px; color: var(--text-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .15s var(--ease), border-color .15s var(--ease); }
nav.tabs a:hover { color: var(--text); }
nav.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.top .src { margin-left: auto; color: var(--muted); }

/* the status strip: the one place that turns red when there is an air threat */
.strip { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 10px 24px;
  border-bottom: 1px solid var(--line); background: var(--bg); color: var(--text-2); }
.strip .state { color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.strip .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; transform: translateY(-1px); }
.strip .checked { margin-left: auto; }
.strip.alarm { background: var(--alarm); color: #fff; border-bottom-color: transparent; }
.strip.alarm .state { color: #fff; }
.strip.alarm .state::before { background: #fff; }
.strip.alarm .checked { color: rgb(255 255 255 / .8); }
.strip.stale .state::before { background: var(--muted); }

main { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px; }

/* map page */
.map-page { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.map-wrap { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.map { width: 100%; height: auto; display: block; }
.map-wrap .map { max-height: calc(100dvh - 240px); min-height: 320px; }
.map path.pow { fill: var(--land); stroke: var(--land-edge); stroke-width: .5; transition: fill .2s var(--ease); }
.map path.woj { fill: none; stroke: var(--land-edge); stroke-width: 2.2; pointer-events: none; }
.map path.pow:hover { fill: var(--land-hover); }
.map path.hit { cursor: pointer; }
.map text { fill: var(--text-2); font: 18px var(--sans); text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: var(--land); stroke-width: 4px; stroke-linejoin: round; }
.map .heat-n { font: 500 22px var(--mono); fill: var(--text); }
.blink { @media (prefers-reduced-motion: no-preference) { animation: blink 1.6s ease-in-out infinite; } }
@keyframes blink { 50% { opacity: .55; } }
/* the zoomable map (Leaflet): powiaty coloured in CSS, so the theme colours work */
/* the period: two handles over the histogram, quick buttons, two dates */
.period { margin-bottom: 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.brush { --a: 0; --b: 1; --pad: 14px; position: relative; min-width: 0; height: 52px; touch-action: none; cursor: pointer; user-select: none; }
.spark { position: absolute; left: var(--pad); right: var(--pad); top: 4px; height: 28px; width: calc(100% - 2 * var(--pad)); fill: var(--bar); opacity: .8; pointer-events: none; }
.brush::before { content: ""; position: absolute; left: var(--pad); right: var(--pad); top: 32px; border-top: 1px solid var(--line-strong); pointer-events: none; }
.brush-sel { position: absolute; top: 0; height: 36px; left: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--a));
  width: max(3px, calc((100% - 2 * var(--pad)) * (var(--b) - var(--a)))); background: var(--accent); opacity: .22; border-radius: 3px; cursor: grab; }
.brush.dragging .brush-sel { cursor: grabbing; }
.brush-h { position: absolute; top: 0; width: 28px; height: 36px; margin-left: -14px; cursor: ew-resize; z-index: 1; }
.brush-h::after { content: ""; position: absolute; left: 11px; top: 2px; width: 6px; height: 32px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
#h-from { left: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--a)); }
#h-to { left: calc(var(--pad) + (100% - 2 * var(--pad)) * var(--b)); }
.brush-h:focus-visible { outline: none; }
.brush-h:focus-visible::after { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.brush-axis { position: absolute; left: var(--pad); right: var(--pad); top: 36px; height: 16px; font-size: .6875rem; color: var(--muted); pointer-events: none; }
.brush-axis span { position: absolute; left: calc(var(--at) * 100%); padding-left: 3px; border-left: 1px solid var(--line-strong); line-height: 16px; }
.period-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.presets { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: var(--surface); }
.presets button { font: inherit; font-size: .8125rem; border: 0; background: none; color: var(--text-2); padding: 0 10px; min-height: 30px; border-radius: 6px; cursor: pointer; }
.presets button:hover { color: var(--text); }
.presets button[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.dates { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dates label { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: .8125rem; }
.dates input { font: inherit; font-size: .8125rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; min-height: 32px; }
.day-label { color: var(--text); font-size: .8125rem; }
/* missiles and drones over Poland (attacks.js): red days on the slider, a card and the flight on the map */
.raid-ticks { position: absolute; left: var(--pad); right: var(--pad); top: 2px; height: 32px; pointer-events: none; z-index: 2; }
.raid-tick { position: absolute; left: calc(var(--x) * 100%); top: 0; width: 3px; height: 32px; margin-left: -1.5px; padding: 0;
  border: 0; border-radius: 2px; background: var(--accent); cursor: pointer; pointer-events: auto; }
.raid-tick::before { content: ""; position: absolute; inset: -4px -6px; }
.raid-tick.on { width: 5px; margin-left: -2.5px; box-shadow: 0 0 0 2px var(--surface); }
.day-label.raid { color: var(--accent); font-weight: 500; }
.raid-days { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -4px 0 12px; font-size: .8125rem; color: var(--text-2); }
.raid-days-t { margin-right: 2px; }
.raid-day { font: inherit; font-family: var(--mono); font-size: .75rem; color: var(--accent); background: transparent; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 2px 8px; min-height: 26px; }
.raid-day:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.raid-day.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.raid { border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); border-left: 4px solid var(--accent); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.raid-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.raid-head h2 { font-size: 1rem; flex: 1; min-width: 12ch; }
.raid-flag { color: #fff; background: var(--accent); border-radius: 4px; padding: 1px 6px; font-size: .75rem; }
.raid-pick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.raid-pick .btn.on { border-color: var(--accent); color: var(--accent); }
.raid-sum { margin: 8px 0 6px; color: var(--text); }
.raid-w { margin: 0 0 6px; padding: 0; list-style: none; font-size: .8125rem; color: var(--text-2); display: grid; gap: 2px; }
.raid-w li { display: flex; gap: 8px; align-items: center; }
.raid-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0; padding: 0; list-style: none; color: var(--text-2); font-size: .75rem; }
.raid-legend li { display: flex; align-items: center; gap: 6px; }
.raid-sw { width: 14px; height: 14px; flex: none; background: currentColor; color: var(--text);
  mask: var(--m) center / contain no-repeat; -webkit-mask: var(--m) center / contain no-repeat; }
.raid-sw.k-missile { color: var(--accent); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1.5c1.6 1.4 2.3 3.3 2.3 5.4V15l2.9 3.3v2.2l-3-1.2-.5 2.2h-3.4l-.5-2.2-3 1.2v-2.2L9.7 15V6.9c0-2.1.7-4 2.3-5.4z'/%3E%3C/svg%3E"); }
.raid-sw.k-drone { color: var(--drill); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.2 22.6 19.6l-1.2 1.2-5.6-2.3-.7 2.2h-6.2l-.7-2.2-5.6 2.3-1.2-1.2z'/%3E%3C/svg%3E"); }
.raid-em { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.raid-em.e-crash, .raid-em.e-debris { background: var(--text); box-shadow: none; border-radius: 2px; }
.raid-em.e-shotdown { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 30%, transparent); }
.raid-em.e-left_airspace, .raid-em.e-not_found { background: transparent; border: 2px dashed var(--muted); box-shadow: none; }
.raid-dash { width: 18px; height: 0; border-top: 2px dashed var(--text-2); flex: none; }
.raid-note { margin: 4px 0; font-size: .75rem; }
.raid-wd .raid-w { margin-top: 6px; }
.raid-src summary { cursor: pointer; font-size: .8125rem; color: var(--text-2); }
.raid-src ul { margin: 6px 0 0; padding-left: 18px; font-size: .8125rem; display: grid; gap: 4px; }
.lmap.raid-on path.hit { fill-opacity: .22; }
.lmap .raid-route { stroke: var(--text); stroke-opacity: .35; stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; fill: none; }
.lmap .raid-trail { stroke-width: 2.5; stroke-dasharray: 8 5; fill: none; stroke-opacity: .9; }
.lmap .raid-trail.k-missile { stroke: var(--accent); }
.lmap .raid-trail.k-drone { stroke: var(--drill); }
.lmap.sat .raid-route { stroke: #fff; stroke-opacity: .6; }
.raid-ico span, .raid-end span { display: block; width: 100%; height: 100%; }
.raid-ico svg, .raid-end svg { width: 100%; height: 100%; display: block; fill: currentColor;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff) drop-shadow(0 1px 2px rgb(0 0 0 / .45)); }
.raid-ico.k-missile { color: var(--accent); }
.raid-ico.k-drone { color: var(--drill); }
.raid-end { color: var(--accent); }
.raid-end.e-crash, .raid-end.e-debris { color: var(--text); }
.raid-end.e-shotdown { color: var(--ok); }
.raid-end.e-left_airspace, .raid-end.e-not_found { color: var(--muted); }
.raid-end.burst span { @media (prefers-reduced-motion: no-preference) { animation: raid-pop .7s var(--ease) both; } }
.raid-end.e-explosion::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent);
  @media (prefers-reduced-motion: no-preference) { animation: raid-ring 1.8s ease-out infinite; } }
@keyframes raid-pop { from { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.5); opacity: 1; } to { transform: scale(1); } }
@keyframes raid-ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }
.leaflet-tooltip.raid-n { background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none;
  padding: 0 4px; font: .6875rem var(--mono); }
.leaflet-tooltip.raid-n::before { display: none; }

#recent button.what { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
#recent button.what[aria-pressed="true"] span { font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn { font: inherit; font-size: .8125rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; min-height: 32px; cursor: pointer; transition: background .15s var(--ease); }
.btn:hover:not(:disabled) { background: var(--land-hover); }
.btn:disabled { color: var(--muted); cursor: default; opacity: .6; }
.btn.icon { width: 32px; padding: 0; font-size: .625rem; }
.lmap { height: min(calc(100dvh - 330px), 760px); min-height: 380px; border-radius: 8px; background: var(--land); z-index: 0; }
.lmap.leaflet-container { font: .75rem var(--sans); background: var(--land); }
.lmap path.pow { fill: transparent; fill-opacity: 1; stroke: var(--muted); stroke-opacity: .45; transition: fill .2s var(--ease); }
.lmap path.pow:hover { fill: var(--text); fill-opacity: .08; }
.lmap path.woj { stroke: var(--text-2); stroke-opacity: .7; fill: none; }
.lmap path.hit { fill-opacity: .55; stroke: var(--surface); stroke-opacity: .6; }
.lmap path.hit:hover { fill-opacity: .75; }
.lmap.sat path.pow { stroke: #fff; stroke-opacity: .35; }
.lmap.sat path.woj { stroke: #fff; stroke-opacity: .8; }
.lmap.sat path.hit { fill-opacity: .45; stroke: #fff; stroke-opacity: .7; }
.lmap path.c-air { fill: var(--air); } .lmap path.c-drill { fill: var(--drill); } .lmap path.c-water { fill: var(--water); }
.lmap path.c-weather { fill: var(--weather); } .lmap path.c-ordnance { fill: var(--ordnance); } .lmap path.c-fire { fill: var(--fire); }
.lmap path.c-chemical { fill: var(--chemical); } .lmap path.c-other { fill: var(--other); }
.lmap .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--line); }
.lmap .leaflet-bar a:hover { background: var(--surface-2); }
.lmap .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent); color: var(--muted); }
.lmap .leaflet-control-attribution a { color: var(--text-2); }
.leaflet-tooltip.tip { position: absolute; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 4px 16px rgb(0 0 0 / .12);
  padding: 8px 12px; border-radius: 8px; font: .8125rem/1.4 var(--sans); white-space: normal; width: max-content; max-width: 260px; }
.leaflet-tooltip.tip::before { display: none; }
.layers { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: .8125rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { position: relative; display: flex; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { flex: 1; display: flex; align-items: center; justify-content: center; padding: 6px 12px; color: var(--text-2); }
.seg label + label span { border-left: 1px solid var(--line); }
.seg input:checked + span { background: var(--text); color: var(--surface); }
.seg input:focus-visible + span { outline: 2px solid var(--text); outline-offset: -4px; }
.layers select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--text-2); }
.chk input { accent-color: #e5251b; margin: 0; }
.base-note { color: var(--muted); margin: 8px 0 0; font-size: .75rem; min-height: 1em; }
.base-note:empty { display: none; }
.sw.fire-dot { background: #ff2a1a; border-radius: 50%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--text-2); font-size: .8125rem; }
/* each legend category is a filter button: one click isolates it, the second clears it */
.legend button { display: inline-flex; align-items: center; font: inherit; color: inherit; background: none; border: 0;
  border-radius: 6px; padding: 5px 8px; margin: -5px -8px; cursor: pointer;
  transition: background-color .15s var(--ease), color .15s var(--ease); }
.legend button:hover { background: var(--surface-2); color: var(--text); }
.legend button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c, var(--other)); margin-right: 8px; flex: none; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--line-strong);
  box-shadow: 0 4px 16px rgb(0 0 0 / .12); padding: 8px 12px; border-radius: 8px; font-size: .8125rem; max-width: 260px; z-index: 2; }
.tip b { font-weight: 500; display: block; }

.panel h2 { font-size: .9375rem; display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.panel h2 .n { font-family: var(--mono); font-weight: 400; color: var(--muted); font-size: .8125rem; }
.panel section + section { margin-top: 32px; }
.more { display: inline-block; margin-top: 12px; color: var(--text-2); font-size: .875rem; }

/* alert rows: hairlines, no cards */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rows > li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-head { display: flex; align-items: center; gap: 0; font-weight: 500; }
.row-msg { color: var(--text-2); margin: 4px 0 4px 18px; font-size: .875rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { margin-left: 18px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .75rem; }
.row-meta a, .hist .src, .rows.compact a { text-decoration: none; }
.row-meta a { color: var(--text-2); }
.row-meta a:hover, .hist .src:hover, .rows.compact a:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.rows > li.empty { color: var(--text-2); }
.rows.compact > li { padding: 8px 0; display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.rows.compact .when { color: var(--muted); font-size: .75rem; }
.rows.compact > li.empty { display: block; }
.rows.compact .what { display: flex; align-items: baseline; min-width: 0; }
.rows.compact .what span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows.compact .what .sw { transform: translateY(0); }

/* history page */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 1.5rem; line-height: 1.2; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 60ch; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters label { display: grid; gap: 4px; font-size: .75rem; color: var(--muted); }
/* the active powiat filter, deep-linked from the analytics page */
.chip { display: inline-flex; align-items: center; align-self: end; gap: 2px; height: 36px; padding: 0 6px 0 10px;
  font-size: .875rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.chip[hidden] { display: none; }
.chip button { border: 0; background: none; font: inherit; line-height: 1; padding: 4px 7px; border-radius: 4px;
  color: var(--text-2); cursor: pointer; }
.chip button:hover { color: var(--text); }
select, input[type="search"] { font: inherit; font-size: .875rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; height: 36px; padding: 0 10px; min-width: 160px; }
input[type="search"] { min-width: 240px; }
select:hover, input[type="search"]:hover { border-color: var(--text-2); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; background: var(--surface); }
.seg button { font: inherit; font-size: .875rem; border: 0; background: none; color: var(--text-2); padding: 0 12px; height: 30px;
  border-radius: 6px; cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); }
.btn { font: inherit; font-size: .875rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 8px; height: 36px; padding: 0 16px; cursor: pointer; }
.btn:hover { background: var(--surface-2); }

.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.month { padding: 0 20px; }
.month + .month { border-top: 1px solid var(--line); }
.month h2 { position: sticky; top: 0; background: var(--surface); padding: 16px 0 8px; font-size: .9375rem;
  display: flex; gap: 8px; align-items: baseline; z-index: 1; }
.month h2 .n { font-family: var(--mono); font-weight: 400; color: var(--muted); font-size: .8125rem; }
.hist { list-style: none; margin: 0 0 8px; padding: 0; }
.hist li { display: grid; grid-template-columns: 112px 220px minmax(0, 1fr) 96px; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.hist .when { color: var(--muted); }
.hist .cat { display: flex; align-items: baseline; font-weight: 500; }
.hist .msg { color: var(--text-2); font-size: .875rem; }
.hist .msg .reg { display: block; color: var(--muted); font-size: .8125rem; margin-top: 2px; }
.hist .src { text-align: right; font-size: .8125rem; color: var(--text-2); }
.count-line { color: var(--muted); margin: 0 0 12px; }
.load-more { display: flex; justify-content: center; padding: 16px; border-top: 1px solid var(--line); }

/* analytics page */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; }
.stat { padding: 20px 24px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .label { color: var(--text-2); font-size: .875rem; }
.stat .value { font-size: 2rem; line-height: 1.15; margin-top: 8px; letter-spacing: -.01em; }
.stat .delta { color: var(--muted); margin-top: 4px; font-size: .75rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; }
.card h2 { font-size: .9375rem; }
.card .sub { color: var(--muted); font-size: .8125rem; margin: 2px 0 16px; }
.grid-a { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.grid-b { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 24px; }
.grid-c { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { fill: var(--muted); font: 11px var(--mono); }
.chart .b-air { fill: var(--accent); }
.chart .b-rest { fill: var(--bar); }
.chart rect.hov { fill: transparent; }
.chart rect.hov:hover { fill: var(--line); }
.chart-legend { display: flex; gap: 16px; color: var(--text-2); font-size: .8125rem; margin: 0 0 12px; padding: 0; list-style: none; }
.chart-legend li { display: flex; align-items: center; }
.ranked { list-style: none; margin: 0; padding: 0; }
.ranked li { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.ranked li:first-child { border-top: 0; }
.ranked .name { display: flex; align-items: baseline; min-width: 0; }
.ranked .name span:last-child, .ranked .name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked a { color: inherit; text-decoration: none; }
.ranked a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ranked .num { text-align: right; font-family: var(--mono); font-size: .8125rem; color: var(--text-2); }
.ranked .track { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; }
.ranked .track i { display: block; height: 100%; background: var(--c, var(--bar)); border-radius: 2px; }
.heat-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .75rem; margin-top: 8px; }
.heat-legend .ramp { height: 8px; width: 160px; border-radius: 2px; }

/* changelog */
.release { padding-bottom: 16px; }
.release h2 { display: flex; align-items: baseline; gap: 10px; }
.release h2 .ver { font-size: 1.0625rem; font-weight: 500; }
.release h2 .n { margin-left: auto; }
.bump { font-size: .75rem; font-weight: 500; padding: 1px 6px;
  border-radius: 4px; border: 1px solid var(--line-strong); color: var(--text-2); }
.bump.major { border-color: var(--air); color: var(--air); }
.bump.minor { color: var(--text); }
.release h3 { font-size: .8125rem; font-weight: 500; color: var(--muted); margin: 12px 0 4px; }
.changes { list-style: none; margin: 0; padding: 0; }
.changes li { display: flex; gap: 10px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); }
.changes li:first-child { border-top: 0; }
.changes .scope { font-size: .75rem; color: var(--text-2); background: var(--surface-2); padding: 0 6px; border-radius: 4px; white-space: nowrap; }
.changes .when { margin-left: auto; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.changes .sha { font-size: .75rem; color: var(--muted); text-decoration: none; }
.changes .sha:hover { text-decoration: underline; }
footer #ver { color: var(--muted); }

footer { color: var(--muted); font-size: .8125rem; padding: 24px; border-top: 1px solid var(--line); }
footer .in { max-width: 1480px; margin: 0 auto; display: grid; gap: 4px; }
footer p { margin: 0; max-width: 90ch; }

/* shelters page (schrony.html) */
:root { --acc-0: light-dark(#2f7a4f, #5cbf86); --acc-1: light-dark(#b07a12, #e2ad3b); --acc-2: light-dark(#2667ad, #5ea0e6);
  --me: light-dark(#c4122f, #ff5d62); }
.sw.acc-0 { background: var(--acc-0); border-radius: 50%; } .sw.acc-1 { background: var(--acc-1); border-radius: 50%; }
.sw.acc-2 { background: var(--acc-2); border-radius: 50%; } .sw.me-dot { background: var(--me); border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--me); }
.finder { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.finder .addr { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; }
.finder .addr input { flex: 1; min-width: 0; }
.btn.primary { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 500; }
.btn.primary:hover:not(:disabled) { background: var(--text-2); border-color: var(--text-2); }
.btn[aria-pressed="true"] { background: var(--text); color: var(--surface); }
.btn.wide { width: 100%; }
.find-note { margin: 0 0 10px; color: var(--text-2); font-size: .875rem; min-height: 1.3em; }
.find-note:empty { display: none; }
.find-note.warn { color: var(--accent); }
.addr-results { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8125rem; }
.addr-results[hidden] { display: none; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline;
  text-decoration-color: var(--line-strong); text-underline-offset: 3px; cursor: pointer; text-align: left; }
.link:hover { color: var(--text); }
.lmap.picking { cursor: crosshair; }
.lmap path.me { stroke: var(--surface); fill: var(--me); }
.lmap path.me-acc { stroke: var(--me); stroke-opacity: .5; fill: var(--me); fill-opacity: .08; }
.leaflet-popup.pop-wrap .leaflet-popup-content-wrapper { background: var(--surface); color: var(--text); border-radius: 10px;
  border: 1px solid var(--line-strong); box-shadow: 0 6px 20px rgb(0 0 0 / .18); }
.leaflet-popup.pop-wrap .leaflet-popup-tip { background: var(--surface); }
.leaflet-popup.pop-wrap .leaflet-popup-content { margin: 12px 14px; font: .875rem/1.4 var(--sans); }
.leaflet-popup.pop-wrap a.leaflet-popup-close-button { color: var(--muted); }
.pop { display: grid; gap: 6px; justify-items: start; }
.pop b { font-weight: 500; padding-right: 12px; }
.pop .muted { font-size: .8125rem; }
.rows.shelters > li { display: grid; gap: 6px; }
.rows.shelters > li.empty { display: block; }
.sh-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; font-weight: 500; }
.sh-n { color: var(--muted); }
.sh-d { color: var(--text); font-size: .875rem; white-space: nowrap; }
.sh-meta { margin-left: 32px; display: flex; align-items: center; color: var(--text-2); font-size: .8125rem; }
.sh-act { margin-left: 32px; display: flex; gap: 8px; }
.sh-act .btn { height: 36px; min-width: 88px; }
.about { margin: 0 0 8px; color: var(--text-2); font-size: .875rem; }
.about.muted { color: var(--muted); font-size: .8125rem; }
/* the navigation chooser: a bottom sheet on a phone, a small dialog on a desktop */
.nav-sheet { border: 1px solid var(--line-strong); border-radius: 16px; padding: 20px; width: min(420px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 12px 40px rgb(0 0 0 / .25); }
.nav-sheet::backdrop { background: rgb(0 0 0 / .45); }
.nav-sheet h2 { font-size: 1.0625rem; }
.nav-to { color: var(--text-2); margin: 4px 0 16px; font-size: .875rem; }
.nav-apps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.nav-apps .app { display: flex; flex-direction: column; justify-content: center; width: 100%; min-height: 52px; padding: 8px 16px;
  font: inherit; font-weight: 500; text-align: left; text-decoration: none; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.nav-apps .app:hover { border-color: var(--line-strong); }
.nav-apps .app.main { background: var(--text); color: var(--surface); border-color: var(--text); }
.nav-apps .app small { font-weight: 400; font-size: .75rem; opacity: .75; }
.shelter-page .lmap { height: min(calc(100dvh - 300px), 760px); }
@media (max-width: 640px) {
  .finder > .btn, .finder .addr { flex: 1 1 100%; }
  .finder #locate { min-height: 48px; font-size: 1rem; }
  .shelter-page .lmap { height: 52dvh; min-height: 300px; }
  .nav-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 16px 16px 0 0; border-bottom: 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); }
}

@media (max-width: 1080px) {
  .map-page, .grid-b { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .hist li { grid-template-columns: 96px minmax(0, 1fr); }
  .hist .cat { grid-column: 2; grid-row: 1; }
  .hist .msg { grid-column: 2; }
  .hist .src { grid-column: 2; text-align: left; }
}
@media (max-width: 640px) {
  .top { gap: 12px; padding: 0 16px; }
  .top .src { display: none; }
  nav.tabs a { padding: 0 8px; }
  .strip { padding: 8px 16px; }
  .strip .checked { margin-left: 0; width: 100%; }
  main { padding: 16px; }
  .map-wrap { padding: 12px; }
  .lmap { height: 62dvh; min-height: 340px; }
  .brush { height: 60px; }
  .brush-h { width: 36px; margin-left: -18px; }
  .brush-h::after { left: 13px; width: 10px; }
  .presets { display: flex; width: 100%; }
  .presets button { flex: 1 1 0; min-width: 0; padding: 0 2px; min-height: 36px; }
  .dates { width: 100%; flex-wrap: nowrap; gap: 6px; }
  .dates label { flex: 1; min-width: 0; gap: 4px; }
  .dates input { flex: 1; min-width: 0; min-height: 36px; padding: 0 4px; }
  .dates .btn.icon { width: 36px; min-height: 36px; flex: none; }
  .seg { width: 100%; }
  .seg label { flex: 1; text-align: center; }
  .seg span { padding: 6px 4px; }
  .wb, .wb select { width: 100%; }
  .map text { font-size: 26px; stroke-width: 6px; }
  .map .heat-n { font-size: 30px; }
  .grid-c { grid-template-columns: 1fr; }
  .stat { padding: 16px; }
  .stat .value { font-size: 1.5rem; }
  .card { padding: 16px; }
  .month { padding: 0 16px; }
  .hist li { grid-template-columns: 1fr; gap: 4px; }
  .hist .cat, .hist .msg, .hist .src { grid-column: 1; grid-row: auto; }
  input[type="search"], select { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 140px; }
  .filters label.q { flex-basis: 100%; }
}
/* on a narrow phone the four tabs do not fit next to the logo: wrap them into their own row */
@media (max-width: 440px) {
  .top { flex-wrap: wrap; height: auto; padding: 8px 16px 0; }
  /* overflow-x: auto makes overflow-y auto too: pin the row so it only scrolls sideways */
  nav.tabs { flex: 1 1 100%; height: 40px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; touch-action: pan-x; scrollbar-width: none; }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs a { flex: 1 0 auto; justify-content: center; padding: 0 8px; }
}

/* live alerts: toasts from the Server-Sent Events stream */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 4px solid var(--alarm); border-radius: var(--r); padding: 12px 14px;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18); animation: toast-in .25s var(--ease); }
.toast .sw { margin-top: 6px; }
.toast p { margin: 4px 0; color: var(--text-2); font-size: .875rem; }
.toast a { font-size: .8125rem; color: var(--text-2); }
.toast .x { border: 0; background: none; color: var(--muted); font-size: 1.25rem; line-height: 1; cursor: pointer; padding: 0 2px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* notifications page */
.notify { display: grid; gap: 24px; max-width: 960px; }
.notify .areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; margin: 12px 0; }
.notify label.chk { display: flex; gap: 8px; align-items: center; font-size: .9375rem; }
.channels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.channels .card { display: flex; flex-direction: column; gap: 12px; }
.channels .card p { margin: 0; color: var(--text-2); font-size: .875rem; }
.channels input[type="email"] { font: inherit; font-size: .875rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; height: 36px; padding: 0 10px; width: 100%; }
.channels .btn { align-self: flex-start; }
.channels .out { min-height: 1.5em; font-size: .875rem; color: var(--text-2); }
.channels .out.err { color: var(--accent); }
.channels .card[aria-disabled="true"] { opacity: .6; }
@media (max-width: 860px) { .channels { grid-template-columns: minmax(0, 1fr); } }

/* phones (mobile audit #35–#41, 23.11.2026): form fields at 16 px so iOS does not zoom in on focus,
   tap targets at least 24 px high (most 32+), no text under 12 px. Also a phone held sideways (low screen)
   and any touch screen. */
@media (max-width: 640px), (max-height: 500px), (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
  .chk, .notify label.chk { min-height: 36px; }
  summary { padding: 8px 0; }
  .more { padding: 8px 0; margin-top: 4px; }
  .row-meta a, .hist a.src, .changes .sha { display: inline-block; padding: 4px 0; min-height: 26px; line-height: 18px; }
  /* the sticky month heading rides over the top rows of its month, and a tap on the covered
     link hits the heading: on touch it scrolls away with its rows instead */
  .month h2 { position: static; }
  .changes li { flex-wrap: wrap; } /* the time and sha drop under the text instead of squeezing it */
  .rows.compact .what { min-height: 32px; align-items: center; }
  .ranked .name a { display: inline-block; padding: 4px 0; min-height: 28px; }
  .dates input { min-height: 40px; }
  .dates .btn.icon { width: 40px; min-height: 40px; font-size: .875rem; }
  .brush-axis { font-size: .75rem; }
  /* the red days on the slider are 3 px wide: on a phone they only mark the days, the chips below are the buttons,
     so they do not cover the period handles */
  .raid-tick { pointer-events: none; }
}
@media (max-width: 640px) {
  .dates { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 36px; align-items: end; gap: 4px; }
  .dates .btn.icon { width: 36px; }
  .dates label { flex-direction: column; align-items: stretch; gap: 2px; font-size: .75rem; }
  .dates input { width: 100%; padding: 0 2px; text-align: center; letter-spacing: -.01em; }
  /* a tap on the field opens the date picker; the calendar icon only takes the room the date needs */
  .dates input::-webkit-calendar-picker-indicator { display: none; }
  nav.tabs a { min-height: 40px; }
}
/* the tab row scrolls sideways on a narrow phone: fade the side that has more tabs (common.js sets the flags) */
nav.tabs[data-more~="r"] { mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
nav.tabs[data-more~="l"] { mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
nav.tabs[data-more~="l"][data-more~="r"] { mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
