:root {
  color-scheme: light;
  --bg: #e9ecea;
  --surface: #f7f8f6;
  --surface-raised: #ffffff;
  --surface-hover: #eff1ef;
  --surface-active: #e6ebed;
  --rule: #d1d6d3;
  --rule-strong: #89928f;
  --text: #171c1f;
  --text-secondary: #384247;
  --muted: #58636a;
  --quiet: #69747a;
  /* Affiliation and operational status are intentionally separate axes. */
  --affiliation-friendly: #256783;
  --affiliation-adversary: #a23f39;
  --affiliation-unknown: #90600f;
  --selection: #205d7a;
  --selection-strong: #17465d;
  --positive: #3f7362;
  --status-stable: #68767a;
  --caution: #a66716;
  --caution-text: #76500f;
  --status-watch: var(--caution);
  --status-constrained: #404b52;
  --status-disrupted: #a23f39;
  --status-verification: var(--affiliation-unknown);
  --blue: var(--selection);
  --blue-strong: var(--selection-strong);
  --green: var(--positive);
  --amber: var(--status-watch);
  --red: var(--status-disrupted);
  --sans: "Helvetica Neue", Arial, ui-sans-serif, system-ui, sans-serif;
  --mono: "SFMono-Regular", Menlo, Consolas, monospace;
  --type-utility: 11px;
  --type-control: 12px;
  --type-body: 13px;
  --type-ui: 14px;
  --type-display: 18px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --tracking-caps: .04em;
  --tracking-heading: -.01em;
  --tracking-display: -.02em;
  --fast: 160ms ease;
  --medium: 220ms ease;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--type-ui);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  border-radius: 0;
  color: inherit;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: .68;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border: 1px solid var(--text);
  border-radius: 0;
  background: var(--text);
  color: var(--bg);
  font-size: var(--type-control);
  font-weight: var(--weight-bold);
  text-decoration: none;
  transition: transform var(--fast);
}

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

.app-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 0;
  height: 100dvh;
  min-height: 640px;
  padding: 0 16px 12px;
}

/* Header ---------------------------------------------------------------- */

.topbar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow,
.section-label {
  color: var(--muted);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-lockup h1 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: var(--type-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: 1.15;
}

.brand-lockup p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: var(--type-control);
}

.topbar-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.as-of {
  display: grid;
  justify-items: end;
  row-gap: 1px;
  padding-right: 14px;
  border-right: 1px solid var(--rule);
  white-space: nowrap;
}

.as-of .source-currency,
.as-of .window-copy {
  color: var(--quiet);
  font-size: var(--type-utility);
}

.as-of .source-currency {
  line-height: 1.2;
}

.as-of time {
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: var(--type-control);
  font-weight: var(--weight-medium);
}

.as-of .window-copy {
  grid-column: 1 / -1;
  margin-top: 1px;
  text-align: right;
}

.header-badges,
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.badge-ready {
  color: var(--text-secondary);
}

.badge-ready .badge-dot {
  background: var(--green);
}

.badge-warning {
  color: var(--caution-text);
}

.badge-warning .badge-dot {
  background: var(--amber);
}

.icon-button,
.secondary-button,
.layer-toggle,
.utility-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}

.icon-button {
  width: 34px;
  padding: 0;
}

.icon-button:hover,
.secondary-button:hover,
.layer-toggle:hover,
.utility-button:hover {
  border-color: var(--rule-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.icon-button svg,
.secondary-button svg,
.layer-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.ph-icon,
.icon-button .ph-icon,
.secondary-button .ph-icon,
.layer-toggle .ph-icon,
.map-controls .ph-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: currentColor !important;
  stroke: none !important;
}

.menu-wrap {
  position: relative;
}

.export-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  right: 0;
  width: 228px;
  padding: 4px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-raised);
}

.export-menu .sharepoint-action {
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 11px;
}

.export-menu button {
  width: 100%;
  display: grid;
  gap: 1px;
  padding: 9px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.export-menu button:hover,
.export-menu button:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
}

.export-menu span {
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
}

.export-menu small {
  color: var(--muted);
  font-size: var(--type-utility);
}

/* Decision brief -------------------------------------------------------- */

.assessment-strip,
.decision-brief {
  min-height: 0;
  display: block;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  background: var(--surface-raised);
}

.assessment-lead,
.metrics-grid {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.assessment-lead,
.decision-lead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: center;
  gap: 16px;
  padding: 12px 14px 11px 12px;
  border-left: 2px solid var(--blue);
}

.decision-lead.actions-empty {
  grid-template-columns: minmax(0, 1fr);
}

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

.decision-context {
  color: var(--text-secondary);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.decision-lead-copy > p,
.decision-lead-copy #network-assessment {
  max-width: 820px;
  margin: 5px 0 4px;
  color: var(--text);
  font-size: var(--type-ui);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  line-height: 1.36;
}

.decision-actions {
  width: 248px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.decision-actions.empty {
  display: none;
}

.decision-action-note {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: var(--type-utility);
  line-height: 1.35;
}

.decision-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}

.decision-button:hover:not(:disabled) {
  border-color: #87918e;
  background: var(--surface-hover);
  color: var(--text);
}

.decision-button.active,
.decision-button[aria-pressed="true"] {
  border-color: var(--rule-strong);
  background: var(--surface-active);
  color: var(--text);
}

.decision-button.primary {
  grid-column: auto;
  min-height: 34px;
  border-color: var(--rule-strong);
  background: var(--surface-raised);
  color: var(--text);
}

.decision-button.primary:hover:not(:disabled) {
  border-color: #87918e;
  background: var(--surface-hover);
}

.decision-button.primary.commit {
  border-color: var(--blue-strong);
  background: var(--blue-strong);
  color: #fff;
}

.decision-button.primary.commit:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.decision-button.completed,
.decision-button.applied,
.decision-button[data-state="applied"] {
  border-color: var(--rule);
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.metrics-grid,
.decision-values {
  position: relative;
  max-width: 980px;
  min-height: 0;
  display: block;
  margin-top: 9px;
  overflow: hidden;
  border-top: 1px solid var(--rule);
  border-left: 0;
}

.decision-values-scroller {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.decision-values::before,
.decision-values::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 1px;
  bottom: 8px;
  width: 48px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fast);
}

.decision-values::before {
  left: 0;
  background: linear-gradient(to left, transparent, var(--surface-raised) 82%);
}

.decision-values::after {
  right: 0;
  background: linear-gradient(to right, transparent, var(--surface-raised) 82%);
}

.decision-values.can-scroll-left::before,
.decision-values.can-scroll-right::after {
  opacity: 1;
}

.decision-fact-table {
  width: max-content;
  min-width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: var(--type-utility);
  table-layout: auto;
}

.decision-fact-table th,
.decision-fact-table td {
  padding: 5px 8px;
  border-top: 1px solid var(--rule);
  line-height: 1.25;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.decision-fact-table thead th {
  padding-top: 7px;
  border-top: 0;
  color: var(--muted);
  font-weight: var(--weight-semibold);
}

.decision-fact-table th:first-child,
.decision-fact-table td:first-child {
  min-width: 180px;
  padding-left: 0;
}

.decision-fact-table th:last-child,
.decision-fact-table td:last-child {
  padding-right: 0;
}

.decision-fact-table tbody th {
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.decision-fact-table tbody td {
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--type-control);
  font-variant-numeric: tabular-nums;
}

.decision-fact-table tbody tr:last-child th,
.decision-fact-table tbody tr:last-child td {
  border-top-color: var(--rule-strong);
}

@media (min-width: 1360px) {
  .decision-lead-copy {
    display: grid;
    grid-template-columns: minmax(440px, 1fr) minmax(500px, .9fr);
    grid-template-rows: auto auto;
    column-gap: 22px;
    align-items: start;
  }

  .decision-lead-copy.facts-hidden {
    grid-template-columns: minmax(0, 1fr);
  }

  .decision-context {
    grid-column: 1;
    grid-row: 1;
  }

  .decision-lead-copy > p {
    grid-column: 1;
    grid-row: 2;
  }

  .metrics-grid,
  .decision-values {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
    margin-top: 0;
    padding-left: 18px;
    border-top: 0;
    border-left: 1px solid var(--rule);
  }

  .decision-values::before {
    left: 18px;
  }
}

/* Continuous workspace -------------------------------------------------- */

.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 324px;
  gap: 0;
  background: var(--surface-raised);
}

.panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.watchlist-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-right: 1px solid var(--rule);
}

.map-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #f4f5f3;
}

.inspector-panel {
  overflow-y: auto;
  border-left: 1px solid var(--rule);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.panel-heading,
.map-heading {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 11px 6px;
  border-bottom: 1px solid var(--rule);
}

.panel-heading h2,
.map-heading h2,
.timeline-header h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: var(--type-ui);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  line-height: 1.18;
}

.result-count,
.timeline-context {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-utility);
  white-space: nowrap;
}

.filter-row {
  min-height: 38px;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 9px;
  border-bottom: 1px solid var(--rule);
}

.filter-chip {
  min-height: 37px;
  padding: 0 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.filter-chip:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.filter-chip.active,
.filter-chip[aria-pressed="true"] {
  border-bottom-color: var(--blue);
  color: var(--text);
}

.clear-filter {
  margin-left: auto;
  align-self: center;
  padding: 0 7px;
  font-size: var(--type-utility);
}

.watchlist {
  min-height: 0;
  overflow: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.watchlist-item {
  position: relative;
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  padding: 8px 10px 8px 8px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}

.watchlist-item:hover {
  background: var(--surface-hover);
}

.watchlist-item.selected,
.watchlist-item[aria-current="true"] {
  background: var(--surface-active);
  box-shadow: inset -2px 0 var(--selection);
}

.watchlist-item[data-record-type="task"] {
  background: transparent;
}

.watchlist-item[data-record-type="task"].selected,
.watchlist-item[data-record-type="task"][aria-current="true"] {
  background: var(--surface-active);
}

.watchlist-item[data-record-type="task"] .watchlist-title {
  color: var(--text-secondary);
}

.watchlist-item[data-record-type="task"] .watchlist-headline::before {
  content: "Verification · ";
  color: var(--text-secondary);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.status-rail {
  width: 3px;
  min-height: 100%;
  background: var(--quiet);
}

.status-rail.stable { background: var(--status-stable); }
.status-rail.watch { background: var(--amber); }
.status-rail.constrained { background: var(--status-constrained); }
.status-rail.disrupted { background: var(--red); }
.status-rail.verification { background: var(--status-verification); }

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

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

.watchlist-title {
  min-width: 0;
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--type-utility);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watchlist-title {
  color: var(--text-secondary);
  font-weight: var(--weight-semibold);
}

.watchlist-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--type-utility);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.watchlist-headline {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
  line-height: 1.27;
}

.watchlist-detail {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.24;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: var(--type-control);
  cursor: pointer;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  font-size: var(--type-control);
  text-align: center;
}

.empty-state strong {
  color: var(--text-secondary);
  font-size: var(--type-body);
}

.mobile-surface-tabs {
  display: none;
}

/* Map ------------------------------------------------------------------- */

.map-heading-actions,
.timeline-title-wrap,
.timeline-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.segmented {
  display: inline-flex;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: transparent;
}

.segmented button {
  min-width: 48px;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: color var(--fast), background var(--fast);
}

.segmented button:first-child {
  border-left: 0;
}

.segmented button:hover {
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.segmented button.active,
.segmented button[aria-pressed="true"] {
  background: var(--surface-active);
  color: var(--text);
}

.segmented.compact button {
  min-width: 58px;
}

.layer-toggle {
  min-height: 32px;
  padding: 0 9px;
  font-size: var(--type-control);
}

.layer-toggle.active,
.layer-toggle[aria-pressed="true"] {
  border-color: var(--rule-strong);
  background: var(--surface-active);
  color: var(--text);
}

.map-view-toggle {
  background: var(--surface-active);
  color: var(--text);
}

.map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #f4f5f3;
}

#network-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}

#network-map:active {
  cursor: grabbing;
}

.ocean {
  fill: #f4f5f3;
}

.graticule {
  fill: none;
  stroke: #d2d8d4;
  stroke-width: .55;
  stroke-opacity: .62;
  vector-effect: non-scaling-stroke;
}

.land {
  fill: #e3e7e3;
  stroke: #aeb7b2;
  stroke-width: .55;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.land-layer,
.region-label-layer {
  pointer-events: none;
}

.region-label,
.water-label,
.corridor-label,
.hub-label,
.hub-id-label,
.movement-label,
.change-callout .callout-kicker,
.change-callout .callout-label {
  font-size: var(--type-utility);
  paint-order: stroke;
  stroke: #f4f5f3;
  stroke-width: 2.5px;
  stroke-linejoin: round;
  pointer-events: none;
}

.region-label {
  fill: #59656b;
  font-family: var(--sans);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.water-label {
  fill: #606b70;
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: var(--tracking-caps);
}

.corridor-label,
.hub-id-label,
.movement-label,
.change-callout .callout-kicker {
  font-family: var(--mono);
}

.corridor-label {
  fill: #5f6a70;
  font-weight: var(--weight-semibold);
}

.hub-label {
  fill: #273136;
  font-family: var(--sans);
  font-weight: var(--weight-semibold);
  font-size: 11.5px;
}

.hub-id-label {
  fill: #667178;
  font-weight: var(--weight-medium);
}

.movement-label {
  fill: #171c1f;
  font-weight: var(--weight-bold);
}

.corridor-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
}

.corridor-hit:focus-visible {
  outline: none;
  stroke: rgba(30, 75, 99, .28);
  stroke-width: 6px;
}

.corridor-base {
  fill: none;
  stroke: #727e83;
  stroke-width: 1.25px;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  opacity: .72;
  vector-effect: non-scaling-stroke;
  transition: opacity var(--medium), stroke var(--medium);
}

.corridor-base.status-stable { stroke: #727e83; }
.corridor-base.status-watch {
  stroke: var(--amber);
  stroke-width: 1.45px;
  stroke-dasharray: 6 3;
}
.corridor-base.status-constrained { stroke: #485156; stroke-width: 1.7px; }
.corridor-base.status-disrupted { stroke: var(--red); stroke-width: 2px; }
.corridor-base.limited { stroke-dasharray: 1 4; }
.corridor-base.related-corridor {
  stroke: #526168;
  stroke-width: 1.55px;
  opacity: .78 !important;
}

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

.corridor-selection {
  fill: none;
  stroke: rgba(255, 255, 255, .96);
  stroke-width: 6px;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.corridor-primary,
.scenario-route {
  fill: none;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.corridor-primary.selected-corridor {
  stroke: var(--blue-strong);
  stroke-width: 2.8px;
  stroke-dasharray: none;
  opacity: 1;
}

.scenario-route.scenario-current-corridor {
  stroke: #3f494e;
  stroke-width: 2.2px;
}

.scenario-route.scenario-alternate-corridor {
  stroke: var(--blue);
  stroke-width: 2.6px;
  stroke-dasharray: 7 3;
}

[data-plan-state="applied"] .scenario-route.scenario-alternate-corridor {
  stroke-dasharray: none;
}

.selected-direction {
  fill: var(--blue-strong);
  opacity: 1;
}

.hub,
.movement {
  cursor: pointer;
  transition: opacity var(--medium);
}

.hub:focus-visible,
.movement:focus-visible {
  outline: none;
}

.hub:focus-visible .hub-core,
.movement:focus-visible .movement-shape {
  stroke: var(--blue);
  stroke-width: 2.4px;
}

.hub { opacity: .9; }
.hub.selected { opacity: 1; }
.hub.related { opacity: .8; }
.movement { opacity: .82; }
.movement.selected { opacity: 1; }
.movement.related { opacity: .72; }

.focus-mode .corridor-base.context-dim { opacity: .12 !important; }
.focus-mode .corridor-base.primary-backbone {
  stroke: #879196;
  stroke-width: 1.1px;
  opacity: .26 !important;
}
.focus-mode .hub.context-dim { opacity: .14; }
.focus-mode .movement.context-dim { display: none; }
.focus-mode .hub.context-dim .capacity-track,
.focus-mode .hub.context-dim .capacity-value,
.focus-mode .hub.context-dim .hub-status-dot { display: none; }

.theater-mode .corridor-base.context-dim { opacity: .42 !important; }
.theater-mode .hub.context-dim { opacity: .48; }
.theater-mode .movement.context-dim { opacity: .32; }

.scenario-mode .corridor-base.context-dim { opacity: .08 !important; }
.scenario-mode .hub.context-dim { opacity: .12; }
.scenario-mode .movement.context-dim { display: none; }

.selected-label,
.related-label { opacity: 1; }
.context-label { opacity: .44; }
.focus-mode .context-label { opacity: .18; }
.theater-mode .context-label { opacity: 1; }

.capacity-track {
  fill: none;
  stroke: #c4cbc8;
  stroke-width: 2.4px;
  vector-effect: non-scaling-stroke;
}

.capacity-value {
  fill: none;
  stroke-width: 2.4px;
  stroke-linecap: butt;
  vector-effect: non-scaling-stroke;
}

.capacity-value.stable { stroke: var(--status-stable); }
.capacity-value.watch { stroke: var(--amber); stroke-dasharray: 2 1; }
.capacity-value.constrained { stroke: var(--status-constrained); }
.capacity-value.disrupted { stroke: var(--red); }

.hub-core {
  fill: #fff;
  stroke: #4f5a5f;
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}

.hub-core.port { rx: 50%; }
.hub-core.selected { stroke: var(--blue); }

.selection-halo,
.movement-halo {
  fill: none;
  stroke: var(--blue);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.hub-status-dot {
  stroke: #fff;
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.map-root.layer-capacity .hub-status-dot { opacity: 0; }
.map-root.layer-movement .capacity-track,
.map-root.layer-movement .capacity-value { opacity: .2 !important; }

.fill-stable { fill: var(--status-stable); }
.fill-watch { fill: var(--amber); }
.fill-constrained { fill: var(--status-constrained); }
.fill-disrupted { fill: var(--red); }
.fill-verification { fill: var(--status-verification); }

.movement-shape {
  fill: #5b666b;
  stroke: #fff;
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}

.movement.status-watch .movement-shape { fill: var(--amber); }
.movement.status-constrained .movement-shape { fill: var(--status-constrained); }
.movement.status-disrupted .movement-shape { fill: var(--red); }
.movement.selected .movement-shape {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 1.8px;
}

.change-callout line {
  stroke: #707a7f;
  stroke-width: 1px;
  vector-effect: non-scaling-stroke;
}

.change-callout .callout-kicker {
  fill: var(--blue);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
}

.change-callout .callout-label {
  fill: var(--text-secondary);
  font-family: var(--sans);
}

.map-key {
  position: absolute;
  z-index: 12;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #465258;
  font-size: var(--type-utility);
  font-weight: var(--weight-medium);
}

.map-key span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.key-line {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 1.5px solid var(--quiet);
  background: transparent;
}

.key-line.stable { border-top-color: #727e83; }
.key-line.watch {
  border-top: 2px dashed var(--amber);
}
.key-line.constrained { border-top: 2px solid var(--status-constrained); }
.key-line.disrupted { border-top: 2px solid var(--status-disrupted); }
.key-line.limited {
  border-top: 1px dotted var(--muted);
}
.key-line.selected { border-top: 3px solid var(--blue-strong); }
.key-line.related { border-top: 2px solid #526168; }
.key-line.context { border-top: 1px solid #aeb7b2; }
.key-line.current { border-top: 2px solid #3f494e; }
.key-line.proposed { border-top: 2px dashed var(--blue); }

.map-controls {
  position: absolute;
  z-index: 13;
  top: 10px;
  right: 10px;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
}

.map-controls button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.map-controls button:first-child {
  border-top: 0;
}

.map-controls button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.map-controls svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.map-tooltip {
  position: absolute;
  z-index: 30;
  max-width: 230px;
  padding: 8px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: rgba(255, 255, 255, .98);
  color: var(--text-secondary);
  font-size: var(--type-control);
  pointer-events: none;
}

.map-tooltip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
}

.map-tooltip span {
  color: var(--muted);
}

/* Causal strip ---------------------------------------------------------- */

.causal-chain-strip {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 6px;
  max-height: 140px;
  padding: 8px 11px 9px;
  overflow-x: auto;
  overflow-y: auto;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-radius: 0;
  background: rgba(247, 248, 246, .98);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.causal-chain-strip:empty,
.causal-chain-strip[hidden] {
  display: none;
}

.causal-chain-header {
  min-width: max-content;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.causal-chain-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.causal-chain-header strong {
  color: var(--text-secondary);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
}

.causal-chain-rows {
  display: grid;
  gap: 5px;
}

.causal-chain-row {
  min-width: max-content;
  display: grid;
  grid-template-columns: 68px minmax(max-content, 1fr);
  align-items: center;
  gap: 8px;
}

.causal-chain-row + .causal-chain-row {
  padding-top: 5px;
  border-top: 1px solid var(--rule);
}

.causal-chain-row.current { --chain-accent: var(--text-secondary); }
.causal-chain-row.recommended { --chain-accent: var(--blue); }

.chain-row-label {
  color: var(--chain-accent, var(--muted));
  font-family: var(--mono);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.causal-steps {
  min-width: max-content;
  display: flex;
  flex: 1 0 auto;
  align-items: stretch;
}

.causal-step {
  min-width: 112px;
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  text-align: center;
  white-space: normal;
}

.causal-step.failure-point {
  border-bottom-color: var(--amber);
  background: transparent;
  color: var(--text);
}

.causal-step.decision-point {
  border-bottom-color: var(--blue);
  background: transparent;
  color: var(--text);
}

.causal-arrow {
  align-self: center;
  flex: 0 0 20px;
  color: var(--chain-accent, var(--rule-strong));
  font-family: var(--mono);
  font-size: var(--type-body);
  font-style: normal;
  text-align: center;
}

/* Inspector ------------------------------------------------------------- */

.inspector {
  min-height: 100%;
}

.inspector-top {
  padding: 11px 12px 10px;
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

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

.inspector-id {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
}

.status-pill {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill { color: var(--text-secondary); }
.status-pill.stable::before { background: var(--status-stable); }
.status-pill.watch::before { background: var(--amber); }
.status-pill.constrained::before { background: var(--status-constrained); }
.status-pill.disrupted::before { background: var(--red); }
.status-pill.verification::before { background: var(--status-verification); }

.inspector-title {
  margin: 7px 0 0;
  color: var(--text);
  font-size: var(--type-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  line-height: 1.16;
}

.inspector-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: var(--type-control);
}

.inspector-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-top: 10px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.inspector-metric {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px 7px;
  border: 0;
  border-left: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}

.inspector-metric:first-child {
  border-left: 0;
}

.inspector-metric strong {
  order: 2;
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  line-height: 1.2;
}

.inspector-metric span {
  order: 1;
  display: block;
  margin-top: 0;
  color: var(--quiet);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}

.inspector-timing {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-utility);
}

.inspector-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--rule);
}

.inspector-action {
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: color var(--fast), background var(--fast), border-color var(--fast);
}

.inspector-action:hover {
  border-color: var(--rule-strong);
  background: var(--surface-hover);
  color: var(--text);
}

.inspector-action.primary,
.inspector-action.active,
.inspector-action[aria-pressed="true"] {
  border-color: var(--rule-strong);
  background: var(--surface-active);
  color: var(--text);
}

.inspector-action.completed {
  border-color: var(--rule);
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.inspector-section {
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
}

.inspector-section:last-child {
  border-bottom: 0;
}

.inspector-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--text-secondary);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.inspector-section h3 span {
  color: var(--quiet);
  font-family: var(--mono);
  font-size: var(--type-utility);
  font-weight: var(--weight-medium);
  letter-spacing: 0;
  text-transform: none;
}

.assessment-copy {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body);
  line-height: 1.48;
}

.task-target {
  margin: 9px 0 0;
  padding: 7px 0 0 10px;
  border-top: 1px solid var(--rule);
  border-left: 2px solid var(--rule-strong);
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.4;
}

.impact-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.impact-list li {
  position: relative;
  padding-left: 13px;
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.38;
}

.impact-list li::before {
  content: "";
  position: absolute;
  top: .56em;
  left: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--quiet);
}

.dependency-chain {
  display: grid;
  gap: 0;
}

.dependency-step {
  position: relative;
  min-height: 38px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
}

.dependency-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 14px;
  bottom: -2px;
  left: 5px;
  width: 1px;
  background: var(--rule-strong);
}

.dependency-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  margin-top: 2px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--quiet);
  outline: 1px solid var(--rule-strong);
}

.dependency-dot.stable { background: var(--status-stable); }
.dependency-dot.watch { background: var(--amber); }
.dependency-dot.constrained { background: var(--status-constrained); }
.dependency-dot.disrupted { background: var(--red); }
.dependency-dot.verification { background: var(--status-verification); }

.dependency-copy button,
.dependency-static {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
}

.dependency-copy button {
  cursor: pointer;
}

.dependency-copy button:hover {
  color: var(--blue);
}

.dependency-copy span {
  display: block;
  margin-top: 1px;
  color: var(--quiet);
  font-size: var(--type-utility);
}

/* Scenario comparison --------------------------------------------------- */

.scenario-comparison {
  margin: 0;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}

.scenario-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 8px;
}

.scenario-heading > div {
  color: var(--text);
  font-size: var(--type-body);
  font-weight: var(--weight-semibold);
}

.scenario-subheading {
  margin: 9px 0 4px;
  color: var(--muted);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.scenario-subheading:first-of-type {
  margin-top: 0;
}

.scenario-subheading.outcome {
  padding-top: 8px;
  border-top: 1px solid var(--rule);
}

.scenario-table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: collapse;
  color: var(--text-secondary);
  font-size: var(--type-control);
}

.scenario-table th,
.scenario-table td {
  padding: 6px 5px;
  border-top: 1px solid var(--rule);
  line-height: 1.28;
  text-align: right;
  vertical-align: middle;
}

.scenario-table thead th {
  padding-top: 3px;
  border-top: 0;
  color: var(--muted);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.scenario-table th:first-child,
.scenario-table td:first-child {
  width: 42%;
  padding-left: 0;
  color: var(--muted);
  text-align: left;
}

.scenario-table th:last-child,
.scenario-table td:last-child {
  padding-right: 0;
}

.scenario-table tbody td:not(:first-child) {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.scenario-table .scenario-current {
  color: var(--muted);
}

.scenario-table .scenario-recommended,
.scenario-table .recommended-cell,
.scenario-table tbody td:last-child {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.scenario-table.record-comparison tbody td:last-child {
  color: var(--text-secondary);
  font-weight: var(--weight-medium);
}

.confidence-copy {
  margin: 0;
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.45;
}

.details-block {
  border: 0;
}

.details-block summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-secondary);
  font-size: var(--type-control);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  list-style: none;
}

.details-block summary::-webkit-details-marker {
  display: none;
}

.details-block summary::after {
  content: "+";
  color: var(--muted);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: var(--weight-regular);
}

.details-block[open] summary::after {
  content: "−";
}

.record-notes-body {
  display: grid;
  gap: 9px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--rule);
}

.evidence-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border-top: 1px solid var(--rule);
}

.evidence-item {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
}

.evidence-item-top {
  display: flex;
  justify-content: space-between;
  gap: 7px;
  color: var(--quiet);
  font-family: var(--mono);
  font-size: var(--type-utility);
}

.evidence-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.42;
}

.evidence-item.restricted p {
  font-style: italic;
}

.governance-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.governance-grid dt,
.governance-grid dd {
  font-size: var(--type-utility);
}

.governance-grid dt {
  color: var(--quiet);
}

.governance-grid dd {
  margin: 0;
  color: var(--text-secondary);
  text-align: right;
}

/* Timeline -------------------------------------------------------------- */

.timeline-drawer {
  min-height: 136px;
  height: 136px;
  overflow: hidden;
  border: 0;
  border-top: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface);
  transition: min-height var(--medium), height var(--medium);
}

.timeline-drawer.collapsed {
  min-height: 42px;
  height: 42px;
}

.timeline-drawer.collapsed .timeline-events {
  display: none;
}

.timeline-drawer.collapsed .timeline-controls .segmented {
  display: none;
}

.timeline-drawer.collapsed .timeline-toggle svg {
  transform: rotate(180deg);
}

.timeline-header {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 8px 5px 11px;
  border-bottom: 1px solid var(--rule);
}

.timeline-title-wrap .timeline-context {
  margin-left: 4px;
}

.timeline-scope {
  border-color: var(--rule);
}

.timeline-scope button {
  min-width: 62px;
}

.timeline-scope button.active,
.timeline-scope button[aria-pressed="true"] {
  background: var(--surface-active);
  color: var(--text);
}

.timeline-toggle {
  min-height: 30px;
  width: 30px;
}

.timeline-toggle svg {
  transition: transform var(--medium);
}

.timeline-events {
  position: relative;
  min-height: 95px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 1fr);
  gap: 0;
  overflow-x: auto;
  padding: 8px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.timeline-event {
  position: relative;
  min-width: 0;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.timeline-event:last-child {
  border-right: 0;
}

.timeline-event:hover {
  background: var(--surface-hover);
}

.timeline-event.selected-record {
  background: var(--surface-active);
  box-shadow: inset 0 -2px var(--selection);
}

.event-top {
  position: relative;
  min-height: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--type-utility);
}

.event-dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--quiet);
  outline: 1px solid var(--rule-strong);
}

.event-dot.review,
.event-dot.corroboration { background: var(--status-stable); }
.event-dot.eta_change,
.event-dot.capacity_change,
.event-dot.transfer_change,
.event-dot.decision_due,
.event-dot.verification_due { background: var(--amber); }
.event-dot.disruption { background: var(--red); }
.event-dot.reconciliation { background: var(--blue); }
.event-dot.route_change,
.event-dot.route_option,
.event-dot.plan_change { background: var(--blue); }

.timeline-event.future-event .event-top {
  color: var(--caution-text);
}

.timeline-event.future-event .event-dot {
  background: var(--surface);
  outline-color: var(--amber);
}

.event-record {
  margin-left: auto;
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  white-space: nowrap;
}

.timeline-summary {
  display: -webkit-box;
  margin-top: 1px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--type-control);
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.timeline-event:hover .timeline-summary {
  color: var(--text-secondary);
}

.timeline-empty {
  grid-column: 1 / -1;
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 10px;
  color: var(--muted);
  font-size: var(--type-control);
  text-align: center;
}

/* Feedback and briefing ------------------------------------------------- */

.toast {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  max-width: 360px;
  padding: 10px 13px;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--blue);
  border-radius: 0;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: var(--type-control);
}

.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--red); }

.briefing-modal {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: auto;
  background: rgba(23, 28, 31, .42);
}

.briefing-dialog {
  position: relative;
  width: min(900px, calc(100vw - 44px));
  max-height: min(700px, calc(100dvh - 44px));
  overflow: auto;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  background: var(--surface-raised);
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
}

.briefing-header {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-raised);
}

.briefing-header h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-size: var(--type-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
}

.briefing-header .icon-button {
  flex: 0 0 auto;
  line-height: 1;
}

.briefing-body {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr);
  gap: 18px;
  padding: 16px;
}

.briefing-narrative {
  min-width: 0;
}

.briefing-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0;
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--type-utility);
  font-weight: var(--weight-semibold);
}

.briefing-status.outdated {
  color: var(--caution-text);
}

.briefing-section {
  padding: 11px 0;
  border-top: 1px solid var(--rule);
}

.briefing-section:first-of-type {
  margin-top: 8px;
}

.briefing-section h3 {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--type-utility);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
}

.briefing-section p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--type-body);
  line-height: 1.5;
}

.briefing-section p + p {
  margin-top: 7px;
}

.briefing-section p.briefing-governance {
  padding-top: 7px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: var(--type-utility);
  line-height: 1.4;
}

.briefing-map-preview {
  position: relative;
  min-height: 230px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: #eef1ef;
}

.briefing-map-preview img,
.briefing-map-preview svg,
.briefing-map-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
}

.briefing-map-preview figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 6px 8px;
  border-top: 1px solid var(--rule);
  background: rgba(255, 255, 255, .94);
  color: var(--muted);
  font-size: var(--type-utility);
  text-align: right;
}

.briefing-footer {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--rule);
  background: var(--surface-raised);
}

.briefing-footer > span {
  color: var(--quiet);
  font-size: var(--type-utility);
}

.briefing-footer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* Responsive ------------------------------------------------------------ */

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 244px minmax(0, 1fr) 306px;
  }

  .assessment-strip,
  .decision-brief {
    grid-template-columns: minmax(0, 1.18fr) minmax(540px, .92fr);
  }

  .assessment-lead,
  .decision-lead {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 12px;
  }

  .decision-actions {
    width: 230px;
  }

  .header-badges .badge-neutral {
    display: none;
  }

}

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

  .app-shell {
    grid-template-rows: auto auto auto minmax(500px, auto) auto;
    height: auto;
    min-height: 100dvh;
    padding: 0 12px 12px;
  }

  .topbar {
    min-height: 60px;
  }

  .assessment-strip,
  .decision-brief {
    grid-template-columns: minmax(0, 1fr);
  }

  .metrics-grid,
  .decision-values {
    min-height: 0;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .mobile-surface-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--rule);
    background: var(--surface);
  }

  .mobile-surface-tabs button {
    min-height: 40px;
    padding: 0 12px;
    border: 0;
    border-left: 1px solid var(--rule);
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: var(--type-control);
    font-weight: var(--weight-semibold);
    cursor: pointer;
  }

  .mobile-surface-tabs button:first-child {
    border-left: 0;
  }

  .mobile-surface-tabs button[aria-selected="true"] {
    border-bottom-color: var(--blue);
    background: var(--surface-active);
    color: var(--text);
  }

  .workspace {
    display: block;
    min-height: clamp(500px, 62vh, 620px);
  }

  .workspace [data-surface] {
    height: clamp(500px, 62vh, 620px);
    border: 0;
  }

  .workspace[data-mobile-active="map"] [data-surface]:not([data-surface="map"]),
  .workspace[data-mobile-active="watchlist"] [data-surface]:not([data-surface="watchlist"]),
  .workspace[data-mobile-active="inspector"] [data-surface]:not([data-surface="inspector"]) {
    display: none;
  }

  .timeline-drawer {
    min-height: 136px;
    height: 136px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0 8px 8px;
  }

  .topbar {
    display: grid;
    gap: 8px;
    padding: 8px 0;
  }

  .brand-lockup p {
    display: none;
  }

  .topbar-meta {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 10px;
  }

  .as-of {
    grid-row: 1;
    grid-column: 1;
    padding-right: 0;
    border-right: 0;
  }

  .header-actions {
    grid-row: 1;
    grid-column: 2;
  }

  .header-badges {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .header-badges .badge-neutral {
    display: none;
  }

  .assessment-lead,
  .decision-lead {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 12px 10px 11px;
  }

  .decision-actions {
    width: 100%;
  }

  .decision-button {
    min-height: 40px;
  }

  .decision-fact-table {
    min-width: 540px;
  }

  .workspace,
  .workspace [data-surface] {
    min-height: clamp(480px, 66vh, 560px);
    height: clamp(480px, 66vh, 560px);
  }

  .panel-heading,
  .map-heading {
    min-height: 48px;
  }

  .map-heading-actions {
    gap: 5px;
  }

  .segmented.compact button {
    min-width: 53px;
    padding-inline: 7px;
  }

  .layer-toggle {
    padding-inline: 7px;
  }

  .map-key {
    max-width: calc(100% - 56px);
    overflow-x: auto;
  }

  .causal-chain-strip {
    max-height: 154px;
    padding-inline: 8px;
  }

  .causal-chain-row {
    grid-template-columns: 58px minmax(max-content, 1fr);
    gap: 6px;
  }

  .causal-step {
    min-width: 118px;
  }

  .inspector-action {
    min-height: 40px;
  }

  .scenario-comparison {
    padding-inline: 10px;
  }

  .timeline-drawer {
    min-height: 178px;
    height: 178px;
  }

  .timeline-drawer.collapsed {
    min-height: 42px;
    height: 42px;
  }

  .timeline-header {
    min-height: 77px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 6px;
    padding: 7px 8px;
  }

  .timeline-controls {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 1px;
  }

  .timeline-drawer.collapsed .timeline-header {
    min-height: 41px;
    display: flex;
    padding: 5px 8px 5px 10px;
  }

  .timeline-drawer.collapsed .timeline-controls {
    width: auto;
    margin-left: auto;
    overflow: visible;
    padding-bottom: 0;
  }

  .timeline-events {
    grid-auto-columns: minmax(180px, 72vw);
    min-height: 101px;
  }

  .briefing-modal {
    align-items: end;
    padding: 8px;
  }

  .briefing-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
  }

  .briefing-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .briefing-header,
  .briefing-footer {
    padding-inline: 13px;
  }

  .briefing-map-preview,
  .briefing-map-preview img,
  .briefing-map-preview svg,
  .briefing-map-preview canvas {
    min-height: 190px;
  }

  .briefing-footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .briefing-footer-actions {
    margin-left: auto;
  }
}

@media (max-width: 420px) {
  .decision-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .decision-button.primary {
    grid-column: auto;
  }

  .map-heading-actions .layer-toggle {
    min-width: 54px;
    padding-inline: 7px;
  }

  .briefing-footer {
    display: grid;
  }

  .briefing-footer-actions {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    margin-left: 0;
  }
}

@media (max-height: 820px) and (min-width: 1180px) {
  .app-shell {
    padding-bottom: 9px;
  }

  .topbar {
    min-height: 52px;
  }

  .assessment-strip,
  .decision-brief {
    min-height: 92px;
  }

  .assessment-lead,
  .decision-lead {
    padding-block: 8px 7px;
  }

  .timeline-drawer {
    min-height: 136px;
    height: 136px;
  }

  .watchlist-item {
    min-height: 63px;
    padding-block: 7px;
  }
}

@media (max-height: 639px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
  }
}

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