:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --line: #d6e1f5;
  --line-strong: #a9c0ea;
  --grid: rgba(29, 91, 216, 0.05);
  --text: #0a2a66;
  --muted: #5b6f96;
  --blue: #1d5bd8;
  --blue-mid: #2f6ad8;
  --blue-deep: #0a2a66;
  --blue-soft: #e8f0fd;
  --aqua: #1fbfc6;
  --aqua-soft: #d6f5f5;
  --land: #f4f8ff;
  /* Carved/runic look: angular slab face for the interface, runes for ornaments,
     a plain sans only for the long post texts so they stay readable. */
  --carved: "Kelly Slab", Georgia, serif;
  --runic: "Noto Sans Runic", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cut: 8px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--bg);
  color: var(--text);
  font-family: var(--carved);
  font-size: 14px;
}

a { color: var(--blue); }
.rune { font-family: var(--runic); font-style: normal; }

/* Chamfered ("cut stone") corners, used on buttons, panels and badges. */
.zoom button, .readout, .tip, .hero-scroll, .show-media, #panel-close, .more, .filters, .f-periods button, #f-reset, .kind-chips button, .f-chips button {
  clip-path: polygon(
    var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut),
    100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%,
    0 calc(100% - var(--cut)), 0 var(--cut)
  );
}

/* Zigzag strip, like a band carved round a rune stone. */
.bar::after, .panel-head::after {
  content: "";
  display: block;
  height: 8px;
  background:
    linear-gradient(135deg, var(--band, var(--blue-mid)) 25%, transparent 25%) -4px 0 / 8px 8px,
    linear-gradient(225deg, var(--band, var(--blue-mid)) 25%, transparent 25%) -4px 0 / 8px 8px;
}

/* ---- intro: ОКО rune-sphere eye ---- */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 16px 80px;
  position: relative;
  text-align: center;
}
#eye { width: min(54vh, 72vw); height: auto; overflow: visible; }
#eye .eye-top { stroke: var(--blue-mid); }
#eye .eye-bottom { stroke: var(--blue-deep); }
#eye .rune-top { fill: var(--blue-mid); }
#eye .rune-bottom { fill: var(--blue-deep); }
#eye .eye-white { fill: #fff; stroke: #fff; stroke-width: 24; stroke-linejoin: miter; }
#eye .eye-lid { fill: none; stroke-width: 16; stroke-linecap: square; stroke-linejoin: miter; }
#eye .eye-iris { fill: var(--blue-deep); }
.hero-title { margin: 10px 0 0; line-height: 0; color: var(--blue-deep); }
.hero-title .runes { width: clamp(150px, 22vw, 240px); height: auto; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.hero-scroll {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  font: 16px var(--carved);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
}
.hero-scroll:hover { background: var(--blue); }
.hero-scroll .rune { color: #7fa8ff; margin-right: 6px; }
.hero-scroll span { display: inline-block; margin-left: 6px; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .hero-scroll span { animation: none; } }

/* ---- top bar ---- */
.bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - 1800px) / 2)) 20px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 18px;
  letter-spacing: 0.2em;
}
.bar::after { position: absolute; left: 0; right: 0; bottom: 0; }
.bar .brand b { color: #7fa8ff; margin-right: 6px; }
.bar .src { font-size: 13px; letter-spacing: 0.04em; color: #b9cbef; }
.bar .src a { color: #fff; }

/* At least one screen tall, so scrolling can always bring the map to the top (which removes the intro). */
#app { min-height: 100dvh; }

main {
  max-width: 1800px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

/* ---- map + panel ---- */
.mapframe {
  position: relative;
  border: 2px solid var(--blue-deep);
  background: #fff;
  /* Whole map visible without scrolling: fills the window below the top bar. */
  height: calc(100dvh - var(--bar-h, 44px) - 24px);
  min-height: 320px;
  overflow: hidden;
}
/* Diamond studs on two corners of the frame. */
.mapframe::before, .mapframe::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  background: var(--blue-mid);
  border: 2px solid #fff;
  transform: rotate(45deg);
  pointer-events: none;
  z-index: 3;
}
.mapframe::before { top: -7px; left: -7px; }
.mapframe::after { bottom: -7px; right: -7px; }

/* Minimal white / blue / aqua map. */
.map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
.map.dragging { cursor: grabbing; }
.map:focus { outline: none; }
.map .graticule { fill: none; stroke: var(--aqua); stroke-opacity: 0.35; stroke-width: 0.6; stroke-dasharray: 2 4; }
.map .halo { fill: none; stroke: var(--aqua-soft); stroke-width: 9; stroke-linejoin: round; }
.map .subjects path { fill: var(--land); stroke: #9fdde0; stroke-width: 0.6; transition: fill 0.15s; }
.map .subjects path:hover { fill: #e2f6f7; }
.map .occupied { stroke: var(--aqua); stroke-width: 0.8; }
.map .hatch-line { stroke: var(--aqua); stroke-width: 1; stroke-opacity: 0.6; }
.map .border { fill: none; stroke: var(--blue); stroke-width: 1.4; stroke-linejoin: round; }
/* Lines keep their on-screen width when zoomed in. */
.map .graticule, .map .halo, .map .subjects path, .map .occupied, .map .border { vector-effect: non-scaling-stroke; }

/* City markers: diamonds. Blue = has video, aqua = text/photo only. */
.pt { cursor: pointer; }
/* Hover/focus/selected: the diamond springs up; it eases back when the cursor leaves.
   (.pt carries the position transform, so the animation lives on the inner .pt-body.) */
.pt-body { transform-origin: 0 0; transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }
.pt:hover .pt-body, .pt:focus-visible .pt-body, .pt.active .pt-body { transform: scale(1.4); }
/* Newly formed markers (after merging/splitting on zoom) pop in. */
.pt.pop .pt-body { animation: pop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop { from { transform: scale(0.2); opacity: 0; } }
.pt .name { transition: opacity 0.2s; }
.pt .name.hidden { opacity: 0; }
.pt.merged .core { stroke-dasharray: none; stroke-width: 2.5; }
@media (prefers-reduced-motion: reduce) {
  .pt-body { transition: none; }
  .pt.pop .pt-body { animation: none; }
}
.pt .glow { fill: var(--aqua); opacity: 0.18; }
.pt .core { fill: var(--aqua); stroke: #fff; stroke-width: 1.5; stroke-linejoin: miter; }
.pt.has-video .core { fill: var(--blue); }
.pt .count { fill: #fff; font-family: var(--carved); text-anchor: middle; pointer-events: none; }
.pt .name {
  fill: var(--blue-deep);
  font-family: var(--carved);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  pointer-events: none;
}
.pt:hover .glow, .pt:focus .glow { opacity: 0.4; }
.pt.active .core { stroke: var(--blue-deep); stroke-width: 3; }
.pt.active .glow { fill: var(--blue); opacity: 0.3; }
.pt:focus { outline: none; }

.zoom {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.zoom button {
  width: 38px; height: 38px;
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  font: 20px var(--carved);
  cursor: pointer;
}
.zoom button:hover { background: var(--blue); }
.readout {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 12px;
  padding: 7px 14px;
  background: var(--blue-deep);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b9cbef;
}
.readout b { color: #fff; margin-left: 6px; }

.tip {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  padding: 8px 14px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  max-width: 280px;
}
.tip b { font-weight: normal; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- filters box: top-right, over the (empty) Arctic; moves left of the posts panel when it opens ---- */
.filters {
  --cut: 10px;
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  max-height: calc(100% - 24px);
  display: flex;
  flex-direction: column;
  transition: right 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  width: 300px;
  max-width: calc(100% - 24px);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 0 0 2px var(--blue-deep);
}
.filters-toggle {
  display: block;
  width: 100%;
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  font: 15px var(--carved);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 14px;
  cursor: pointer;
}
.filters-toggle .rune { color: #7fa8ff; margin-right: 6px; }
.filters.collapsed .filters-body { display: none; }
.filters-body { padding: 12px 14px 12px; display: grid; gap: 10px; }
#f-q {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  font: 14px var(--sans);
  color: var(--text);
  background: #fff;
}
#f-q:focus, .f-dates input:focus { outline: 2px solid var(--aqua); outline-offset: -1px; }
.f-periods { display: flex; flex-wrap: wrap; gap: 4px; }
.f-periods button {
  --cut: 4px;
  flex: 1 0 auto;
  border: 0;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font: 13px var(--carved);
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.f-periods button:hover { background: #d3e2fb; }
.f-periods button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.f-group { display: grid; gap: 4px; }
.f-group > span { font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.f-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.f-chips button {
  --cut: 3px;
  border: 0;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font: 12px var(--carved);
  padding: 4px 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.f-chips button b { font-weight: normal; color: var(--muted); }
.f-chips button:hover { background: #d3e2fb; }
.f-chips button[aria-pressed="true"] { background: var(--aqua); color: #fff; }
.f-chips button[aria-pressed="true"] b { color: #fff; }
.filters-body { min-height: 0; overflow-y: auto; }
.mapframe:has(.drawer.open) .filters { right: calc(min(440px, 100%) + 12px); }
@media (max-width: 900px) { .mapframe:has(.drawer.open) .filters { right: 12px; } }
.f-dates { display: flex; gap: 8px; }
.f-dates label { flex: 1; display: grid; gap: 2px; font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.f-dates input { width: 100%; padding: 5px 6px; border: 1px solid var(--line-strong); font: 13px var(--sans); color: var(--text); background: #fff; }
.f-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.f-foot p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.35; }
#f-updated { color: var(--aqua); }
#f-reset { --cut: 4px; flex: none; border: 0; background: var(--aqua); color: #fff; font: 13px var(--carved); padding: 5px 10px; cursor: pointer; }
#f-reset:hover { background: var(--blue); }
mark { background: #bdf0f1; color: inherit; padding: 0 1px; }

/* ---- posts drawer: slides in over the right side of the map ---- */
.drawer {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--blue-soft);
  border-left: 2px solid var(--blue-deep);
  box-shadow: -12px 0 32px rgba(10, 42, 102, 0.14);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.38s;
}
.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
}
.panel-head {
  position: relative;
  z-index: 2; /* always above the scrolling posts (and the Telegram iframes inside them) */
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px 22px;
  background: var(--blue-deep);
  color: #fff;
}
.panel-head::after { position: absolute; left: 0; right: 0; bottom: 0; }
.panel-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: normal;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.panel-head h2::before { content: "ᛟ"; font-family: var(--runic); color: #7fa8ff; margin-right: 10px; }
#panel-sub { margin: 4px 0 0; color: #b9cbef; font-size: 13px; letter-spacing: 0.04em; }
.kind-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.kind-chips button {
  --cut: 4px;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #dce6fb;
  font: 13px var(--carved);
  letter-spacing: 0.06em;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.kind-chips button b { font-weight: normal; color: #7fa8ff; margin-left: 2px; }
.kind-chips button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.kind-chips button[aria-pressed="true"] { background: var(--aqua); color: #fff; }
.kind-chips button[aria-pressed="true"] b { color: #fff; }
.kind-chips button:disabled { opacity: 0.4; cursor: default; }

#panel-close {
  --cut: 5px;
  flex: none;
  width: 32px; height: 32px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font: 15px var(--carved);
  cursor: pointer;
}
#panel-close:hover { background: var(--aqua); }
.panel-list {
  position: relative;
  z-index: 1;
  isolation: isolate; /* keep the embedded iframes' layers inside the list */
  flex: 1;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 2px;
}
/* `backwards`, not `both`: no transform may stay on the posts afterwards - in Safari a transformed
   ancestor lets Telegram's iframes catch clicks outside the list (e.g. on the close button). */
.drawer.open .event-item, .drawer.open .incident { animation: rise 0.4s ease-out backwards; }
.drawer.open :is(.event-item, .incident):nth-child(2) { animation-delay: 0.04s; }
.drawer.open :is(.event-item, .incident):nth-child(3) { animation-delay: 0.08s; }
.drawer.open :is(.event-item, .incident):nth-child(4) { animation-delay: 0.12s; }
.drawer.open :is(.event-item, .incident):nth-child(n+5) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer.open { transition: none; }
  .drawer.open .event-item, .drawer.open .incident { animation: none; }
}

.event-item {
  padding: 12px 16px;
  background: #fff;
}
.event-item .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
.event-item .cat, .incident .cat {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c, var(--blue));
}
.event-item .cat::before, .incident .cat::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin: 0 8px 1px 1px;
  background: currentColor;
  transform: rotate(45deg);
}
.event-item .text {
  margin: 6px 0 8px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-item .city { color: var(--blue-deep); letter-spacing: 0.04em; }

/* Incident cards */
.incident { padding: 14px 16px 12px; background: #fff; }
.incident .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.incident h3 { margin: 6px 0 4px; font-size: 17px; font-weight: normal; letter-spacing: 0.03em; color: var(--blue-deep); }
.incident .summary { margin: 6px 0 0; font-family: var(--sans); font-size: 13px; line-height: 1.45; color: var(--text); }
.inc-loc { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-family: var(--sans); font-size: 12.5px; }
.inc-loc a { text-decoration: none; }
.sat { margin-top: 8px; padding: 6px 10px; font-family: var(--sans); font-size: 12.5px; line-height: 1.4; }
.sat.confirmed { background: #dcf6f6; color: var(--blue-deep); box-shadow: inset 3px 0 0 var(--aqua); }
.sat.muted { background: var(--blue-soft); color: var(--muted); }
.sat a { text-decoration: none; }
.show-on-map {
  --cut: 4px;
  flex: none;
  border: 0;
  background: var(--aqua);
  color: #fff;
  font: 12px var(--carved);
  letter-spacing: 0.05em;
  padding: 3px 9px;
  cursor: pointer;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.show-on-map:hover { background: var(--blue); }
.inc-toggle, .loose-toggle {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--blue);
  font: 14px var(--carved);
  letter-spacing: 0.06em;
  text-align: left;
  padding: 8px 0 0;
  cursor: pointer;
}
.inc-toggle .rune { color: var(--aqua); margin-right: 4px; }
.inc-toggle:hover, .loose-toggle:hover { color: var(--blue-deep); }
.incident.open { box-shadow: inset 3px 0 0 var(--aqua); }
.inc-posts { display: grid; gap: 2px; margin: 10px -16px -12px; background: var(--blue-soft); }
.inc-posts .event-item { padding-left: 22px; }
.loose-toggle { margin: 0; padding: 12px 16px; background: #fff; border-top: 0; }
.loose-toggle b { font-weight: normal; color: var(--muted); }

/* Exact object pins (shown when zoomed in) */
.map .objects { opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.map .objects.shown, .map .objects:has(.hl) { opacity: 1; pointer-events: auto; }
.obj { cursor: pointer; }
.obj .obj-ring { fill: #fff; stroke: var(--aqua); stroke-width: 2.5; }
.obj .obj-core { fill: var(--blue-deep); }
.obj:hover .obj-ring, .obj:focus .obj-ring { stroke: var(--blue); stroke-width: 3.5; }
.obj.hl .obj-ring { stroke: var(--blue); animation: obj-pulse 1s ease-in-out 3; }
@keyframes obj-pulse { 50% { stroke-width: 6; stroke-opacity: 0.5; } }
.obj:focus { outline: none; }
.event-item .target, .incident .target { margin-top: 4px; font-family: var(--sans); font-size: 12.5px; color: var(--blue-deep); }
.event-item .target span, .incident .target span {
  font-family: var(--carved);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--blue-deep);
  padding: 1px 7px 2px;
  margin-right: 4px;
  clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 50%, calc(100% - 4px) 100%, 4px 100%, 0 50%);
}
.loc-note { margin-top: 6px; font-family: var(--sans); font-size: 12px; color: var(--muted); line-height: 1.4; }
.loc-note .src-tag { font-family: var(--carved); color: var(--aqua); letter-spacing: 0.04em; white-space: nowrap; }
.event-item .actions { display: flex; gap: 12px; align-items: center; }
.event-item a { text-decoration: none; }
.show-media {
  --cut: 5px;
  border: 0;
  background: var(--blue);
  color: #fff;
  font: 13px var(--carved);
  letter-spacing: 0.04em;
  padding: 4px 10px;
  cursor: pointer;
}
.show-media:hover { background: var(--blue-deep); }
a.show-media { text-decoration: none; }
.show-media.tg-only { background: var(--aqua); }
.embed-note { margin: 6px 0 0; font-family: var(--sans); font-size: 12px; color: var(--muted); }
.embed { margin-top: 8px; }
.event-item.embedded .text { display: none; }
.embed:empty { display: none; }
.embed iframe { max-width: 100%; }

.more {
  --cut: 6px;
  display: block;
  width: 100%;
  padding: 12px;
  border: 0;
  background: var(--blue-deep);
  color: #fff;
  font: 15px var(--carved);
  letter-spacing: 0.14em;
  cursor: pointer;
}
.more::before, .more::after { content: "᛫"; font-family: var(--runic); color: #7fa8ff; margin: 0 10px; }
.more:hover { background: var(--blue); }

@media (max-width: 900px) {
  /* The map is short here, so the posts open as a sheet sliding up from the bottom of the screen. */
  .drawer {
    position: fixed;
    top: auto;
    left: 0;
    width: 100%;
    height: 72vh;
    border-left: 0;
    border-top: 2px solid var(--blue-deep);
    box-shadow: 0 -12px 32px rgba(10, 42, 102, 0.18);
    transform: translateY(105%);
  }
}

/* ---- top bar link ---- */
.bar-right { display: flex; align-items: center; gap: 22px; }
.bar-link { color: #fff; text-decoration: none; font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; }
.bar-link .rune { color: #7fa8ff; margin-right: 4px; }
.bar-link:hover { color: #7fa8ff; }

/* ---- statistics ---- */
.stats { margin-top: 28px; scroll-margin-top: 12px; }
.st-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.st-head h2 { margin: 0; font-size: 22px; font-weight: normal; letter-spacing: 0.16em; text-transform: uppercase; color: var(--blue-deep); }
.st-head h2 .rune { color: var(--aqua); }
#st-note { margin: 0; color: var(--muted); font-size: 13px; }
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.st-tile {
  --cut: 8px;
  padding: 14px 16px;
  background: var(--blue-soft);
  display: grid;
  gap: 4px;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.st-tile span { font-size: 13px; color: var(--muted); letter-spacing: 0.04em; }
.st-tile b { font: 600 28px var(--sans); color: var(--blue-deep); }
.st-tile.lead { background: var(--blue-deep); }
.st-tile.lead span { color: #b9cbef; }
.st-tile.lead b { color: #fff; font-size: 34px; }
.st-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 1200px) { .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-card { padding: 16px 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.st-card.wide { grid-column: 1 / -1; }
.st-card h3 { margin: 0; font-size: 16px; font-weight: normal; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue-deep); }
.st-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.st-empty { color: var(--muted); font-family: var(--sans); font-size: 13px; }

.hbars { display: grid; gap: 2px; margin-top: 12px; }
.hbar {
  display: grid;
  grid-template-columns: minmax(110px, 38%) 1fr 44px;
  align-items: center;
  gap: 10px;
  border: 0;
  background: none;
  padding: 5px 4px;
  font: 14px var(--carved);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.hbar:hover { background: var(--blue-soft); }
.hbar.active { background: #dcf6f6; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; background: var(--blue); border-radius: 0 4px 4px 0; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.hbar.active .hbar-fill { background: var(--aqua); }
.hbar-value { font: 600 13px var(--sans); color: var(--blue-deep); text-align: right; }

.cols { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: 180px 22px; column-gap: 8px; margin-top: 14px; }
.cols-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font: 11px var(--sans); color: var(--muted); transform: translateY(6px); }
.cols-plot { position: relative; border-bottom: 1px solid var(--line-strong); }
.cols-grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--line); }
.col { position: absolute; top: 0; bottom: 0; display: flex; align-items: flex-end; justify-content: center; cursor: default; }
.col:hover { background: rgba(29, 91, 216, 0.06); }
.col-fill { width: calc(100% - 2px); max-width: 24px; background: var(--blue); border-radius: 4px 4px 0 0; }
.col:hover .col-fill { background: var(--blue-deep); }
.cols-x { grid-column: 2; position: relative; font: 11px var(--sans); color: var(--muted); }
.cols-x span { position: absolute; top: 5px; transform: translateX(-50%); white-space: nowrap; }
@media (max-width: 900px) {
  .bar-link { font-size: 12px; }
  .bar-right .src { display: none; }
  .st-grid { grid-template-columns: 1fr; }
}

/* ---- Sentinel-2 before/after in incident cards ---- */
.s2 { margin-top: 10px; padding: 10px; background: var(--blue-soft); }
.s2.visible { background: #dcf6f6; box-shadow: inset 3px 0 0 var(--aqua); }
.s2-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--sans); font-size: 12.5px; color: var(--blue-deep); }
.s2.differences { background: #eef3fc; box-shadow: inset 3px 0 0 var(--blue); }
.s2-modes { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.s2-modes button { border: 1px solid var(--line-strong); background: #fff; color: var(--blue); font: 12px var(--carved); padding: 2px 8px; cursor: pointer; }
.s2-modes button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.s2-view .s2-diff { z-index: 2; }
.s2.diff-mode .s2-slider, .s2.diff-mode .s2-label, .s2.diff-mode .s2-view::after { display: none; }
.s2.diff-mode .s2-ring { z-index: 3; }
.s2-legend { margin: 6px 0 0; font-family: var(--sans); font-size: 12px; color: var(--muted); line-height: 1.4; }
.s2-legend i { display: inline-block; width: 10px; height: 10px; margin: 0 3px -1px 0; }
.s2-legend .dk { background: #ff4040; } .s2-legend .lt { background: #40ff40; margin-left: 8px; }
.s2-view { position: relative; margin-top: 8px; aspect-ratio: 1; overflow: hidden; background: #000; }
.s2-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.s2-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.s2-view::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(10, 42, 102, 0.4); pointer-events: none; }
.s2-ring { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid #00e5ff; border-radius: 50%; pointer-events: none; }
.s2-label { position: absolute; top: 6px; padding: 2px 6px; background: rgba(10, 42, 102, 0.8); color: #fff; font: 11px var(--sans); pointer-events: none; }
.s2-label.l { left: 6px; } .s2-label.r { right: 6px; }
.s2-slider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.s2-note { margin: 8px 0 0; font-family: var(--sans); font-size: 12.5px; line-height: 1.45; color: var(--text); }
.s2-note span { color: var(--muted); }
