/* ============================================================================
   VISA RUNWAY — 70/20/10 Color Architecture & Aviation HUD
   70% Neutral Base: Clean canvas, borders, and negative space (un-tinted).
   20% Neutral Structure: Crisp card surfaces, dark departures gate, and ink.
   10% Standalone Accent: Pure focal pop (countdown, runway beacon, primary CTA).
   The accent never influences or tints the 70% canvas or 20% surfaces.
   ========================================================================== */

/* ---- tokens ---- */
:root {
  color-scheme: light dark;

  /* Typography */
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* 70% Pure Neutral Canvas Foundation (Strictly Monochromatic R=G=B, Zero Tint) */
  --bg: light-dark(#f6f6f6, #121212);
  --bg-gradient: none;
  --line: light-dark(#e2e2e2, #2c2c2c);
  --line-subtle: light-dark(#ededed, #1f1f1f);
  --soft: light-dark(#ececec, #202020);

  /* 20% Pure Neutral Structural Surfaces & Typography (Zero Tint) */
  --surface: light-dark(#ffffff, #181818);
  --surface-raised: light-dark(#fafafa, #222222);
  --surface-hover: light-dark(#f0f0f0, #282828);
  --ink: light-dark(#141414, #f0f0f0);
  --ink-heading: light-dark(#000000, #ffffff);
  --muted: light-dark(#666666, #8c8c8c);
  --muted-light: light-dark(#8c8c8c, #666666);

  /* Departures Gate (Neutral Monochromatic Carbon Terminal) */
  --gate: #151515;
  --gate-surface: #202020;
  --gate-ink: #f5f5f5;
  --gate-muted: #999999;
  --gate-line: #2e2e2e;

  /* 10% Standalone Signal Accent (Precision Emerald Green — Strictly Standalone & High Contrast) */
  --accent: light-dark(#047857, #10b981);
  --accent-bright: light-dark(#065f46, #34d399);
  --accent-soft: light-dark(rgba(4, 120, 87, 0.08), rgba(16, 185, 129, 0.14));
  --accent-border: light-dark(rgba(4, 120, 87, 0.25), rgba(16, 185, 129, 0.3));
  --accent-glow: light-dark(rgba(4, 120, 87, 0.18), rgba(16, 185, 129, 0.3));
  --on-accent: light-dark(#ffffff, #0a0a0c);
  --gate-signal: #10b981;
  --gate-signal-glow: rgba(16, 185, 129, 0.3);

  /* Semantic Alerts */
  --warn: light-dark(#c2410c, #fb923c);
  --warn-bg: light-dark(#fff7ed, #2b170c);
  --warn-line: light-dark(#fed7aa, #552a14);
  --danger: light-dark(#b91c1c, #f87171);
  --danger-bg: light-dark(#fef2f2, #2c1215);
  --danger-line: light-dark(#fecaca, #521c21);
  --success: light-dark(#047857, #34d399);
  --success-bg: light-dark(#ecfdf5, #08281d);
  --success-line: light-dark(#a7f3d0, #0f513a);

  /* Architectural Geometry & Precision Hairlines (Zero Rounded Corners, Zero Shadows) */
  --radius: 0px;
  --radius-sm: 0px;
  --card-shadow: none;
  --pass-shadow: none;
  --gate-shadow: none;
}

/* Explicit Light Mode Override (Strictly Neutral 70% & 20% + WCAG AA Accessible Emerald #047857) */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f6f6;
  --bg-gradient: none;
  --line: #e2e2e2;
  --line-subtle: #ededed;
  --soft: #ececec;
  --surface: #ffffff;
  --surface-raised: #fafafa;
  --surface-hover: #f0f0f0;
  --ink: #141414;
  --ink-heading: #000000;
  --muted: #666666;
  --muted-light: #8c8c8c;
  --accent: #047857;
  --accent-bright: #065f46;
  --accent-soft: rgba(4, 120, 87, 0.08);
  --accent-border: rgba(4, 120, 87, 0.25);
  --accent-glow: rgba(4, 120, 87, 0.18);
  --on-accent: #ffffff;
  --gate: #151515;
  --gate-surface: #222222;
  --gate-ink: #f5f5f5;
  --gate-muted: #999999;
  --gate-line: #2e2e2e;
  --gate-signal: #10b981;
  --gate-signal-glow: rgba(16, 185, 129, 0.3);
  --card-shadow: none;
  --pass-shadow: none;
  --gate-shadow: none;
}

/* Explicit Dark Mode Override (Strictly Neutral 70% & 20% + WCAG AAA Accessible Signal Emerald #10b981) */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --bg-gradient: none;
  --line: #2c2c2c;
  --line-subtle: #1f1f1f;
  --soft: #202020;
  --surface: #181818;
  --surface-raised: #222222;
  --surface-hover: #282828;
  --ink: #f0f0f0;
  --ink-heading: #ffffff;
  --muted: #8c8c8c;
  --muted-light: #666666;
  --accent: #10b981;
  --accent-bright: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --accent-border: rgba(16, 185, 129, 0.3);
  --accent-glow: rgba(16, 185, 129, 0.3);
  --on-accent: #0a0a0c;
  --gate: #151515;
  --gate-surface: #202020;
  --gate-ink: #f5f5f5;
  --gate-muted: #999999;
  --gate-line: #2e2e2e;
  --gate-signal: #10b981;
  --gate-signal-glow: rgba(16, 185, 129, 0.3);
  --card-shadow: none;
  --pass-shadow: none;
  --gate-shadow: none;
}

/* ---- base ---- */
* { box-sizing: border-box; }
html { scroll-padding-top: 104px; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 15px/1.55 var(--sans);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
  transition: background-color .2s ease, color .2s ease;
}

button, input, select, textarea { font: inherit; }
button, a, summary { touch-action: manipulation; }
button, summary { cursor: pointer; }
a { color: var(--accent); text-underline-offset: 3px; transition: color .15s ease; }
a:hover { color: var(--accent-bright); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--ink-heading); }
h1 { font-size: 32px; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
strong { font-weight: 600; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: 1060px;
  margin: auto;
  padding: 0 20px;
}
.muted { color: var(--muted); font-size: 14px; }
.skip {
  position: absolute;
  left: 20px;
  top: -120px;
  z-index: 50;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  box-shadow: var(--card-shadow);
  transition: top .2s ease;
}
.skip:focus { top: 16px; }

/* HUD / Departures Board Monospace Labels */
.eyebrow, .facts dt, .field label, .rule-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
time, .date-label, .countdown, .authorization-countdown {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.date-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.countdown {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.countdown.due { color: var(--warn); }

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background-color .2s ease, border-color .2s ease;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding-top: 6px;
  padding-bottom: 6px;
}
.header-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink-heading);
  font: 700 15px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
/* Architectural Runway Brand Mark */
.brand-runway {
  display: inline-block;
  width: 20px;
  height: 10px;
  border-radius: 0;
  background:
    linear-gradient(90deg, var(--bg) 0 2px, transparent 2px 5px, var(--bg) 5px 7px, transparent 7px 10px, var(--bg) 10px 12px, transparent 12px 15px, var(--bg) 15px 17px, transparent 17px) center/20px 2px no-repeat,
    linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  box-shadow: none;
}
.brand-tag {
  font: 700 9px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 3px 6px;
  border-radius: 0;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav {
  display: flex;
  gap: 2px;
  align-items: center;
}
.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  text-decoration: none;
  color: var(--muted);
  font: 600 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  transition: all .15s ease;
}
.nav a:hover {
  color: var(--ink-heading);
  background: var(--surface-hover);
}
.nav a[aria-current="location"] {
  color: var(--ink-heading);
  background: transparent;
  border-bottom-color: var(--accent);
  box-shadow: none;
}

/* Theme Switcher Architectural Toggle */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0;
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s ease;
}
.theme-btn:hover {
  color: var(--ink-heading);
  background: var(--surface-hover);
}
.theme-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 1;
}
.theme-btn.active {
  background: var(--ink-heading);
  color: var(--bg);
  box-shadow: none;
}

/* ---- Today ---- */
main.wrap {
  padding-top: 28px;
  padding-bottom: 36px;
}
.today {
  display: grid;
  gap: 24px;
}
.today-col {
  display: contents;
}
.position { order: 1; }
.action-area { order: 2; }
.constraint { order: 3; }
.today .upcoming { order: 4; }

/* Position: Architectural Flight Authorization Ledger */
.position {
  position: relative;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  transition: border-color .15s ease;
  overflow: visible;
}
.position::after {
  content: "+";
  position: absolute;
  top: -7px;
  right: -5px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  color: var(--muted-light);
  pointer-events: none;
}
.pass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.pass-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pass-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--soft);
  padding: 3px 6px;
  border-radius: 0;
  border: 1px solid var(--line);
}
.pass-subtag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
/* Authentic CSS Barcode Pattern */
.pass-barcode {
  width: 68px;
  height: 18px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0 2px,
    transparent 2px 4px,
    var(--ink) 4px 7px,
    transparent 7px 8px,
    var(--ink) 8px 10px,
    transparent 10px 13px,
    var(--ink) 13px 14px,
    transparent 14px 17px,
    var(--ink) 17px 20px,
    transparent 20px 22px
  );
  opacity: 0.6;
  border-radius: 0;
}
.position h1 {
  margin: 4px 0 0;
  font: 700 52px/1 var(--mono);
  letter-spacing: -.04em;
  text-transform: uppercase;
  color: var(--ink-heading);
}

/* Monolithic Architectural Countdown */
.authorization-countdown {
  position: relative;
  margin: 22px -28px 0;
  padding: 22px 28px 0;
  border-top: 1px solid var(--line);
  font: 700 42px/1 var(--mono);
  color: var(--accent);
  letter-spacing: -.04em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.authorization-countdown::before {
  content: "T-MINUS // RUNWAY METRIC";
  position: absolute;
  top: -8px;
  left: 28px;
  background: var(--surface);
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted);
}
.position .muted {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Next Action: Architectural Departures Terminal */
.action-card {
  --bg: var(--gate);
  --ink: var(--gate-ink);
  --muted: var(--gate-muted);
  --line: var(--gate-line);
  --accent: var(--gate-signal);
  --surface: var(--gate-surface);
  --soft: var(--gate-surface);
  --on-accent: #0a0a0c;
  padding: 26px 28px;
  background: var(--gate);
  color: var(--ink);
  border-radius: 0;
  border: 1px solid var(--gate-line);
  border-top: 3px solid var(--accent);
  box-shadow: none;
  position: relative;
}
.action-card::before {
  content: "LOC // GATE_01";
  position: absolute;
  top: -8px;
  right: 24px;
  background: var(--gate);
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--gate-muted);
}
.action-card h2 {
  margin-top: 12px;
  font-size: 24px;
  font-weight: 600;
  color: var(--gate-ink);
}
.action-card .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--gate-line);
  padding: 3px 8px;
  border-radius: 0;
  letter-spacing: .14em;
  font-size: 10px;
}
.action-card .reason {
  margin: 16px 0 20px;
  max-width: 65ch;
  color: var(--gate-muted);
  font-size: 14px;
  line-height: 1.6;
}
.action-card.urgent {
  --accent: #ff7849;
  border-top-color: #ff7849;
}
.urgent-label { color: var(--accent) !important; }
.timing {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}
.timing .date-stamp {
  justify-content: flex-start;
  align-items: flex-start;
}
.timing .date-label { font-size: 14px; color: var(--gate-ink); font-weight: 500; }
.timing .countdown { text-align: left; }
.timing .date-stamp > .countdown { text-align: left; }
.timing .countdown.due { color: var(--accent); }
.next-detail {
  border-top: 1px solid var(--gate-line);
  padding-top: 18px;
  margin-top: 20px;
}
.next-detail > p { font-size: 14px; margin-bottom: 16px; color: var(--gate-muted); }
.next-detail .route-list { margin-bottom: 12px; }
.next-detail .text-button { justify-content: flex-start; }
.action-card > .primary {
  width: 100%;
  margin-top: 20px;
}
.action-card > .reason + .primary { margin-top: 0; }

/* Constraint: Architectural Job-Gap Ledger */
.constraint {
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  position: relative;
  transition: border-color .15s ease;
}
.constraint::before {
  content: "BUFFER // UNEMPLOYMENT";
  position: absolute;
  top: -8px;
  left: 20px;
  background: var(--surface);
  padding: 0 6px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--muted);
}
.constraint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}
.constraint-row strong {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-heading);
}
.constraint p.muted { margin-top: 6px; }

/* Architectural Meter */
.meter {
  height: 4px;
  margin-top: 14px;
  border-radius: 0;
  background: var(--soft);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: none;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 0;
  background: var(--accent);
  transition: width .2s ease;
}
.meter.paused > span {
  background: var(--muted);
}

/* Up Next: Architectural Ruled Flight Ledger */
.upcoming {
  padding: 0;
}
.upcoming h3 {
  font: 700 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink-heading);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.date-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  transition: background-color .15s ease;
}
.date-row:hover {
  background: var(--surface-hover);
}
.date-row strong { font-weight: 600; color: var(--ink-heading); }
.date-row > .date-stamp { max-width: 55%; text-align: right; }

.alert-list { display: grid; gap: 12px; margin-bottom: 18px; }
.alert {
  padding: 16px 20px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-left: 3px solid var(--warn);
  border-radius: 0;
  font-size: 14px;
}
.alert p { margin-top: 6px; }
.alert .countdown { color: var(--warn); }
.action-card .kind-word { color: var(--accent); }
.note {
  padding: 14px 18px;
  background: var(--soft);
  border-radius: 0;
  font-size: 14px;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.note p + p { margin-top: 6px; }

/* ---- shared date stamp ---- */
.date-stamp {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px 8px;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.date-stamp > .countdown {
  flex-basis: 100%;
  text-align: right;
  order: -2;
}
.date-stamp > .kind { order: -1; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Date kinds */
.kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.kind::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-sizing: border-box;
}
.k-recorded::before {
  background: var(--muted);
}
.k-target::before {
  border: 2px solid var(--accent);
  background: transparent;
}
.k-estimate::before {
  border: 1.5px dashed var(--muted);
  background: transparent;
}
.k-deadline::before {
  background: var(--warn);
  border-radius: 2px;
}
.kind-word {
  font: 700 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--warn);
}
.kind-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 0 0 8px;
  padding: 10px 0 14px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.kind-key li {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Swiss Architectural Runway Matrix ---- */
.runway {
  margin-top: 22px;
}
.runway-track {
  position: relative;
  height: 4px;
  border-radius: 0;
  background: var(--soft);
  border: 1px solid var(--line);
  box-shadow: none;
  overflow: visible;
  margin: 18px 0 10px;
}
/* Centerline architectural scale ticks */
.runway-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -6px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 8px);
  z-index: 1;
}
/* Solid architectural elapsed progress datum */
.runway-elapsed {
  position: absolute;
  left: 0;
  top: -1px;
  height: calc(100% + 2px);
  border-radius: 0;
  background: var(--accent);
  box-shadow: none;
  z-index: 2;
  transition: width .2s ease;
}
/* Architectural cursor beacon */
.runway-elapsed::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -5px;
  width: 8px;
  height: 14px;
  border-radius: 0;
  background: var(--accent-bright);
  border: 1px solid var(--ink-heading);
  box-shadow: none;
  box-sizing: border-box;
  z-index: 4;
}
/* Milestone marker pins: Precision square coordinates */
.runway-mark {
  position: absolute;
  top: -4px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 0;
  background: var(--surface);
  box-sizing: border-box;
  border: 1px solid var(--muted);
  z-index: 3;
  transition: transform .15s ease, border-color .15s ease;
  cursor: pointer;
}
.runway-mark:hover {
  transform: scale(1.3);
  z-index: 6;
  border-color: var(--ink-heading);
}
.runway-mark.k-recorded {
  background: var(--muted);
}
.runway-mark.k-estimate {
  border-style: dashed;
}
.runway-mark.k-deadline {
  border-radius: 0;
  background: var(--warn);
  border-color: var(--warn);
}
.runway-mark.next {
  z-index: 5;
  border-color: var(--accent);
  background: var(--accent);
  border-radius: 0;
  transform: rotate(45deg);
  top: -3px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  box-shadow: none;
}
.runway-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font: 600 11px/1.3 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes radar-beacon {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Step dots in route summaries */
.pips {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.attempt-year {
  padding: 8px 0 12px;
}
.attempt-year > h3 { margin-bottom: 14px; }
.pip {
  width: 8px;
  height: 8px;
  border-radius: 0;
  border: 1px solid var(--muted);
  box-sizing: border-box;
  transition: all .15s ease;
}
.pip.done {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
.pip.waiting {
  border-color: var(--accent);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--surface), inset 0 0 0 3px var(--accent);
  animation: none;
}
.pip.blocked {
  opacity: .35;
}

/* ---- Architectural Buttons ---- */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-heading);
  text-decoration: none;
  font: 700 12px/1.2 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  transition: all .15s ease;
  cursor: pointer;
}
.primary {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  box-shadow: none;
}
.primary:focus-visible {
  outline: 2px solid var(--ink-heading);
  outline-offset: 3px;
}
.primary:hover {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
  transform: none;
  box-shadow: none;
  filter: none;
}
.primary:active {
  background: var(--accent);
  transform: none;
  box-shadow: none;
}
.secondary {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}
.secondary:hover {
  background: var(--ink-heading);
  color: var(--bg);
  border-color: var(--ink-heading);
  transform: none;
}
.secondary:active {
  transform: none;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 6px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font: 600 12px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: background-color .15s ease, color .15s ease;
}
.text-button:hover {
  background: var(--accent-soft);
  color: var(--accent-bright);
}
.buttons, .record-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.buttons > * { flex: 1; }
.record-actions { margin-top: 8px; }
.record-actions .text-button { margin-right: 8px; }

/* ---- sections ---- */
.section {
  margin-top: 50px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.section-heading h2 {
  font: 700 12px/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-heading);
}
.section-heading::after {
  content: "// MATRIX";
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--muted);
}
.section-heading p { margin-top: 6px; }

/* Disclosures as Manifest Rows & Flight Route Panels */
.disclosure {
  border-bottom: 1px solid var(--line);
  transition: border-color .15s ease;
}
.disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 14px 4px;
  list-style: none;
  transition: background-color .15s ease;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-1px) rotate(45deg);
  justify-self: center;
  transition: transform .2s ease, border-color .15s ease;
}
.disclosure[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
  border-color: var(--accent);
}
.summary-copy {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}
.summary-copy > strong {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-heading);
  min-width: 0;
}
.summary-copy > span {
  flex-shrink: 0;
  font: 600 12px/1.3 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: right;
  max-width: 55%;
}
.detail-body {
  padding: 6px 4px 28px;
}
.detail-body > p {
  margin: 12px 0;
  max-width: 65ch;
  line-height: 1.6;
}
.detail-body > .primary, .detail-body > .secondary { margin-top: 14px; }
/* ---- Entries inside a card: Sub-Cards & Manifest Tiles ---- */
.compact {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 0;
  margin: 10px 0;
  position: relative;
  transition: background-color .15s ease, border-color .15s ease;
}
.compact:hover {
  background: var(--surface-hover);
  border-color: var(--line);
  border-left-color: var(--accent);
}
.compact[open] {
  border-color: var(--line);
  border-left-color: var(--accent);
  background: var(--surface-raised);
  margin-bottom: 14px;
}
.compact > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  transition: background-color .15s ease;
}
.compact > summary::-webkit-details-marker { display: none; }
.compact > summary:hover {
  background: transparent;
}
.compact > summary .summary-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}
.compact > summary .summary-copy strong {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--ink-heading);
}
.compact > summary .summary-copy > span {
  font: 700 10px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 4px 8px;
  border-radius: 0;
}
.compact:hover > summary .summary-copy > span,
.compact[open] > summary .summary-copy > span {
  color: var(--ink-heading);
  border-color: var(--accent-border);
}
.compact > summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-1px) rotate(45deg);
  justify-self: center;
  transition: transform .2s ease, border-color .15s ease;
}
.compact[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
  border-color: var(--accent);
}
.compact .detail-body {
  font-size: 14px;
  padding: 14px 16px 18px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
}
.action-card .compact {
  background: var(--gate-surface);
  border-color: var(--gate-line);
  border-left-color: var(--gate-line);
}
.action-card .compact:hover {
  background: #262626;
  border-left-color: var(--gate-signal);
}
.action-card .compact[open] {
  border-left-color: var(--gate-signal);
  background: var(--gate-surface);
}
.action-card .compact > summary .summary-copy strong {
  color: var(--gate-ink);
}
.action-card .compact .detail-body {
  background: var(--gate);
  border-top-color: var(--gate-line);
}

/* Route: Flight Path Waypoints & Rail */
.route-list {
  list-style: none;
  padding: 0;
  margin: 4px 0;
}
.route-item {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 6px 0 20px;
  transition: background-color .15s ease;
}
.route-item::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-top: 5px;
  flex: 0 0 12px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: var(--bg);
  z-index: 2;
  box-sizing: border-box;
}
.route-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 17px;
  bottom: -6px;
  border-left: 2px dashed var(--line);
  z-index: 1;
}
.route-item.done::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}
.route-item.done:not(:last-child)::after {
  border-left: 2px solid var(--accent);
}
.route-item.done .date-label {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
}
.route-item.waiting::before {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
  animation: radar-beacon 2s infinite;
}
.route-copy {
  flex: 1;
  min-width: 0;
}
.route-copy > p {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}
.route-copy > .text-button {
  justify-content: flex-start;
  text-align: left;
}
.route-copy strong { font-weight: 600; }
.route-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.route-heading > strong {
  min-width: 0;
  color: var(--ink-heading);
}
.timeline-date {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 4px 14px;
}
.route-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.owner {
  font: 700 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 4px 8px;
}
.route-item.blocked .route-copy { opacity: .55; }
.route-item.current {
  background: var(--surface-raised);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}
.route-item.current strong { color: var(--ink-heading); }
.route-item.current::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.timeline-date > strong { min-width: 0; font-weight: 500; }
.timeline-date > .date-stamp { justify-self: end; text-align: right; }
.route-meta > .text-button, .record-heading > .text-button, .constraint-row > .text-button {
  flex-shrink: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  transition: background-color .15s ease;
}
.timeline li:hover {
  background: var(--surface-hover);
  border-radius: 4px;
}
.timeline .muted { margin-top: 4px; }

/* ---- facts and records ---- */
.facts {
  margin: 0;
  font-size: 14px;
}
.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
}
.facts > div:last-child { border-bottom: 0; }
.facts dd {
  margin: 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--ink-heading);
}
.record-entry {
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 0;
  padding: 16px 18px;
  margin-bottom: 12px;
  transition: background-color .15s ease, border-color .15s ease;
}
.record-entry:hover {
  background: var(--surface-hover);
  border-left-color: var(--accent);
}
.record-entry:last-child {
  margin-bottom: 0;
}
.record-entry p { margin-top: 6px; }
.record-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.record-heading > h3 { min-width: 0; font-weight: 600; color: var(--ink-heading); }

/* ---- forms ---- */
.inline-form {
  padding: 24px;
  margin: 20px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: 0;
  box-shadow: none;
}
.inline-form h3 { margin-bottom: 18px; color: var(--ink-heading); font-family: var(--mono); }
.inline-form .secondary { background: var(--surface); }
.field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
input:not([type=checkbox]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 14px;
  font-family: var(--mono);
  transition: border-color .15s ease;
}
input:not([type=checkbox]):focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
  box-shadow: none;
}
input[type=date], input[type=number] {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
input[type=checkbox] {
  width: 20px;
  height: 20px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 14px;
}
.form-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-top: 18px;
  font-size: 14px;
}
.impact {
  padding: 16px;
  background: var(--soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-top: 18px;
  font-size: 14px;
}
.impact p + p { margin-top: 6px; }

/* ---- scenarios and reference ---- */
.scenario {
  margin-top: 18px;
  padding: 20px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.scenario p { margin-bottom: 16px; }
.scenario .field-grid { gap: 14px; }
.scenario-result {
  margin-top: 18px;
  font: 700 34px/1 var(--mono);
  color: var(--accent);
  letter-spacing: -.02em;
}
.rule-status { margin-bottom: .4rem; }
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  font-size: 13px;
  margin-top: .8rem;
}
.source-links a { overflow-wrap: anywhere; }
.duties {
  padding-left: 20px;
  font-size: 14px;
}
.duties li { margin-bottom: 14px; }
.duties span { display: block; color: var(--muted); margin-top: 2px; }
.empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- footer and messages ---- */
.footer {
  margin-top: 36px;
  padding: 16px 20px 48px;
  color: var(--muted);
  font-size: 14px;
  border-top: 2px dashed var(--line);
}
.footer > .wrap { padding: 0; }
.footer p { margin-top: 14px; }
.footer .buttons { margin: 14px 0; }
.live-message, .toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--ink-heading);
  color: var(--bg);
  font: 600 13px/1.4 var(--mono);
  letter-spacing: .05em;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.live-message { width: max-content; }

/* ---- responsive ---- */
@media(min-width: 640px) {
  .wrap { padding-left: 24px; padding-right: 24px; }
  main.wrap { padding-top: 36px; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .buttons > * { flex: 0 1 auto; }
  .scenario .field-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .position { padding: 26px 28px 28px; }
  .authorization-countdown { margin-inline: -28px; padding-inline: 28px; font-size: 48px; }
  .position h1 { font-size: 58px; }
  @supports(grid-template-rows: subgrid) {
    .field-grid > .field { display: grid; grid-template-rows: subgrid; grid-row: span 2; }
    .field-grid > .check { grid-row: span 2; align-self: end; }
  }
}

@media(min-width: 960px) {
  main.wrap { padding-top: 48px; }
  .authorization-countdown { font-size: 54px; }
  .today {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 36px;
    align-items: start;
  }
  .today-col {
    display: flex;
    flex-direction: column;
    gap: 28px;
  }
  .position, .action-area, .constraint, .today .upcoming {
    order: initial;
  }
  .action-card { padding: 32px; }
  .action-card h2 { font-size: 26px; }
  .section { margin-top: 60px; }
  .section-heading { margin-bottom: 16px; }
  .route-summaries {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
  }
  .route-summaries > .disclosure {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0 20px;
    box-shadow: none;
    margin-bottom: -1px;
    position: relative;
    transition: border-color .15s ease;
  }
  .route-summaries > .disclosure:hover {
    border-color: var(--ink-heading);
    z-index: 2;
  }
  .route-summaries > .disclosure[open] {
    grid-column: 1 / -1;
    border-color: var(--accent);
    z-index: 3;
    margin-bottom: 12px;
  }
  .records-list > .disclosure {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0 20px;
    box-shadow: none;
    margin-bottom: -1px;
    position: relative;
    transition: border-color .15s ease;
  }
  .records-list > .disclosure:hover {
    border-color: var(--ink-heading);
    z-index: 2;
  }
  .records-list > .disclosure[open] {
    border-color: var(--accent);
    z-index: 3;
    margin-bottom: 12px;
  }
}

@media(max-width: 359px) {
  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .facts dd { text-align: left; }
  .facts .date-stamp { align-items: flex-start; }
  .action-card, .inline-form { padding: 18px; }
  .position { padding: 18px; }
  .authorization-countdown { margin-inline: -18px; padding-inline: 18px; font-size: 26px; }
  .position h1 { font-size: 38px; }
  .date-row { gap: 10px; }
  .date-row time { flex-shrink: 1; }
  .buttons { flex-direction: column; }
  .buttons > * { width: 100%; }
}

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