/* assets/style.css — shared look for all status pages. Calm, plain,
   readable at phone width. No external fonts or resources of any kind. */

:root {
  --ink: #1c2733;
  --muted: #5b6b7c;
  --line: #d7dee6;
  --bg: #f3f6fa;
  --card: #ffffff;
  --accent: #2f7ae0;
  --accent-soft: #e7f0fd;
  --amber: #b7791f;
  --amber-bg: #fdf3dd;
  --amber-line: #f0d38f;
  --good: #1e8a5f;
  --bad: #c0392b;
  --bad-bg: #fdeceb;
  --bad-line: #f0b3ac;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
}

a {
  color: var(--accent);
}

/* ---- header / nav ---- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  font-weight: 700;
  font-size: 1.05rem;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

.site-header nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

.asof-badge {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
}

/* ---- banner ---- */

.banner {
  background: var(--amber-bg);
  color: var(--amber);
  border-bottom: 1px solid var(--amber-line);
  padding: 0.55rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

/* ---- layout ---- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

h1 {
  font-size: 1.4rem;
  margin: 0 0 0.25rem;
}

.lede {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem 2.5rem;
}

.empty,
.tile-empty {
  color: var(--muted);
  font-style: italic;
}

/* ---- pipeline svg ---- */

#pipeline {
  width: 100%;
  height: auto;
  display: block;
}

.pipe {
  fill: none;
  stroke-width: 10;
  opacity: 0.25;
}
.pipe.flowing {
  opacity: 0.9;
  stroke-dasharray: 14 10;
  animation: flow 1s linear infinite;
}
.pipe.recent {
  opacity: 0.6;
}
.pipe.planned {
  stroke-dasharray: 4 8;
  opacity: 0.3;
}
@keyframes flow {
  to {
    stroke-dashoffset: -24;
  }
}

.station {
  fill: #fff;
  stroke: #b8c4d4;
  stroke-width: 2;
  cursor: pointer;
}
.station.flowing {
  stroke: #2f7ae0;
  stroke-width: 3;
  filter: drop-shadow(0 0 6px #7ab0ff);
}
.station.recent {
  stroke: #6fae55;
}
.station.idle {
  stroke: #b8c4d4;
}
.station.planned {
  stroke-dasharray: 6 4;
  fill: #f5f7fa;
}

/* stalled: amber, and never signalled by colour alone — the station label
   carries "⚠ stalled" too. */
.station.stalled {
  fill: var(--amber-bg);
  stroke: var(--amber-line);
}
.pipe.stalled {
  stroke: var(--amber);
  stroke-dasharray: 6 4;
}
span.queue-stalled {
  color: var(--amber);
  font-weight: 700;
}

/* failing: red, and — like stalled — never signalled by colour alone; the
   station label carries "✕ failing". Deliberately NOT animated: a broken step
   must not borrow the visual language of a working one. */
.station.failing {
  fill: var(--bad-bg);
  stroke: var(--bad);
  stroke-width: 3;
}
.pipe.failing {
  stroke: var(--bad);
  stroke-dasharray: 2 6;
}

.podhealth-panel {
  margin-top: 1.5rem;
}
.podhealth-panel h2 {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}
.podhealth-panel p.ok {
  color: var(--good);
  margin: 0;
}
.podhealth-panel p.bad {
  color: var(--bad);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
table.podhealth {
  border-collapse: collapse;
  width: 100%;
  max-width: 46rem;
  font-size: 0.9rem;
}
table.podhealth th,
table.podhealth td {
  text-align: left;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
table.podhealth tbody tr {
  background: var(--bad-bg);
}

/* Reliability page */
.rel-live {
  margin: 1.25rem 0 2rem;
}
.rel-ok {
  color: var(--good);
  font-weight: 600;
}
.rel-bad {
  color: var(--bad);
  font-weight: 700;
}
.rel-unknown {
  color: var(--amber);
  font-weight: 600;
}
.rel-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: -0.4rem;
}
.incident {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
/* An ongoing incident is marked in the date line, which already SAYS "ongoing" —
   the state belongs in the words, not in a coloured bar down the side. Resolved
   entries get no accent at all: when every card is decorated, the decoration
   stops distinguishing anything. */
.incident .i-date {
  font-size: 0.82rem;
  color: var(--muted);
}
.incident.open {
  border-color: var(--bad-line);
}
.incident.open .i-date {
  color: var(--bad);
  font-weight: 700;
}
.incident h3 {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.08rem;
}
.incident p {
  margin: 0 0 0.5rem;
}
.incident .i-impact,
.incident .i-prevention {
  font-size: 0.92rem;
  color: var(--muted);
}
.incident .i-detail summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--accent);
}
.incident .i-detail p {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

#pipeline text {
  font-family: inherit;
  fill: var(--ink);
  text-anchor: middle;
  pointer-events: none;
}
#pipeline .t1 {
  font-size: 13px;
  font-weight: 700;
}
#pipeline .t2 {
  font-size: 11px;
  fill: var(--muted);
}
#pipeline .t3 {
  font-size: 10px;
  fill: var(--muted);
}

/* ---- dialog / stage card ---- */

dialog#stagecard {
  border: none;
  border-radius: var(--radius);
  padding: 1.5rem;
  max-width: 420px;
  width: 90vw;
  box-shadow: 0 10px 40px rgba(20, 30, 45, 0.25);
}
dialog#stagecard::backdrop {
  background: rgba(20, 30, 45, 0.4);
}
dialog#stagecard h2 {
  margin-top: 0;
}
dialog#stagecard p.big {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
dialog#stagecard p.state {
  color: var(--muted);
}
dialog#stagecard button {
  margin-top: 0.5rem;
  padding: 0.5rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ---- data tiles ---- */

.tile-group {
  margin-bottom: 2rem;
}
.tile-group h2 {
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.tile-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
}

/* per-run (per-batch) detail under the queue tiles */
.queue-runs {
  margin-top: 1.25rem;
  overflow-x: auto;
}
.queue-runs h3 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
}
.queue-runs p.tile-empty {
  margin: 0 0 0.5rem;
}
.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.tile-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.tile-caption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.tile-delta {
  display: flex;
  gap: 1.1rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}
.delta-cell {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.delta-label {
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* Growth, standstill and no-data must stay tellable apart at a glance, and
   never by colour alone — hence the differing weights as well. */
.delta-pos {
  color: var(--good);
  font-size: 0.9rem;
  font-weight: 700;
}
.delta-zero {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}
.delta-none {
  color: var(--line);
  font-size: 0.9rem;
  font-weight: 400;
}

/* ---- roadmap ---- */

.phase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
/* Roadmap freshness line. Phase status comes from a hand-edited file whose
   snapshot section has cadence 0, so it can never go "stale" and never raises
   the amber banner — this line is the only drift signal the page has. */
.state-asof {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -0.9rem 0 1.5rem;
}

.state-asof.is-stale {
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-weight: 600;
  margin: -0.5rem 0 1.5rem;
}

.phase-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}
.phase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
}
.phase-id {
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.phase-chip {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.phase-card p {
  margin: 0;
  color: var(--ink);
}

/* ---- dev page ---- */

.dev-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.dev-section h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.kerberos-banner {
  background: var(--amber-bg);
  border: 1px solid var(--amber-line);
  color: var(--amber);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th,
td {
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-weight: 600;
}

.log-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.log-form input {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 200px;
}
.log-form button {
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.verdict-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.verdict-PASS {
  background: #e5f6ee;
  color: var(--good);
}
.verdict-FAIL {
  background: #fbe9e7;
  color: var(--bad);
}
.verdict-running_or_queued {
  background: var(--amber-bg);
  color: var(--amber);
}
.verdict-crashed {
  background: #eceff3;
  color: var(--muted);
}

pre.log-out {
  background: #10161f;
  color: #d6e2f0;
  padding: 0.9rem;
  border-radius: 8px;
  max-height: 360px;
  overflow: auto;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-word;
}

#dev-reasons {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--bad);
  font-size: 0.85rem;
}

/* ---- responsive ---- */

@media (max-width: 600px) {
  .site-header {
    padding: 0.85rem 1rem;
  }
  main {
    padding: 1.1rem 0.9rem 2.5rem;
  }
  .log-form {
    flex-direction: column;
    align-items: stretch;
  }
  .log-form input {
    min-width: 0;
  }
}

@media (prefers-color-scheme: dark) {
  :root:not(.public) {
    --ink: #e7edf5;
    --muted: #9fb0c3;
    --line: #2c3846;
    --bg: #0f151d;
    --card: #171f29;
    --accent: #6aa6f8;
    --accent-soft: #1c2c42;
    --amber: #f0c26a;
    --amber-bg: #2c2410;
    --amber-line: #4d3f18;
    --good: #4fd08b;
    --bad: #f0796a;
    --bad-bg: #2e1614;
    --bad-line: #5a2a25;
  }
  .station {
    fill: #171f29;
  }
  .station.planned {
    fill: #131a22;
  }
  :root:not(.public) pre.log-out {
    background: #05080c;
    color: #cfe0f2;
  }
}

/* ---- public tier: light only, one navy accent (spec 2026-10-31 §6.7) ---- */
:root.public {
  color-scheme: light;
  --navy: #0a2540;
  --ink: #1a1a1a;
  --muted: #5b6570;
  --line: #e3e7ec;
  --bg: #ffffff;
  --card: #ffffff;
  --accent: var(--navy);
  --accent-soft: #eef2f7;
}
.public body { background: #fff; }
.public .site-header { background: #fff; }
.public .site-header .brand { color: var(--navy); }
.public .site-header .brand small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.public .site-header nav a[aria-current="page"] { color: var(--navy); background: var(--accent-soft); }
.public .site-footer { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.public .site-footer a { color: var(--muted); text-decoration: none; }
.public .site-footer a:hover { color: var(--navy); text-decoration: underline; }
.public .site-footer .cite { flex-basis: 100%; color: var(--muted); font-size: 0.8rem; }

/* an episode still running is the row that matters most on the page */
table.podhealth tbody tr.ep-open td {
  font-weight: 700;
  color: var(--bad);
}
#history {
  margin: 2rem 0;
}


/* dev page — a finished PBS job with a non-zero Exit_status */
tr.pbs-failed td {
  color: var(--bad);
}
button.pbs-log-link {
  font: inherit;
  padding: 0.1rem 0.5rem;
}

/* ---- Conflicts on Map (conflict.html) ---------------------------------- */
.conflict-main { max-width: none; }
.conflict-wrap { position: relative; height: calc(100vh - 230px); min-height: 520px; border: 1px solid #d9dee3; border-radius: 6px; overflow: hidden; }
#conflict-map { position: absolute; inset: 0; background: #fcfcfb; }
.conflict-note { padding: 120px 24px 24px; color: #5b6570; font-size: 14px; }
.conflict-panel { position: absolute; background: rgba(252, 252, 251, 0.96); border: 1px solid #d9dee3; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); font-size: 12px; color: #1f2428; }
#conflict-time { left: 12px; top: 12px; width: 560px; max-width: calc(100% - 24px); padding: 8px 12px; }
.conflict-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.conflict-row label { color: #5b6570; }
.conflict-row input[type="date"] { font: inherit; font-size: 12px; padding: 2px 4px; border: 1px solid #d9dee3; border-radius: 4px; color: #1f2428; background: #fff; }
.conflict-presets { margin-left: auto; display: flex; gap: 4px; }
.conflict-presets button { font: inherit; font-size: 11px; padding: 2px 7px; border: 1px solid #d9dee3; border-radius: 4px; background: #fff; color: #5b6570; cursor: pointer; }
.conflict-presets button:hover { border-color: #8a939c; color: #1f2428; }
.conflict-hint { color: #8a939c; font-size: 11px; margin-top: 5px; }
#conflict-controls { right: 12px; top: 12px; width: 240px; padding: 10px 12px; }
#conflict-controls h3 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6570; }
#conflict-controls h3 + label { margin-top: 2px; }
#conflict-controls h3:not(:first-child) { margin-top: 10px; }
#conflict-controls label { display: block; margin: 4px 0; cursor: pointer; }
#conflict-controls input[type="checkbox"] { margin-right: 6px; }
.conflict-legend { left: 12px; bottom: 28px; width: 270px; padding: 10px 12px; }
.conflict-legend .item { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.conflict-legend .item.small { font-size: 11px; color: #5b6570; margin-top: -2px; }
.conflict-legend .sw { width: 12px; height: 12px; border: 1px solid #889; flex: none; }
.conflict-legend .sw.blank { border: none; }
.conflict-legend .sw.dot { border-radius: 50%; background: #b5321f; border-color: #fff; box-shadow: 0 0 0 1px #b5321f; }
.conflict-legend .sw.dot.hollow { background: transparent; }
.conflict-legend .ramp { height: 10px; flex: 1; background: linear-gradient(90deg, #f3f5f7, #dbe6ef, #9fbdd6, #4f86b0, #1f4e79); border: 1px solid #ccd; }
.conflict-legend .note { color: #5b6570; font-size: 11px; margin-top: 6px; line-height: 1.35; }
.conflict-status { right: 52px; bottom: 28px; padding: 6px 10px; color: #5b6570; font-size: 11px; max-width: 480px; }
.conflict-wrap .mapboxgl-popup-content { font-family: inherit; font-size: 12px; line-height: 1.35; padding: 8px 10px; border-radius: 6px; }
.conflict-wrap .mapboxgl-popup-content b { display: block; }
.conflict-wrap .mapboxgl-popup-content .muted { color: #5b6570; }
.conflict-wrap .mapboxgl-popup-content .open { color: #0e7fb0; text-decoration: underline; }

/* ---- Conflict incident page (conflict-incident.html) ------------------- */
.conflict-incident { max-width: 960px; }
.conflict-incident .conflict-back { margin: 0 0 12px; font-size: 13px; }
.conflict-incident h1 { font-size: 22px; margin: 0 0 4px; }
.conflict-incident h2 { font-size: 15px; margin: 24px 0 8px; padding-bottom: 4px; border-bottom: 1px solid #d9dee3; }
.conflict-incident .lede { margin-bottom: 18px; }
.conflict-incident table { border-collapse: collapse; width: 100%; font-size: 13px; }
.conflict-incident td, .conflict-incident th { border-bottom: 1px solid #eceff2; padding: 5px 6px; text-align: left; vertical-align: top; }
.conflict-incident th { font-weight: 600; font-size: 12px; }
.conflict-incident td.k { width: 150px; opacity: 0.8; }
.conflict-incident .muted { opacity: 0.75; }
.conflict-incident .small { font-size: 12px; }
.conflict-incident .pill { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; background: rgba(128, 140, 150, 0.2); margin-left: 4px; }
.conflict-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.conflict-stats .stat { min-width: 150px; }
.conflict-stats .stat .v { font-size: 20px; font-weight: 600; }
.conflict-stats .stat .c { font-size: 12px; opacity: 0.75; }
.conflict-outlet { margin: 6px 0; }
.conflict-outlet summary { cursor: pointer; font-size: 13px; padding: 4px 0; }
.conflict-outlet table { margin: 4px 0 8px 18px; width: calc(100% - 18px); font-size: 12px; }
.conflict-future { border: 1px dashed #9aa3ab; padding: 12px 14px; border-radius: 6px; margin-top: 24px; opacity: 0.85; }
.conflict-err { color: #b5321f; }

/* ---- Public incident study (incidents.html, incident.html) -------------- */
.pub h2 { font-size: 15px; margin: 24px 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.pub table { border-collapse: collapse; width: 100%; font-size: 13px; }
.pub td, .pub th { border-bottom: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: top; }
.pub th { font-weight: 600; font-size: 12px; }
.pub td.num { text-align: right; white-space: nowrap; }
.pub .muted { color: var(--muted); }
.pub .small { font-size: 12px; }
.pub .pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--accent-soft); color: var(--ink); margin: 0 6px 4px 0; }
.pill.ok { background: #e3f4e6; color: #1d5a2a; }
.pill.warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-line); }
.pill.exp { background: #f1e6ff; color: #4b2a7a; }
.pub-err { color: var(--bad); }
.pub-unreliable { color: var(--amber); font-weight: 600; }
.pub-ground { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pub-ground b { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.pub-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 8px 0 12px; }
.pub-tiles .tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.pub-tiles .tile .v { font-size: 20px; font-weight: 600; }
.pub-tiles .tile .c { font-size: 11px; color: var(--muted); }
.pub-curve { margin: 0 0 12px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: #1c2733; }
.pub-curve svg { width: 100%; max-width: 760px; height: auto; display: block; }
.pub-curve figcaption { font-size: 12px; color: #5b6b7c; margin: 4px 0; }
.pub-toggle { display: flex; gap: 4px; margin-bottom: 4px; }
.pub-toggle button { font: inherit; font-size: 12px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #5b6b7c; cursor: pointer; }
.pub-toggle button[aria-pressed="true"] { background: #e7f0fd; color: #2f7ae0; border-color: #2f7ae0; }
.pub-dl { display: inline-block; margin-top: 2px; }
.pub-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
.pub .bar { display: inline-block; height: 10px; border-radius: 3px; background: #9db8e0; vertical-align: middle; }
.pub-first td:first-child { word-break: break-word; }
.pub-compare tr.nc td.pat { opacity: 0.45; }
.pub-care { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 8px 14px; font-size: 13px; }
.pub-care ul { margin: 6px 0; padding-left: 20px; }
.pub-phase-two { margin-top: 24px; }
.pub-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; margin: 0 0 8px; }
.pub-filters select { font: inherit; font-size: 13px; }
.cat-group h2 .ty { vertical-align: middle; }
.cat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cat .i { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; background: var(--card); color: var(--ink); text-decoration: none; }
.cat .i:hover { border-color: var(--accent); }
.cat .i .star { color: #b7791f; }
.cat .i .nums { color: var(--muted); }
.cat .i.un { opacity: 0.55; }
.cat .i .un-note { color: var(--amber); }
.cat .spark { width: 100%; height: 26px; display: block; }
.ty { display: inline-block; align-self: flex-start; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; padding: 1px 6px; border-radius: 3px; }
.ty.coup { background: #14213d; }
.ty.russian { background: #b23a48; }
.ty.civilian { background: #7a4e00; }
.ty.army { background: #2e6b57; }
@media (max-width: 720px) {
  .pub-ground, .pub-tiles, .pub-two, .cat { grid-template-columns: 1fr; }
}

/* ---- Public Overview (index.html) ---------------------------------------- */
.ov-hero h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 4px; max-width: 900px; }
.ov-sub { color: var(--muted); margin: 0 0 10px; font-size: 14px; }
.conflict-compact { display: flex; flex-direction: column; height: 380px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #eef1f6; }
.conflict-compact-map { position: relative; flex: 1 1 auto; min-height: 0; cursor: pointer; }
.conflict-compact-legend { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; color: var(--muted); background: var(--card); border-top: 1px solid var(--line); }
.conflict-compact-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 2px; }
.conflict-compact.unavailable { height: auto; background: var(--card); }
.conflict-compact-note { margin: 0; padding: 12px 14px; font-size: 13px; color: var(--muted); }
.ov-counters { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin: 12px 0 4px; }
.ov-counters .tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ov-counters .tile .v { font-size: 20px; font-weight: 600; }
.ov-counters .tile .v.small { font-size: 14px; padding-top: 5px; }
.ov-counters .tile .c { font-size: 11px; color: var(--muted); }
.ov-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ov-steps li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.ov-steps li .n { display: block; font-size: 11px; color: var(--muted); letter-spacing: 0.5px; }
.ov-steps li b { display: block; font-size: 14px; margin-bottom: 4px; }
.ov-feat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ov-card { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.ov-card:hover { border-color: var(--accent); }
.ov-card .small { color: var(--accent); }
.ov-shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ov-block { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--card); }
.ov-block .pill { align-self: flex-start; }
.pill.plan { background: #eceef1; color: #555; }
.ov-claims { margin-top: 24px; background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 4px 14px 10px; font-size: 13px; }
.ov-claims h2 { border-bottom: 0; margin-top: 8px; }
.ov-claims ul { margin: 0 0 6px; padding-left: 20px; }
.ov-own { margin-top: 16px; display: flex; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 13px; }
.ov-own img { width: 52px; height: 52px; object-fit: contain; }
@media (max-width: 900px) {
  .ov-counters { grid-template-columns: repeat(4, 1fr); }
  .ov-steps, .ov-shelf { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .ov-counters, .ov-steps { grid-template-columns: 1fr 1fr; }
  .ov-feat, .ov-shelf { grid-template-columns: 1fr; }
  .conflict-compact { height: 320px; }
}

/* ---- Method & Data, Downloads, public Roadmap ---- */
.pub h3 { font-size: 14px; margin: 18px 0 6px; }
.pub-docs { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; }
.pub-claims { font-size: 13px; padding-left: 22px; }
.pub-claims li { margin-bottom: 4px; }
.pub-rel-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; margin: 0 0 12px; }
.pub-rel-card h3 { margin-top: 6px; }
.pub-rel { max-width: 640px; }
.pub-data td { word-break: break-word; }
.pub-sha { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); padding: 1px 6px; cursor: pointer; }
.pub-sha:hover { border-color: var(--accent); color: var(--accent); }
.pub-changes, .pub-next { font-size: 13px; padding-left: 20px; }
.pub-changes li, .pub-next li { margin-bottom: 4px; }
.doc-back { font-size: 13px; margin: 0 0 8px; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 22px 20px; max-width: 860px; line-height: 1.55; font-size: 14px; }
.doc h1 { font-size: 1.3rem; margin-top: 12px; }
.doc h2 { font-size: 16px; }
.doc h3, .doc h4 { font-size: 14px; }
.doc pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 12px; }
.doc code { font-size: 0.92em; }
.doc table { display: block; overflow-x: auto; margin: 8px 0 14px; }
.doc-note { background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 8px; padding: 8px 12px; margin: 8px 0 14px; font-size: 13px; }
#data-table { overflow-x: auto; }
.pub-data td.small { min-width: 140px; }

/* ---- open-data pages (spec 2026-10-31): filters, document table, cards --- */
.public .lede { color: var(--muted); font-size: 14px; max-width: 900px; margin: 0 0 14px; }
.public .filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.public .filters input, .public .filters select, .public .filters button { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.public .filters input[type="search"] { min-width: 260px; flex: 1; }
.public .filters button, .public .btn { background: var(--navy); color: #fff; border: 1px solid var(--navy); border-radius: 6px; padding: 5px 10px; font-size: 13px; text-decoration: none; cursor: pointer; }
.public .btn.secondary { background: #fff; color: var(--navy); }
.public .docs-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; flex-wrap: wrap; }
.public table.docs td:nth-child(4) { max-width: 560px; }
.public table.docs td:nth-child(1), .public table.docs td:nth-child(2), .public table.docs td:nth-child(3) { white-space: nowrap; }
.public .pager { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.public .pager button { font: inherit; font-size: 12px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.public .pager button[disabled] { opacity: 0.4; cursor: default; }
.public .doc-text { white-space: pre-wrap; font-size: 15px; line-height: 1.5; max-width: 800px; }
.public table.meta th { width: 180px; color: var(--muted); font-weight: 500; }
.public table.files td code { font-size: 11px; }
.public .cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.public .card { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.public .card .img { height: 110px; background: #e9edf2; color: #7a8794; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.public .card .b { padding: 10px 12px; }
.public .card h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.public .card p { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.public .kpis { display: flex; gap: 20px; flex-wrap: wrap; margin: 8px 0 14px; }
.public .kpis div b { display: block; font-size: 20px; color: var(--navy); }
.public .kpis div span { color: var(--muted); font-size: 11px; }
.public .two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.public .box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
.public .box h3 { margin: 0 0 6px; font-size: 14px; color: var(--navy); }
.public .bars div { display: flex; align-items: center; gap: 6px; margin: 3px 0; font-size: 12px; }
.public .bars .l { width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public .bars .b { height: 10px; background: var(--navy); opacity: 0.65; border-radius: 2px; }
.public .bars .v { color: var(--muted); }
.public .tabs { display: flex; gap: 6px; margin: 8px 0; }
.public .tabs button { font: inherit; font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
.public .tabs button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.public .pipe { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 14px; }
.public .pipe a { flex: 1; padding: 8px 10px; border-right: 1px solid var(--line); font-size: 12px; color: var(--ink); text-decoration: none; background: #fafafa; }
.public .pipe a:last-child { border-right: none; }
.public .pipe a b { display: block; font-size: 13px; }
.public .pipe a.on { background: var(--accent-soft); border-bottom: 3px solid var(--navy); }
@media (max-width: 800px) {
  .public .cards, .public .two { grid-template-columns: 1fr; }
  .public .pipe { flex-wrap: wrap; }
  .public .pipe a { flex-basis: 50%; }
  .public main.pub { overflow-x: auto; }
}

.public .controls { display: flex; flex-wrap: wrap; gap: 14px; margin: 6px 0 12px; }
.public .legend .lg { margin-right: 10px; white-space: nowrap; }
.public .legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.public svg.weeks rect { fill: var(--navy); opacity: 0.7; }
.public svg.regions path { fill: var(--navy); stroke: #fff; stroke-width: 0.6; }
.public svg.regions circle { fill: #c0392b; fill-opacity: 0.75; }
.public table.copied td:last-child { max-width: 420px; }

/* ---- home (map first) ---- */
.public .home-hero { position: relative; min-height: 420px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 0 0 12px; }
.public .home-map { position: absolute; inset: 0; }
.public .home-map .conflict-compact-map { height: 100%; }
.public .home-card { position: absolute; left: 16px; top: 16px; max-width: 360px; background: rgba(255,255,255,0.96); padding: 12px 14px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.public .home-card h1 { font-size: 1.2rem; margin: 0 0 6px; color: var(--navy); }
.public .home-card p { margin: 0 0 8px; font-size: 14px; }
.public .home-counters { grid-template-columns: repeat(4, 1fr); }
.public a.card { text-decoration: none; color: inherit; }
.public .home-own { margin-top: 14px; }
@media (max-width: 800px) { .public .home-counters { grid-template-columns: repeat(2, 1fr); } .public .home-card { position: static; max-width: none; } .public .home-hero { min-height: 0; } .public .home-map { position: relative; height: 260px; } }
.public .home-map .conflict-compact-note { position: absolute; left: 16px; bottom: 12px; margin: 0; padding: 6px 10px; background: rgba(255,255,255,0.92); border-radius: 6px; }
