/* MVP turnaround monitor styles, copied verbatim from sumitomo_ta_mvp
   web/src/styles.css (commit f52601f). Active only on the live replay and GSE
   pages (main.js swaps stylesheets). Local additions are at the end. */
/* Turnaround monitor: dark operations theme, legible from a distance.
   Status colour is never the only signal: every state also has text. */
:root {
  --bg: #0a0f15;
  --bg-glow: #12273f;
  --surface: #111923;
  --surface-2: #17212d;
  --surface-3: #1f2b39;
  --line: #233142;
  --line-strong: #34465b;
  --text: #edf2f7;
  --text-2: #b4c2d0;
  --text-3: #8b9cae;
  --accent: #4fb3ff;
  --accent-ink: #03192b;
  --live: #3ddc97;
  --late: #ff7d73;
  --early: #4fd1c5;
  --remaining: #7cc4ff;
  --warn: #ffc65c;
  --danger: #ff8a8a;
  --radius-s: 6px;
  --radius: 10px;
  --radius-l: 14px;
  --shadow: 0 10px 30px #0009;
  color-scheme: dark;
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', 'Yu Gothic', Meiryo, system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(1100px 420px at 15% -8%, var(--bg-glow) 0%, transparent 65%) no-repeat, var(--bg);
  color: var(--text);
  font-size: 18px;
  line-height: 1.5;
  /* Break Japanese at phrase boundaries where supported (lang="ja"). */
  word-break: auto-phrase;
}
button, input, select { font: inherit; }
button, a, input, select, canvas, summary, [tabindex] { outline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
canvas:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-feature-settings: 'palt'; letter-spacing: .02em; }
h1, h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 19px; font-weight: 650; }
small, .small { font-size: 15px; }
input, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #0c131b;
  color: var(--text);
}
input:focus, select:focus { border-color: var(--accent); }
input[readonly] { color: var(--text-3); background: transparent; }
input::placeholder { color: var(--text-3); }
[hidden] { display: none !important; }
.muted { color: var(--text-2); }
.warning-text { color: var(--warn) !important; }
.danger-text { color: var(--danger) !important; }
.mono, time, .wall-clock, .expected-time, .schedule-delta { font-variant-numeric: tabular-nums; }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-weight: 650;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.primary:hover:not(:disabled) { background: #7cc8ff; }
.button.secondary { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.button.secondary:hover:not(:disabled) { background: var(--surface-3); border-color: #4a6078; }
.button.quiet { background: transparent; color: var(--text-2); }
.button.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.button.danger { background: #3d1f25; border-color: #7d3b44; color: #ffd2d2; }
.button.danger:hover:not(:disabled) { background: #552a32; }

/* Status pills: a dot plus text, so meaning never depends on colour alone. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
  padding: 4px 11px 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.pill.live { color: var(--live); background: #3ddc9714; border-color: #3ddc9750; }
.pill.live .pill-dot { animation: pulse-live 2s ease-out infinite; }
.pill.complete { color: #cfe3f7; background: #4fb3ff14; border-color: #4fb3ff45; }
.pill.complete .pill-dot { background: var(--accent); }
.pill.provisional { color: var(--warn); background: #ffc65c12; border-color: #ffc65c55; }
.pill.provisional .pill-dot { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.pill.pending { color: var(--text-3); background: transparent; border-color: var(--line); }
.pill.pending .pill-dot { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill.idle { color: var(--text-2); }
.pill.warning { color: var(--warn); background: #ffc65c12; border-color: #ffc65c55; }

@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 #3ddc9799; }
  70% { box-shadow: 0 0 0 7px #3ddc9700; }
  100% { box-shadow: 0 0 0 0 #3ddc9700; }
}
@keyframes pulse-rec {
  0% { box-shadow: 0 0 0 0 #ff5a5acc; }
  70% { box-shadow: 0 0 0 6px #ff5a5a00; }
  100% { box-shadow: 0 0 0 0 #ff5a5a00; }
}

/* Top bar */
.topbar {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: #0d141cdd;
  backdrop-filter: blur(8px);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--live) 35%, transparent 75%);
  opacity: .7;
}
.topbar-inner {
  max-width: 2100px;
  margin: auto;
  min-height: 64px;
  padding: 10px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: var(--accent-ink);
  background: linear-gradient(135deg, #7cc8ff, var(--accent) 45%, #36d6a6);
  box-shadow: 0 4px 14px #4fb3ff40;
}
.brand-mark .icon { width: 22px; height: 22px; transform: rotate(45deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-name { white-space: nowrap; font-weight: 700; font-size: 20px; font-feature-settings: 'palt'; letter-spacing: .03em; }
.brand-sub { font-size: 12px; color: var(--text-3); letter-spacing: .08em; }
.topbar-right { display: flex; gap: 18px; align-items: center; font-size: 15px; }
.wall-clock { font-size: 17px; font-weight: 600; color: var(--text); }
.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--live);
  white-space: nowrap;
  padding: 4px 11px;
  border-radius: 999px;
  background: #3ddc9712;
  border: 1px solid #3ddc9740;
}
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse-live 2.4s ease-out infinite; }
.connection.stale { color: var(--warn); background: #ffc65c14; border-color: #ffc65c55; }
.connection.stale .connection-dot { animation: none; }
.identity { color: var(--text-3); }

/* Page layout */
.main { max-width: 2100px; margin: auto; padding: 22px 28px 40px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 16px; }
.page-heading .muted { font-size: 16px; }
.title-line { display: flex; align-items: center; gap: 14px; min-width: 0; }
.connection-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #ffc65c80;
  border-radius: var(--radius);
  background: #3a2e1a;
  color: #ffe2a8;
  font-size: 17px;
}

/* Gate selector */
.gate-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.gate-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px 12px 14px;
  min-width: 190px;
  max-width: 100%;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.gate-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.gate-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, #17324c, #122538);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 8px 20px #0006;
}
.gate-status-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--text-3); }
.gate-card.running .gate-status-dot { background: var(--live); box-shadow: none; animation: pulse-live 2s ease-out infinite; }
.gate-card-body { display: flex; flex-direction: column; min-width: 0; }
.gate-card h2 { font-size: 19px; line-height: 1.3; }
.gate-card-meta { font-size: 14px; color: var(--text-3); font-weight: 600; }
.gate-card.running .gate-card-meta { color: var(--live); }
.empty-state {
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-l);
  background: #ffffff04;
  padding: 26px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.empty-title { font-size: 19px; font-weight: 650; margin-bottom: 4px; }

/* Workspace */
.workspace-head { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 14px; }
.workspace-title { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.workspace-head h2 { font-size: 28px; overflow-wrap: anywhere; }
.gate-meta { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--text-3); }
.gate-meta:empty { display: none; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.workspace-grid.details-open { grid-template-columns: minmax(0, 1fr) 340px; }
.workspace-main { min-width: 0; }
.workspace-side { min-width: 0; display: flex; flex-direction: column; gap: 18px; font-size: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px 20px; }
.panel h3 { font-size: 17px; color: var(--text-2); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }

/* Sticky monitor: video plus the steps in progress stay in the upper half. */
.monitor-panel {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
  max-height: 50dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.video-container {
  position: relative;
  background: #05080c;
  height: 24dvh;
  min-height: 100px;
  flex-shrink: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-container video { display: block; width: 100%; height: 100%; object-fit: contain; }
.video-overlay {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.video-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  color: #e8eef5;
  background: #000000b3;
  border: 1px solid #ffffff1f;
  backdrop-filter: blur(4px);
}
.video-chip.live::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5a5a;
  animation: pulse-rec 2s ease-out infinite;
}
.video-chip.recorded::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--remaining); }
.video-chip.warning { color: var(--warn); border-color: #ffc65c66; }
.monitor-summary {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--line);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.summary-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.summary-heading h3 { font-size: 18px; color: var(--text-2); }
.analysis-freshness { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 16px; }
.freshness-chip { color: var(--text-2); background: var(--surface-3); border-radius: 999px; padding: 3px 12px; }
.freshness-chip strong { color: var(--text); font-weight: 650; }
.analysis-lag { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.current-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  overflow-y: auto;
  min-height: 0;
  max-height: 17dvh;
}
.current-step {
  --proc: var(--accent);
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  background: linear-gradient(90deg, color-mix(in srgb, var(--proc) 18%, transparent), transparent 75%), var(--surface-2);
}
.current-step::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--proc); }
.current-step-main { min-width: 0; }
.current-step-name { display: block; font-size: 22px; line-height: 1.3; font-feature-settings: 'palt'; }
.current-step small { display: block; font-size: 14px; }
.current-step .schedule-delta { align-items: flex-end; white-space: nowrap; }

/* Schedule deltas: sign + text label, colour reinforces. */
.schedule-delta { display: flex; flex-direction: column; line-height: 1.15; }
.schedule-delta strong { font-size: 30px; font-weight: 750; letter-spacing: -.01em; }
.schedule-delta small { font-size: 14px; margin-top: 3px; font-weight: 600; }
.schedule-delta.none { color: var(--text-3); }
.schedule-delta.none strong { font-weight: 400; }
.schedule-delta.late { color: var(--late); }
.schedule-delta.early { color: var(--early); }
.schedule-delta.remaining { color: var(--remaining); }
.schedule-delta.on-time { color: var(--text); }

/* Procedure table */
.results-panel { margin-top: 18px; }
.results-label { margin-top: -4px; }
.tabs { display: flex; gap: 3px; background: var(--bg); border: 1px solid var(--line); padding: 3px; border-radius: 999px; }
.button.tab { padding: 6px 14px; border-radius: 999px; color: var(--text-2); background: transparent; font-size: 15px; }
.button.tab:hover { color: var(--text); }
.button.tab.active { color: var(--text); background: var(--surface-3); box-shadow: 0 1px 3px #0008; }
.procedure-table { margin-top: 14px; overflow-x: auto; }
.procedure-table table { width: 100%; min-width: 960px; border-collapse: separate; border-spacing: 0; table-layout: fixed; text-align: left; }
.procedure-table th, .procedure-table td { padding: 14px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.procedure-table thead th {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 650;
  letter-spacing: .06em;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 0;
}
.procedure-table th:first-child { width: 22%; }
.procedure-table th:nth-child(2) { width: 12%; }
.procedure-table th:nth-child(3), .procedure-table th:nth-child(5) { width: 15%; }
.procedure-table th:nth-child(4), .procedure-table th:nth-child(6) { width: 18%; }
.procedure-row { --proc: var(--text-3); transition: background-color .15s; }
.procedure-row:hover { background: #ffffff05; }
.procedure-row.active { background: linear-gradient(90deg, color-mix(in srgb, var(--proc) 14%, transparent), transparent 60%); }
.procedure-row.active > :first-child { box-shadow: inset 4px 0 0 var(--proc); }
.procedure-name { font-size: 20px; font-weight: 650; overflow-wrap: anywhere; font-feature-settings: 'palt'; }
.procedure-row.pending .procedure-name { color: var(--text-2); font-weight: 500; }
.proc-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  border-radius: 3px;
  vertical-align: .08em;
  background: var(--proc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--proc) 22%, transparent);
}
.procedure-row.pending .proc-dot { opacity: .45; box-shadow: none; }
.step-badges small { display: block; margin-top: 6px; font-size: 13px; line-height: 1.4; }
.no-value { color: var(--text-3); }
.expected-time { font-size: 18px; color: #c5d1dd; }
.procedure-row.pending .expected-time { color: var(--text-3); }
.observed-time time { display: block; font-size: 17px; color: var(--text-2); margin-top: 6px; }
.observed-time .unobserved { font-weight: 600; }
.empty-results { padding: 40px 10px; text-align: center; color: var(--text-2); font-size: 18px; }

/* Timeline: planned windows (dashed) and observed intervals (solid) on one axis. */
.results-controls { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: flex-end; }
.gantt { margin-top: 14px; overflow-x: auto; }
.gantt-inner { min-width: 760px; }
.gantt-scale, .gantt-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; }
.gantt-ticks { position: relative; height: 26px; }
.gantt-tick {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gantt-row { --proc: var(--text-3); border-top: 1px solid var(--line); }
.gantt-row:hover { background: #ffffff05; }
.gantt-label { font-size: 17px; font-weight: 650; padding: 7px 12px 7px 4px; overflow-wrap: anywhere; font-feature-settings: 'palt'; }
.gantt-row.pending .gantt-label { color: var(--text-2); font-weight: 500; }
.gantt-row.pending .proc-dot { opacity: .45; box-shadow: none; }
.gantt-track { position: relative; height: 40px; }
.gantt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.gantt-plan {
  position: absolute;
  top: 8px;
  bottom: 8px;
  min-width: 2px;
  border: 1.5px dashed color-mix(in srgb, var(--proc) 80%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--proc) 10%, transparent);
}
.gantt-actual {
  position: absolute;
  top: 13px;
  bottom: 13px;
  min-width: 4px;
  border-radius: 4px;
  background: var(--proc);
  box-shadow: 0 0 12px color-mix(in srgb, var(--proc) 45%, transparent);
}
.gantt-actual.ongoing {
  border-radius: 4px 0 0 4px;
  background: linear-gradient(90deg, var(--proc) 65%, color-mix(in srgb, var(--proc) 20%, transparent));
}
.gantt-actual.estimated::after {
  content: '';
  position: absolute;
  right: -2px;
  top: -5px;
  bottom: -5px;
  border-right: 2px dashed var(--text);
}
.gantt-plan-mark, .gantt-mark, .gantt-sighting {
  position: absolute;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.gantt-plan-mark { border: 1.5px dashed var(--proc); }
.gantt-mark { background: var(--proc); box-shadow: 0 0 0 2px var(--surface); }
.gantt-sighting { border: 2.5px solid var(--proc); border-radius: 50%; transform: translate(-50%, -50%); background: var(--surface); }
.gantt-now { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--live); opacity: .9; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 12px 4px 2px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.gantt-key { display: inline-flex; align-items: center; gap: 7px; }
.gantt-swatch { --proc: var(--accent); position: relative; display: inline-block; width: 22px; height: 12px; flex: none; }
.gantt-swatch.plan { border: 1.5px dashed var(--proc); border-radius: 4px; background: color-mix(in srgb, var(--proc) 10%, transparent); }
.gantt-swatch.actual { height: 8px; border-radius: 3px; background: var(--proc); }
.gantt-swatch.ongoing { height: 8px; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, var(--proc) 55%, transparent); }
.gantt-swatch.estimated { height: 8px; border-radius: 3px; background: var(--proc); border-right: 2px dashed var(--text); }
.gantt-swatch.mark { width: 10px; height: 10px; margin: 0 6px; transform: rotate(45deg); background: var(--proc); }
.gantt-swatch.sighting { width: 11px; height: 11px; margin: 0 5px; border: 2.5px solid var(--proc); border-radius: 50%; }
.gantt-swatch.now { width: 2px; height: 16px; margin: 0 10px; background: var(--live); }

/* Details sidebar */
.session-stats { display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; margin: 14px 0 0; font-size: 15px; }
.session-stats dt { color: var(--text-3); }
.session-stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.video-caption { margin-top: 10px; color: var(--text-2); font-size: 15px; }
.history-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow: auto; }
.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 9px 10px;
  width: 100%;
}
.history-item:hover { background: var(--surface-2); }
.history-item.selected { background: #17324c; border-color: #2f5577; }
.history-text { min-width: 0; }
.history-item strong { display: block; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-item small { display: block; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.history-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--text-3); }
.history-dot.live { background: #ff5a5a; box-shadow: none; }
.history-dot.running { background: var(--live); box-shadow: none; animation: pulse-live 2s ease-out infinite; }
.observation-feed { max-height: 640px; overflow: auto; padding: 2px 0 0 6px; }
.observation { position: relative; padding: 0 0 18px 20px; border-left: 2px solid var(--line); }
.observation:last-child { padding-bottom: 4px; }
.observation::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--line-strong);
}
.observation.has-changes::before { background: var(--accent); box-shadow: 0 0 0 3px #4fb3ff33; }
.observation.status-warning::before { box-shadow: inset 0 0 0 2px var(--warn); }
.observation-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.observation-head strong { font-size: 15px; font-weight: 600; }
.observation-head .pill { font-size: 13px; padding: 2px 9px 2px 7px; gap: 5px; }
.observation-head .pill-dot { width: 6px; height: 6px; }
.change-list { list-style: none; margin: 9px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; font-weight: 600; }
.change-list li { --proc: var(--accent); }
.change-list .proc-dot { width: 8px; height: 8px; margin-right: 8px; }
.observation p { font-size: 15px; color: #d0d9e2; margin: 8px 0; line-height: 1.65; overflow-wrap: anywhere; }
.observation > small { font-size: 13px; color: var(--text-3); }
.observations-panel .button.quiet { margin-top: 6px; width: 100%; }

/* Login, boot and dialogs */
.boot { padding: 100px 20px; color: var(--text-2); text-align: center; }
.login {
  max-width: 470px;
  width: calc(100% - 32px);
  margin: 13vh auto;
  padding: 40px 36px 36px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #152131, var(--surface));
  box-shadow: var(--shadow);
}
.login .brand-mark { width: 60px; height: 60px; border-radius: 16px; margin-bottom: 20px; }
.login .brand-mark .icon { width: 34px; height: 34px; }
.login h1 { font-size: 28px; line-height: 1.4; margin-bottom: 10px; }
.login-description { margin-bottom: 28px; }
.login > .button { padding: 12px 24px; min-width: 200px; }
.login > .form-error { margin-top: 20px; text-align: left; }
.gate-dialog, .confirm-dialog {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  padding: 0;
  width: min(850px, calc(100% - 32px));
  max-height: 90dvh;
  box-shadow: 0 24px 60px #000c;
}
.confirm-dialog { width: min(540px, calc(100% - 32px)); padding: 26px; }
.confirm-dialog h2 { font-size: 22px; overflow-wrap: anywhere; }
.confirm-dialog p { margin-top: 12px; }
.gate-dialog::backdrop, .confirm-dialog::backdrop { background: #030910c7; backdrop-filter: blur(3px); }
.gate-form { padding: 26px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.icon-button { border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 28px; line-height: 1; padding: 4px 10px; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.field { display: block; margin: 18px 0; }
.field > span { display: block; font-size: 16px; font-weight: 600; margin-bottom: 7px; color: var(--text-2); }
.crop-hint { margin: -4px 0 10px; }
.crop-preview { background: #070b10; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.crop-placeholder { padding: 46px 25px; color: var(--text-2); text-align: center; font-size: 16px; }
.crop-canvas { display: block; width: 100%; height: auto; max-height: 32vh; object-fit: contain; touch-action: none; cursor: crosshair; }
.crop-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.crop-number span { display: block; font-size: 14px; color: var(--text-3); margin-bottom: 5px; }
.crop-number input { padding: 9px; }
.crop-preview + p { margin-top: 10px; }
.schedule-editor { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.schedule-editor > summary { font-size: 17px; font-weight: 650; }
.schedule-editor .small { margin: 12px 0; }
.schedule-input-row { display: grid; grid-template-columns: minmax(150px, 1fr) 115px 115px; gap: 12px; align-items: center; margin: 8px 0; font-size: 16px; }
.schedule-input-row input { padding: 8px; }
.schedule-input-head { font-size: 14px; color: var(--text-3); }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; }
.form-error { color: var(--danger); font-size: 16px; white-space: pre-line; }
.form-error:empty { display: none; }
.gate-form > .form-error { margin-top: 15px; }

/* Notifications */
#notifications {
  position: fixed;
  bottom: 25px;
  right: 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  max-width: min(500px, calc(100vw - 50px));
}
.notification {
  padding: 14px 18px 14px 20px;
  border: 1px solid #3f7d68;
  border-left: 5px solid var(--live);
  border-radius: var(--radius);
  background: #17322a;
  color: #e1fff3;
  box-shadow: var(--shadow);
  font-size: 17px;
}
.notification.error { border-color: #8c5560; border-left-color: var(--danger); background: #3f252c; color: #ffdcdf; }

/* Wall displays */
@media (min-width: 1800px) {
  body { font-size: 20px; }
  .current-step-name { font-size: 25px; }
  .schedule-delta strong, .current-step .schedule-delta strong { font-size: 34px; }
  .procedure-name { font-size: 23px; }
  .gantt-label { font-size: 20px; }
  .gantt-track { height: 46px; }
  .gantt-scale, .gantt-row { grid-template-columns: 270px minmax(0, 1fr); }
  .expected-time { font-size: 21px; }
  .observed-time time { font-size: 19px; }
  .procedure-table thead th { font-size: 16px; }
  .procedure-table th, .procedure-table td { padding: 17px; }
  .button { font-size: 18px; }
  .pill { font-size: 16px; }
}

@media (max-width: 1150px) {
  .identity, .brand-sub { display: none; }
  .workspace-grid.details-open { grid-template-columns: minmax(0, 1fr); }
  .workspace-side { display: grid; grid-template-columns: 1fr 1fr; }
  .workspace-side > .panel:first-child { grid-column: 1 / -1; }
  .session-stats { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .monitor-panel { max-height: 52dvh; }
  .current-step-name { font-size: 20px; }
  .analysis-freshness { font-size: 15px; }
  .analysis-lag { font-size: 19px; }
}

@media (max-width: 650px) {
  body { font-size: 17px; }
  .main { padding: 16px 12px 30px; }
  .topbar-inner { padding: 10px 12px; gap: 10px; min-height: 56px; }
  .brand { gap: 9px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-mark .icon { width: 18px; height: 18px; }
  .brand-name { font-size: 16px; }
  .topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; font-size: 13px; }
  .wall-clock, .identity { display: none; }
  .connection { padding: 3px 8px; }
  .topbar-right .button { font-size: 13px; padding: 5px 8px; }
  .topbar-right .button .icon { display: none; }
  .page-heading { gap: 10px; }
  .page-heading .title-line { flex-direction: column; align-items: flex-start; gap: 2px; }
  .page-heading h1 { font-size: 21px; }
  .page-heading .muted { font-size: 14px; }
  .page-heading > .button { padding: 8px 12px; }
  .gate-grid { gap: 8px; margin-bottom: 16px; }
  .gate-card { min-width: 0; padding: 9px 12px; gap: 10px; }
  .gate-card h2 { font-size: 17px; }
  .workspace-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .workspace-head > .actions { justify-content: space-between; width: 100%; gap: 4px; }
  .workspace-head .button { font-size: 14px; padding: 8px 10px; }
  .workspace-head .actions { gap: 5px; }
  .workspace-head h2 { font-size: 22px; }
  .monitor-panel { max-height: 50dvh; border-radius: var(--radius); }
  .video-container { height: 20dvh; min-height: 90px; }
  .video-overlay { top: 6px; left: 8px; right: 8px; }
  .video-chip { font-size: 12px; padding: 2px 8px; }
  .monitor-summary { padding: 8px 10px; gap: 7px; }
  .summary-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .summary-heading h3 { font-size: 16px; }
  .analysis-freshness { font-size: 13px; gap: 4px 8px; }
  .analysis-lag { font-size: 16px; }
  .current-steps { display: flex; overflow-x: auto; overflow-y: auto; max-height: 12dvh; }
  .current-step { flex: 0 0 240px; padding: 7px 10px 7px 14px; }
  .current-step-name { font-size: 18px; }
  .current-step .schedule-delta strong { font-size: 26px; }
  .current-step small { font-size: 12px; }
  .current-steps > p { font-size: 15px; }
  .results-panel { padding: 14px 10px; }
  .results-panel > .section-heading { align-items: flex-start; flex-direction: column; }
  .results-controls { justify-content: flex-start; }
  .gantt-scale, .gantt-row { grid-template-columns: 150px minmax(0, 1fr); }
  .gantt-label { font-size: 15px; }
  .results-panel h3 { font-size: 18px; }
  .button.tab { font-size: 14px; padding: 7px 10px; }
  .results-panel > .small { font-size: 13px; }
  .procedure-table table { min-width: 920px; }
  .procedure-table th, .procedure-table td { padding: 14px 10px; }
  .workspace-side { display: flex; }
  .session-stats { grid-template-columns: 1fr auto; }
  .empty-state { flex-direction: column; align-items: flex-start; padding: 20px; }
  .gate-form { padding: 18px; }
  .gate-form .section-heading { align-items: flex-start; flex-direction: column; }
  .gate-form h2 { font-size: 23px; }
  .crop-numbers { gap: 6px; }
  .crop-number input { padding: 7px; }
  .schedule-input-row { grid-template-columns: minmax(85px, 1fr) 85px 85px; gap: 7px; font-size: 14px; }
  .schedule-input-row input { padding: 6px; }
  .schedule-input-head { font-size: 13px; }
  .login { margin: 10vh auto; padding: 30px 22px; }
  .login h1 { font-size: 25px; }
}

/* Desktop only: column headings stay directly below the sticky monitor. */
.procedure-table.table-fits { overflow: visible; }
.procedure-table.table-fits thead th {
  position: sticky;
  top: var(--monitor-height, 50dvh);
  z-index: 9;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}

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

/* ---- Additions for this dashboard (not in the MVP) ---------------------- */

/* Page chrome shared with the results dashboard. The results header is never
   shown here; boot-mode.js activates this sheet before <body> is parsed. */
#site-header { display: none; }
html.mvp-mode .app { display: block; }
html.mvp-mode .footer {
  max-width: 2100px; margin: 0 auto; padding: 18px 28px 30px;
  border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px;
}
html.mvp-mode .loading, html.mvp-mode .empty { padding: 80px 20px; text-align: center; color: var(--text-2); }
html.mvp-mode .spin {
  display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px;
  border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%;
  animation: mvp-spin .9s linear infinite;
}
@keyframes mvp-spin { to { transform: rotate(360deg); } }
.topbar-right a.button { text-decoration: none; }

/* App navigation (from the MVP GSE page mock). */
.app-nav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.app-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-2); font-weight: 650; font-size: 16px;
}
.app-nav a:hover { background: var(--surface-2); color: var(--text); }
.app-nav a[aria-current='page'] { color: var(--text); background: var(--surface-3); box-shadow: inset 0 -2px 0 var(--accent); }
.connection.paused { color: var(--text-2); background: var(--surface-2); border-color: var(--line-strong); }
.connection.paused .connection-dot { animation: none; background: transparent; box-shadow: inset 0 0 0 2px currentColor; }

/* Replay bar: stands in for the MVP's start/stop controls. */
.replay-bar {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 22px; padding: 14px 20px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.replay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 24px; align-items: end; }
.replay-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.replay-kicker { font-size: 14px; font-weight: 650; color: var(--text-3); letter-spacing: .04em; }
.replay-transport { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.replay-transport .live-play { min-width: 128px; }
.replay-time { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.replay-date { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.replay-clock { font-size: 32px; font-weight: 750; letter-spacing: .01em; }
.replay-foot { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.replay-meta { font-size: 14px; color: var(--text-2); }
.live-progress { width: 100%; margin: 2px 0; accent-color: var(--accent); cursor: pointer; }

/* Gate cards: a turnaround per card; a second line names the flight. */
.gate-card-sub { font-size: 13px; color: var(--text-3); }
.gate-card.finished .gate-status-dot { background: var(--accent); box-shadow: none; }
.gate-meta { flex-wrap: wrap; }
.gate-meta .source-name { overflow-wrap: anywhere; }
.gate-meta-sep { color: var(--line-strong); }
.expected-time .eta-source { display: block; margin-top: 4px; font-size: 12px; color: var(--text-3); }
.video-container video { cursor: pointer; }
.replay-note p { margin-top: 8px; line-height: 1.6; }

@media (max-width: 1150px) {
  .app-nav { margin-left: 6px; }
}
@media (max-width: 900px) {
  .replay-row { grid-template-columns: minmax(0, 1fr) auto; }
  .replay-group { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-nav a span { display: none; }
  .app-nav a { padding: 8px 10px; }
}
@media (max-width: 650px) {
  .main { padding-inline: 16px; }
  .topbar-inner { padding-inline: 16px; }
  .brand-text { display: none; }
  .replay-bar { padding: 12px 14px; }
  .replay-row { grid-template-columns: minmax(0, 1fr); }
  .replay-time { align-items: flex-start; flex-direction: row; gap: 10px; align-items: baseline; }
  .replay-clock { font-size: 26px; }
  .replay-transport .tabs { flex-wrap: wrap; }
  html.mvp-mode .footer { padding-inline: 16px; }
}
