:root {
  color-scheme: dark;
  --game-bg:#05070a;
  --game-panel:#0a0f15;
  --game-panel-2:#0f161f;
  --game-line:#253142;
  --game-line-2:#344357;
  --game-text:#edf2f8;
  --game-muted:#8594a8;
  --game-muted-2:#647387;
  --game-accent:#7c9cff;
  --game-green:#43d39e;
  --game-orange:#f2a34a;
  --game-red:#ff756d;
  --game-yellow:#ffd166;
}

* { box-sizing:border-box; }
[hidden] { display:none !important; }

html,
body.control-shift-page {
  margin:0;
  min-width:320px;
  min-height:100%;
  background:var(--game-bg);
  color:var(--game-text);
}
body.control-shift-page {
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:
    radial-gradient(circle at 18% -10%,rgba(79,104,191,.12),transparent 31%),
    var(--game-bg);
}
body.control-shift-page button,
body.control-shift-page input,
body.control-shift-page select {
  font:inherit;
}

.game-topbar {
  min-height:64px;
  padding:0 max(18px,calc((100vw - 1500px)/2));
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:20px;
  align-items:center;
  position:sticky;
  top:0;
  z-index:60;
  border-bottom:1px solid #171e28;
  background:rgba(5,7,10,.94);
  backdrop-filter:blur(18px);
}
.game-brand {
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
  color:inherit;
  text-decoration:none;
}
.game-brand img { border-radius:10px; }
.game-brand span { display:grid; gap:1px; }
.game-brand strong { font-size:.9rem; }
.game-brand small,
.game-topbar-copy span { color:var(--game-muted-2); font-size:.64rem; }
.game-topbar-copy { min-width:0; display:grid; gap:2px; }
.game-topbar-copy strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#cfd8e6;
  font-size:.78rem;
}
.exit-link {
  min-height:35px;
  display:inline-flex;
  align-items:center;
  padding:0 12px;
  border:1px solid var(--game-line);
  border-radius:9px;
  color:var(--game-muted);
  text-decoration:none;
  font-size:.72rem;
  font-weight:750;
}

.setup-screen {
  min-height:calc(100vh - 64px);
  display:grid;
  place-items:center;
  padding:34px 18px 56px;
}
.setup-card {
  width:min(1040px,100%);
  padding:34px;
  display:grid;
  gap:24px;
  border:1px solid var(--game-line);
  border-radius:24px;
  background:rgba(10,15,21,.96);
  box-shadow:0 24px 80px rgba(0,0,0,.34);
}
.setup-hero { display:grid; gap:10px; }
.setup-hero h1 {
  margin:0;
  color:var(--game-text);
  font-size:clamp(2.6rem,7vw,5.3rem);
  letter-spacing:-.07em;
  line-height:.9;
}
.setup-hero p {
  margin:0;
  max-width:780px;
  color:var(--game-muted);
  font-size:.95rem;
  line-height:1.6;
}
.control-shift-page .eyebrow {
  margin:0;
  color:var(--game-accent);
  font-size:.64rem;
  font-weight:850;
  letter-spacing:.13em;
  text-transform:uppercase;
}
.scenario-banner {
  display:flex;
  align-items:center;
  gap:14px;
  padding:15px 17px;
  border:1px solid #26344b;
  border-radius:16px;
  background:#0a1321;
}
.scenario-banner > div { min-width:0; display:grid; gap:4px; }
.scenario-banner strong { font-size:.9rem; }
.scenario-banner small { color:var(--game-muted); font-size:.72rem; }
.service-badge {
  width:56px;
  height:44px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:#2462d3;
  color:white;
  font-size:1.2rem;
  font-weight:900;
  letter-spacing:-.04em;
}
.service-badge.small { width:48px; height:38px; font-size:1rem; }

.difficulty-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.difficulty-card { position:relative; cursor:pointer; }
.difficulty-card input { position:absolute; opacity:0; pointer-events:none; }
.difficulty-card > span {
  min-height:142px;
  padding:18px;
  display:grid;
  align-content:start;
  gap:8px;
  border:1px solid var(--game-line);
  border-radius:17px;
  background:var(--game-panel-2);
}
.difficulty-card input:checked + span {
  border-color:#587bea;
  background:#101a2c;
  box-shadow:inset 0 0 0 1px rgba(124,156,255,.15);
}
.difficulty-card.hard input:checked + span {
  border-color:#bd694d;
  background:#211514;
}
.difficulty-card b { font-size:.82rem; }
.difficulty-card strong { color:#ff786f; font-size:1.12rem; letter-spacing:.08em; }
.difficulty-card small { color:var(--game-muted); font-size:.72rem; line-height:1.48; }

.schedule-builder {
  padding:20px;
  display:grid;
  gap:16px;
  border:1px solid var(--game-line);
  border-radius:17px;
  background:#080c11;
}
.section-heading {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:18px;
}
.section-heading > div { display:grid; gap:3px; }
.section-heading span {
  color:var(--game-muted-2);
  font-size:.61rem;
  text-transform:uppercase;
  letter-spacing:.1em;
}
.section-heading strong { font-size:.88rem; }
.section-heading small { color:var(--game-muted-2); font-size:.67rem; }
.schedule-fields {
  display:grid;
  grid-template-columns:repeat(5,minmax(120px,1fr));
  gap:10px;
}
.schedule-fields label { display:grid; gap:7px; }
.schedule-fields label > span {
  color:var(--game-muted);
  font-size:.68rem;
  font-weight:700;
}
.schedule-fields input,
.action-drawer input,
.action-drawer select {
  width:100%;
  height:42px;
  padding:0 11px;
  border:1px solid var(--game-line-2);
  border-radius:10px;
  background:#0d141c;
  color:var(--game-text);
  outline:none;
}
.input-unit {
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  position:relative;
}
.input-unit input {
  grid-column:1/-1;
  grid-row:1;
  padding-right:45px;
}
.input-unit b {
  grid-column:2;
  grid-row:1;
  padding-right:10px;
  color:var(--game-muted-2);
  font-size:.65rem;
  pointer-events:none;
}
.scenario-note {
  margin:0;
  color:var(--game-muted-2);
  font-size:.67rem;
  line-height:1.5;
}
.setup-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.setup-error { color:var(--game-red); font-size:.72rem; }
.start-game {
  min-width:170px;
  min-height:48px;
  padding:0 22px;
  border:0;
  border-radius:12px;
  background:var(--game-accent);
  color:#08101e;
  font-weight:900;
}

.game-shell {
  width:min(1500px,calc(100% - 32px));
  margin:0 auto;
  padding:20px 0 54px;
  display:grid;
  gap:16px;
}
.hud {
  display:grid;
  grid-template-columns:minmax(220px,1fr) auto auto auto auto auto;
  align-items:center;
  gap:10px;
}
.hud-service {
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.hud-service > div,
.hud-clock,
.hud-hearts {
  display:grid;
  gap:2px;
}
.hud small {
  color:var(--game-muted-2);
  font-size:.6rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.hud-service strong { color:#c9d2df; font-size:.72rem; }
.hud-clock,
.hud-hearts {
  min-height:48px;
  min-width:112px;
  padding:7px 12px;
  border:1px solid var(--game-line);
  border-radius:11px;
  background:var(--game-panel);
}
.hud-clock strong {
  color:#f2f6fa;
  font:750 1.05rem "SFMono-Regular",Consolas,monospace;
}
.hud-hearts strong {
  color:#ff756d;
  font-size:.95rem;
  letter-spacing:.08em;
}
.hud-button {
  min-height:42px;
  padding:0 13px;
  border:1px solid var(--game-line);
  border-radius:10px;
  background:var(--game-panel);
  color:var(--game-text);
  font-size:.7rem;
  font-weight:750;
}
.hud-button.danger { color:#ff948e; }
.inbox-button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.inbox-button b {
  min-width:20px;
  height:20px;
  display:grid;
  place-items:center;
  padding:0 5px;
  border-radius:999px;
  background:#2d1a1a;
  color:#ff958e;
}

.game-occ-panel {
  display:grid;
  gap:12px;
}
.game-section-head {
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  padding:4px 3px;
}
.game-section-head > div:first-child { display:grid; gap:4px; }
.game-section-head h1 {
  margin:0;
  color:var(--game-text);
  font-size:1.45rem;
  letter-spacing:-.035em;
}
.game-section-head p {
  margin:0;
  color:var(--game-muted-2);
  font-size:.68rem;
}
.game-occ-panel .occ-legend {
  justify-content:flex-end;
  padding:0;
}
.game-occ-panel .occ-boards { width:100%; }
.game-occ-panel .occ-control-board { width:100%; }

/* Make simulated blocks behave as interactive Control Desk cards without
   changing the production Control Desk styles themselves. */
.game-occ-panel .occ-bus-block {
  cursor:pointer;
}
.game-occ-panel .occ-bus-block:hover {
  filter:brightness(1.06);
}
.game-occ-panel .occ-bus-block:focus-within {
  outline:2px solid rgba(138,223,228,.8);
  outline-offset:2px;
}

.operations-grid {
  min-width:0;
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(300px,.68fr);
  gap:16px;
}
.game-panel {
  min-width:0;
  padding:17px;
  border:1px solid var(--game-line);
  border-radius:17px;
  background:rgba(10,15,21,.96);
  box-shadow:0 12px 44px rgba(0,0,0,.16);
}
.panel-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.panel-head > div:first-child { display:grid; gap:3px; }
.panel-head h2 {
  margin:0;
  color:var(--game-text);
  font-size:1.05rem;
  letter-spacing:-.025em;
}
.dispatch-head { align-items:end; }
.terminal-tabs {
  display:flex;
  gap:5px;
  padding:3px;
  border:1px solid var(--game-line);
  border-radius:10px;
  background:#080c11;
}
.terminal-tab {
  min-height:32px;
  padding:0 10px;
  border:0;
  border-radius:7px;
  background:transparent;
  color:var(--game-muted);
  font-size:.62rem;
  font-weight:750;
}
.terminal-tab.active {
  background:#1a2431;
  color:#eef3f9;
}
.terminal-strip {
  min-height:42px;
  padding:0 12px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
  border:1px solid #2f3b4b;
  border-bottom:0;
  border-radius:10px 10px 0 0;
  background:#101820;
  font-family:"SFMono-Regular",Consolas,monospace;
}
.terminal-strip span {
  color:#6f8197;
  font-size:.57rem;
  letter-spacing:.1em;
}
.terminal-strip strong { font-size:.74rem; }
.terminal-strip small { color:#69778a; font-size:.56rem; }

.dispatch-table-wrap {
  overflow:auto;
  border:1px solid #2f3b4b;
  border-radius:0 0 10px 10px;
}
.dispatch-table {
  width:100%;
  min-width:1060px;
  border-collapse:collapse;
  font-family:"SFMono-Regular",Consolas,monospace;
}
.dispatch-table th,
.dispatch-table td {
  height:42px;
  padding:7px 9px;
  border-bottom:1px solid #1f2935;
  white-space:nowrap;
  text-align:left;
  font-size:.63rem;
}
.dispatch-table th {
  position:sticky;
  top:0;
  z-index:2;
  background:#111923;
  color:#75849a;
  font-size:.54rem;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.dispatch-table tbody tr { cursor:pointer; }
.dispatch-table tbody tr:hover td { background:#0f1822; }
.dispatch-table tbody tr.selected td { background:#12213b; }
.dispatch-table td strong {
  display:block;
  color:#e4eaf2;
  font-size:.65rem;
}
.dispatch-table td small {
  display:block;
  margin-top:2px;
  color:#607087;
  font-size:.5rem;
}
.late-time { color:#ff8a80; }
.revised-time { color:var(--game-yellow); font-weight:800; }
.headway-chip {
  min-width:38px;
  padding:4px 6px;
  display:inline-grid;
  place-items:center;
  border-radius:6px;
  background:#19222d;
  color:#9aa8ba;
}
.headway-chip.good { background:#143126; color:#65d8a8; }
.headway-chip.close { background:#142a49; color:#7cb1ff; }
.headway-chip.wide { background:#382717; color:#f2ab5d; }
.dispatch-status {
  padding:4px 6px;
  border-radius:5px;
  background:#1b2530;
  color:#9aabba;
  font-size:.52rem;
}
.dispatch-status.late-ready,
.dispatch-status.duty-terminated { background:#3a201d; color:#ff978e; }
.dispatch-status.revised { background:#332b15; color:#ffdc72; }
.dispatch-status.on-route { background:#123125; color:#5bd5a1; }
.dispatch-status.meal-cover { background:#15293e; color:#87baff; }
.dispatch-status.halfway-insertion,
.dispatch-status[class*="throw"] { background:#392519; color:#f4a65b; }
.empty-cell {
  text-align:center !important;
  color:var(--game-muted-2);
  padding:30px !important;
}

.comms-panel {
  min-height:430px;
  display:grid;
  grid-template-rows:auto 1fr;
}
.live-pill {
  padding:5px 8px;
  border-radius:999px;
  background:#123224;
  color:#54d69d;
  font-size:.54rem;
  font-weight:850;
  letter-spacing:.08em;
}
.comms-log {
  min-height:0;
  max-height:550px;
  overflow:auto;
  display:grid;
  align-content:start;
  gap:7px;
}
.comms-entry {
  width:100%;
  padding:9px 10px;
  display:grid;
  grid-template-columns:43px 1fr;
  gap:9px;
  border:1px solid #1d2733;
  border-radius:9px;
  background:#080c11;
  color:#cfd7e2;
  text-align:left;
}
.comms-entry time {
  color:#66758a;
  font:600 .58rem "SFMono-Regular",Consolas,monospace;
}
.comms-entry span {
  font-size:.63rem;
  line-height:1.35;
}
.comms-entry.traffic { border-left:3px solid var(--game-orange); }
.comms-entry.call { border-left:3px solid #d65fba; }
.comms-entry.radio,
.comms-entry.control { border-left:3px solid #6da7ff; }
.comms-entry.complaint { border-left:3px solid var(--game-red); }
.comms-entry.departure,
.comms-entry.arrival { border-left:3px solid var(--game-green); }
.comms-entry.meal { border-left:3px solid #a58cff; }
.comms-empty {
  padding:30px;
  color:var(--game-muted-2);
  font-size:.7rem;
  text-align:center;
}

.action-drawer {
  position:fixed;
  top:0;
  right:0;
  z-index:2147483450;
  width:min(430px,100vw);
  height:100dvh;
  padding:24px;
  overflow:auto;
  border-left:1px solid #293646;
  background:#090e14;
  box-shadow:-24px 0 70px rgba(0,0,0,.48);
}
.drawer-close {
  position:absolute;
  top:14px;
  right:14px;
  width:34px;
  height:34px;
  border:1px solid var(--game-line);
  border-radius:9px;
  background:#111820;
  color:#b8c1ce;
  font-size:1.2rem;
}
.action-drawer header {
  padding-right:40px;
  display:grid;
  gap:6px;
}
.action-drawer h2 {
  margin:0;
  color:var(--game-text);
  font-size:1.32rem;
}
.action-drawer header p {
  margin:0;
  color:var(--game-muted);
  font-size:.72rem;
  line-height:1.4;
}
.action-badges {
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.action-badges > span:first-child,
.action-state {
  width:max-content;
  padding:5px 8px;
  border-radius:7px;
  background:#17222d;
  color:#aebccc;
  font-size:.58rem;
  font-weight:760;
}
.action-metrics {
  margin:20px 0;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}
.action-metrics div {
  min-width:0;
  padding:11px;
  display:grid;
  gap:5px;
  border:1px solid var(--game-line);
  border-radius:10px;
  background:#0d141c;
}
.action-metrics span,
.meal-summary span {
  color:var(--game-muted-2);
  font-size:.54rem;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.action-metrics strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font:750 .74rem "SFMono-Regular",Consolas,monospace;
}
.drawer-section {
  padding:16px 0;
  display:grid;
  gap:10px;
  border-top:1px solid var(--game-line);
}
.drawer-label {
  color:#7d8da1;
  font-size:.6rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.drawer-help,
.throw-section p {
  margin:0;
  color:var(--game-muted-2);
  font-size:.63rem;
  line-height:1.48;
}
.delta-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:7px;
}
.delta-grid button,
.meal-buttons button,
.vehicle-radio-buttons button,
.wide-action,
.exact-time-row button {
  min-height:40px;
  border:1px solid #2d3a4a;
  border-radius:9px;
  background:#121a23;
  color:#dfe6ef;
  font-weight:760;
  font-size:.67rem;
}
.exact-time-row {
  display:grid;
  grid-template-columns:1fr 1.15fr;
  gap:7px;
}
.wide-action.warning {
  border-color:#654424;
  background:#25180e;
  color:#f3b267;
}
.meal-summary {
  display:grid;
  grid-template-columns:1fr;
  gap:7px;
}
.meal-summary > div {
  padding:9px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #222f3d;
  border-radius:9px;
  background:#0c131b;
}
.meal-summary strong { font-size:.68rem; }
.meal-buttons {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:6px;
}
.meal-buttons button.active {
  border-color:#7b6bc8;
  background:#211d38;
}
.meal-threat {
  margin:0;
  color:#ff8f87;
  font-size:.63rem;
  line-height:1.45;
}

.control-shift-vehicle-sheet .vehicle-timetable-summary {
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.control-shift-vehicle-sheet .vehicle-timetable-summary > div:last-child {
  text-align:right;
}
.vehicle-radio-actions {
  margin:0 18px 12px;
  padding:12px 14px;
  display:grid;
  grid-template-columns:minmax(180px,1fr) auto;
  gap:10px 14px;
  align-items:center;
  border:1px solid #24313d;
  border-radius:12px;
  background:#081017;
}
.vehicle-radio-actions > div:first-child {
  min-width:0;
  display:grid;
  gap:3px;
}
.vehicle-radio-actions > div:first-child > strong {
  font-size:.78rem;
}
.vehicle-radio-actions > div:first-child small {
  color:#77879a;
  font-size:.58rem;
}
.vehicle-radio-buttons {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.vehicle-radio-buttons button {
  min-width:78px;
}
.vehicle-radio-actions p {
  grid-column:1/-1;
  margin:0;
  color:#69798c;
  font-size:.58rem;
}

.inbox-sheet,
.end-overlay {
  position:fixed;
  inset:0;
  z-index:2147483500;
  padding:24px;
  display:grid;
  place-items:center;
  background:rgba(2,4,7,.82);
  backdrop-filter:blur(12px);
}
.inbox-shell {
  width:min(980px,100%);
  height:min(700px,calc(100dvh - 48px));
  display:grid;
  grid-template-rows:auto 1fr;
  border:1px solid #2a3748;
  border-radius:18px;
  overflow:hidden;
  background:#0a0f15;
}
.inbox-shell > header {
  padding:16px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--game-line);
}
.inbox-shell h2 { margin:3px 0 0; font-size:1.05rem; }
.inbox-shell header button {
  width:34px;
  height:34px;
  border:1px solid var(--game-line);
  border-radius:9px;
  background:#111923;
  color:#dfe6ef;
  font-size:1.2rem;
}
.inbox-grid {
  min-height:0;
  display:grid;
  grid-template-columns:320px 1fr;
}
.inbox-list {
  padding:12px;
  overflow:auto;
  border-right:1px solid var(--game-line);
}
.inbox-list button {
  width:100%;
  padding:11px;
  display:grid;
  gap:5px;
  border:1px solid transparent;
  border-bottom-color:#1c2630;
  background:transparent;
  color:#dce4ef;
  text-align:left;
}
.inbox-list button.active {
  border-color:#36527e;
  border-radius:9px;
  background:#101a28;
}
.inbox-list button > span {
  display:flex;
  justify-content:space-between;
  color:#6f7e91;
  font-size:.55rem;
}
.inbox-list strong { font-size:.67rem; }
.inbox-list small { color:var(--game-muted-2); font-size:.58rem; }
.inbox-empty {
  padding:30px 10px;
  color:var(--game-muted-2);
  font-size:.7rem;
  text-align:center;
}
.letter-pane {
  min-height:0;
  padding:24px;
  overflow:auto;
  background:#11151a;
}
.letter-paper {
  min-height:360px;
  padding:32px;
  border-radius:4px;
  background:#e9e7df;
  color:#24272c;
}
.letter-paper > span {
  color:#6b6f73;
  font-size:.68rem;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.letter-paper h3 { margin:18px 0; font-size:1.3rem; }
.letter-paper p {
  max-width:620px;
  font:400 .9rem Georgia,serif;
  line-height:1.8;
}
.letter-paper footer {
  margin-top:42px;
  color:#75787c;
  font-size:.68rem;
}
.letter-empty {
  min-height:100%;
  display:grid;
  place-items:center;
  color:var(--game-muted-2);
}

.end-overlay > div {
  width:min(440px,100%);
  padding:30px;
  display:grid;
  gap:13px;
  border:1px solid #334154;
  border-radius:18px;
  background:#0c1219;
}
.end-overlay h2 { margin:0; font-size:2rem; }
.end-overlay p {
  margin:0;
  color:var(--game-muted);
  line-height:1.55;
}
.end-overlay button {
  min-height:44px;
  margin-top:8px;
  border:0;
  border-radius:10px;
  background:var(--game-accent);
  color:#0a1020;
  font-weight:850;
}

@media (max-width:1050px) {
  .schedule-fields { grid-template-columns:repeat(3,1fr); }
  .operations-grid { grid-template-columns:1fr; }
  .comms-panel { min-height:300px; }
  .comms-log { max-height:330px; }
  .hud { grid-template-columns:minmax(200px,1fr) auto auto auto; }
}

@media (max-width:760px) {
  .game-topbar {
    min-height:58px;
    padding:0 12px;
    grid-template-columns:1fr auto;
  }
  .game-topbar-copy { display:none; }
  .setup-screen { padding:18px 12px 36px; }
  .setup-card {
    padding:20px;
    border-radius:18px;
    gap:18px;
  }
  .difficulty-grid { grid-template-columns:1fr; }
  .schedule-fields { grid-template-columns:1fr 1fr; }
  .schedule-fields label:last-child { grid-column:1/-1; }
  .section-heading {
    align-items:start;
    flex-direction:column;
    gap:5px;
  }
  .setup-actions {
    align-items:stretch;
    flex-direction:column;
  }
  .start-game { width:100%; }
  .game-shell {
    width:calc(100% - 20px);
    padding-top:12px;
  }
  .hud { grid-template-columns:1fr 1fr; }
  .hud-service { grid-column:1/-1; }
  .hud-clock,
  .hud-hearts { min-width:0; }
  .hud-button { width:100%; }
  .game-section-head {
    align-items:start;
    flex-direction:column;
  }
  .game-occ-panel .occ-legend { justify-content:flex-start; }
  .game-panel {
    padding:12px;
    border-radius:14px;
  }
  .panel-head {
    align-items:start;
    flex-direction:column;
  }
  .terminal-tabs { width:100%; }
  .terminal-tab { flex:1; }
  .terminal-strip { grid-template-columns:auto 1fr; }
  .terminal-strip small { display:none; }
  .action-drawer { padding:20px; }
  .action-metrics { grid-template-columns:1fr; }
  .control-shift-vehicle-sheet .vehicle-timetable-summary {
    grid-template-columns:1fr;
  }
  .control-shift-vehicle-sheet .vehicle-timetable-summary > div:last-child {
    text-align:left;
  }
  .vehicle-radio-actions { grid-template-columns:1fr; }
  .vehicle-radio-actions p { grid-column:auto; }
  .inbox-sheet { padding:10px; }
  .inbox-shell { height:calc(100dvh - 20px); }
  .inbox-grid {
    grid-template-columns:1fr;
    grid-template-rows:210px 1fr;
  }
  .inbox-list {
    border-right:0;
    border-bottom:1px solid var(--game-line);
  }
  .letter-pane { padding:12px; }
  .letter-paper { padding:22px; }
}

@media (max-width:430px) {
  .schedule-fields { grid-template-columns:1fr; }
  .schedule-fields label:last-child { grid-column:auto; }
  .scenario-banner { align-items:flex-start; }
  .meal-buttons { grid-template-columns:1fr 1fr; }
}


/* v2.0.2 · stable simulated OCC bunch interaction + exact edge colours */
.game-occ-panel {
  --occ-green:#04931D;
  --occ-blue:#148CDA;
  --occ-orange:#FF871E;
  --occ-edge:#727272;
}

.game-occ-panel .occ-bus-block.edge {
  --bus-color:#727272;
  background:#727272 !important;
  border-color:#727272 !important;
  color:#0b0b0b !important;
  opacity:1 !important;
  visibility:visible !important;
}
.game-occ-panel .occ-bus-block.scheduled {
  opacity:1 !important;
  visibility:visible !important;
}

/* The production Control Desk can use hover fan-out because its graph DOM is
   comparatively stable. The game redraws positions continuously, so hover
   fan-out would chase the pointer and oscillate. Control Shift therefore
   expands a bunch only after the player clicks it. */
.game-occ-panel .occ-bus-bunch.bunched:hover:not(.expanded) {
  z-index:8 !important;
}
.game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded) .occ-bus-member .occ-bus-block {
  transform:translateX(calc(-50% + var(--edge-x,0px) + var(--stack))) !important;
  box-shadow:4px 0 0 rgba(255,255,255,.05),0 6px 18px rgba(0,0,0,.32) !important;
}
.game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-1 .occ-bus-member > .occ-bus-link {
  height:var(--base-link-len) !important;
  top:calc(200px - var(--base-link-len)) !important;
  transform-origin:50% 100% !important;
  transform:rotate(var(--base-angle)) !important;
}
.game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-2 .occ-bus-member > .occ-bus-link {
  height:var(--base-link-len) !important;
  top:-110px !important;
  transform-origin:50% 0% !important;
  transform:rotate(var(--base-angle-neg)) !important;
}

@media (orientation:portrait), (max-width:759px) {
  .game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-1 .occ-bus-member .occ-bus-block {
    transform:translate(calc(-100% - 24px),calc(-50% + var(--stack))) !important;
  }
  .game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-2 .occ-bus-member .occ-bus-block {
    transform:translate(24px,calc(-50% + var(--stack))) !important;
  }
  .game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-1 .occ-bus-member > .occ-bus-link {
    top:-1px !important;
    left:calc(0px - var(--base-portrait-len)) !important;
    width:var(--base-portrait-len) !important;
    height:2px !important;
    transform-origin:100% 50% !important;
    transform:rotate(var(--base-portrait-angle-neg)) !important;
  }
  .game-occ-panel .occ-shared-graph .occ-bus-bunch.bunched:hover:not(.expanded).dir-2 .occ-bus-member > .occ-bus-link {
    top:-1px !important;
    left:0 !important;
    width:var(--base-portrait-len) !important;
    height:2px !important;
    transform-origin:0 50% !important;
    transform:rotate(var(--base-portrait-angle)) !important;
  }
}


/* v2.1.1 · scenario source selector */
.schedule-source-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.schedule-source-card {
  position:relative;
  cursor:pointer;
}
.schedule-source-card input {
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.schedule-source-card > span {
  min-height:104px;
  padding:14px 15px;
  display:grid;
  align-content:start;
  gap:5px;
  border:1px solid var(--game-line);
  border-radius:13px;
  background:#0b1118;
}
.schedule-source-card input:checked + span {
  border-color:#5579e6;
  background:#101a2c;
  box-shadow:inset 0 0 0 1px rgba(124,156,255,.14);
}
.schedule-source-card b {
  color:#e9eef6;
  font-size:.75rem;
}
.schedule-source-card strong {
  color:#9db7ff;
  font-size:.67rem;
}
.schedule-source-card small {
  color:var(--game-muted);
  font-size:.64rem;
  line-height:1.45;
}
.schedule-fields input:disabled {
  opacity:.54;
  cursor:not-allowed;
  border-style:dashed;
}

@media (max-width:760px) {
  .schedule-source-grid { grid-template-columns:1fr; }
}
