:root {
  --page: #0d0d0d;
  --surface: #121214;
  --surface-2: #232322;
  --land: #3f4048;
  --border: rgba(255,255,255,0.10);
  --ink: #ffffff;
  --ink-2: #c3c2b7;
  --muted: #898781;
  --side-a: #3987e5;
  --side-b: #d95926;
  --side-other: #9085e9;
  --st-escalating: #d03b3b;
  --st-active: #ec835a;
  --st-de-escalating: #fab219;
  --st-ceasefire: #0ca30c;
  --st-frozen: #898781;
  --heat: #f2a33a;
  --w-missile: #ffffff;
  --w-drone: #eda100;
  --w-airstrike: #e87ba4;
  --w-artillery: #c3c2b7;
  --w-naval: #1baf7a;
  --w-other: #9085e9;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; height: 100dvh; margin: 0; background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; }
body { display: flex; flex-direction: column; overflow: hidden; }

#top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 16px; margin: 0; font-weight: 600; letter-spacing: .02em; }
.brand .sub { color: var(--muted); font-size: 12px; }
.brand .gh { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; padding: 3px 8px; border: 1px solid var(--border);
  border-radius: 999px; color: var(--ink-2); font-size: 12px; text-decoration: none; transition: color .15s, border-color .15s; }
.brand .gh:hover { color: var(--ink); border-color: var(--ink-2); }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-escalating); box-shadow: 0 0 0 0 rgba(208,59,59,.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(208,59,59,.6);} 70% { box-shadow: 0 0 0 10px rgba(208,59,59,0);} 100% { box-shadow: 0 0 0 0 rgba(208,59,59,0);} }
#menu-btn { display: inline-flex; align-items: center; gap: 6px; }
#menu-btn[aria-expanded="true"] { border-color: var(--ink-2); background: var(--surface); }
/* layers & settings: a popover under the header button */
.controls { display: none; position: absolute; top: calc(100% + 6px); right: 12px; width: 290px; flex-direction: column; gap: 12px;
            padding: 12px 14px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
            box-shadow: 0 12px 32px rgba(0,0,0,.55); font-size: 13px; color: var(--ink-2); max-height: calc(100dvh - 80px); overflow-y: auto; }
body.menu-open .controls { display: flex; }
.grp { display: grid; gap: 0 12px; }
.grp-h { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; min-height: 30px; }
.toggle input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--st-active); margin: 0; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; white-space: nowrap; }
.field .range { display: flex; align-items: center; gap: 8px; }
.field input[type=range] { width: 100px; accent-color: var(--st-active); }
#day-label { min-width: 70px; color: var(--ink); }
#refresh { width: 100%; }
select, button { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 5px 9px; font: inherit; font-size: 12px; }
button { cursor: pointer; }
button:hover { border-color: var(--ink-2); }
button:disabled { opacity: .5; cursor: default; }
.status { font-size: 12px; color: var(--muted); margin-left: auto; text-align: right; }
.status b { color: var(--ink-2); font-weight: 500; }
.status .online { color: var(--ink-2); white-space: nowrap; }
.status .online i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--st-ceasefire); margin-right: 5px; vertical-align: 1px;
                    box-shadow: 0 0 0 0 rgba(12,163,12,.6); animation: online 2.4s infinite; }
@keyframes online { 70% { box-shadow: 0 0 0 5px rgba(12,163,12,0); } 100% { box-shadow: 0 0 0 0 rgba(12,163,12,0); } }
:focus-visible { outline: 2px solid var(--st-de-escalating); outline-offset: 2px; }
.card:focus-visible, .src:focus-visible, .dev:focus-visible, .strike:focus-visible, .fig:focus-visible { outline-offset: -2px; }

#main { flex: 1; display: flex; min-height: 0; position: relative; }
#map { flex: 1; background: #070b14; position: relative; }
#map::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.55) 100%); }
.mk.selected { box-shadow: 0 0 18px 4px currentColor; }
.mk.selected::after { animation-duration: 1.4s; border-width: 3px; }
#panel { width: 380px; min-width: 300px; max-width: 70vw; border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; flex: none; }
#panel-resizer { width: 7px; margin-right: -7px; flex: none; cursor: col-resize; position: relative; z-index: 6; }
#panel-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 2px; width: 3px; border-radius: 2px; background: transparent; transition: background .15s; }
#panel-resizer:hover::after, body.resizing #panel-resizer::after { background: var(--st-active); }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing #map { pointer-events: none; }

/* list toolbar */
#list-tools { position: sticky; top: 0; z-index: 1; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
#list-tools[hidden] { display: none; }
#q { width: 100%; background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font: inherit; font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--ink-2); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tools-row { display: flex; gap: 6px; }
.tools-row select { flex: 1; min-width: 0; }
.skel { padding: 14px; border-bottom: 1px solid var(--border); }
.skel i { display: block; height: 10px; border-radius: 4px; background: var(--surface-2); margin: 6px 0; animation: shimmer 1.4s ease-in-out infinite; }
.skel i:nth-child(1) { width: 65%; height: 13px; } .skel i:nth-child(2) { width: 45%; } .skel i:nth-child(3) { width: 25%; }
@keyframes shimmer { 50% { opacity: .45; } }

/* list */
.card { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.card:hover, .card.selected { background: var(--surface-2); }
.card .head { display: flex; align-items: center; gap: 8px; }
.card .name { font-weight: 600; flex: 1; }
.card .region { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card .flags { font-size: 15px; letter-spacing: 2px; margin-top: 4px; }
.badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; color: #0d0d0d; font-weight: 700; }
.badge.st-escalating { background: var(--st-escalating); color: #fff; }
.badge.st-active { background: var(--st-active); }
.badge.st-de-escalating { background: var(--st-de-escalating); }
.badge.st-ceasefire { background: var(--st-ceasefire); color: #fff; }
.badge.st-frozen { background: var(--st-frozen); }
.sevbar { display: inline-flex; gap: 2px; }
.sevbar i { width: 6px; height: 10px; background: var(--border); border-radius: 1px; }
.sevbar i.on { background: var(--st-active); }
.empty { padding: 30px 16px; color: var(--muted); line-height: 1.5; }

/* detail */
#detail { padding: 14px; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.reveal { animation: reveal .45s ease-out both; }
.back { color: var(--muted); cursor: pointer; font-size: 12px; margin: 0 0 8px; display: inline-block; background: none; border: none; padding: 2px 0; font: inherit; font-size: 12px; }
.back:hover { color: var(--ink); }
#detail h2 { margin: 4px 0 2px; font-size: 18px; }
#detail .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
#detail p.summary { line-height: 1.5; color: var(--ink-2); margin: 8px 0 14px; }
#detail h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.side { margin-bottom: 8px; }
.side .lbl { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.party { display: flex; align-items: baseline; gap: 6px; padding: 3px 0; }
.party .flag { width: 22px; }
.party .pname { font-weight: 500; }
.party .role { color: var(--muted); font-size: 12px; }
.party .note { color: var(--muted); font-size: 12px; margin-left: auto; text-align: right; }
.party.A .pname { color: var(--side-a); } .party.B .pname { color: var(--side-b); } .party.other .pname { color: var(--side-other); }
.cons { display: flex; flex-direction: column; gap: 6px; }
.con { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.4; }
.con .cat { flex: none; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); margin-top: 2px; min-width: 70px; text-align: center; }
.dev { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; line-height: 1.4; }
.dev .date { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; width: 78px; }
.dev a { color: var(--muted); text-decoration: none; margin-left: 4px; }
.dev a:hover { color: var(--ink); }
.src { font-size: 12px; padding: 3px 0; }
.src a { color: var(--ink-2); text-decoration: none; }
.src a:hover { color: var(--ink); }
.src .s { color: var(--muted); }

/* viewers + problem reports */
.viewing { color: var(--st-ceasefire); margin-left: 6px; white-space: nowrap; }
.viewing::before { content: "●"; font-size: 8px; margin-right: 4px; vertical-align: 1px; }
#detail .meta { flex-wrap: wrap; }
.report-link { background: none; border: none; padding: 2px 0; min-height: 0; color: var(--muted); font-size: 11.5px; cursor: pointer; margin-left: auto; }
.report-link:hover { color: var(--ink); }
.maplibregl-popup-content .report-link { margin: 4px 0 0; }
.report-row { margin: -2px 0 8px; display: flex; }
.report-row .report-link { margin-left: 0; }
.report-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.report-form fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 10px; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.report-form legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.report-form fieldset label { display: flex; align-items: center; gap: 8px; min-height: 30px; color: var(--ink-2); cursor: pointer; }
.report-form input[type=radio] { accent-color: var(--st-active); }
.report-form .note { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 13px; }
.report-form .opt { color: var(--muted); }
.report-form textarea { background: var(--surface-2); color: var(--ink); border: 1px solid var(--border); border-radius: 6px; padding: 8px; font: inherit; font-size: 13px; resize: vertical; }
.report-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.report-form .fine { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.report-done { margin-top: 12px; color: var(--ink-2); line-height: 1.6; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
#reports-btn.has-open { border-color: var(--st-de-escalating); color: var(--st-de-escalating); }
.rep { border-bottom: 1px solid var(--border); padding: 10px 0; }
.rep.done { opacity: .5; }
.rep-h { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.rep-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; color: var(--ink-2); }
.rep-t { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.rep-title { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.rep-note { color: var(--ink); font-size: 13px; margin-top: 4px; font-style: italic; }
.rep-actions { display: flex; gap: 6px; margin-top: 8px; }
.rep-actions button { font-size: 11.5px; padding: 3px 8px; min-height: 0; }

/* travel advice */
.adv { display: inline-block; width: 11px; height: 11px; border-radius: 2px; border: 1px solid rgba(0,0,0,.5); }
.adv.a0 { background: #3f8f63; } .adv.a1 { background: #d9c24a; } .adv.a2 { background: #e8893a; } .adv.a3 { background: #d4502a; } .adv.a4 { background: #9e1b1b; }
.adv.u1 { background: #3f8f63; } .adv.u2 { background: #d9c24a; } .adv.u3 { background: #e8893a; } .adv.u4 { background: #9e1b1b; }
.adv-h { color: var(--ink); font-weight: 600; margin-right: 2px; }
.advice-box { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.advice-box .who { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.advice-box a { color: var(--ink-2); }
.advice-box .fine { font-size: 11px; color: var(--muted); }

/* trust signals */
.trust { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; vertical-align: 1px; }
.vb, .ob, .po, .bg { display: inline-block; font-size: 10px; line-height: 1.5; padding: 0 5px; border-radius: 3px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; font-style: normal; }
.vb.ok { color: #6fcf6f; border-color: rgba(111,207,111,.35); }
.vb.warn { color: #f2c14e; border-color: rgba(242,193,78,.35); }
.ob.multi { color: var(--ink-2); }
.ob.one, .ob.gone { color: var(--muted); }
.ob.limited { color: #f2c14e; border-color: rgba(242,193,78,.35); margin-left: 6px; letter-spacing: normal; vertical-align: 2px; }
.po { color: #c9a0ff; border-color: rgba(201,160,255,.35); margin-left: 4px; }
.bg { color: var(--muted); border-style: dashed; margin-left: 4px; }
a.cite { color: var(--muted); text-decoration: none; }
a.cite:hover { color: var(--ink); }
.ai-note { font-size: 11.5px; color: var(--muted); margin: -4px 0 8px; }
.linkish { background: none; border: none; padding: 0; min-height: 0; color: var(--ink-2); text-decoration: underline; font-size: inherit; cursor: pointer; }
.about h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 0 6px; }
.about p, .about li { color: var(--ink-2); line-height: 1.55; font-size: 13px; }
.about ul { padding-left: 18px; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 6px; }
.about ul.outlets { padding-left: 0; list-style: none; gap: 3px; }
.about ul.outlets span { color: var(--muted); font-size: 12px; }
.about a { color: var(--ink-2); }
#about-btn { white-space: nowrap; }

/* country view */
.rel-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--ink-2); margin: 2px 0 10px; }
.rel-key i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
#detail .ccard { margin: 0 -14px; }
.ccard .myrole { color: var(--ink-2); font-size: 12.5px; margin-top: 4px; }
.ccard .rel { font-size: 12.5px; line-height: 1.45; margin-top: 3px; color: var(--ink-2); }
.ccard .rel b { font-weight: 600; margin-right: 3px; }
.ccard .rel.ally b { color: var(--side-a); } .ccard .rel.enemy b { color: var(--side-b); } .ccard .rel.other b { color: var(--side-other); }

/* conflict stats */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; }
.tile .big { font-size: 22px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .big .unit { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.tile .lbl { font-size: 11px; color: var(--muted); margin-top: 3px; }
.tile .up { font-size: 12px; color: #e34948; } .tile .down { font-size: 12px; color: #0ca30c; } .tile .flat { font-size: 12px; color: var(--muted); }
.figs { display: flex; flex-direction: column; gap: 8px; }
.fig { padding: 8px 10px; border-left: 3px solid var(--st-active); background: var(--surface-2); border-radius: 0 6px 6px 0; cursor: pointer; }
.fig:hover { border-left-color: var(--ink-2); }
.fig .num { font-size: 18px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.fig .what { color: var(--ink-2); font-size: 13px; }
.fig .per { color: var(--muted); font-size: 11px; margin-left: 6px; }
.fig .claim { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: #fab219; border: 1px solid rgba(250,178,25,.4); border-radius: 3px; padding: 0 4px; margin-left: 6px; }
.fig .quote { font-size: 12.5px; color: var(--ink-2); font-style: italic; margin: 4px 0 3px; line-height: 1.45; }
.fig .figsrc { font-size: 11px; color: var(--muted); }
.fig .figsrc a { color: var(--muted); text-decoration: none; }
.fignote { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* reader */
#reader { padding: 14px; }
#reader .site { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
#reader h2 { font-size: 18px; line-height: 1.3; margin: 4px 0 6px; }
#reader .meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
#reader .meta a { color: var(--ink-2); }
#reader img.hero { width: 100%; border-radius: 8px; margin: 6px 0 10px; display: block; }
#reader p { line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; font-size: 13.5px; }
#reader .alt { margin: 10px 0 12px; }
#reader .alt div { font-size: 12px; padding: 4px 0; cursor: pointer; color: var(--ink-2); }
#reader .alt div:hover, #reader .alt div.on { color: var(--ink); }
#reader .alt div.on::before { content: "▸ "; }
#reader .err { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 10px 0; }
#reader .loading { color: var(--muted); font-size: 13px; padding: 10px 0; }
#reader .loading::after { content: "…"; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.src, .dev { cursor: pointer; }
.src:hover, .dev:hover { background: var(--surface-2); }

/* markers */
/* status has a shape as well as a colour: escalating pulses, active is solid, easing half-filled,
   ceasefire a hollow ring, frozen a dashed ring */
.mk { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.85); background: currentColor; cursor: pointer; position: absolute; transition: opacity .6s ease, box-shadow .6s ease, width .4s ease, height .4s ease; }
.mk::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.mk.st-escalating::after, .mk.selected::after { opacity: .6; animation: ring 2.4s ease-out infinite; }
.mk.st-de-escalating, .mkk.st-de-escalating { background: linear-gradient(to top, currentColor 50%, #101014 50%); }
.mk.st-ceasefire, .mkk.st-ceasefire { background: rgba(10,10,14,.75); border: 3px solid currentColor; }
.mk.st-frozen, .mkk.st-frozen { background: rgba(10,10,14,.75); border: 2px dashed currentColor; }
.mk.hidden { display: none; }
.mk.dim { opacity: .22; }
.mk.dim::after { animation: none; opacity: 0; transition: opacity .6s; }
@keyframes ring { 0% { transform: scale(.6); opacity: .8; } 100% { transform: scale(2.2); opacity: 0; } }

/* legend */
#legend-btn { position: absolute; left: 12px; bottom: 12px; z-index: 6; background: rgba(26,26,25,.92); }
#legend-btn[aria-expanded="true"] { border-color: var(--ink-2); }
#legend { position: absolute; left: 12px; bottom: 50px; z-index: 6; background: rgba(26,26,25,.92); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--ink-2); display: none; flex-direction: column; gap: 5px; max-width: min(520px, calc(100% - 24px)); }
body.legend-open #legend { display: flex; }
#legend .row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#legend .row.off { display: none; }
#legend .note { color: var(--ink-2); opacity: .8; }
.mkk { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.85); background: currentColor; }
.mkk.st-escalating { color: var(--st-escalating); box-shadow: 0 0 0 2px rgba(208,59,59,.35); } .mkk.st-active { color: var(--st-active); }
.mkk.st-de-escalating { color: var(--st-de-escalating); } .mkk.st-ceasefire { color: var(--st-ceasefire); } .mkk.st-frozen { color: var(--st-frozen); }
.sev { display: inline-block; border-radius: 50%; background: var(--st-active); }
.sev.s5 { width: 16px; height: 16px; } .sev.s3 { width: 11px; height: 11px; } .sev.s1 { width: 7px; height: 7px; }
.sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.sw.w-ground { background: #e34948; } .sw.inc { background: #ec835a; opacity: .6; width: 7px; height: 7px; }
.sw.w-missile { background: var(--w-missile);} .sw.w-drone { background: var(--w-drone);} .sw.w-airstrike { background: var(--w-airstrike);} .sw.w-artillery { background: var(--w-artillery);} .sw.w-naval { background: var(--w-naval);}
#legend .plane { font-size: 12px; line-height: 1; }
#aircraft-count { color: var(--muted); }
.strike { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; line-height: 1.4; cursor: pointer; }
.strike:hover { background: var(--surface-2); }
.strike .date { flex: none; color: var(--muted); width: 44px; font-variant-numeric: tabular-nums; }
.strike .w { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.wi { display: inline-block; vertical-align: middle; flex: none; }
.strike .body { flex: 1; }
.strike .route { font-weight: 500; }
.strike .meta { color: var(--muted); }
.strike .prec { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--border); border-radius: 3px; padding: 0 4px; margin-left: 4px; }
.card .strikes { color: var(--muted); font-size: 11px; margin-left: auto; }
.maplibregl-popup-content { background: var(--surface); color: var(--ink-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; padding: 10px 12px; max-width: 280px; }
.maplibregl-popup-content b { color: var(--ink); }
.maplibregl-popup-content a { color: var(--ink-2); }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 16px; }
.sw.st-escalating { background: var(--st-escalating);} .sw.st-active { background: var(--st-active);} .sw.st-de-escalating { background: var(--st-de-escalating);} .sw.st-ceasefire { background: var(--st-ceasefire);}
.ramp { width: 60px; height: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--land), var(--heat)); }
.line { width: 22px; height: 2px; display: inline-block; }
.ln { display: inline-block; width: 8px; height: 8px; border-radius: 2px; border: 1px solid rgba(0,0,0,.6); }
.ln.v { background: #ff6b6b; } .ln.t { background: #f2c14e; } .ln.o { background: #9fb4d9; }
.toggle .hint { color: var(--muted); font-size: 11.5px; }
.line.gd { background: #c3c2b7; opacity: .6; } .line.a { background: var(--side-a);} .line.b { background: var(--side-b);} .line.other { background: var(--side-other);}

#tooltip { position: absolute; pointer-events: none; background: rgba(26,26,25,.95); border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px; font-size: 12px; color: var(--ink-2); z-index: 5; max-width: 260px; }
#tooltip b { color: var(--ink); }

.maplibregl-ctrl-attrib { display: none; }
.mobile-only { display: none; }

/* ---------- live TV: a docked player over the map, top right ---------- */
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e34948; flex: none; }
#tv-btn { display: inline-flex; align-items: center; gap: 7px; }
#tv-btn .short { display: none; }
#tv-btn[aria-expanded="true"] { border-color: var(--ink-2); background: var(--surface); }
#tv-btn[aria-expanded="true"] .live-dot { animation: online 2.4s infinite; box-shadow: 0 0 0 0 rgba(227,73,72,.6); }
#tv { position: absolute; top: 12px; right: var(--tv-right, 392px); z-index: 7; width: 380px; max-width: calc(100% - 24px);
      background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
      box-shadow: 0 12px 32px rgba(0,0,0,.55); display: flex; flex-direction: column; }
#tv[hidden] { display: none; }
#tv.large { width: 620px; }
.tv-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-bottom: 1px solid var(--border); }
.tv-live { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: #e34948; flex: none; }
.tv-now { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* every channel visible at once: the buttons wrap onto as many rows as they need */
.tv-chans { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.tv-chans button { flex: none; font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: transparent; color: var(--ink-2); min-height: 0; }
.tv-chans button[aria-selected="true"] { background: var(--surface-2); color: var(--ink); border-color: var(--ink-2); }
.tv-chans button.off { opacity: .5; }
.tv-size, .tv-close { flex: none; width: 28px; height: 28px; padding: 0; min-height: 0; font-size: 15px; line-height: 1; background: transparent; }
.tv-screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.tv-screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tv-screen .tv-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
                     padding: 16px; text-align: center; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.tv-foot { display: flex; justify-content: space-between; gap: 10px; padding: 5px 10px; font-size: 11px; color: var(--muted); }
.tv-foot a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.tv-foot a:hover { color: var(--ink); }

/* ---------- phones & small tablets: full-screen map, bottom sheet, layers menu ---------- */
@media (max-width: 900px) {
  body { font-size: 15px; }
  #top { gap: 4px 10px; padding: 8px 12px 6px; padding-top: max(8px, env(safe-area-inset-top));
         padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right));
         position: relative; z-index: 20; flex-wrap: wrap; }
  .brand .sub { display: none; }
  .brand .gh { padding: 5px; margin-left: 2px; }
  .brand .gh span { display: none; }
  .mobile-only { display: inline-flex; align-items: center; justify-content: center; }
  #top { flex-wrap: wrap; }
  #menu-btn { margin-left: auto; min-height: 36px; padding: 6px 14px; font-size: 13px; }
  .status { order: 3; flex-basis: 100%; margin-left: 0; min-width: 0; text-align: left; font-size: 11px;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* layer toggles drop down under the header */
  .controls { top: 100%; left: 0; right: 0; width: auto; border-radius: 0; border-width: 0 0 1px; padding: 10px 14px 14px;
              padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right));
              font-size: 14px; max-height: 70vh; }
  .grp { grid-template-columns: 1fr 1fr; }
  .grp-h, .field { grid-column: 1 / -1; }
  .toggle { min-height: 42px; gap: 10px; }
  .toggle input[type=checkbox] { width: 20px; height: 20px; }
  .field .range { flex: 1; justify-content: flex-end; }
  .field input[type=range] { flex: 1; width: auto; height: 28px; }
  #list-tools { padding: 6px 16px 10px; gap: 6px; }
  #q { font-size: 16px; min-height: 40px; }
  /* one swipeable row of chips so the tools don't eat the half-open sheet */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .chip { min-height: 32px; font-size: 13px; flex: none; }
  .tools-row select { min-height: 38px; font-size: 15px; }
  select, button { font-size: 16px; min-height: 42px; }   /* 16px stops iOS zooming on focus */

  /* the map fills the screen; the panel is a sheet over it */
  #main { display: block; }
  #panel-resizer { display: none; }
  #panel { width: auto !important; min-width: 0; max-width: none; }   /* ignore any desktop drag width */
  #map { position: absolute; inset: 0; }
  #panel { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; width: auto;
           height: 42%; border-left: none; border-top: 1px solid var(--border); border-radius: 14px 14px 0 0;
           box-shadow: 0 -8px 24px rgba(0,0,0,.45); transition: height .28s cubic-bezier(.2,.8,.2,1);
           overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
           padding-bottom: env(safe-area-inset-bottom); }
  #panel[data-sheet="min"] { height: calc(56px + env(safe-area-inset-bottom)); overflow: hidden; }
  #panel[data-sheet="full"] { height: calc(100% - 8px); }
  #sheet-handle { position: sticky; top: 0; z-index: 2; display: flex; width: 100%; height: 26px; min-height: 0;
                  padding: 0; border: none; border-radius: 14px 14px 0 0; background: var(--surface); touch-action: none; }
  #sheet-handle span { width: 40px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .7; }
  .card { padding: 12px 16px; }
  #detail, #reader { padding: 4px 16px 16px; }
  .back { font-size: 14px; padding: 8px 12px 8px 0; margin-bottom: 2px; min-height: 0; }
  #detail h2, #reader h2 { font-size: 19px; }
  #reader p { font-size: 15.5px; line-height: 1.6; }
  .dev, .src, .strike { padding-top: 8px; padding-bottom: 8px; }
  .src { font-size: 13.5px; }
  .dev .date { width: auto; white-space: nowrap; }
  .party { flex-wrap: wrap; }
  .party .note { flex-basis: 100%; margin-left: 28px; text-align: left; }

  /* legend behind a "Key" button, top-right of the map */
  #legend-btn { top: 10px; bottom: auto; left: auto; right: max(10px, env(safe-area-inset-right));
                min-height: 34px; padding: 4px 12px; font-size: 13px; }
  #legend { left: auto; right: max(10px, env(safe-area-inset-right)); top: 52px; bottom: auto; max-width: calc(100% - 20px); }

  .maplibregl-ctrl-top-left { top: 0; left: env(safe-area-inset-left); }
  #tv-btn { margin-left: auto; min-height: 36px; padding: 6px 12px; font-size: 13px; }
  #tv-btn .long { display: none; } #tv-btn .short { display: inline; }
  #tv-btn + #menu-btn { margin-left: 0; }
  #tv, #tv.large { top: 8px; left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); width: auto; max-width: none; z-index: 12; }
  .tv-size { display: none; }
  .maplibregl-popup-content { max-width: min(280px, 80vw); }
}
/* touch: no hover tooltips (they stick after a tap) and bigger hit areas on markers */
@media (hover: none), (pointer: coarse) {
  #tooltip { display: none !important; }
  .mk::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
}
@media (min-width: 901px) and (max-width: 1100px) { .brand .gh { padding: 4px 6px; } .brand .gh span { display: none; } .brand .sub { display: none; } }
@media (max-width: 900px) { #detail .ccard { margin: 0 -16px; } }
.menu-about { align-self: flex-start; font-size: 12px; }
@media (max-width: 900px) { #about-btn { display: none; } }

/* ---------- good news mode ---------- */
.sun { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #5fd38d; flex: none; }
#good-btn { display: inline-flex; align-items: center; gap: 7px; }
#good-btn[aria-pressed="true"] { border-color: #5fd38d; background: rgba(95,211,141,.14); color: var(--ink); }
#good-btn[aria-pressed="true"] .sun { box-shadow: 0 0 0 3px rgba(95,211,141,.25); }
body:not(.good-mode) #legend .good-only, body.good-mode #legend .bad-only { display: none; }
.ln.g { background: #5fd38d; }
.mkk.good { color: #5fd38d; }
body.good-mode .controls label:has(:disabled) { opacity: .4; }
body.good-mode .mk { color: #5fd38d !important; }
body.good-mode .mk::after { animation: none; opacity: 0; }
.good-intro { padding: 12px 14px; margin: 10px 12px 4px; border: 1px solid rgba(95,211,141,.35); background: rgba(95,211,141,.08); border-radius: 8px; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
#list h3.gh3 { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 16px 14px 6px; }
#list .gdev .gtext { color: var(--ink-2); font-size: 13px; line-height: 1.4; margin-top: 4px; }
#list .gdev .date { color: var(--muted); font-size: 12px; margin-left: auto; font-variant-numeric: tabular-nums; }
#list .glocal { padding: 6px 14px; border-bottom: 1px dashed var(--border); }
#list .empty.small { padding: 8px 14px; }
@media (max-width: 760px) {
  #good-btn { display: none; }    /* no room in the phone header: the switch in Layers does it */
}

/* ---------- "new version available" notice ---------- */
#update-note { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 10px;
               padding: 8px 8px 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
               box-shadow: 0 6px 24px rgba(0,0,0,.5); font-size: 13px; color: var(--ink-2); max-width: calc(100% - 24px); }
#update-note[hidden] { display: none; }
#update-note #update-reload { border-color: var(--ink-2); color: var(--ink); }
#update-note .x { background: none; border: none; color: var(--muted); font-size: 18px; padding: 0 6px; min-height: 0; cursor: pointer; }
