/*
 * console.css - the CORE operator screen (the standard Directive layout) for the web simulator.
 *
 * The colour tokens below are copied from core.app/App.axaml ThemeDictionaries (Dark) under
 * the same names, so the web console matches the shipped app and a palette change there is
 * a find-and-replace here. The web version is dark-only by decision: no light theme.
 *
 * Two kinds of UI live on this page and are styled apart on purpose:
 *   .dir      - the Directive operator screen (Views/OperatorDirectiveView.axaml). Keep it faithful.
 *   .sim-*    - simulator chrome (top bar, console desk, coach, CTAs). Never part of
 *               the real product; styled as hardware / overlay so nobody mistakes it.
 */

:root {
  --AppBackground:#0f172a; --FieldDeep:#0b1220; --FieldDeep2:#0b1120; --Recessed:#111827;
  --SurfaceBackground:#1e293b; --Panel2:#1c253b; --SurfaceBorder:#334155; --Border2:#374151;
  --TextPrimary:#f8fafc; --TextBright:#e2e8f0; --TextSoft:#cbd5e1; --TextSecondary:#b8c4d6;
  --TextMuted:#94a3b8; --TextTertiary:#64748b; --TextFaint:#475569;
  --LogInfo:#d6deea; --LogState:#38bdf8; --LogCmd:#7dd3fc; --LogAck:#9fb3c8; --LogRejected:#fb923c;
  --LogFaultActive:#f87171; --LogFaultCleared:#4ade80; --LogError:#f472b6; --LogBeam:#fbbf24;
  --LogStep2:#c4b5fd; --LogStream:#8b9bb4;
  --AccentBlue:#3b82f6; --AccentHover:#2563eb; --AccentSoft:#60a5fa;
  --Ok:#10b981; --OkStrong:#16a34a; --OkFill:#14532d; --OkPale:#bbf7d0;
  --Fault:#ef4444; --FaultStrong:#dc2626; --FaultFill:#7f1d1d; --FaultPale:#fecaca;
  --Warn:#f59e0b; --WarnText:#fbbf24; --WarnDeep:#b45309; --OkText:#34d399; --WarnPale:#fed7aa; --WarnFillPale:#ffedd5; --Orange:#ea580c; --WarnFill:#7c2d12;
  --EngineeringFill:#2e1065; --EngineeringPale:#ede9fe;
  --CardShadow:0 4px 12px 0 rgba(0,0,0,.25);
  --WordmarkUrl:url("img/core-wordmark-white.png");
  --LogoUrl:url("img/sl-logo-white.png");
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: var(--AppBackground); color: var(--TextPrimary);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; }
.hidden { display: none !important; }
svg.ico { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* ======================= page frame ======================= */
/* Two frames. PHONE (narrow or short window): everything stacks and the page scrolls, as a
   1080p console cannot be read scaled onto a phone. FIT (laptop / desktop / ultrawide, see
   the media query in "fit to window" below): the page never scrolls - the operator screen is
   laid out at a console-sized canvas and scaled to the window by console.js fitStage(). */
.app { display: flex; flex-direction: column; min-height: 100vh; }
/* The console's own breakpoints follow the CANVAS width (container queries, in
   "responsive" below), not the window: scaled down on a laptop it keeps its desktop layout. */
.sim-canvas { container: console / inline-size; }
/* Phone: the side column dissolves (its tour and desk join the page flow), so the desk's
   sticky strip is bounded by the whole page, not by the column. FIT mode makes it a box. */
.sim-side { display: contents; }

/* ======================= SIM: top bar ======================= */
.sim-bar {
  display: flex; align-items: center; gap: 14px; padding: 8px 16px;
  background: #020617; color: #cbd5e1; font-size: 13px; border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
}
.sim-bar .tag {
  font-weight: 800; letter-spacing: 1.5px; font-size: 11px; color: #0f172a;
  background: #fbbf24; padding: 3px 8px; border-radius: 4px;
}
.sim-bar .note { color: #94a3b8; flex: 1; min-width: 200px; }
.sim-bar .grp { display: flex; gap: 8px; align-items: center; }
.sim-btn {
  background: transparent; border: 1px solid #334155; color: #e2e8f0; border-radius: 6px;
  padding: 5px 12px; font-size: 12.5px; font-weight: 600;
}
.sim-btn:hover { border-color: #60a5fa; }
.sim-btn.on { background: #1e3a8a; border-color: #3b82f6; }
.sim-cta {
  background: #2563eb; border: 0; color: #fff; border-radius: 6px; padding: 6px 14px;
  font-weight: 700; font-size: 13px; text-decoration: none;
}
.sim-cta:hover { background: #1d4ed8; }

/* ======================= shared by the screen, log and modals ======================= */
/* Radiation symbol: amber (the Warn token), as App.axaml colours every trefoil. */
svg.rad { fill: currentColor; color: var(--Warn); flex: none; }
@keyframes radFade { 0%,100% { opacity: .1 } 50% { opacity: 1 } }
.btn-accent { background: var(--AccentBlue); color: #fff; border: 0; border-radius: 10px; font-weight: 900; }
.btn-accent:hover:not(:disabled) { background: var(--AccentHover); }
@keyframes wig { 0% { opacity: 1 } 50% { opacity: 0 } }
@keyframes wag { 0% { opacity: 0 } 50% { opacity: 1 } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px) } to { opacity: 1; transform: none } }
/* Event-log colours by entry type (AddLogEntry types) */
.t-INFO { color: var(--LogInfo) } .t-STATE { color: var(--LogState) } .t-CMD { color: var(--LogCmd) }
.t-ACK { color: var(--LogAck) } .t-REJECTED { color: var(--LogRejected) } .t-FAULT_ACTIVE { color: var(--LogFaultActive) }
.t-FAULT_CLEARED { color: var(--LogFaultCleared) } .t-ERROR { color: var(--LogError) } .t-BEAM { color: var(--LogBeam) }
.t-STEP2 { color: var(--LogStep2) } .t-STREAM { color: var(--LogStream) }

/* Modals (fault details + simulator messages) */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.8); display: flex; align-items: center;
  justify-content: center; z-index: 50; padding: 16px; }
.modal-card { background: var(--SurfaceBackground); width: 520px; max-width: 100%; border-radius: 16px;
  padding: 28px; border: 1px solid var(--SurfaceBorder); box-shadow: 0 20px 40px rgba(0,0,0,.63);
  display: flex; flex-direction: column; gap: 20px; max-height: calc(100vh - 32px); overflow: auto; }
.modal-card .ico-big { width: 40px; height: 40px; margin: 0 auto; }
.modal-card h2 { margin: 0; text-align: center; font-size: 24px; font-weight: 900; }
.pane { background: var(--AppBackground); border: 1px solid var(--SurfaceBorder); border-radius: 12px; padding: 18px; }
.pane .Label { font-size: 11px; font-weight: 700; color: var(--TextSecondary); letter-spacing: .5px; margin-bottom: 8px; }
.pane p { margin: 0; font-size: 13px; line-height: 1.45; }
.chips-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.chip { background: var(--Recessed); border: 1px solid var(--SurfaceBorder); border-radius: 8px; padding: 6px 14px; text-align: center; }
.chip .Label { margin: 0; }
.chip .v { font-size: 14px; font-weight: 900; }
.modal-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.modal-actions button, .modal-actions a { height: 45px; min-width: 120px; padding: 0 18px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; }
.btn-ghost { background: transparent; border: 1px solid var(--SurfaceBorder); color: var(--TextPrimary); }

/* ======================= DIRECTIVE (the standard operator screen) =======================
   Views/OperatorDirectiveView.axaml, designed at 1920x1080: header 68, the next-action
   banner, then a content column (state + dosimetry / interlocks / power-targets-beam)
   beside a 480 px event log that collapses to a 44 px rail. Chip colours are the view
   model's fixed hexes (FaultViewModel), as the app draws them. */
.dir { flex: 1; display: flex; flex-direction: column; background: var(--AppBackground); }
.d-head { height: 68px; flex: none; display: flex; align-items: center; padding: 0 24px;
  background: var(--FieldDeep); border-bottom: 1px solid var(--SurfaceBorder); }
.d-wordmark { width: 94px; height: 40px; flex: none; background: var(--WordmarkUrl) left center/contain no-repeat; }
.d-div { width: 1px; height: 28px; margin: 0 22px; background: var(--SurfaceBorder); flex: none; }
.d-site { font-size: 12px; font-weight: 800; color: var(--TextTertiary); white-space: nowrap; }
.d-spacer { flex: 1; }
.d-rad { width: 34px; height: 34px; color: var(--Warn); opacity: 0; margin-right: 18px; flex: none; }
.beaming .d-rad { animation: radFade 2s ease-in-out infinite; }
.d-logo { width: 118px; height: 44px; flex: none; background: var(--LogoUrl) center/contain no-repeat; margin-right: 28px; }
.d-run { display: flex; gap: 18px; align-items: center; font-size: 12.5px; color: var(--TextMuted); margin-right: 22px; white-space: nowrap; }
.d-run > span { display: inline-flex; align-items: center; gap: 8px; }
.d-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--Ok); display: inline-block; }
.d-lic { color: var(--Warn); font-weight: 600; }
.d-hbtn { height: 32px; padding: 0 14px; border-radius: 4px; background: transparent; border: 1px solid var(--Border2);
  color: var(--TextMuted); font-size: 11.5px; font-weight: 600; margin-left: 8px; flex: none; }
.d-hbtn.svc { border-color: var(--WarnDeep); color: var(--Warn); }

.d-banner { display: flex; flex: none; background: var(--WarnFill); border-bottom: 1px solid var(--WarnDeep); }
.d-banner .rail { width: 8px; flex: none; background: #64748b; }
.d-banner-in { flex: 1; display: flex; align-items: center; gap: 26px; padding: 20px 26px; min-width: 0; }
.d-banner .b-ico { width: 40px; height: 40px; }
.b-text { flex: 1; min-width: 0; }
.b-title { font-size: 25px; font-weight: 800; color: var(--WarnText); line-height: 1.2; }
.b-detail { font-size: 14.5px; line-height: 20px; color: var(--WarnPale); margin-top: 4px; }
.b-acts { display: flex; gap: 12px; align-items: center; flex: none; }
.b-btn { height: 56px; padding: 0 28px; border-radius: 6px; border: 0; font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; }
.b-btn:hover { filter: brightness(1.1); }
.b-clear { background: var(--Warn); color: #1c1204; }
.b-power { background: var(--AccentBlue); }
.b-start { background: var(--OkStrong); }
.b-stop { background: var(--Recessed); border: 3px solid var(--Fault); color: var(--Fault); font-size: 18px; font-weight: 900;
  padding: 0 16px; display: inline-flex; align-items: center; gap: 14px; }
.b-stop .rad { width: 40px; height: 40px; color: var(--Warn); opacity: 0; }
.b-fault { background: transparent; border: 1px solid var(--WarnDeep); color: var(--WarnText); font-size: 15px; font-weight: 600; padding: 0 22px; }
.beaming .b-stop .rad.a, .beaming .d-beam .rad.a { animation: wig .5s steps(1, end) infinite; }
.beaming .b-stop .rad.b, .beaming .d-beam .rad.b { animation: wag .5s steps(1, end) infinite; }

.d-body { flex: 1; display: flex; min-height: 0; }
.d-content { flex: 1; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.d-card { background: var(--SurfaceBackground); border: 1px solid var(--SurfaceBorder); border-radius: 10px; padding: 18px 18px 16px; }
.d-lbl { font-size: 11px; font-weight: 800; color: var(--TextTertiary); letter-spacing: .3px; }
.d-row1 { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; }
.d-row1 .d-card { padding: 22px 24px; }
.d-state { font-size: 58px; font-weight: 900; color: var(--AccentBlue); line-height: 1.15; margin-top: 12px; }
.d-warm { background: var(--WarnFill); border: 1px solid var(--WarnDeep); border-radius: 8px; padding: 8px 14px; margin-top: 14px; }
.d-warm .w-lbl { font-size: 11px; font-weight: 800; color: var(--Warn); margin-right: 12px; }
.d-warm .w-val { font-size: 34px; font-weight: 900; color: var(--WarnText); vertical-align: middle; }
.d-warm .w-cap { font-size: 11.5px; color: var(--WarnPale); }
.d-step2 { background: #2e1065; border: 1px solid #8b5cf6; border-radius: 8px; padding: 8px 14px; margin-top: 14px;
  font-size: 12px; font-weight: 600; color: #ede9fe; }
.d-checks { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.d-checks li { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--TextSecondary); }
.d-checks li svg { width: 16px; height: 16px; color: var(--Fault); }
.d-checks li.ok svg { color: var(--Ok); }
.d-row1 #dDosiCard { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.d-dosi { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; flex: 1; }
.d-del { display: flex; align-items: flex-end; gap: 8px; }
.d-del .big { font-size: 76px; font-weight: 900; color: var(--TextPrimary); line-height: 1; }
.d-del .of { font-size: 20px; font-weight: 600; color: var(--TextSecondary); margin-bottom: 8px; }
.d-rates { display: flex; gap: 30px; margin-bottom: 4px; }
.d-sub { font-size: 10.5px; font-weight: 800; color: var(--TextTertiary); }
.d-rates .rv { font-size: 42px; font-weight: 900; color: var(--AccentBlue); line-height: 1.1; }
.d-prog { height: 14px; border-radius: 7px; background: var(--FieldDeep); overflow: hidden; }
.d-prog span { display: block; height: 100%; width: 0; background: var(--AccentBlue); border-radius: 7px; transition: width .1s linear; }

.d-ilk { flex: 1; padding: 18px 22px; min-height: 0; overflow: auto; }
.d-ilk-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pill { border-radius: 10px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: var(--FieldDeep); }
.pill.amber { background: var(--Warn); }
.pill.green { background: var(--Ok); }
.faint { font-size: 11px; color: var(--TextFaint); }
.d-sev { font-size: 10px; font-weight: 700; margin-bottom: 8px; }
.d-sev.major { color: var(--Fault); }
.d-sev.minor { color: var(--Warn); margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; }
.chipf { margin: 0 10px 10px 0; padding: 8px 11px; border-radius: 6px; border: 2px solid #16a34a; background: #0f172a;
  min-width: 150px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.chipf.minor { border-width: 1.5px; min-width: 128px; }
.chipf:hover { filter: brightness(1.15); }
.chipf .k { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-family: Consolas, Menlo, monospace; font-size: 13px; font-weight: 800; color: #f8fafc; }
.chipf .k svg { width: 12px; height: 12px; }
.chipf .s { font-size: 9px; font-weight: 700; }

.d-row3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); }
.d-row3 #dPowerCard { margin-right: 20px; }
.d-row3 #dTargetsCard { margin-right: 12px; }
.d-row3 .d-lbl { display: block; margin-bottom: 12px; }
.d-power { width: 100%; height: 84px; border-radius: 8px; background: var(--Panel2); color: var(--TextPrimary);
  border: 1px solid var(--Border2); font-size: 22px; font-weight: 800; }
.d-power:hover { border-color: var(--AccentBlue); }
.t-row { display: flex; align-items: center; height: 38px; margin-bottom: 8px; min-width: 0; }
.t-lbl { font-size: 10.5px; font-weight: 800; color: var(--TextTertiary); margin-right: 10px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 150px; flex: 0 1 auto; }
.t-in { flex: 1; min-width: 50px; width: 0; height: 38px; border-radius: 6px; border: 1px solid var(--SurfaceBorder); background: var(--FieldDeep);
  color: var(--TextPrimary); font-size: 16px; font-weight: 700; padding: 0 10px; outline: none; }
.t-in:focus { border-color: var(--AccentBlue); }
.t-set { width: 78px; height: 38px; margin-left: 8px; border-radius: 6px; border: 0; background: var(--AccentBlue); color: #fff;
  font-size: 14px; font-weight: 900; flex: none; }
.t-set:hover { background: var(--AccentHover); }
.t-step { flex: 1; min-width: 96px; display: grid; grid-template-columns: 28px minmax(40px, 1fr) 28px; height: 38px; }
.t-step button { border-radius: 6px; border: 1px solid var(--SurfaceBorder); background: var(--Panel2); color: var(--TextPrimary);
  font-size: 20px; font-weight: 900; padding: 0; }
.t-step output { margin: 0 3px; display: flex; align-items: center; justify-content: center; border-radius: 6px;
  border: 1px solid var(--SurfaceBorder); background: var(--FieldDeep); font-size: 16px; font-weight: 700; }
/* Beam faces, App.axaml order: dirBeam (grey idle) -> startGreen.ready -> stopFace.beaming */
.d-beam { width: 100%; height: 84px; border-radius: 8px; background: var(--FieldDeep); border: 1px solid var(--Border2);
  display: flex; align-items: center; justify-content: center; color: var(--TextPrimary); }
.d-beam.ready { background: var(--OkFill); border-color: var(--OkStrong); }
.d-beam.beaming { background: var(--Recessed); border: 3px solid var(--Fault); }
.d-beam:disabled { opacity: 1; }
.d-beam .cap { font-size: 26px; font-weight: 900; }
.d-beam .cap.ok { color: var(--OkText); }
.d-beam .cap.muted { color: var(--TextMuted); }
.d-beam .cap.stop { color: var(--Fault); }
.d-beam .stopRow { display: flex; align-items: center; gap: 20px; }
.d-beam .rad { width: 52px; height: 52px; color: var(--Warn); opacity: 0; }
.d-beam .blocked { display: flex; align-items: center; gap: 12px; text-align: left; }
.d-beam .lk { width: 26px; height: 26px; color: var(--TextMuted); }
.d-beam .why { font-size: 12.5px; font-weight: 500; color: var(--TextTertiary); }

.d-log { width: 480px; flex: none; background: var(--FieldDeep); border-left: 1px solid var(--SurfaceBorder);
  display: flex; flex-direction: column; min-height: 0; contain: size; }
.d-log-h { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 20px; }
.d-log-h .faint { margin-left: auto; }
.d-collapse { width: 36px; height: 36px; border-radius: 6px; background: transparent; border: 1px solid var(--Border2);
  color: var(--TextMuted); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.d-collapse svg { width: 20px; height: 20px; }
.d-log-list { flex: 1; overflow-y: auto; padding-bottom: 12px; min-height: 0; }
.d-entry { display: grid; grid-template-columns: auto 74px minmax(0, 1fr); padding: 11px 20px; border-bottom: 1px solid var(--SurfaceBorder);
  font-family: Consolas, Menlo, monospace; font-size: 13px; animation: slideIn .18s ease-out; }
.d-entry .ts { color: var(--TextFaint); margin-right: 10px; }
.d-entry .lab { font-weight: 700; margin-right: 8px; }
.d-entry .msg { overflow-wrap: anywhere; }
.d-rail { width: 44px; flex: none; background: var(--FieldDeep); border: 0; border-left: 1px solid var(--SurfaceBorder);
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 14px 0; color: var(--TextMuted); }
.d-rail svg { width: 22px; height: 22px; }
.d-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; font-weight: 800; color: var(--TextTertiary); }

/* ======================= SIM: console desk (simulated hardware) ======================= */
.sim-desk {
  background: linear-gradient(#26292e, #1b1d21); border-top: 3px solid #0a0a0b; color: #d4d4d8;
  padding: 14px 20px 16px; display: flex; gap: 28px; align-items: stretch; flex-wrap: wrap;
  box-shadow: inset 0 1px 0 #3f434a;
}
.desk-sec { display: flex; flex-direction: column; gap: 8px; }
.desk-sec h4 { margin: 0; font-size: 10.5px; letter-spacing: 1.8px; color: #a1a1aa; font-weight: 800; }
.desk-sec .hint { font-size: 11.5px; color: #8b8b93; max-width: 280px; }
.keysw { display: flex; align-items: center; gap: 14px; background: none; border: 0; padding: 0; color: inherit; text-align: left; }
.keysw .plate { width: 64px; height: 64px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, #d4d4d8, #71717a 60%, #3f3f46); box-shadow: 0 2px 6px #000, inset 0 -2px 4px rgba(0,0,0,.5); }
.keysw .slot { position: absolute; left: 50%; top: 50%; width: 10px; height: 46px; margin: -23px 0 0 -5px;
  border-radius: 5px; background: linear-gradient(90deg, #3f3f46, #18181b); transform: rotate(-45deg); transition: transform .25s; }
.keysw.on .slot { transform: rotate(45deg); }
.keysw .pos { font-size: 11px; line-height: 1.6; font-weight: 700; color: #71717a; }
.keysw .pos .act { color: #fbbf24; }
.keysw.on .pos .act { color: #71717a; }
.keysw.on .pos .en { color: #4ade80; }
.hw-btns { display: flex; gap: 14px; }
.hw-btn { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #3f3f46; font-weight: 900; font-size: 11px;
  color: #fff; box-shadow: 0 3px 0 #000, 0 4px 8px rgba(0,0,0,.6); letter-spacing: .5px; }
.hw-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.hw-btn.on { background: radial-gradient(circle at 40% 35%, #4ade80, #15803d); }
.hw-btn.off { background: radial-gradient(circle at 40% 35%, #f87171, #b91c1c); }
.hw-lamp { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: #a1a1aa; }
.hw-lamp i { width: 16px; height: 16px; border-radius: 50%; background: #3f3f46; box-shadow: inset 0 1px 2px #000; display: inline-block; }
.hw-lamp.lit.ready i { background: #4ade80; box-shadow: 0 0 10px #4ade80; }
.hw-lamp.lit.beam i { background: #fbbf24; box-shadow: 0 0 12px #fbbf24; }
.trips { display: flex; flex-wrap: wrap; gap: 6px; max-width: 520px; }
.trip { background: #18181b; border: 1px solid #3f3f46; color: #e4e4e7; border-radius: 5px; padding: 5px 9px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .5px; }
.trip:hover { border-color: #f87171; }
.trip.on { background: #7f1d1d; border-color: #ef4444; color: #fecaca; }
.desk-sec.grow { flex: 1; min-width: 260px; }

/* ======================= SIM: coach (guided tour) ======================= */
/* A strip between the screen and the console desk: never on top of the operator screen
   (either layout), and right above the key switch / trip buttons it talks about.
   Dashed amber so it reads as simulator chrome, not product. */
.sim-coach {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 22px; align-items: start;
  background: #0b1220; color: #e2e8f0; border-top: 2px dashed #f59e0b;
  padding: 12px 20px; font-size: 13.5px;
}
.sim-coach .hd { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.sim-coach .hd b { font-size: 11px; letter-spacing: 1.6px; color: #fbbf24; }
.sim-coach .x { background: none; border: 1px solid #334155; color: #94a3b8; font-size: 11.5px; border-radius: 5px; padding: 1px 8px; }
.sim-coach h3 { margin: 0 0 4px; font-size: 17px; color: #fff; }
.sim-coach p { margin: 0; color: #cbd5e1; line-height: 1.45; }
.sim-coach ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 16px; }
.sim-coach li { display: flex; gap: 8px; align-items: center; color: #64748b; font-size: 12.5px; }
.sim-coach li .ck { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #475569; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.sim-coach li.done { color: #86efac; }
.sim-coach li.done .ck { background: #16a34a; border-color: #16a34a; color: #fff; }
.sim-coach li.cur { color: #fff; font-weight: 600; }
.sim-coach li.cur .ck { border-color: #f59e0b; box-shadow: 0 0 0 3px #f59e0b33; }
.sim-coach .foot { margin-top: 10px; display: flex; gap: 8px; }
.coach-prog { display: none; gap: 6px; align-items: center; font-size: 11.5px; color: #94a3b8; }
.coach-prog i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #475569; display: inline-block; }
.coach-prog i.done { background: #16a34a; border-color: #16a34a; }
.coach-prog i.cur { border-color: #f59e0b; box-shadow: 0 0 0 3px #f59e0b33; }
.coach-prog span { margin-left: 6px; }
.sim-coach .foot:empty { display: none; }
.sim-desk .coach-tab { align-self: center; margin-left: auto; }

/* Highlight ring the coach puts on the control it is talking about. */
.coach-target { outline: 3px solid #fbbf24 !important; outline-offset: 3px; border-radius: 12px;
  animation: pulseRing 1.4s ease-in-out infinite; }
@keyframes pulseRing { 50% { outline-color: #fbbf2455 } }

/* Attract mode (the landing page's live preview iframe): no chrome, no input. */
.attract .sim-bar, .attract .sim-desk, .attract .sim-coach, .attract .sim-side { display: none !important; }
.attract { pointer-events: none; user-select: none; }

/* ======================= fit to window (laptop / desktop / ultrawide) ======================= */
/* Same query as FIT_QUERY in console.js - keep them identical. */
@media (min-width: 900px) and (min-height: 480px) {
  html, body { height: 100%; overflow: hidden; }
  .app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .sim-main { flex: 1; min-height: 0; display: flex; }
  .sim-stage { flex: 1; min-width: 0; position: relative; overflow: hidden; background: #05080f; }
  /* console.js sets width, height and transform: scale(s) from the stage's size. */
  .sim-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; display: flex; flex-direction: column; }
  /* While fitStage() measures, show the tallest content the screen can have (the warm-up
     card, a two-line banner), so the scale chosen now never overflows later. */
  .sim-canvas.measuring #dWarm { display: block !important; }
  .sim-canvas.measuring .b-detail { min-height: 2.9em; }

  /* The side column: guided tour on top, console desk under it. */
  .sim-side { width: 330px; flex: none; display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
    background: linear-gradient(#26292e, #1b1d21); border-left: 3px solid #0a0a0b; }
  .sim-side .sim-coach { grid-template-columns: 1fr; gap: 10px; border-top: 0; border-bottom: 2px dashed #f59e0b; padding: 12px 16px; }
  .sim-side .sim-coach ol { grid-template-columns: 1fr; }
  .sim-side .sim-desk { flex: 1; border-top: 0; box-shadow: none; background: none; padding: 14px 16px;
    display: grid; grid-template-columns: auto 1fr; gap: 16px 18px; align-content: start; }
  .sim-side .desk-sec:nth-child(1) { grid-column: 1 / -1; }          /* key switch */
  .sim-side .desk-sec.grow { grid-column: 1 / -1; min-width: 0; }    /* instructor trips */
  .sim-side .trips { max-width: none; }
  .sim-side .coach-tab { grid-column: 1 / -1; margin-left: 0; justify-self: start; }
}
/* Ultrawide: a wider side column. Short windows: the compact tour (dots, not the list). */
@media (min-width: 2000px) and (min-height: 480px) { .sim-side { width: 400px; } }
@media (min-width: 900px) and (min-height: 480px) and (max-height: 820px) {
  .sim-side .sim-coach ol { display: none; }
  .sim-side .coach-prog { display: flex; }
  .sim-side .desk-sec .hint { display: none; }
  .sim-side .sim-coach p { font-size: 12.5px; line-height: 1.4; }
}

/* Very short windows (a 1280x720 laptop): a tighter desk so the side column still fits. */
@media (min-width: 900px) and (min-height: 480px) and (max-height: 640px) {
  .sim-side .sim-desk { gap: 10px 16px; padding: 10px 16px; }
  .sim-side .keysw .plate, .sim-side .hw-btn { width: 52px; height: 52px; }
  .sim-side .keysw .slot { height: 38px; margin-top: -19px; }
  .sim-side .sim-coach { padding: 10px 16px; }
}

/* ======================= responsive (the console's own width) ======================= */
@container console (max-width: 1500px) {
  .d-log { width: 380px; }
  .d-site, .d-logo { display: none; }
}
@container console (max-width: 1280px) {
  .d-run span:nth-child(n+2):nth-child(-n+4) { display: none; }
}
@container console (max-width: 1100px) {
  .d-run, .d-rad { display: none; }
  .d-body { flex-direction: column; }
  .d-log { width: auto; height: 300px; border-left: 0; border-top: 1px solid var(--SurfaceBorder); }
  .d-log.hidden { display: flex !important; }   /* stacked: the log is never collapsed */
  .d-rail, .d-collapse { display: none !important; }
  .d-row1 { grid-template-columns: 1fr; }
  .d-row3 { grid-template-columns: 1fr 1fr; gap: 14px; }
  .d-row3 #dPowerCard, .d-row3 #dTargetsCard { margin-right: 0; }
  .d-row3 #dBeamCard { grid-column: 1 / -1; }
  .d-banner-in { flex-wrap: wrap; gap: 14px 20px; }
  .b-text { flex: 1 1 100%; }
  .b-acts { flex-wrap: wrap; width: 100%; }
}
@container console (max-width: 700px) {
  .d-head { padding: 0 14px; height: 56px; }
  .d-hbtn { padding: 0 9px; }
  .d-content { padding: 14px; gap: 14px; }
  .d-row3 { grid-template-columns: 1fr; }
  .d-state { font-size: 44px; }
  .d-del .big { font-size: 56px; }
  .d-rates .rv { font-size: 32px; }
  .b-title { font-size: 20px; }
  .b-btn { height: 48px; padding: 0 18px; }
  .d-banner-in { padding: 14px 16px; }
  .b-ico { display: none; }
  .chipf, .chipf.minor { min-width: 0; flex: 1 1 96px; }
}
/* Phone chrome (outside the console, so a window query). */
@media (max-width: 700px) {
  /* Phone: the console desk becomes a sticky strip (key + trips) so the key switch and the
     instructor panel stay in reach while the visitor scrolls the screen above. */
  .sim-desk { position: sticky; bottom: 0; z-index: 30; padding: 8px 10px; gap: 12px; flex-wrap: nowrap; align-items: center; }
  .sim-desk .desk-sec:nth-child(2), .sim-desk .desk-sec:nth-child(3), .sim-desk .hint, .sim-desk .coach-tab { display: none; }
  .sim-desk h4 { font-size: 9px; letter-spacing: 1.2px; }
  .keysw .plate { width: 44px; height: 44px; }
  .keysw .slot { height: 32px; margin-top: -16px; }
  .keysw .pos { font-size: 9.5px; }
  .desk-sec.grow { min-width: 0; }
  .trips { flex-wrap: nowrap; overflow-x: auto; max-width: none; padding-bottom: 2px; }
  .trip { flex: none; }
  .sim-bar { padding: 8px 10px; gap: 8px; }
  .sim-bar .note { display: none; }
  .sim-bar .grp { flex-wrap: wrap; gap: 6px; }
  .sim-btn { padding: 4px 8px; font-size: 11.5px; }
  .sim-coach { grid-template-columns: 1fr; padding: 10px 12px; }
  .sim-coach ol { display: none; }
}
