:root {
  color-scheme: light;
  --ink: #102b3a;
  --ink-2: #375462;
  --muted: #6c858f;
  --paper: #f4f7f6;
  --surface: #ffffff;
  --line: #cfdcde;
  --cyan: #0094ad;
  --teal: #006f89;
  --route-main: #087ca7;
  --approved: #2d765f;
  --alert: #c9473d;
  --amber: #d58a25;
  --lime: #a8cc56;
  --blue: #2a7097;
  --navy: #122f3e;
  --shadow: 0 16px 40px rgba(18, 54, 67, 0.12);
  --display: "Arial Narrow", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --body: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--body);
  background:
    linear-gradient(90deg, rgba(7, 107, 117, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(7, 107, 117, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

button[disabled] {
  cursor: not-allowed;
  opacity: 0.38;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  color: white;
  background: var(--navy);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.preview {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  padding-bottom: 88px;
}

.uncertainty-bar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 7px 24px;
  color: #f8ffff;
  font-size: 12px;
  background: var(--navy);
}

.uncertainty-bar strong {
  color: var(--lime);
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.uncertainty-bar span + span {
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.uncertainty-bar button {
  border: 0;
  color: #fff;
  font-size: 12px;
  text-decoration: underline;
  background: transparent;
  cursor: pointer;
}

.brand-header {
  display: grid;
  min-height: 76px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
}

.brand-header.compact {
  min-height: 64px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup p,
.brand-lockup h1 {
  margin: 0;
}

.brand-lockup p {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.brand-lockup h1 {
  margin-top: 2px;
  font-family: var(--display);
  font-size: clamp(19px, 2vw, 27px);
  font-stretch: condensed;
  letter-spacing: -0.03em;
}

.brand-signal {
  display: flex;
  width: 34px;
  height: 34px;
  align-items: end;
  gap: 3px;
  padding: 5px;
  border: 2px solid var(--ink);
}

.brand-signal i {
  display: block;
  width: 6px;
  background: var(--cyan);
}

.brand-signal i:nth-child(1) { height: 8px; }
.brand-signal i:nth-child(2) { height: 15px; }
.brand-signal i:nth-child(3) { height: 22px; background: var(--alert); }

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.header-status strong {
  color: var(--ink);
  font-family: var(--mono);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--approved);
  box-shadow: 0 0 0 5px rgba(45, 118, 95, 0.14);
}

.quiet-button,
.primary-button,
.approve-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
}

.quiet-button svg,
.approve-button svg,
.map-corner-label svg,
.ai-summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.primary-button {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.approve-button {
  border-color: var(--approved);
  color: white;
  background: var(--approved);
}

.approve-button.approved,
.mobile-command button.approved {
  border-color: #a8c8c3;
  color: var(--approved);
  background: #e9f5f2;
}

.city-overview-preview {
  background: #f2f5f5;
}

.city-overview-title {
  display: flex;
  min-height: 84px;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px 15px;
  border-bottom: 1px solid var(--line);
  background: #f8faf9;
}

.city-overview-title span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
}

.city-overview-title h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 43px);
  letter-spacing: -.045em;
}

.city-overview-title p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.city-overview-title p strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
}

.city-overview-layout {
  display: grid;
  min-height: calc(100vh - 198px);
  grid-template-columns: 225px minmax(520px, 1fr) minmax(300px, 345px);
}

.city-status-rail {
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: #edf2f1;
}

.city-status-heading,
.status-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.city-status-heading {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
}

.city-status-heading strong {
  color: var(--ink);
  font-family: var(--mono);
}

.city-status-rail section {
  padding: 16px 0;
  border-top: 1px solid #c9d5d4;
}

.status-section-title {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 900;
}

.status-section-title strong {
  min-width: 24px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
}

.status-line {
  display: grid;
  grid-template-columns: 9px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--ink-2);
  font-size: 10px;
}

.status-line i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aabad;
}

.status-line strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 9px;
}

.status-line.critical i { background: var(--alert); }
.status-line.warning i { background: var(--amber); }
.status-line.normal i { background: #9aabad; }
.status-line.crowd i { background: #a8669d; }
.status-line.multilingual i { background: var(--teal); }
.status-line.dismissal i { background: var(--blue); }

.source-health p {
  margin: 7px 0;
  padding-left: 15px;
  color: var(--muted);
  font-size: 9px;
}

.source-health p::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 7px 1px -13px;
  border-radius: 50%;
  background: var(--approved);
  content: "";
}

.city-map-column {
  min-width: 0;
  padding: 18px;
}

.overview-map-shell {
  min-height: 610px;
  height: 100%;
  border-color: #b5c8ca;
  background: #e7eeee;
}

.overview-map {
  min-height: 610px;
}

.overview-map .road-a {
  stroke: rgba(201, 71, 61, .78);
  stroke-width: 19;
}

.overview-map .road-b {
  stroke: rgba(213, 138, 37, .78);
  stroke-width: 18;
}

.overview-map .signal-road {
  stroke-dasharray: 10 6;
}

.overview-map .crowd-station circle {
  fill: #f0d7eb;
  stroke: #925b89;
}

.overview-map .multilingual-station circle {
  fill: #d7edf1;
  stroke: var(--teal);
}

.overview-map .station > text:nth-of-type(1) {
  font-size: 8px;
  font-weight: 900;
}

.overview-incident circle {
  stroke: white;
  stroke-width: 4;
}

.overview-incident text {
  fill: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  text-anchor: middle;
}

.overview-incident.severity-critical circle { fill: var(--alert); }
.overview-incident.severity-high circle { fill: var(--amber); }
.overview-incident.severity-medium circle { fill: var(--blue); }

.overview-callout rect {
  fill: rgba(18, 47, 62, .94);
}

.overview-callout text {
  fill: white;
  font-family: var(--body);
  font-size: 9px;
}

.overview-callout text:first-of-type {
  fill: #b8dfe5;
  font-weight: 900;
}

.legend-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-dot.critical { background: var(--alert); }
.legend-dot.multilingual { background: var(--teal); }
.legend-line.grade-a { background: var(--alert); }
.legend-line.grade-b { background: var(--amber); }

.priority-queue {
  padding: 20px 17px;
  border-left: 1px solid var(--line);
  background: white;
}

.queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.queue-heading span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
}

.queue-heading h2 {
  margin: 2px 0 0;
  font-family: var(--display);
  font-size: 28px;
}

.queue-heading > strong {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--alert);
  font-family: var(--mono);
  font-size: 11px;
}

.queue-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.queue-order {
  padding-top: 2px;
  color: #92a5aa;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 900;
}

.queue-content > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  text-transform: uppercase;
}

.queue-content > div span {
  font-weight: 900;
}

.queue-item.critical .queue-content > div span { color: var(--alert); }
.queue-item.high .queue-content > div span { color: var(--amber); }
.queue-item.medium .queue-content > div span { color: var(--blue); }

.queue-content h3 {
  margin: 6px 0 4px;
  font-size: 13px;
  line-height: 1.35;
}

.queue-content p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.queue-content button {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 0;
  border: 0;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.overview-ai-note {
  margin-top: 10px;
  padding: 13px;
  border-left: 3px solid var(--cyan);
  background: #e9f2f3;
}

.overview-ai-note > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-size: 9px;
  font-weight: 900;
}

.overview-ai-note svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
}

.overview-ai-note p {
  margin: 8px 0;
  color: var(--ink-2);
  font-size: 10px;
  line-height: 1.55;
}

.overview-ai-note small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 7px;
}

.back-overview {
  position: absolute;
  z-index: 7;
  top: 127px;
  left: calc(18vw + 24px);
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  background: rgba(255,255,255,.94);
  cursor: pointer;
}

.dashboard-a {
  display: grid;
  min-height: calc(100vh - 114px);
  grid-template-columns: minmax(230px, 18vw) minmax(480px, 1fr) minmax(280px, 22vw);
}

.event-rail.vertical {
  padding: 22px 14px;
  border-right: 1px solid var(--line);
  background: rgba(244, 247, 246, 0.8);
}

.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.rail-heading strong {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--alert);
}

.event-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 38px 8px 1fr;
  gap: 9px;
  align-items: start;
  padding: 15px 12px;
  border: 1px solid transparent;
  border-radius: 5px;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.event-rail,
.reason-timeline,
.uncertainty-bar {
  scrollbar-width: none;
}

.event-rail::-webkit-scrollbar,
.reason-timeline::-webkit-scrollbar,
.uncertainty-bar::-webkit-scrollbar {
  display: none;
}

.event-item + .event-item {
  margin-top: 7px;
}

.event-item:hover {
  background: #eaf1f1;
}

.event-item.active {
  border-color: #b8d0d2;
  background: white;
  box-shadow: 0 8px 24px rgba(15, 59, 72, 0.08);
}

.event-item.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -1px;
  width: 3px;
  background: var(--cyan);
  content: "";
}

.event-time {
  padding-top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

.severity-dot {
  width: 8px;
  height: 8px;
  margin-top: 4px;
  border-radius: 50%;
}

.severity-dot.critical,
.severity-label.critical { background: var(--alert); }
.severity-dot.high,
.severity-label.high { background: var(--amber); }
.severity-dot.medium,
.severity-label.medium { background: var(--blue); }

.event-copy {
  min-width: 0;
}

.event-copy strong,
.event-copy small {
  display: block;
}

.event-copy strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.event-state {
  grid-column: 3;
  margin-top: 10px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.map-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 20px;
}

.case-brief {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 42%);
  margin-bottom: 14px;
  padding: 0 4px;
}

.brief-title,
.case-brief > h2,
.case-brief > p,
.tag-row {
  grid-column: 1;
}

.brief-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.severity-label {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 3px;
  color: white;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.case-brief h2 {
  margin: 8px 0 2px;
  font-family: var(--display);
  font-size: clamp(22px, 2.3vw, 34px);
  letter-spacing: -0.04em;
}

.case-brief > p {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.tag-row {
  display: flex;
  gap: 6px;
}

.tag-row span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 10px;
}

.ai-summary {
  grid-row: 1 / span 4;
  grid-column: 2;
  align-self: center;
  padding: 13px 16px;
  border-left: 3px solid var(--cyan);
  background: #eaf4f3;
}

.ai-summary > span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.ai-summary p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.6;
}

.map-shell {
  position: relative;
  min-height: 430px;
  flex: 1;
  overflow: hidden;
  border: 1px solid #b9cdd0;
  border-radius: 6px;
  background: #e4edef;
  box-shadow: inset 0 0 80px rgba(29, 78, 91, 0.07);
}

.command-map {
  width: 100%;
  height: 100%;
  min-height: 430px;
}

.map-bg { fill: #e9f0ef; }
.map-grid { color: rgba(13, 74, 86, 0.08); }
.block { fill: #d7e2e1; stroke: #c5d5d5; stroke-width: 1; }
.road { fill: none; stroke: #a7b8ba; stroke-linecap: round; }
.road.minor { stroke-width: 8; opacity: .52; }
.road.arterial { stroke: #859da2; stroke-width: 15; }
.road.vertical { stroke-width: 17; }
.command-map .road.route-affected { stroke: var(--alert); stroke-width: 20; stroke-dasharray: 10 5; }
.command-map .road.route-main { stroke: var(--route-main); stroke-width: 21; }
.command-map .road.route-secondary { stroke: var(--amber); stroke-width: 18; stroke-dasharray: 18 7; }
.road.is-focus { stroke-width: 27; }
.station.is-focus circle { stroke-width: 6; }
.route-walk.is-focus { stroke-width: 11; }

.route-walk {
  display: none;
  fill: none;
  stroke: var(--route-main);
  stroke-dasharray: 8 7;
  stroke-width: 8;
}

.route-walk.visible,
.police-route.visible {
  display: block;
}

.police-route {
  display: none;
}

.police-route circle {
  fill: #0c4861;
  stroke: white;
  stroke-width: 4;
}

.road-labels text,
.station text,
.map-callout text,
.north text {
  font-family: var(--body);
  font-size: 11px;
  font-weight: 800;
  paint-order: stroke;
  stroke: #eef4f3;
  stroke-width: 4px;
}

.station circle {
  fill: #f7fbfa;
  stroke: #4e747b;
  stroke-width: 3;
}

.station > text:nth-of-type(1) {
  font-size: 9px;
  text-anchor: middle;
  stroke-width: 0;
}

.station.active circle {
  fill: var(--amber);
  stroke: #7a4b04;
}

.incident-marker circle {
  fill: rgba(232, 76, 61, 0.17);
  stroke: var(--alert);
  stroke-width: 3;
}

.incident-marker path {
  fill: none;
  stroke: var(--alert);
  stroke-width: 5;
}

.incident-marker.is-focus {
  filter: url("#glow");
}

.map-callout rect {
  fill: rgba(9, 36, 51, 0.94);
}

.map-callout text {
  fill: white;
  stroke: none;
}

.map-callout text:last-child {
  fill: #a9d9d5;
  font-family: var(--mono);
  font-size: 9px;
}

.north path { fill: var(--ink); }
.north text { stroke: none; font-family: var(--mono); }

.map-corner-label {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(9, 36, 51, 0.25);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 14px rgba(12, 52, 66, 0.1);
}

.map-corner-label span {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
}

.map-corner-label strong {
  color: var(--alert);
  font-family: var(--mono);
  font-size: 10px;
}

.map-legend {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 12px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 9px;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-line {
  display: block;
  width: 18px;
  height: 4px;
  background: var(--alert);
}

.legend-line.main { background: var(--route-main); }
.legend-line.secondary { background: var(--amber); }

.evidence-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 26px 22px;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.panel-eyebrow {
  display: flex;
  justify-content: space-between;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.evidence-panel h2 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.step-detail {
  min-height: 84px;
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.75;
}

.source-box {
  display: grid;
  gap: 5px;
  margin-top: 18px;
  padding: 12px;
  border: 1px solid #c7d8d9;
  background: #f4f8f7;
}

.source-box span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.source-box strong {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
}

.metric-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  background: var(--line);
}

.metric-pair > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 15px 12px;
  background: white;
}

.metric-pair span,
.metric-pair small {
  color: var(--muted);
  font-size: 9px;
}

.metric-pair strong {
  font-family: var(--display);
  font-size: 21px;
}

.step-controls {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 24px;
}

.step-controls button,
.field-actions button,
.deck-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
  cursor: pointer;
}

.step-controls .primary-button,
.field-actions .primary-button,
.deck-actions .primary-button {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.approve-button {
  width: 100%;
  margin-top: 8px;
}

/* Variant B — map as a command theatre, timeline as the control surface */
.variant-b {
  color: #e9f6f5;
  background: #071d2a;
}

.variant-b .brand-header {
  border-color: #183f50;
  color: white;
  background: #092433;
}

.variant-b .brand-lockup p,
.variant-b .header-status {
  color: #8fb4bc;
}

.variant-b .header-status strong {
  color: white;
}

.variant-b .brand-signal {
  border-color: white;
}

.variant-b .quiet-button {
  border-color: #315766;
  color: white;
  background: #123342;
}

.dashboard-b {
  display: grid;
  min-height: calc(100vh - 102px);
  grid-template-rows: minmax(480px, 1fr) auto;
}

.war-map {
  position: relative;
  min-height: 0;
  padding: 22px 28px 12px;
}

.war-map .map-shell {
  min-height: 460px;
  border-color: #2f5966;
  background: #102f3c;
}

.war-map .map-bg { fill: #0d303d; }
.war-map .map-grid { color: rgba(130, 208, 211, 0.09); }
.war-map .block { fill: #153b47; stroke: #244d59; }
.war-map .road.minor { stroke: #31535d; }
.war-map .road.arterial { stroke: #446873; }
.war-map .command-map .road.route-affected { stroke: var(--alert); }
.war-map .command-map .road.route-main { stroke: #36a7cf; }
.war-map .command-map .road.route-secondary { stroke: var(--amber); }
.war-map .road-labels text,
.war-map .station text {
  fill: #d4e7e7;
  stroke: #102f3c;
}

.war-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 210px 12px 2px;
}

.war-title span {
  color: #85b1b8;
  font-family: var(--mono);
  font-size: 10px;
}

.war-title h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(28px, 3.2vw, 48px);
  letter-spacing: -0.045em;
}

.war-ete {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.war-ete small { color: #8fb4bc; }
.war-ete strong {
  color: var(--lime);
  font-family: var(--display);
  font-size: 38px;
}

.floating-proof {
  position: absolute;
  z-index: 4;
  top: 28px;
  right: 28px;
  width: 250px;
  padding: 19px;
  border-top: 4px solid var(--lime);
  color: var(--ink);
  background: rgba(246, 250, 248, 0.95);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
}

.floating-proof span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 9px;
}

.floating-proof h3 {
  margin: 12px 0 8px;
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.05;
}

.floating-proof p {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}

.floating-proof > strong {
  display: block;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
}

.timeline-deck {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 190px;
  align-items: stretch;
  border-top: 1px solid #244958;
  background: #0a2734;
}

.event-rail.horizontal {
  padding: 12px;
  border-right: 1px solid #244958;
}

.event-rail.horizontal .rail-heading {
  color: #8fb4bc;
}

.event-rail.horizontal .event-item {
  padding: 8px;
  color: #dcedec;
}

.event-rail.horizontal .event-item.active {
  border-color: #355e6b;
  background: #133746;
  box-shadow: none;
}

.event-rail.horizontal .event-state,
.event-rail.horizontal .event-copy small {
  display: none;
}

.reason-timeline {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 18px 14px;
  list-style: none;
  overflow-x: auto;
}

.reason-timeline li {
  position: relative;
  min-width: 170px;
  flex: 1;
}

.reason-timeline li::before {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  height: 2px;
  background: #315462;
  content: "";
}

.reason-timeline li.done::before,
.reason-timeline li.active::before {
  background: var(--lime);
}

.reason-timeline button {
  position: relative;
  width: 100%;
  padding: 0 14px;
  border: 0;
  color: #91aeb5;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.reason-timeline button > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  margin-bottom: 12px;
  border: 2px solid #315462;
  border-radius: 50%;
  color: #b6cdd1;
  font-family: var(--mono);
  font-size: 9px;
  background: #0a2734;
}

.reason-timeline li.active button > span {
  border-color: var(--lime);
  color: #071d2a;
  background: var(--lime);
}

.reason-timeline strong,
.reason-timeline small {
  display: block;
}

.reason-timeline strong {
  color: #edf7f6;
  font-size: 11px;
  line-height: 1.4;
}

.reason-timeline small {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.5;
}

.deck-actions {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 16px;
  border-left: 1px solid #244958;
}

.deck-actions button:not(.primary-button) {
  border-color: #315462;
  color: #dceaea;
  background: #0f303e;
}

/* Variant C — a field-first composition that becomes a mobile command card */
.variant-c {
  background: #edf1ec;
}

.variant-c .brand-header {
  background: #f9fbf7;
}

.dashboard-c {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px 30px 90px;
}

.focus-head {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0 22px;
  border-bottom: 2px solid var(--ink);
}

.focus-number {
  display: flex;
  width: 92px;
  height: 74px;
  flex-direction: column;
  justify-content: center;
  padding-left: 14px;
  border-left: 8px solid var(--alert);
}

.focus-number span {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 900;
}

.focus-number small {
  color: var(--muted);
  font-size: 10px;
}

.focus-head h2 {
  margin: 8px 0 2px;
  font-family: var(--display);
  font-size: clamp(29px, 4vw, 56px);
  letter-spacing: -0.055em;
}

.focus-head p {
  margin: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.focus-ete {
  text-align: right;
}

.focus-ete small,
.focus-ete strong {
  display: block;
}

.focus-ete small {
  color: var(--muted);
  font-size: 10px;
}

.focus-ete strong {
  margin-top: 5px;
  color: var(--teal);
  font-family: var(--display);
  font-size: 40px;
}

.event-rail.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 14px 0;
}

.event-rail.tabs .rail-heading {
  display: none;
}

.event-rail.tabs .event-item {
  grid-template-columns: 42px 8px 1fr auto;
  border-color: #ccd6d0;
  background: rgba(255, 255, 255, 0.5);
}

.event-rail.tabs .event-item.active {
  border-color: var(--ink);
  box-shadow: none;
}

.event-rail.tabs .event-state {
  grid-row: 1;
  grid-column: 4;
  margin: 0;
}

.field-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, .8fr);
  align-items: stretch;
  gap: 14px;
}

.field-layout .map-shell {
  min-height: 560px;
  border: 2px solid var(--ink);
  border-radius: 0;
}

.field-card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  color: #edf7f4;
  background: var(--navy);
}

.field-progress {
  height: 4px;
  margin-bottom: 28px;
  background: #294756;
}

.field-progress i {
  display: block;
  height: 100%;
  background: var(--lime);
  transition: width .25s ease;
}

.field-card > span {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
}

.field-card h3 {
  margin: 18px 0 12px;
  font-family: var(--display);
  font-size: clamp(30px, 3vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.field-card > p {
  color: #bcd0d3;
  font-size: 13px;
  line-height: 1.75;
}

.field-card .source-box {
  border-color: #365663;
  color: white;
  background: #123543;
}

.field-card .source-box span {
  color: #8db4b9;
}

.field-actions {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 8px;
  margin-top: auto;
  padding-top: 28px;
}

.field-actions button:not(.primary-button) {
  border-color: #385866;
  color: white;
  background: transparent;
}

.mobile-command {
  position: fixed;
  z-index: 8;
  right: 30px;
  bottom: 84px;
  left: 30px;
  display: flex;
  max-width: 680px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: auto;
  padding: 13px 16px;
  border: 1px solid #a9beb7;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.mobile-command span,
.mobile-command strong {
  display: block;
}

.mobile-command span {
  color: var(--muted);
  font-size: 9px;
}

.mobile-command strong {
  margin-top: 2px;
  font-size: 12px;
}

.mobile-command button {
  min-height: 44px;
  padding: 9px 16px;
  border: 0;
  color: white;
  background: var(--approved);
  cursor: pointer;
}

.prototype-switcher {
  position: fixed;
  z-index: 30;
  bottom: 18px;
  left: 50%;
  display: grid;
  min-width: 310px;
  grid-template-columns: 46px 1fr 46px;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: white;
  background: #061923;
  box-shadow: 0 12px 36px rgba(1, 21, 30, 0.32);
  transform: translateX(-50%);
}

.prototype-switcher button {
  height: 48px;
  border: 0;
  color: white;
  font-size: 20px;
  background: transparent;
  cursor: pointer;
}

.prototype-switcher button:hover {
  background: #173946;
}

.prototype-switcher span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.prototype-switcher small {
  color: #80b5b8;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: .16em;
}

.prototype-switcher strong {
  margin-top: 3px;
  font-size: 11px;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 28px;
  border: 1px solid #8eaaad;
  border-radius: 6px;
  color: var(--ink);
  background: white;
  box-shadow: 0 30px 100px rgba(0, 25, 34, .35);
}

dialog::backdrop {
  background: rgba(3, 22, 30, .58);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  font-size: 25px;
  background: transparent;
  cursor: pointer;
}

.dialog-kicker {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
}

dialog h2 {
  margin: 10px 40px 24px 0;
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.1;
}

dialog label {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 800;
}

dialog textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  line-height: 1.6;
}

.diff-preview {
  margin: 14px 0;
  padding: 12px;
  background: #f0f5f4;
}

.diff-preview > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.diff-preview p {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 11px;
}

.diff-preview del { color: #a34d44; }
.diff-preview ins { color: var(--approved); text-decoration: none; }

dialog > .primary-button {
  width: 100%;
  margin-bottom: 10px;
}

dialog > small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.unknowns-dialog ul {
  padding-left: 22px;
  color: var(--ink-2);
  line-height: 1.7;
}

.unknowns-dialog li + li {
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .city-overview-layout {
    grid-template-columns: 205px minmax(0, 1fr);
  }

  .priority-queue {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 18px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .queue-heading,
  .overview-ai-note {
    grid-column: 1 / -1;
  }

  .queue-item {
    min-width: 0;
  }

  .dashboard-a {
    grid-template-columns: 210px minmax(440px, 1fr);
  }

  .dashboard-a .evidence-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .evidence-panel .panel-eyebrow,
  .evidence-panel h2,
  .evidence-panel .step-detail {
    grid-column: 1;
  }

  .evidence-panel .source-box,
  .evidence-panel .metric-pair {
    grid-column: 2;
  }

  .evidence-panel .step-controls,
  .evidence-panel .approve-button {
    grid-column: 3;
  }

  .timeline-deck {
    grid-template-columns: 220px 1fr;
  }

  .deck-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 2fr;
    border-top: 1px solid #244958;
    border-left: 0;
  }

  .war-title {
    margin-right: 0;
  }

  .floating-proof {
    top: 115px;
  }
}

@media (max-width: 780px) {
  .preview {
    padding-bottom: 76px;
  }

  .uncertainty-bar {
    justify-content: flex-start;
    overflow-x: auto;
    min-height: 52px;
    padding: 4px 14px;
    white-space: nowrap;
  }

  .uncertainty-bar button {
    min-height: 44px;
  }

  .uncertainty-bar span {
    display: none;
  }

  .brand-header,
  .brand-header.compact {
    min-height: 60px;
    grid-template-columns: 1fr auto;
    padding: 9px 14px;
  }

  .brand-lockup p,
  .header-status {
    display: none;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .quiet-button {
    min-width: 44px;
    min-height: 44px;
    padding: 7px 10px;
    font-size: 0;
  }

  .quiet-button svg {
    width: 22px;
    height: 22px;
  }

  .city-overview-title {
    display: block;
    min-height: 0;
    padding: 14px;
  }

  .city-overview-title h2 {
    font-size: 30px;
  }

  .city-overview-title p {
    margin-top: 8px;
    line-height: 1.6;
  }

  .city-overview-layout {
    display: flex;
    flex-direction: column;
  }

  .city-status-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .city-status-heading {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }

  .city-status-rail section {
    padding: 10px 0;
  }

  .city-status-rail .source-health {
    display: none;
  }

  .city-map-column {
    padding: 10px;
  }

  .overview-map-shell,
  .overview-map {
    min-height: 430px;
  }

  .priority-queue {
    display: block;
    padding: 16px 14px 110px;
  }

  .queue-content button {
    min-height: 44px;
  }

  .back-overview {
    position: static;
    width: 100%;
    min-height: 44px;
    border-width: 0 0 1px;
    text-align: left;
  }

  .dashboard-a {
    display: flex;
    flex-direction: column;
  }

  .event-rail.vertical {
    display: flex;
    padding: 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .event-rail.vertical .rail-heading {
    display: none;
  }

  .event-rail.vertical .event-item {
    min-width: 225px;
    margin: 0 6px 0 0;
  }

  .map-column {
    padding: 12px;
  }

  .case-brief {
    display: block;
  }

  .case-brief .ai-summary {
    margin-top: 12px;
  }

  .map-shell,
  .command-map {
    min-height: 390px;
  }

  .dashboard-a .evidence-panel {
    display: block;
    padding: 20px 16px;
  }

  .step-detail {
    min-height: 0;
  }

  .timeline-deck {
    display: block;
  }

  .dashboard-b {
    grid-template-rows: auto auto;
  }

  .war-map {
    padding: 12px;
  }

  .war-title {
    align-items: start;
    margin: 0 0 10px;
  }

  .war-title h2 {
    font-size: 28px;
  }

  .war-ete {
    flex-direction: column;
    gap: 0;
  }

  .war-ete strong {
    font-size: 25px;
  }

  .war-map .map-shell {
    min-height: 400px;
  }

  .floating-proof {
    position: relative;
    top: auto;
    right: auto;
    width: auto;
    margin-top: 10px;
  }

  .event-rail.horizontal {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid #244958;
  }

  .event-rail.horizontal .rail-heading {
    display: none;
  }

  .event-rail.horizontal .event-item {
    min-width: 220px;
    margin: 0 7px 0 0;
  }

  .reason-timeline {
    padding: 14px 8px;
  }

  .dashboard-c {
    padding: 12px 12px 110px;
  }

  .focus-head {
    grid-template-columns: 74px 1fr;
    gap: 12px;
    padding-top: 6px;
  }

  .focus-number {
    width: 68px;
    height: 62px;
    padding-left: 8px;
    border-left-width: 5px;
  }

  .focus-number span {
    font-size: 23px;
  }

  .focus-head h2 {
    font-size: 27px;
  }

  .focus-head p {
    font-size: 11px;
  }

  .focus-ete {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid #bec9c3;
    text-align: left;
  }

  .focus-ete strong {
    font-size: 28px;
  }

  .event-rail.tabs {
    display: flex;
    overflow-x: auto;
  }

  .event-rail.tabs .event-item {
    min-width: 235px;
  }

  .field-layout {
    display: flex;
    flex-direction: column;
  }

  .field-layout .map-shell {
    min-height: 390px;
  }

  .field-card {
    min-height: 370px;
    padding: 22px 18px;
  }

  .field-card h3 {
    font-size: 32px;
  }

  .mobile-command {
    right: 12px;
    bottom: 72px;
    left: 12px;
    padding: 10px;
  }

  .mobile-command strong {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prototype-switcher {
    bottom: 12px;
    min-width: 286px;
  }

  .map-legend {
    right: 8px;
    bottom: 8px;
    gap: 7px;
    padding: 6px;
  }

  .map-corner-label {
    top: 8px;
    left: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
