/* War room: the World map's calm dark surface and red accent, as a conflict dashboard. body[data-level] (0 stable to 4 critical) sets one level colour. */
:root { color-scheme: dark; --bg: #0b0b0c; --panel: #111113; --raised: #18181b; --hover: #1d1d21; --line: #26262b; --line-strong: #36363d;
  --text: #f2f2f3; --muted: #9b9ba3; --faint: #6e6e76; --accent: #ff3b4e; --glow: #ff8a1f; --level: #f2f2f3;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace; }
/* The level runs along the World map's marker ramp: white, pink, red, deep red. */
body[data-level="1"] { --level: #ffb0b9; }
body[data-level="2"] { --level: #ff8a95; }
body[data-level="3"] { --level: #f34a5f; }
body[data-level="4"] { --level: #ff1f3d; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; padding: 8px 12px; background: var(--panel); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.eyebrow { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .06em; }

/* Full-width, full-height grid like the map pages: side · centre · wire. */
.war { display: grid; grid-template-columns: 270px minmax(0, 1fr) 320px; height: calc(100dvh - var(--header-h)); min-height: 560px; }
.side, .wire { display: flex; flex-direction: column; min-height: 0; background: var(--panel); }
.side { border-right: 1px solid var(--line); }
.wire { border-left: 1px solid var(--line); }
.centre { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow-y: auto; background: #070708; }

.level { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.page-title { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.level h2 { margin: 2px 0 10px; color: var(--level); font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; transition: color .6s; }
.steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; margin: 0; padding: 0; list-style: none; color: var(--faint); font-size: 9px; font-weight: 600; letter-spacing: .03em; text-align: center; }
.steps li { padding-top: 5px; border-top: 3px solid var(--line-strong); transition: border-color .6s, color .6s; }
.steps li.lit { border-color: var(--level); color: var(--muted); }
.why { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.side-title, .wire-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 8px; }
.side-title h2, .wire-title h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.wire-sub { margin: 2px 0 0; color: var(--faint); font-size: 12px; }
.clear, .sound { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: transform 100ms ease-out, color .15s, border-color .15s; }
.clear:hover, .sound:hover { color: var(--text); border-color: var(--line-strong); }
.sound[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.clear:active, .sound:active, .card:active { transform: scale(.97); }

.conflicts, .reports { flex: 1; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.conflicts { padding: 0 10px 10px; }
.conflicts li + li { margin-top: 4px; }
.card { --chip: var(--muted); display: grid; gap: 3px; width: 100%; padding: 9px 11px; border: 1px solid transparent; border-radius: 10px; background: var(--raised); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform 100ms ease-out; }
.card:hover { background: var(--hover); }
.card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 3px 0 var(--accent); }
.card[data-status="ESCALATING"] { --chip: var(--accent); }
.card[data-status="QUIET"] { --chip: var(--faint); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.flags { font-size: 15px; letter-spacing: 2px; }
.chip { color: var(--chip); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.card-name { font-size: 13.5px; font-weight: 650; letter-spacing: -.005em; }
.card-meta { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.card[data-heat="0"] { opacity: .55; }
/* Heat uses the World map's fire colours: ember to flame. */
.heat { display: flex; align-items: center; gap: 8px; }
.heat-bars { display: grid; grid-template-columns: repeat(5, 12px); gap: 2px; }
.heat-bars i { height: 4px; border-radius: 2px; background: var(--line-strong); }
.heat-bars i.on:nth-child(1) { background: #ffd08a; }
.heat-bars i.on:nth-child(2) { background: var(--glow); }
.heat-bars i.on:nth-child(3) { background: #ff5a1f; }
.heat-bars i.on:nth-child(4) { background: #ff3d00; }
.heat-bars i.on:nth-child(5) { background: #d90f32; box-shadow: 0 0 6px #ff3d00; }
.heat-label { color: var(--faint); font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.card[data-heat="4"] .heat-label, .card[data-heat="5"] .heat-label { color: var(--glow); }
.card-latest { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 12px; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.empty { padding: 12px 16px; color: var(--faint); font-size: 13px; }

/* Flash wire: the World page's report cards. */
.reports li { display: grid; gap: 3px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.reports li.new { box-shadow: inset 3px 0 var(--accent); animation: arrive .8s ease-out; }
.reports time { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.reports .title { color: var(--text); font-size: 13.5px; font-weight: 600; line-height: 1.35; text-decoration: none; }
.reports a.title:hover { text-decoration: underline; text-underline-offset: 3px; }
.reports .meta { color: var(--faint); font-size: 11.5px; }
.tag { display: inline-flex; align-items: center; gap: 6px; justify-self: start; color: #69b1ff; font-size: 11px; font-weight: 600; }
.tag:before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.strike { color: #ff4258; }
.outlet-note { justify-self: start; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 999px; color: #edbd53; font-size: 10.5px; font-weight: 600; }
.flag { margin-right: 6px; }
.caveat { margin: 0; padding: 10px 16px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }
@keyframes arrive { from { opacity: 0; transform: translateX(14px); } }

.clocks { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--panel); }
.clock { display: grid; padding: 5px 12px; border-right: 1px solid var(--line); }
.clock:last-child { border-right: 0; }
.clock span { color: var(--faint); font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.clock b { font: 600 13px var(--mono); font-variant-numeric: tabular-nums; }
.note { margin: 0; padding: 5px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; }

/* Dashboard tiles: the map across the top, hotspots, types and activity beneath. */
.tiles { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1.4fr); grid-template-rows: minmax(340px, 1fr) 210px; gap: 8px; padding: 8px; } /* the map never shrinks below 340px; the centre scrolls instead */
.tile { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.map-tile { position: relative; grid-column: 1 / -1; padding: 0; overflow: hidden; background: #070708; }
.map-tile .tile-head { position: absolute; top: 10px; left: 12px; right: 56px; z-index: 2; padding: 5px 10px; border-radius: 999px; background: rgb(11 11 12 / .8); pointer-events: none; }
.tile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.map-tile .tile-head { margin: 0; width: max-content; max-width: calc(100% - 68px); }
.tile h3 { font-size: 12px; font-weight: 600; color: var(--muted); }
.tile-meta { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.map { flex: 1; min-height: 0; width: 100%; }
.legend { position: absolute; left: 12px; bottom: 10px; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; max-width: calc(100% - 24px); margin: 0; padding: 5px 10px; border-radius: 999px; background: rgb(11 11 12 / .8); color: var(--muted); font-size: 11px; pointer-events: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend b { font-weight: 500; }
.legend .ramp i { width: 40px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #fff, #ffb0b9 42%, #f34a5f 70%, #d90f32); }
.key { display: inline-block; }
.key.glow { width: 14px; height: 3px; border-radius: 2px; background: var(--glow); box-shadow: 0 0 6px #ff3d00; }
.key.arc { width: 16px; height: 0; border-top: 2px dashed var(--accent); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* The World map's markers: a glowing dot sized and coloured by article count, with a label. */
.map-marker { --marker-size: 10px; --heat: #ffffff; position: absolute; width: var(--marker-size); height: var(--marker-size); border-radius: 50%; background: var(--heat); box-shadow: 0 0 6px var(--heat), 0 0 16px color-mix(in srgb, var(--heat) 60%, transparent); }
.map-marker.intensity-2 { --marker-size: 12px; --heat: #ffb0b9; }
.map-marker.intensity-3 { --marker-size: 14px; --heat: #f34a5f; }
.map-marker.intensity-4 { --marker-size: 17px; --heat: #d90f32; }
.map-marker:before { content: ''; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--heat) 45%, transparent) 0 20%, color-mix(in srgb, var(--heat) 18%, transparent) 45%, transparent 72%); pointer-events: none; }
.map-marker.intensity-1 .marker-label { display: none; } /* single reports stay unlabelled so busy regions stay readable */
.map-marker .marker-label { position: absolute; top: 50%; left: calc(100% + 8px); transform: translateY(-50%); padding: 2px 7px; border-radius: 999px; background: rgb(11 11 12 / .85); color: #f0f0f2; font-size: 11px; font-weight: 600; letter-spacing: .02em; white-space: pre; box-shadow: 0 2px 8px #0008; pointer-events: none; }

/* Zoomed out, only conflict lines and their names show; place markers wait for a closer zoom. */
.map.overview .map-marker { display: none; }
.map:not(.overview) .side-label { display: none; }
.side-label { padding: 3px 9px; border: 1px solid color-mix(in srgb, #ff8a95 45%, transparent); border-radius: 999px; background: rgb(11 11 12 / .85); color: #f0f0f2; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: 0 2px 10px #0009; transition: transform 100ms ease-out, border-color .15s; }
.side-label:hover { border-color: #ff8a95; }
.side-label:active { transform: scale(.97); }
.side-label.heat-4, .side-label.heat-5 { border-color: #ff3d00; box-shadow: 0 0 10px #ff3d0066, 0 2px 10px #0009; }
.hotspots { display: grid; align-content: start; flex: 1; min-height: 0; overflow-y: auto; gap: 2px; margin: 0; padding: 0; list-style: none; }
.hotspots li { display: grid; grid-template-columns: minmax(0, 1fr) 3ch 3ch; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
.hotspots li:nth-child(odd) { background: var(--raised); }
.hotspots li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hotspots b, .hotspots .strikes { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.hotspots .strikes { color: var(--faint); }
.hotspots .strikes.on { color: var(--accent); }
.hotspots .empty { background: none; }

.types { display: grid; align-content: space-between; flex: 1; min-height: 0; overflow-y: auto; gap: 2px; margin: 0; padding: 0; list-style: none; }
.types li { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.types b { color: var(--text); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.types i { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--w, 0%), var(--line) var(--w, 0%)); }

.activity { flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 2px; }
.activity span { flex: 1; height: 100%; display: flex; flex-direction: column-reverse; }
.activity span:before { content: ''; height: var(--strikes); background: var(--accent); border-radius: 0 0 2px 2px; }
.activity span:after { content: ''; height: var(--other); background: var(--line-strong); border-radius: 2px 2px 0 0; }
.activity span:nth-child(24) { box-shadow: inset -1px 0 0 var(--line); }
.axis { display: flex; justify-content: space-between; margin-top: 4px; color: var(--faint); font-size: 10px; }

/* Escalation: a flash when the level rises, a quick flicker on new reports. */
body.alarm .level h2 { animation: blink .5s steps(2) 6; }
body.incoming .map-tile { animation: flicker .5s steps(3) 1; }
@keyframes blink { 50% { opacity: .35; } }
@keyframes flicker { 33% { opacity: .85; } 66% { opacity: 1; } }
.noscript { padding: 16px; color: var(--faint); }
.search-guide { padding: 14px 16px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.search-guide summary { cursor: pointer; color: var(--text); font-weight: 600; }
.guide-content { max-width: 760px; padding-top: 6px; }
.guide-content h2 { font-size: 18px; color: var(--text); }
.guide-content h3 { margin-top: 14px; font-size: 14px; color: var(--text); }
.guide-content a { color: var(--text); }
.conflict-links { columns: 2 240px; padding-left: 18px; }
.conflicts li.card a.card-name { color: var(--text); text-decoration: none; }

@media (max-width: 1180px) {
  .war { grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: auto; min-height: calc(100dvh - var(--header-h)); }
  .side { height: calc(100dvh - var(--header-h)); min-height: 620px; }
  .centre { overflow: visible; }
  .tiles { flex: none; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 420px 190px 190px; }
  .tiles .tile:last-child { grid-column: 1 / -1; }
  .wire { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .reports { max-height: 70vh; }
  .clocks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .clock:nth-child(n+5) { display: none; }
}
@media (max-width: 760px) {
  .war { display: flex; flex-direction: column; }
  .centre { order: -1; height: auto; min-height: 0; }
  .tiles { flex: none; grid-template-columns: 1fr; grid-template-rows: none; }
  .map { flex: none; height: 300px; }
  .legend .ramp { display: none; }
  .tiles .tile:not(.map-tile) { height: 210px; }
  .side { height: auto; min-height: 0; border-right: 0; }
  .conflicts { max-height: 60vh; }
  .clocks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clock:nth-child(n+4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
