:root {
  color-scheme: dark;
  --ink: #f5f7f2;
  --muted: #98a3a5;
  --soft: #69777a;
  --panel: #11191f;
  --panel-deep: #0d1419;
  --panel-raised: #182329;
  --line: rgba(220, 236, 231, 0.1);
  --line-strong: rgba(220, 236, 231, 0.2);
  --accent: #57d6a1;
  --accent-bright: #8bf2c3;
  --cyan: #70d9e0;
  --gold: #f0c66b;
  --accent-soft: rgba(87, 214, 161, 0.14);
  --warning: #f0c66b;
  --orange: #f58b61;
  --critical: #f26378;
  --glass-light: rgba(248, 252, 249, 0.92);
  --glass-dark: rgba(16, 27, 33, 0.88);
  --shadow: 0 22px 56px rgba(5, 12, 16, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--panel-deep);
  color: var(--ink);
}

body {
  min-width: 320px;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 0%, rgba(87, 214, 161, 0.07), transparent 28rem),
    var(--panel-deep);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 350px minmax(0, 1fr);
  height: 100vh;
  min-height: 650px;
}

.control-rail {
  position: relative;
  isolation: isolate;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 24px 20px;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 40px rgba(2, 7, 10, 0.16);
}

.control-rail::before,
.control-rail::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.control-rail::before {
  top: -180px;
  right: -150px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(87, 214, 161, 0.1), transparent 68%);
}

.control-rail::after {
  inset: 0;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 100% 5px;
}

.control-rail > * {
  position: relative;
  flex-shrink: 0;
}

.control-rail::-webkit-scrollbar {
  width: 6px;
}

.control-rail::-webkit-scrollbar-thumb {
  background: rgba(87, 214, 161, 0.24);
  border-radius: 99px;
}

.brand-lockup,
.map-title-row,
.simulation-status,
.clock-controls,
.inspector-topline,
.inspector-footer,
.incident-actions,
.range-caption,
.section-heading,
.policy-row,
.scenario-button,
.incident-row {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 12px;
}

.brand-lockup h1,
.map-title-row h2,
.section-heading h2,
.corridor-inspector h3 {
  margin: 0;
  letter-spacing: -0.035em;
}

.brand-lockup h1 {
  font-size: 19px;
  font-weight: 650;
}

.brand-mark {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 28px;
  height: 28px;
  padding: 4px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(87, 214, 161, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transform: rotate(-8deg);
}

.brand-mark span {
  display: block;
  width: 4px;
  border-radius: 4px;
  background: var(--panel-deep);
}

.brand-mark span:nth-child(1) {
  height: 8px;
}

.brand-mark span:nth-child(2) {
  height: 14px;
}

.brand-mark span:nth-child(3) {
  height: 18px;
}

.eyebrow,
.metric-label,
.section-index,
.status-mode,
.legend-title,
.map-disclaimer,
.incident-time,
.range-caption,
.rail-footnote {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--soft);
}

.simulation-status {
  gap: 8px;
  min-height: 33px;
  padding: 0 11px;
  color: var(--accent);
  background: rgba(87, 214, 161, 0.08);
  border: 1px solid rgba(87, 214, 161, 0.17);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 20px rgba(0, 0, 0, 0.1);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.shift-card {
  position: relative;
  overflow: hidden;
  padding: 16px 15px 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(112, 217, 224, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(87, 214, 161, 0.16), rgba(24, 35, 41, 0.96) 62%);
  border: 1px solid rgba(87, 214, 161, 0.27);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 32px rgba(0, 0, 0, 0.12);
}

.shift-card::after {
  position: absolute;
  top: -80px;
  right: -90px;
  width: 190px;
  height: 190px;
  content: "";
  border: 1px solid rgba(139, 242, 195, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 16px rgba(139, 242, 195, 0.025), 0 0 0 32px rgba(139, 242, 195, 0.018);
  pointer-events: none;
}

.shift-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.shift-card h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.045em;
}

.game-state-badge {
  padding: 5px 7px;
  color: var(--accent);
  background: rgba(87, 214, 161, 0.12);
  border: 1px solid rgba(87, 214, 161, 0.22);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.game-state-badge.is-won {
  color: #f0c66b;
  background: rgba(240, 198, 107, 0.13);
  border-color: rgba(240, 198, 107, 0.28);
}

.game-state-badge.is-lost {
  color: var(--critical);
  background: rgba(242, 99, 120, 0.12);
  border-color: rgba(242, 99, 120, 0.25);
}

.shift-objective {
  margin: 8px 0 13px;
  color: #b5c9c2;
  font-size: 11px;
  line-height: 1.45;
}

.directive-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 5px;
  margin: 0 0 13px;
  padding: 10px 10px 9px 11px;
  overflow: hidden;
  background:
    linear-gradient(105deg, rgba(240, 198, 107, 0.13), rgba(112, 217, 224, 0.05) 58%, rgba(6, 13, 16, 0.22)),
    rgba(6, 13, 16, 0.28);
  border: 1px solid rgba(240, 198, 107, 0.24);
  border-left: 3px solid var(--gold);
  border-radius: 7px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.directive-card::after {
  position: absolute;
  top: -28px;
  right: -28px;
  width: 74px;
  height: 74px;
  content: "";
  border: 1px solid rgba(240, 198, 107, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(240, 198, 107, 0.025), 0 0 0 16px rgba(240, 198, 107, 0.02);
  pointer-events: none;
}

.directive-topline,
.directive-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.directive-kicker {
  color: #e6c977;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.directive-topline strong {
  color: #f6d780;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.directive-card > strong {
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.directive-card > span {
  overflow: hidden;
  color: #a9bbb4;
  font-size: 9px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directive-progress {
  height: 4px;
  overflow: hidden;
  margin-top: 2px;
  background: rgba(220, 236, 231, 0.1);
  border-radius: 999px;
}

.directive-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--accent-bright));
  border-radius: inherit;
  box-shadow: 0 0 10px rgba(240, 198, 107, 0.48);
  transition: width 260ms ease;
}

.directive-meta {
  color: var(--soft);
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.directive-meta strong {
  color: #f6d780;
  font-size: 8px;
}

.directive-card.is-complete {
  border-color: rgba(87, 214, 161, 0.42);
  border-left-color: var(--accent);
  background: linear-gradient(105deg, rgba(87, 214, 161, 0.15), rgba(6, 13, 16, 0.24));
}

.directive-card.is-complete .directive-kicker,
.directive-card.is-complete .directive-topline strong,
.directive-card.is-complete .directive-meta strong {
  color: var(--accent-bright);
}

.directive-card.is-missed {
  border-color: rgba(242, 99, 120, 0.3);
  border-left-color: var(--critical);
  background: linear-gradient(105deg, rgba(242, 99, 120, 0.11), rgba(6, 13, 16, 0.24));
}

.directive-card.is-missed .directive-kicker,
.directive-card.is-missed .directive-topline strong {
  color: #ffabb5;
}

.shift-progress {
  height: 5px;
  overflow: hidden;
  background: rgba(6, 13, 16, 0.55);
  border-radius: 6px;
}

.shift-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 12px rgba(87, 214, 161, 0.45);
  border-radius: inherit;
  transition: width 220ms ease;
}

.shift-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--soft);
  font-size: 10px;
}

.shift-progress-meta strong {
  color: var(--ink);
  font-weight: 600;
}

.game-stat-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 13px;
}

.game-stat-strip > div {
  padding: 9px 10px;
  background: rgba(6, 13, 16, 0.28);
  border: 1px solid rgba(220, 236, 231, 0.08);
  border-radius: 7px;
}

.game-stat-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 550;
}

.game-stat-strip .metric-label {
  font-size: 9px;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.command-meter {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding: 10px;
  background: rgba(6, 13, 16, 0.3);
  border: 1px solid rgba(112, 217, 224, 0.16);
  border-radius: 7px;
  transition: border-color 180ms ease, background 180ms ease;
}

.command-meter.is-charged {
  background: rgba(87, 214, 161, 0.1);
  border-color: rgba(87, 214, 161, 0.36);
}

.command-meter.is-shaken {
  background: rgba(242, 99, 120, 0.08);
  border-color: rgba(242, 99, 120, 0.24);
}

.command-meter-heading,
.command-meter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.command-meter-heading strong {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.command-meter-track {
  height: 5px;
  overflow: hidden;
  background: rgba(220, 236, 231, 0.1);
  border-radius: 999px;
}

.command-meter-track span {
  display: block;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--accent-bright));
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(112, 217, 224, 0.5);
  transition: width 280ms ease, background 180ms ease;
}

.command-meter.is-shaken .command-meter-track span {
  background: linear-gradient(90deg, var(--critical), var(--orange));
  box-shadow: 0 0 12px rgba(242, 99, 120, 0.45);
}

.command-meter-meta {
  color: var(--soft);
  font-size: 8px;
  line-height: 1.3;
}

.command-meter-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-meter-meta strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.game-alert-progress {
  margin: 9px 0 0;
  color: #d8b978;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-result {
  display: grid;
  gap: 6px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(220, 236, 231, 0.12);
}

.game-result[hidden] {
  display: none;
}

.game-result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-result-heading strong {
  font-size: 13px;
}

.game-result span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.result-rating {
  padding: 4px 6px;
  color: #f6d780;
  background: rgba(240, 198, 107, 0.14);
  border: 1px solid rgba(240, 198, 107, 0.3);
  border-radius: 4px;
  font-size: 8px !important;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1 !important;
}

.result-rating-s {
  color: var(--accent-bright);
  background: rgba(87, 214, 161, 0.14);
  border-color: rgba(87, 214, 161, 0.32);
}

.result-rating-a {
  color: var(--cyan);
  background: rgba(112, 217, 224, 0.12);
  border-color: rgba(112, 217, 224, 0.28);
}

.result-rating-c,
.result-rating-d {
  color: #ffabb5;
  background: rgba(242, 99, 120, 0.12);
  border-color: rgba(242, 99, 120, 0.28);
}

.game-best-run {
  color: #d8b978 !important;
  font-size: 8px !important;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.game-result .button {
  width: max-content;
  margin-top: 4px;
}

.decision-section {
  position: relative;
  overflow: hidden;
  padding: 13px 12px 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(240, 198, 107, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(240, 198, 107, 0.12), rgba(24, 35, 41, 0.96) 66%);
  border: 1px solid rgba(240, 198, 107, 0.24);
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 32px rgba(0, 0, 0, 0.1);
}

.decision-section::after {
  position: absolute;
  right: -35px;
  bottom: -45px;
  width: 130px;
  height: 130px;
  content: "";
  border: 1px solid rgba(240, 198, 107, 0.11);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(240, 198, 107, 0.025), 0 0 0 24px rgba(240, 198, 107, 0.018);
  pointer-events: none;
}

.decision-section .section-heading {
  margin-bottom: 9px;
}

.decision-badge {
  padding: 4px 6px;
  color: #d8b978;
  background: rgba(240, 198, 107, 0.12);
  border: 1px solid rgba(240, 198, 107, 0.22);
  border-radius: 5px;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.decision-badge.is-alert {
  color: #ffabb5;
  background: rgba(242, 99, 120, 0.12);
  border-color: rgba(242, 99, 120, 0.25);
}

.decision-badge.is-incoming {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(87, 214, 161, 0.22);
}

.decision-badge.is-ended {
  color: var(--muted);
  background: rgba(220, 236, 231, 0.07);
  border-color: var(--line);
}

.decision-brief {
  display: grid;
  gap: 3px;
  margin-bottom: 9px;
}

.decision-brief-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #d8b978;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.decision-brief-meta span:last-child {
  color: var(--accent);
  white-space: nowrap;
}

.decision-brief strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.decision-brief span,
.decision-empty {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.decision-choices {
  display: grid;
  gap: 5px;
}

.decision-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 7px 8px;
  color: inherit;
  background: rgba(6, 13, 16, 0.28);
  border: 1px solid rgba(220, 236, 231, 0.12);
  border-radius: 7px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.decision-choice:hover,
.decision-choice:focus-visible {
  background: rgba(87, 214, 161, 0.1);
  border-color: rgba(87, 214, 161, 0.38);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.decision-choice.is-on {
  background: rgba(87, 214, 161, 0.1);
  border-color: rgba(87, 214, 161, 0.34);
}

.decision-choice.is-recommended {
  background: linear-gradient(100deg, rgba(240, 198, 107, 0.14), rgba(87, 214, 161, 0.08));
  border-color: rgba(240, 198, 107, 0.42);
  box-shadow: inset 3px 0 0 var(--gold);
}

.decision-choice.is-recommended .decision-choice-cta {
  color: var(--gold);
}

.decision-choice.is-locked {
  opacity: 0.58;
}

.decision-choice-copy {
  min-width: 0;
}

.decision-choice-topline {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.decision-choice-topline strong,
.decision-choice-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.decision-choice-topline strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
}

.decision-choice-topline em {
  flex: 0 0 auto;
  padding: 2px 4px;
  color: #f6d780;
  background: rgba(240, 198, 107, 0.13);
  border: 1px solid rgba(240, 198, 107, 0.26);
  border-radius: 3px;
  font-size: 7px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.decision-choice-copy small {
  margin-top: 2px;
  color: var(--soft);
  font-size: 9px;
}

.decision-choice-cta {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-align: right;
  text-transform: uppercase;
}

.decision-choice.is-on .decision-choice-cta {
  color: var(--ink);
}

.decision-choice-cta em {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 8px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: none;
}

.status-mode {
  margin-left: auto;
  color: var(--soft);
  font-size: 9px;
}

.status-dot,
.data-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(87, 214, 161, 0.1);
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.section-index {
  align-self: flex-start;
  color: var(--soft);
  font-size: 9px;
  white-space: nowrap;
}

.compact-heading {
  align-items: flex-start;
}

.compact-heading .eyebrow {
  margin-bottom: 4px;
}

.scenario-list {
  display: grid;
  gap: 6px;
}

.scenario-button {
  width: 100%;
  gap: 11px;
  padding: 11px 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: 160ms ease;
}

.scenario-button:hover,
.scenario-button:focus-visible {
  color: var(--ink);
  background: var(--panel-raised);
  outline: none;
}

.scenario-button.is-active {
  color: var(--ink);
  background: var(--accent-soft);
  border-color: rgba(87, 214, 161, 0.25);
}

.scenario-indicator {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid var(--soft);
  border-radius: 50%;
}

.scenario-button.is-active .scenario-indicator {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(87, 214, 161, 0.11);
}

.scenario-copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

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

.scenario-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.scenario-copy small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.metric-card {
  min-height: 77px;
  padding: 11px 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.metric-card:hover {
  background: linear-gradient(145deg, rgba(112, 217, 224, 0.08), var(--panel-raised));
  border-color: rgba(112, 217, 224, 0.24);
  transform: translateY(-1px);
}

.metric-wide {
  grid-column: span 2;
}

.metric-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.metric-card small,
.inspector-grid small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
  letter-spacing: 0;
}

.metric-trend {
  display: block;
  margin-top: 2px;
  color: var(--soft);
  font-size: 10px;
}

.network-status {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  white-space: nowrap;
  text-transform: uppercase;
}

.network-status.is-alert {
  color: var(--critical);
  background: rgba(242, 99, 120, 0.12);
}

.range-control {
  display: block;
  padding: 12px;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.range-control > span:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.range-control strong {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.range-control strong em {
  display: block;
  margin-top: 3px;
  color: var(--soft);
  font-size: 9px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  margin: 17px 0 7px;
  accent-color: var(--accent);
}

.range-caption {
  justify-content: space-between;
  color: var(--soft);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.policy-list {
  display: grid;
  gap: 2px;
  margin-top: 7px;
}

.policy-row {
  justify-content: space-between;
  gap: 10px;
  padding: 10px 3px;
  border-bottom: 1px solid var(--line);
}

.policy-row:last-child {
  border-bottom: 0;
}

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

.policy-copy strong {
  font-size: 12px;
  font-weight: 550;
}

.policy-copy small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 10px;
}

.policy-effect {
  display: block;
  margin-top: 4px;
  color: var(--accent);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.01em;
}

.policy-row {
  position: relative;
}

.policy-cost {
  margin-left: 5px;
  color: var(--soft);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.policy-row:has(.toggle.is-locked) {
  opacity: 0.6;
}

.transit-control-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 3px 3px;
  border-top: 1px solid var(--line);
}

.transit-control-heading strong {
  color: #d8b978;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.transit-control-heading span {
  color: var(--soft);
  font-size: 9px;
}

.policy-row-transit .policy-effect {
  color: #d8b978;
}

.toggle {
  position: relative;
  width: 62px;
  height: 25px;
  flex: 0 0 62px;
  padding: 0 7px 0 17px;
  background: #26343a;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
  transition: 160ms ease;
}

.toggle::after {
  position: absolute;
  top: 8px;
  left: 3px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--muted);
  border-radius: 50%;
  transition: 160ms ease;
}

.toggle.is-on {
  background: var(--accent-soft);
  border-color: rgba(87, 214, 161, 0.45);
  color: var(--accent);
  padding-right: 17px;
  padding-left: 7px;
  text-align: left;
}

.toggle.is-on::after {
  right: 7px;
  left: auto;
  background: var(--accent);
}

.toggle.is-locked {
  cursor: not-allowed;
}

.count-badge {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 4px 6px;
  color: var(--muted);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.incident-list {
  display: grid;
  gap: 6px;
}

.incident-row {
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  padding: 9px;
  color: inherit;
  background: rgba(242, 99, 120, 0.07);
  border: 1px solid rgba(242, 99, 120, 0.17);
  border-radius: 7px;
  text-align: left;
  transition: 160ms ease;
}

.incident-row:hover,
.incident-row:focus-visible,
.incident-row.is-selected {
  background: rgba(242, 99, 120, 0.14);
  border-color: rgba(242, 99, 120, 0.4);
  outline: none;
}

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

.incident-copy strong,
.incident-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-copy strong {
  color: #ffd6da;
  font-size: 11px;
  font-weight: 600;
}

.incident-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.incident-row-mark {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: var(--critical);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(242, 99, 120, 0.11);
}

.incident-focus {
  flex: 0 0 auto;
  color: #ffabb5;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.empty-state {
  padding: 13px 0 2px;
  color: var(--soft);
  font-size: 11px;
}

.empty-state.is-incoming {
  color: #d8b978;
}

.empty-state-mark {
  display: inline-grid;
  width: 17px;
  height: 17px;
  margin-right: 5px;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
  font-size: 10px;
}

.incident-actions {
  gap: 7px;
  margin-top: 9px;
}

.incident-actions-secondary {
  justify-content: flex-end;
  margin-top: 2px;
}

.incident-actions-secondary .text-button {
  color: var(--soft);
  font-size: 9px;
  font-weight: 600;
}

.incident-actions-secondary .text-button:hover {
  color: var(--critical);
}

.incident-actions-secondary .text-button span,
.button span {
  margin-left: 4px;
  color: inherit;
  font-size: 9px;
  opacity: 0.72;
}

.button {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.button-primary {
  color: var(--panel-deep);
  background: var(--accent);
  border: 1px solid var(--accent);
}

.button-primary:hover,
.button-primary:focus-visible {
  background: #7be2b8;
  outline: none;
}

.button-quiet {
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line-strong);
}

.button-quiet:hover,
.button-quiet:focus-visible {
  color: var(--ink);
  border-color: var(--muted);
  outline: none;
}

.button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.event-feed {
  display: grid;
  gap: 7px;
}

.feed-event {
  position: relative;
  padding: 8px 9px 8px 15px;
  background: rgba(24, 35, 41, 0.68);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.feed-event::before {
  position: absolute;
  top: 12px;
  left: 6px;
  width: 4px;
  height: 4px;
  content: "";
  background: var(--soft);
  border-radius: 50%;
}

.feed-event.is-action::before {
  background: var(--accent);
}

.feed-event.is-warning::before {
  background: var(--warning);
}

.feed-event.is-success::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(87, 214, 161, 0.1);
}

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

.feed-event strong {
  color: var(--ink);
  font-size: 10px;
  font-weight: 650;
}

.feed-event small {
  margin-top: 3px;
  color: var(--soft);
  font-size: 9px;
}

.feed-event span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.rail-footnote {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 9px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  text-transform: none;
}

.shift-time-note {
  margin: 7px 0 0;
  color: var(--soft);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map-stage {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 62% 44%, rgba(255, 255, 255, 0.24), transparent 34%),
    #b9dadd;
}

.map-header {
  position: absolute;
  z-index: 600;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px 48px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(248, 245, 236, 0.96) 0%, rgba(248, 245, 236, 0.82) 50%, transparent 100%);
}

.map-header > *,
.clock-controls > * {
  pointer-events: auto;
}

.map-hud {
  position: absolute;
  z-index: 600;
  top: 124px;
  left: 32px;
  width: min(300px, calc(100% - 64px));
  padding: 11px 12px 10px;
  color: #dcebe5;
  background: linear-gradient(145deg, rgba(17, 35, 40, 0.9), rgba(20, 39, 43, 0.76));
  border: 1px solid rgba(112, 217, 224, 0.22);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(32, 55, 55, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  overflow: hidden;
  pointer-events: none;
}

.map-hud::before {
  position: absolute;
  top: 0;
  right: 14px;
  left: 14px;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(139, 242, 195, 0.8), transparent);
}

.map-hud::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28%;
  width: 18%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(112, 217, 224, 0.14), transparent);
  animation: hud-scan 5.5s ease-in-out infinite;
  pointer-events: none;
}

.map-hud > * {
  position: relative;
  z-index: 1;
}

.map-hud-topline,
.map-hud-kicker,
.map-hud-grid,
.map-hud-signal {
  display: flex;
  align-items: center;
}

.map-hud-topline {
  justify-content: space-between;
  gap: 10px;
}

.map-hud-kicker {
  gap: 7px;
  color: #9ab7af;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.map-signal-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-bright);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(139, 242, 195, 0.12), 0 0 12px rgba(139, 242, 195, 0.7);
}

.map-hud-state {
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-hud-state.is-stable {
  color: var(--accent-bright);
  background: rgba(87, 214, 161, 0.14);
}

.map-hud-state.is-degraded {
  color: #f6d780;
  background: rgba(240, 198, 107, 0.14);
}

.map-hud-state.is-critical {
  color: #ffacb9;
  background: rgba(242, 99, 120, 0.16);
}

.map-hud-grid {
  gap: 0;
  margin-top: 12px;
}

.map-hud-grid > div {
  min-width: 0;
  flex: 1 1 0;
  padding-right: 10px;
  border-right: 1px solid rgba(220, 236, 231, 0.12);
}

.map-hud-grid > div + div {
  padding-left: 10px;
}

.map-hud-grid > div:last-child {
  padding-right: 0;
  border-right: 0;
}

.map-hud-grid span,
.map-hud-grid strong,
.map-hud-grid small {
  display: inline-block;
}

.map-hud-grid span {
  display: block;
  overflow: hidden;
  color: #86a09c;
  font-size: 7px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-hud-grid strong {
  margin-top: 4px;
  color: #f1f7f1;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.map-hud-grid small {
  margin-left: 2px;
  color: #89a49e;
  font-size: 8px;
}

.map-hud-note {
  overflow: hidden;
  margin: 10px 0 0;
  color: #a5bbb5;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-toast {
  position: absolute;
  z-index: 640;
  top: 258px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(360px, calc(100% - 64px));
  padding: 10px 11px 10px 10px;
  color: #fff5f4;
  background: linear-gradient(120deg, rgba(66, 33, 42, 0.94), rgba(29, 37, 43, 0.92));
  border: 1px solid rgba(242, 99, 120, 0.46);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(23, 20, 26, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  transform-origin: top left;
  animation: toast-in 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  pointer-events: auto;
}

.alert-toast[hidden] {
  display: none;
}

.alert-toast.is-missed {
  color: #fff8e8;
  background: linear-gradient(120deg, rgba(66, 54, 30, 0.94), rgba(29, 37, 43, 0.92));
  border-color: rgba(240, 198, 107, 0.46);
}

.alert-toast-icon {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  color: #fff;
  background: var(--critical);
  border: 4px solid rgba(242, 99, 120, 0.2);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.alert-toast.is-missed .alert-toast-icon {
  color: #1d2529;
  background: var(--gold);
  border-color: rgba(240, 198, 107, 0.2);
}

.alert-toast-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.alert-toast-copy span,
.alert-toast-copy strong,
.alert-toast-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.alert-toast-copy span {
  color: #ff9eac;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.alert-toast.is-missed .alert-toast-copy span {
  color: #f6d780;
}

.alert-toast-copy strong {
  font-size: 12px;
  font-weight: 700;
}

.alert-toast-copy small {
  color: #d4c7c8;
  font-size: 9px;
}

.alert-toast-dismiss {
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 4px 5px;
  color: #ffb3bd;
  background: transparent;
  border: 1px solid rgba(255, 179, 189, 0.3);
  border-radius: 4px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.alert-toast-dismiss:hover,
.alert-toast-dismiss:focus-visible {
  color: #fff;
  background: rgba(242, 99, 120, 0.18);
  border-color: rgba(255, 179, 189, 0.6);
  outline: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hud-scan {
  0%,
  18% {
    transform: translateX(0);
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  72%,
  100% {
    transform: translateX(760%);
    opacity: 0;
  }
}

.map-header .eyebrow {
  color: #657875;
}

.map-title-row {
  gap: 10px;
}

.map-title-row h2 {
  color: #223238;
  font-size: 28px;
  font-weight: 520;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  color: #176e60;
  background: rgba(239, 249, 240, 0.9);
  border: 1px solid rgba(38, 125, 105, 0.2);
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.clock-controls {
  gap: 8px;
  padding: 9px;
  background: rgba(248, 252, 249, 0.94);
  border: 1px solid rgba(42, 67, 68, 0.14);
  border-radius: 9px;
  box-shadow: var(--shadow);
}

.clock-block {
  min-width: 118px;
  padding: 0 7px;
}

.clock-block strong {
  color: #223238;
  display: block;
  margin-top: 3px;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.02em;
}

.icon-button,
.speed-button {
  display: inline-grid;
  place-items: center;
  height: 34px;
  color: var(--ink);
  background: var(--panel-raised);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.icon-button {
  width: 34px;
  font-size: 11px;
  letter-spacing: -0.15em;
  text-indent: -2px;
}

.speed-button {
  width: 40px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.icon-button:hover,
.speed-button:hover,
.icon-button:focus-visible,
.speed-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map-overlay-stack {
  position: absolute;
  z-index: 500;
  right: 32px;
  bottom: 224px;
  left: 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.map-overlay-stack > * {
  pointer-events: auto;
}

.map-disclaimer {
  position: static;
  flex: 1 1 0;
  max-width: 650px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #33484b;
  background: rgba(248, 252, 249, 0.91);
  border: 1px solid rgba(42, 67, 68, 0.13);
  border-radius: 5px;
  box-shadow: 0 12px 30px rgba(32, 55, 55, 0.12);
  backdrop-filter: blur(10px);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: none;
  flex-wrap: wrap;
}

.map-disclaimer .map-source-link {
  flex-basis: 100%;
  padding-left: 14px;
}

.map-disclaimer strong {
  color: #267d69;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.disclaimer-divider {
  width: 1px;
  height: 12px;
  background: rgba(42, 67, 68, 0.2);
}

.data-pulse {
  width: 6px;
  height: 6px;
  flex-basis: 6px;
  box-shadow: 0 0 0 3px rgba(87, 214, 161, 0.18);
}

.corridor-inspector {
  position: absolute;
  z-index: 500;
  right: 32px;
  bottom: 32px;
  left: 32px;
  max-width: 690px;
  padding: 17px 18px 12px;
  color: #223238;
  background: rgba(248, 252, 249, 0.95);
  border: 1px solid rgba(39, 62, 64, 0.13);
  border-radius: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.corridor-inspector .eyebrow,
.inspector-grid .metric-label {
  color: #637579;
}

.inspector-topline {
  justify-content: space-between;
  gap: 15px;
}

.corridor-inspector h3 {
  font-size: 17px;
  font-weight: 650;
}

.status-chip {
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-free {
  color: #1d8168;
  background: rgba(87, 214, 161, 0.17);
}

.status-moderate {
  color: #926d17;
  background: rgba(240, 198, 107, 0.24);
}

.status-heavy {
  color: #aa4d27;
  background: rgba(245, 139, 97, 0.2);
}

.status-critical {
  color: #b63c55;
  background: rgba(242, 99, 120, 0.2);
}

.inspector-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.inspector-grid .metric-label,
.inspector-grid strong {
  display: block;
}

.inspector-grid strong {
  margin-top: 3px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.inspector-grid small {
  color: #6d7d7f;
}

.inspector-footer {
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  color: #718083;
  border-top: 1px solid rgba(42, 67, 68, 0.12);
  font-size: 10px;
}

.text-button {
  padding: 0;
  color: #1f8272;
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 700;
}

.text-button:hover,
.text-button:focus-visible {
  color: #125b51;
  outline: none;
}

.map-legend {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 10px;
  color: #34474a;
  background: rgba(248, 252, 249, 0.91);
  border: 1px solid rgba(42, 67, 68, 0.13);
  border-radius: 5px;
  box-shadow: 0 12px 30px rgba(32, 55, 55, 0.12);
  backdrop-filter: blur(10px);
  font-size: 9px;
}

.legend-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.legend-title {
  color: #6d7d7f;
  font-size: 8px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.legend-items {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 11px;
  min-width: 0;
}

.legend-item,
.legend-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.legend-note {
  color: #718083;
  font-size: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legend-state-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  flex: 0 0 12px;
  background: #718684;
  border: 1px solid rgba(113, 134, 132, 0.2);
  border-radius: 999px;
  opacity: 0.55;
}

.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 3px;
  flex: 0 0 12px;
  border-radius: 3px;
}

.swatch-free {
  background: var(--accent);
}

.swatch-moderate {
  background: var(--warning);
}

.swatch-heavy {
  background: var(--orange);
}

.swatch-critical {
  background: var(--critical);
}

.transit-swatch {
  display: inline-block;
  width: 14px;
  height: 3px;
  flex: 0 0 14px;
  border-radius: 3px;
}

.transit-swatch-bus {
  background: repeating-linear-gradient(90deg, #d27a45 0 2px, transparent 2px 6px);
}

.transit-swatch-train {
  background: linear-gradient(90deg, #66509b 0 50%, #137f84 50% 100%);
  box-shadow: 0 0 0 1px rgba(19, 127, 132, 0.15);
}

@media (max-width: 1450px) {
  .map-overlay-stack {
    display: grid;
    align-items: stretch;
    gap: 8px;
  }

  .map-disclaimer,
  .map-legend {
    width: 100%;
    max-width: none;
  }

  .map-legend {
    justify-content: flex-start;
  }
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 305px minmax(0, 1fr);
  }

  .control-rail {
    padding-right: 18px;
    padding-left: 18px;
  }

  .map-header,
  .corridor-inspector,
  .map-overlay-stack {
    right: 22px;
    left: 22px;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
  }

  .control-rail {
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .rail-footnote {
    margin-top: 0;
  }

  .map-stage {
    height: 720px;
    min-height: 720px;
  }

  .map-header {
    padding: 20px 18px 42px;
  }

  .map-title-row h2 {
    font-size: 23px;
  }

  .clock-controls {
    gap: 5px;
    padding: 6px;
  }

  .clock-block {
    min-width: 94px;
  }

  .corridor-inspector {
    right: 18px;
    bottom: 18px;
    left: 18px;
  }

  .map-overlay-stack {
    right: 18px;
    bottom: 224px;
    left: 18px;
  }

  .map-disclaimer #scenario-description {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .map-header {
    display: block;
  }

  .clock-controls {
    width: max-content;
    margin-top: 14px;
  }

  .map-title-row h2 {
    font-size: 21px;
  }

  .map-legend {
    display: grid;
    gap: 10px;
  }

  .legend-group {
    display: grid;
    gap: 6px;
  }

  .legend-items {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px 10px;
  }

  .legend-note {
    max-width: none;
  }

  .map-disclaimer {
    right: 18px;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 5px 7px;
  }

  .map-disclaimer .disclaimer-divider {
    display: none;
  }

  .map-disclaimer #scenario-description {
    grid-column: span 3;
  }

  .inspector-grid {
    gap: 8px;
  }

  .inspector-grid strong {
    font-size: 17px;
  }

  .inspector-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Local city illustration ------------------------------------------------ */

.map-stage {
  background: #b9dadd;
}

.map-canvas {
  background: #b9dadd;
}

.city-map-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.city-map-svg.is-dragging {
  cursor: grabbing;
}

.city-water-texture,
.city-map-compass,
.city-grid,
.city-vignette,
.city-junctions,
.city-junction,
.city-label,
.city-landmark {
  pointer-events: none;
}

.city-grid {
  mix-blend-mode: multiply;
  opacity: 0.52;
}

.city-vignette {
  pointer-events: none;
}

.city-junction-halo {
  fill: rgba(255, 255, 255, 0.12);
  stroke: rgba(49, 88, 91, 0.18);
  stroke-width: 0.8;
}

.city-junction-core {
  fill: #557f7e;
  opacity: 0.7;
}

.city-land {
  stroke: #c9c2b4;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.city-neighborhood {
  stroke: rgba(177, 168, 151, 0.42);
  stroke-width: 1.1;
  stroke-linejoin: round;
}

.city-street {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.city-street-minor {
  stroke: #c9c6bd;
  stroke-width: 1;
  opacity: 0.58;
}

.city-street-major {
  stroke: #fffdf7;
  stroke-width: 5.2;
  opacity: 0.9;
}

.city-street-traffic {
  stroke: #fffdf7;
  stroke-width: 11;
  opacity: 0.92;
}

.city-park {
  stroke: #8dbb9e;
  stroke-width: 1.2;
  opacity: 0.86;
}

.city-transit-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0.76;
  pointer-events: none;
}

.city-transit-route {
  pointer-events: none;
  transition: opacity 180ms ease;
}

.city-transit-route.is-proposed {
  opacity: 0.38;
}

.city-transit-route.is-active {
  opacity: 1;
}

.city-transit-route.is-active .city-transit-line {
  animation: transit-flow 4.2s linear infinite;
}

.city-transit-train .city-transit-line {
  stroke-width: 3.8;
  stroke-dasharray: 22 16;
  opacity: 0.94;
}

.city-transit-bus .city-transit-line {
  stroke-width: 2.8;
  stroke-dasharray: 2 6;
  opacity: 0.96;
}

.city-transit-stop {
  fill: #fffdf7;
  stroke-width: 1.9;
  opacity: 1;
  pointer-events: none;
}

.city-transit-route.is-active .city-transit-stop {
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.65));
}

.city-transit-bus .city-transit-stop {
  r: 2.6;
  stroke-width: 1.5;
}

.city-transit-label {
  fill: #31585b;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  paint-order: stroke;
  stroke: #f8f2e7;
  stroke-width: 4px;
  stroke-linejoin: round;
  text-anchor: middle;
}

.city-transit-bus .city-transit-label {
  fill: #a85f35;
}

.city-label {
  fill: #728480;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-anchor: middle;
}

.city-label-small {
  font-size: 7px;
  letter-spacing: 0.16em;
}

.city-label-large {
  fill: #647b77;
  font-size: 9.5px;
  letter-spacing: 0.17em;
}

.city-label-water {
  fill: #6c9da1;
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.21em;
}

.city-road-label {
  fill: #69807b;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  paint-order: stroke;
  stroke: #f8f2e7;
  stroke-width: 3px;
  stroke-linejoin: round;
  text-anchor: middle;
  text-transform: uppercase;
}

.city-landmark circle:first-child {
  fill: #f8f2e7;
  stroke: #798b87;
  stroke-width: 1.4;
}

.city-landmark-core {
  fill: #798b87;
}

.city-landmark text {
  fill: #647875;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.city-landmark-ferry circle:first-child {
  stroke: #2b8790;
}

.city-landmark-ferry .city-landmark-core {
  fill: #2b8790;
}

.city-landmark-stadium circle:first-child {
  stroke: #e38b55;
}

.city-landmark-stadium .city-landmark-core {
  fill: #e38b55;
}

.city-map-compass circle {
  fill: rgba(248, 242, 231, 0.74);
  stroke: rgba(49, 82, 84, 0.2);
  stroke-width: 1;
}

.city-map-compass path {
  fill: #2f777a;
}

.city-map-compass text {
  fill: #477778;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
}

.corridor-layer {
  pointer-events: auto;
}

.corridor-hit {
  pointer-events: stroke;
  cursor: pointer;
}

.corridor-casing,
.corridor-line {
  pointer-events: none;
}

.corridor-layer.is-selected .corridor-line {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.62));
}

.corridor-flow {
  animation: corridor-flow 2.8s linear infinite;
  pointer-events: none;
}

.corridor-layer.is-free .corridor-flow {
  animation-duration: 3.8s;
}

.corridor-layer.is-moderate .corridor-flow {
  animation-duration: 2.8s;
}

.corridor-layer.is-heavy .corridor-flow {
  animation-duration: 2s;
}

.corridor-layer.is-critical .corridor-flow {
  animation-duration: 1.25s;
}

.incident-marker {
  pointer-events: auto;
  cursor: pointer;
  outline: none;
}

.incident-pulse {
  fill: rgba(242, 99, 120, 0.16);
  stroke: rgba(242, 99, 120, 0.38);
  stroke-width: 1;
  animation: incident-pulse 1.8s ease-out infinite;
}

.incident-sweep {
  fill: none;
  stroke: rgba(255, 255, 255, 0.78);
  stroke-width: 1.5;
  stroke-dasharray: 2 8;
  transform-origin: center;
  animation: incident-sweep 2.2s linear infinite;
}

.incident-ring {
  fill: #fff8ef;
  stroke: #f26378;
  stroke-width: 2.5;
}

.incident-core {
  fill: #f26378;
}

.incident-marker.is-selected .incident-ring {
  stroke: #ffffff;
  stroke-width: 3.4;
}

.incident-marker.is-urgent .incident-ring {
  stroke: #ffffff;
  filter: drop-shadow(0 0 6px rgba(242, 99, 120, 0.72));
}

.incident-marker.is-urgent .incident-sweep {
  stroke: #f26378;
  animation-duration: 1s;
}

@keyframes incident-pulse {
  0% {
    opacity: 0.85;
    transform: scale(0.72);
    transform-origin: center;
  }

  70%,
  100% {
    opacity: 0;
    transform: scale(1.2);
    transform-origin: center;
  }
}

@keyframes incident-sweep {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes corridor-flow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -36;
  }
}

@keyframes transit-flow {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: -38;
  }
}

.map-tools {
  position: absolute;
  z-index: 650;
  top: 112px;
  right: 32px;
  display: grid;
  gap: 5px;
}

.map-tool {
  display: inline-grid;
  width: 34px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #31585b;
  background: rgba(248, 252, 249, 0.82);
  border: 1px solid rgba(42, 67, 68, 0.18);
  border-radius: 6px;
  box-shadow: 0 10px 22px rgba(32, 55, 55, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(10px);
  font-size: 17px;
  font-weight: 500;
}

.map-tool-wide {
  width: auto;
  padding: 0 9px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-tool:hover,
.map-tool:focus-visible {
  color: #1f7770;
  background: #f8fcf9;
  box-shadow: 0 12px 26px rgba(32, 55, 55, 0.2), 0 0 0 3px rgba(87, 214, 161, 0.1);
  border-color: rgba(31, 119, 112, 0.52);
  outline: none;
}

.map-source-link {
  color: #28736c;
  font-size: 9px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.map-source-link:hover,
.map-source-link:focus-visible {
  color: #145b55;
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .map-hud {
    left: 22px;
  }

  .alert-toast {
    left: 22px;
    width: min(360px, calc(100% - 44px));
  }

  .map-tools {
    right: 22px;
  }
}

@media (max-width: 820px) {
  .map-hud {
    top: 126px;
    left: 18px;
    width: min(300px, calc(100% - 36px));
  }

  .alert-toast {
    top: 294px;
    left: 18px;
    width: calc(100% - 36px);
  }

  .map-tools {
    top: 104px;
    right: 18px;
  }
}

@media (max-width: 560px) {
  .map-hud {
    top: 188px;
    width: calc(100% - 36px);
  }

  .alert-toast {
    top: 356px;
  }

  .map-tools {
    top: 142px;
    right: 18px;
  }

  .map-source-link {
    grid-column: span 3;
    flex-basis: auto;
    padding-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

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