/* app.css — layout and components. */

/* ---------------------------------------------------------------- chrome */
.topbar {
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo { width: 30px; height: 30px; color: var(--ink); flex: none;
  /* A real object catches light and casts a contact shadow. */
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.5));
  transition: transform var(--dur) var(--ease); }
.brand:hover .logo { transform: rotate(-4deg); }
.wordmark {
  font-family: var(--font-mono);
  font-weight: 700; font-size: var(--text-sm);
  letter-spacing: 0.18em;
}
.wordmark em { font-style: normal; color: var(--phos); }

.nav { display: flex; gap: 2px; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); }
.nav-btn {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 7px 14px; border-radius: var(--r-sm); color: var(--ink-3);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-btn:hover { color: var(--ink); }
.nav-btn.on { color: var(--ink); background: var(--bg-4); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); }

.topbar-right { display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; }
.deadline {
  display: flex; align-items: baseline; gap: 6px;
  font-family: var(--font-mono); padding: 5px 11px;
  border: 1px solid var(--amber-dim); border-radius: var(--r);
  background: color-mix(in oklab, var(--amber) 8%, transparent);
}
.deadline span { font-size: var(--text-md); font-weight: 700; color: var(--amber); }
.deadline small { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r);
  color: var(--ink-2); background: var(--bg-2);
  transition: color var(--dur-fast), border-color var(--dur-fast);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }

/* ---------------------------------------------------------------- views */
.view { display: none; }
.view.active { display: block; }
body[data-view="cockpit"] .topbar { position: relative; }

/* ---------------------------------------------------------------- hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--s8); align-items: center;
  max-width: 1360px; margin: 0 auto;
  padding: var(--s9) var(--s5) var(--s8);
}
.eyebrow { margin-bottom: var(--s4); }
.hero h1 { margin-bottom: var(--s5); }
.hero h1 em { font-style: normal; color: var(--ink-3); }
.lede {
  font-size: var(--text-md); color: var(--ink-2);
  max-width: 60ch; margin-bottom: var(--s6);
  text-wrap: pretty;
}
.hero-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; margin-bottom: var(--s4);
}
.hero-stats div { padding: var(--s3) var(--s4); background: var(--bg-1); }
.hero-stats b {
  display: block; font-family: var(--font-mono); font-size: var(--text-lg);
  font-weight: 700; color: var(--phos); letter-spacing: -0.02em;
}
.hero-stats span { font-size: var(--text-xs); color: var(--ink-3); line-height: 1.35; display: block; }
.hero-note { font-size: var(--text-xs); color: var(--ink-4); font-family: var(--font-mono); }

.hero-panel {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: var(--bg-1);
  padding: var(--s4); overflow: hidden;
}
.hp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.hp-cell { background: var(--bg); padding: var(--s3) var(--s2); text-align: center; }
.hp-cell span { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em; color: var(--ink-4); }
.hp-cell b { display: block; font-family: var(--font-mono); font-size: var(--text-lg); font-weight: 700; color: var(--phos); }
.hp-cell small { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); }
.hp-trace { margin: var(--s4) 0 var(--s2); background: var(--bg); border-radius: var(--r-sm); border: 1px solid var(--line); }
.hp-trace svg { width: 100%; height: 150px; }
.hp-cap { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); letter-spacing: .06em; text-align: center; }

/* ---------------------------------------------------------------- hangar */
.hangar-grid { max-width: 1360px; margin: 0 auto; padding: 0 var(--s5) var(--s8); }
.tier { margin-bottom: var(--s8); }
.tier-head {
  display: flex; align-items: baseline; gap: var(--s4);
  padding-bottom: var(--s3); margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.tier-head h2 { font-size: 11px; }
.tier-head p { font-size: var(--text-sm); color: var(--ink-3); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s4); }
.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  /* background-color only — the lit gradient, edge highlights and grain all come
     from css/material.css so every raised surface is lit by the same source. */
  background-color: var(--bg-1);
  padding: var(--s4);
  cursor: pointer;
}
/* The phosphor hover wash lives on ::before so ::after stays free for the grain
   overlay. A highlight on a matte surface is still a matte surface, so the wash
   has to sit *under* the roughness, not over it. */
.card::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px 200px at 50% -20%, color-mix(in oklab, var(--phos) 12%, transparent), transparent 70%);
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.card:hover, .card:focus-visible { border-color: var(--phos-dim); transform: translateY(-3px); }
.card:hover::before, .card:focus-visible::before { opacity: 1; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.icao { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; letter-spacing: .1em; color: var(--phos); }
.rwy { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; color: var(--ink-4); }
.card h3 { margin-bottom: var(--s2); font-size: var(--text-lg); letter-spacing: -0.025em; }
.tagline { font-size: var(--text-sm); color: var(--ink-2); margin-bottom: var(--s4); text-wrap: pretty; }
.profile { width: 100%; height: 54px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: var(--s3); }
.profile-label { font-family: var(--font-mono); font-size: 8px; fill: var(--ink-4); letter-spacing: .06em; }
.specs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1) var(--s4); margin-bottom: var(--s4); }
.specs div { display: flex; justify-content: space-between; gap: var(--s2); border-bottom: 1px dotted var(--line); padding-bottom: 2px; }
.specs dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; color: var(--ink-4); text-transform: uppercase; }
.specs dd { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; color: var(--ink); }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); }
.why { font-size: var(--text-xs); color: var(--ink-3); line-height: 1.4; max-width: 26ch; }
.go { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700; letter-spacing: .1em; color: var(--phos); flex: none; }

/* ---------------------------------------------------------------- controls note */
.controls-note {
  max-width: 1360px; margin: 0 auto var(--s9);
  padding: var(--s5); margin-inline: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg-1);
  width: calc(100% - var(--s5) * 2);
}
.controls-note h3 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s4); }
.devices { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.dev {
  font-family: var(--font-mono); font-size: 10px; padding: 4px 9px;
  border: 1px solid var(--phos-dim); border-radius: 99px; color: var(--phos);
  background: color-mix(in oklab, var(--phos) 7%, transparent);
}
.dev.warn { border-color: var(--line-2); color: var(--ink-3); background: transparent; }
.key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s2) var(--s5); margin-bottom: var(--s4); }
.key-grid > div { display: flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--ink-2); }
.key-grid span { color: var(--ink-3); margin-left: 4px; }
.cn-note { font-size: var(--text-xs); color: var(--ink-4); max-width: 80ch; }

/* ---------------------------------------------------------------- cockpit */
body[data-view="cockpit"] { overflow: hidden; }
.view[data-view="cockpit"].active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: calc(100vh - 57px);
}
.sim { position: relative; overflow: hidden; background: #05070a; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ---- HUD */
.hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--font-mono); }
.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--s3) var(--s4);
  background: linear-gradient(180deg, rgba(4,6,9,.72), transparent);
}
.ht-block { display: flex; flex-direction: column; gap: 1px; }
.ht-block.right { text-align: right; }
.ht-block .v { font-size: var(--text-md); font-weight: 700; color: #f0f4f7; letter-spacing: -0.01em; }
.ht-block .k2 { font-size: 10px; color: rgba(255,255,255,.5); letter-spacing: .08em; }
.hud .k { color: rgba(255,255,255,.45); }

.tape {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 5px;
  padding: var(--s3); border-radius: var(--r);
  background: rgba(6,8,11,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
}
.tape.left { left: var(--s4); align-items: center; }
.tape.right { right: var(--s4); align-items: flex-end; }
.tape-label { color: rgba(255,255,255,.42) !important; }
.tape-num { display: flex; align-items: baseline; gap: 3px; }
.tape-num b { font-size: 40px; font-weight: 700; color: #f2f6f9; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tape-num small { font-size: 10px; color: rgba(255,255,255,.45); }
.tape-sub { font-size: var(--text-xs); color: rgba(255,255,255,.55); }
.tape-sub b { color: #e6ebf0; font-weight: 600; }
.tape-sub b.warn { color: var(--amber); }
.tape-sub b.crit { color: var(--crit); }
.tape-target { font-size: 10px; color: rgba(255,255,255,.42); letter-spacing: .08em; }
.tape-target b { color: var(--amber); }

.speed-bar { position: relative; width: 12px; height: 190px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: visible; }
.speed-bar .fill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 99px; background: var(--phos); transition: height 80ms linear; }
.speed-bar .fill.warn { background: var(--amber); }
.speed-bar .fill.crit { background: var(--crit); }
.speed-bar .target { position: absolute; left: -5px; right: -5px; height: 2px; background: var(--amber); }

.deviation {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 190px; height: 190px; opacity: 0; transition: opacity var(--dur);
}
.deviation.live { opacity: 1; }
.hud[data-mode="clean"] .deviation,
.hud[data-mode="clean"] .gates-panel,
.hud[data-mode="clean"] .tape { opacity: 0 !important; }
.dev-v, .dev-h { position: absolute; }
.dev-v { right: 0; top: 50%; transform: translateY(-50%); width: 22px; height: 150px; border-left: 1px solid rgba(255,255,255,.2); }
.dev-h { bottom: 0; left: 50%; transform: translateX(-50%); height: 22px; width: 150px; border-top: 1px solid rgba(255,255,255,.2); }
.dev-v::before, .dev-h::before { content: ''; position: absolute; background: rgba(255,255,255,.45); }
.dev-v::before { left: -5px; right: 0; top: 50%; height: 1px; }
.dev-h::before { top: -5px; bottom: 0; left: 50%; width: 1px; }
.dev-v i, .dev-h i {
  position: absolute; display: block; border-radius: 2px;
  background: var(--phos); transition: transform 90ms linear, background var(--dur-fast);
}
.dev-v i { left: 2px; width: 16px; height: 4px; top: calc(50% - 2px); }
.dev-h i { top: 2px; height: 16px; width: 4px; left: calc(50% - 2px); }
.dev-v i[data-state="warn"], .dev-h i[data-state="warn"] { background: var(--amber); }
.dev-v i[data-state="crit"], .dev-h i[data-state="crit"] { background: var(--crit); }
.dev-v span, .dev-h span { position: absolute; font-size: 9px; color: rgba(255,255,255,.4); letter-spacing: .1em; }
.dev-v span { right: 2px; top: -14px; }
.dev-h span { left: -2px; bottom: -14px; }

.gates-panel, .feed-panel {
  position: absolute; bottom: 46px; width: 320px; max-width: 34vw;
  background: rgba(6,8,11,.66); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--r);
  overflow: hidden;
}
/* Offset past the airspeed tape's column: at bottom-left the gate list was
   covering the IAS digits, which is the one number a student must never lose. */
.gates-panel { left: calc(var(--s4) + 118px); }
.feed-panel { right: var(--s4); }
.gates-panel header, .feed-panel header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; border-bottom: 1px solid rgba(255,255,255,.07);
  font-size: 9px; letter-spacing: .14em; color: rgba(255,255,255,.42);
}
.gates-panel header b { color: var(--phos); font-size: 11px; }
#gate-list { list-style: none; padding: 6px; max-height: 150px; overflow-y: auto; }
.gate { display: flex; align-items: center; gap: 7px; padding: 4px 5px; font-size: 11px; color: rgba(255,255,255,.62); position: relative; }
.gate .dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); flex: none; }
.gate.active .dot { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 8px var(--amber); }
.gate.pass .dot { background: var(--phos); border-color: var(--phos); }
.gate.fail .dot { background: var(--crit); border-color: var(--crit); }
.gate.pass { color: var(--phos); }
.gate.fail { color: var(--crit); }
.gate .gl { flex: 1; }
.gate .gp { position: absolute; left: 5px; right: 5px; bottom: 0; height: 1.5px; background: rgba(255,255,255,.1); }
.gate .gp i { display: block; height: 100%; background: var(--amber); }
.gate .gs { font-size: 9px; color: rgba(255,255,255,.38); flex: none; }

#feed { padding: 6px; max-height: 200px; overflow-y: auto; }
.feed-item {
  border-left: 2px solid var(--ink-4); padding: 5px 8px; margin-bottom: 5px;
  background: rgba(255,255,255,.03); border-radius: 0 var(--r-sm) var(--r-sm) 0;
  animation: slideIn var(--dur) var(--ease); transition: opacity var(--dur-slow);
}
.feed-item.sev1 { border-left-color: var(--info); }
.feed-item.sev2 { border-left-color: var(--amber); }
.feed-item.sev3 { border-left-color: var(--crit); background: color-mix(in oklab, var(--crit) 9%, transparent); }
.feed-item.fade { opacity: .32; }
.feed-head { display: flex; justify-content: space-between; gap: var(--s2); align-items: baseline; }
.feed-msg { font-size: 12px; font-weight: 600; color: #eef2f6; }
.feed-acs { font-size: 8px; color: rgba(255,255,255,.34); letter-spacing: .06em; flex: none; }
.feed-fix { font-size: 10px; color: rgba(255,255,255,.56); line-height: 1.4; margin-top: 2px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }

.hud-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: var(--s5); justify-content: center; flex-wrap: wrap;
  padding: 8px var(--s4);
  background: linear-gradient(0deg, rgba(4,6,9,.78), transparent);
}
.hud-bottom span { display: flex; align-items: baseline; gap: 5px; }
.hud-bottom i { font-style: normal; font-size: 9px; letter-spacing: .1em; color: rgba(255,255,255,.4); }
.hud-bottom b { font-size: var(--text-sm); font-weight: 600; color: #e8edf2; font-variant-numeric: tabular-nums; }

.veil {
  position: absolute; inset: 0; display: none; place-items: center;
  background: rgba(4,6,9,.7); backdrop-filter: blur(6px); pointer-events: all;
}
.veil.open { display: grid; }
.veil-inner { text-align: center; }
.veil-inner h2 { font-family: var(--font-mono); letter-spacing: .16em; margin-bottom: var(--s2); color: #fff; }
.veil-inner p { font-size: var(--text-sm); color: rgba(255,255,255,.6); }

.brief {
  position: absolute; top: 62px; left: 50%; transform: translate(-50%, -12px);
  width: min(620px, 88vw); pointer-events: all;
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: var(--s4) var(--s5) var(--s5);
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
.brief.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.brief header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s3); }
.brief h3 { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.brief p { font-size: var(--text-sm); color: var(--ink-2); white-space: pre-line; line-height: 1.62; }

/* ---- physical panel: one row of round instruments, engine block on the right */
.panel {
  --gauge: 132px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--gauge) 268px;
  gap: var(--s4);
  align-items: start;
  padding: var(--s3) var(--s4) var(--s4);
  background-color: var(--bg-1);
  border-top: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.gauges { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s3); }
.gauge-slot { display: grid; justify-items: center; gap: 5px; min-width: 0; }
.gauge, .tach {
  width: 100%; max-width: var(--gauge); aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.05);
}
.tach-slot { width: var(--gauge); }
.gauge-cap {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .11em; color: var(--ink-4); white-space: nowrap;
}
.panel-side { display: grid; gap: var(--s3); align-content: start; }
.engine-strip {
  width: 100%; height: 84px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.sim-controls { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }
.speeds { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-2); }
.speed-btn { font-family: var(--font-mono); font-size: 10px; font-weight: 600; padding: 4px 8px; border-radius: 3px; color: var(--ink-3); }
.speed-btn.on { background: var(--bg-4); color: var(--phos); }

/* ---------------------------------------------------------------- ground school */
.school { max-width: 1080px; margin: 0 auto; padding: var(--s7) var(--s5) var(--s9); }
.gs-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s5); align-items: stretch; margin-bottom: var(--s5); }
.gs-readiness {
  display: flex; gap: var(--s5); align-items: center;
  padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: var(--bg-1);
}
.rd-ring {
  --pct: 0;
  width: 116px; height: 116px; flex: none; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--phos) calc(var(--pct) * 1%), var(--bg-3) 0);
}
.rd-ring::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--bg-1); }
.rd-num { position: relative; font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.03em; }
.rd-num small { font-size: var(--text-sm); color: var(--ink-3); }
.gs-readiness.early .rd-ring { background: conic-gradient(var(--ink-4) calc(var(--pct) * 1%), var(--bg-3) 0); }
.gs-readiness.working .rd-ring { background: conic-gradient(var(--crit) calc(var(--pct) * 1%), var(--bg-3) 0); }
.gs-readiness.close .rd-ring { background: conic-gradient(var(--amber) calc(var(--pct) * 1%), var(--bg-3) 0); }
.rd-meta h2 { margin-bottom: var(--s2); }
.rd-meta p { font-size: var(--text-sm); color: var(--ink-2); font-family: var(--font-mono); }
.rd-note { font-size: var(--text-xs) !important; color: var(--ink-4) !important; margin-top: var(--s2); max-width: 54ch; font-family: var(--font-sans) !important; }
.gs-countdown {
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: var(--s5) var(--s6); border: 1px solid var(--amber-dim); border-radius: var(--r-lg);
  background: color-mix(in oklab, var(--amber) 7%, transparent); text-align: center;
}
.cd-num { font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: 700; color: var(--amber); line-height: 1; letter-spacing: -0.04em; }
.cd-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.cd-due { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: var(--s3); }

.gs-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.gs-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); margin-bottom: var(--s6); }
.area {
  text-align: left; padding: var(--s3) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-1); transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.area:hover { border-color: var(--line-2); transform: translateY(-2px); }
.ar-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: 7px; }
.ar-head span:first-child { font-size: var(--text-sm); font-weight: 600; }
.ar-n { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.ar-bar { height: 4px; background: var(--bg-3); border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.ar-bar i { display: block; height: 100%; background: var(--ink-4); transition: width var(--dur); }
.area.weak .ar-bar i { background: var(--crit); }
.area.mid .ar-bar i { background: var(--amber); }
.area.strong .ar-bar i { background: var(--phos); }
.ar-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }

/* ---- quiz */
.quiz-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: var(--bg-1); padding: var(--s5);
}
.q-top { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.q-area { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--phos); }
.q-acs { font-size: 10px; color: var(--ink-4); }
.q-diff { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink-3); }
.q-diff.d3 { border-color: var(--crit); color: var(--crit); }
.q-diff.d1 { border-color: var(--phos-dim); color: var(--phos); }
.q-count { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.mock-clock { font-family: var(--font-mono); font-size: var(--text-md); font-weight: 700; color: var(--phos); margin-left: auto; }
.mock-clock.low { color: var(--crit); }
.q-stem { font-size: var(--text-md); line-height: 1.55; margin-bottom: var(--s4); text-wrap: pretty; }
.q-options { display: grid; gap: var(--s2); }
.opt {
  display: flex; gap: var(--s3); align-items: flex-start; text-align: left;
  padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-1); font-size: var(--text-sm); line-height: 1.5;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.opt:hover:not(:disabled) { border-color: var(--phos-dim); background: var(--bg-2); }
.opt .ol { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--ink-4); flex: none; width: 14px; }
.opt.chosen { border-color: var(--info); background: color-mix(in oklab, var(--info) 8%, transparent); }
.opt.correct { border-color: var(--phos); background: color-mix(in oklab, var(--phos) 12%, transparent); }
.opt.correct .ol { color: var(--phos); }
.opt.wrong { border-color: var(--crit); background: color-mix(in oklab, var(--crit) 11%, transparent); }
.opt.wrong .ol { color: var(--crit); }
.opt:disabled { cursor: default; }
.q-result { margin-top: var(--s4); padding: var(--s4); border-radius: var(--r); border-left: 3px solid var(--line-2); background: var(--bg-2); }
.q-result.ok { border-left-color: var(--phos); }
.q-result.bad { border-left-color: var(--crit); }
.qr-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; letter-spacing: .04em; margin-bottom: var(--s2); }
.qr-head .box { font-size: 9px; color: var(--ink-4); letter-spacing: .08em; font-weight: 500; }
.q-result p { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.6; margin-bottom: var(--s2); }
.qr-ref { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4) !important; }
.q-result .btn { margin-top: var(--s2); }
.mock-bar { display: flex; gap: 2px; margin-bottom: var(--s4); }
.mock-bar i { flex: 1; height: 4px; background: var(--bg-3); border-radius: 1px; cursor: pointer; transition: background var(--dur-fast); }
.mock-bar i.done { background: var(--phos-dim); }
.mock-bar i.cur { background: var(--amber); }
.mock-nav { display: flex; gap: var(--s2); margin-top: var(--s4); }
.mock-nav .btn:last-child { margin-left: auto; }

.mock-result { border: 1px solid var(--line); border-radius: var(--r-lg); background-color: var(--bg-1); padding: var(--s6); }
.mock-result.pass { border-color: var(--phos-dim); }
.mock-result.fail { border-color: var(--crit); }
.mr-score { display: flex; align-items: baseline; gap: 3px; font-family: var(--font-mono); margin-bottom: var(--s2); }
.mr-score span { font-size: 62px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.mock-result.pass .mr-score span { color: var(--phos); }
.mock-result.fail .mr-score span { color: var(--crit); }
.mr-score small { font-size: var(--text-lg); color: var(--ink-3); }
.mock-result h3 { margin-bottom: var(--s2); }
.mock-result > p { font-size: var(--text-sm); color: var(--ink-2); margin-bottom: var(--s5); }
.mr-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s2); margin-bottom: var(--s6); }
.mr-area { display: flex; justify-content: space-between; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--text-xs); }
.mr-area b { font-family: var(--font-mono); }
.mr-area.weak { border-color: var(--crit); color: var(--crit); }
.mock-result h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s4); }
.mr-missed { list-style: none; display: grid; gap: var(--s4); }
.mr-missed li { padding: var(--s4); border-left: 2px solid var(--crit); background: var(--bg-2); border-radius: 0 var(--r) var(--r) 0; }
.mm-stem { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--s2); }
.mm-chose { font-size: var(--text-xs); color: var(--crit); font-family: var(--font-mono); }
.mm-right { font-size: var(--text-xs); color: var(--phos); font-family: var(--font-mono); margin-bottom: var(--s2); }
.mm-exp { font-size: var(--text-sm); color: var(--ink-2); line-height: 1.55; margin-bottom: 4px; }
.mm-ref { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.mock-result .btn { margin-top: var(--s5); }

/* ---------------------------------------------------------------- debrief modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: var(--s5);
  background: rgba(3,5,7,.78); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
.modal.open { opacity: 1; visibility: visible; }
.modal-card {
  width: min(1000px, 100%); max-height: 90vh; display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-xl);
  overflow: hidden;
  transform: translateY(14px) scale(.985); transition: transform var(--dur-slow) var(--ease);
}
.modal.open .modal-card { transform: none; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s4);
  padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); flex: none;
}
.modal-head h2 { font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.modal-actions { display: flex; align-items: center; gap: var(--s2); }
.modal-body { overflow-y: auto; padding: 0 var(--s5) var(--s6); }

.db-hero { padding: var(--s6) 0 var(--s5); border-bottom: 1px solid var(--line); margin-bottom: var(--s5); position: relative; }
.db-badge {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: .18em; padding: 4px 11px; border-radius: 99px; margin-bottom: var(--s4);
  border: 1px solid var(--line-2); color: var(--ink-3);
}
.db-hero.crash .db-badge { border-color: var(--crit); color: var(--crit); background: color-mix(in oklab, var(--crit) 12%, transparent); }
.db-hero.pass .db-badge { border-color: var(--phos); color: var(--phos); background: color-mix(in oklab, var(--phos) 12%, transparent); }
.db-hero.fail .db-badge { border-color: var(--amber); color: var(--amber); background: color-mix(in oklab, var(--amber) 12%, transparent); }
.db-hero h2 { font-size: var(--text-2xl); letter-spacing: -0.035em; max-width: 26ch; }
.db-mech { font-size: var(--text-md); color: var(--ink-2); margin-top: var(--s3); max-width: 68ch; }
.db-grade { position: absolute; top: var(--s6); right: 0; display: flex; align-items: baseline; gap: var(--s4); font-family: var(--font-mono); }
.db-grade .g { font-size: 54px; font-weight: 700; line-height: 1; color: var(--phos); letter-spacing: -0.04em; }
.db-grade .p { font-size: var(--text-lg); font-weight: 600; color: var(--ink-2); }
.db-grade .p small { font-size: var(--text-sm); color: var(--ink-4); }

.db-sec { margin-bottom: var(--s6); }
.db-sec h3 {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); padding-bottom: var(--s2); margin-bottom: var(--s4);
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
}
.db-sec h3 small { font-weight: 400; letter-spacing: .06em; color: var(--ink-4); text-transform: none; }

.chain { list-style: none; display: grid; gap: 0; position: relative; }
.chain-item { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: var(--s4); padding: var(--s3) 0; position: relative; }
.chain-item::before { content: ''; position: absolute; left: 74px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.chain-item:first-child::before { top: 50%; }
.chain-item:last-child::before { bottom: 50%; }
.chain-item::after {
  content: ''; position: absolute; left: 71px; top: calc(50% - 3.5px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); border: 2px solid var(--bg-1); box-sizing: content-box;
}
.chain-item.root::after { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in oklab, var(--crit) 22%, transparent); }
.chain-item.out::after { background: var(--amber); }
.ci-t { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-4); text-align: right; padding-top: 2px; }
.ci-body { padding-left: var(--s4); }
.ci-label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; color: var(--ink-4); margin-bottom: 2px; }
.chain-item.root .ci-label { color: var(--crit); }
.chain-item.out .ci-label { color: var(--amber); }
.ci-text { font-size: var(--text-base); font-weight: 600; margin-bottom: 3px; }
.ci-values { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); }

.fix-card {
  padding: var(--s5); border-radius: var(--r-lg);
  border: 1px solid var(--phos-dim);
  background: color-mix(in oklab, var(--phos) 7%, var(--bg-1));
}
.fix-card h4 { font-size: var(--text-lg); margin-bottom: var(--s3); letter-spacing: -0.025em; }
.fix-card p { font-size: var(--text-base); color: var(--ink-2); line-height: 1.65; max-width: 70ch; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.charts figure { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); padding: var(--s3); }
.charts figure.wide { grid-column: 1 / -1; }
.charts canvas { width: 100%; height: 132px; }
.charts figure.wide canvas { height: 200px; }
.charts figcaption { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; color: var(--ink-4); margin-top: 6px; }

.score-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.score-table th {
  text-align: left; font-family: var(--font-mono); font-size: 9px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-4); padding: 0 var(--s3) var(--s2); font-weight: 600;
}
.score-table td { padding: var(--s2) var(--s3); border-top: 1px solid var(--line); }
.score-table td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.score-table .verdict { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-align: right; }
.score-table tr.ok .verdict { color: var(--phos); }
.score-table tr.bad .verdict { color: var(--crit); }
.score-table tr.bad td { background: color-mix(in oklab, var(--crit) 5%, transparent); }

.db-gates { list-style: none; display: grid; gap: var(--s2); }
.db-gates li { display: flex; align-items: center; gap: var(--s3); font-size: var(--text-sm); color: var(--ink-2); }
.db-gates .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: none; }
.db-gates li.pass .dot { background: var(--phos); }
.db-gates li.pass { color: var(--phos); }
.db-gates li.fail .dot { background: var(--crit); }
.db-gates li.fail { color: var(--crit); }
.db-gates .gs { margin-left: auto; font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }

.db-devs { list-style: none; display: grid; gap: var(--s3); }
.db-devs li { padding: var(--s3) var(--s4); border-left: 2px solid var(--ink-4); background: var(--bg-2); border-radius: 0 var(--r) var(--r) 0; }
.db-devs li.sev1 { border-left-color: var(--info); }
.db-devs li.sev2 { border-left-color: var(--amber); }
.db-devs li.sev3 { border-left-color: var(--crit); }
.dv-head { display: flex; justify-content: space-between; gap: var(--s3); align-items: baseline; margin-bottom: 3px; }
.dv-head span { font-size: var(--text-sm); font-weight: 600; }
.dv-head code { font-size: 9px; color: var(--ink-4); flex: none; }
.dv-snap { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); margin-bottom: 4px; }
.dv-why { font-size: var(--text-xs); color: var(--ink-3); line-height: 1.5; max-width: 76ch; }

.acs-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px;
  color: var(--ink-2); transition: border-color var(--dur-fast), color var(--dur-fast);
}
.chip:hover { border-color: var(--phos); color: var(--phos); }

/* ---------------------------------------------------------------- toast */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 12px);
  z-index: 200; pointer-events: none;
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600; letter-spacing: .1em;
  padding: 9px 20px; border-radius: 99px;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--line-2); color: var(--ink);
  opacity: 0; visibility: hidden; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur);
}
#toast.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
#toast.crit { border-color: var(--crit); color: var(--crit); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; gap: var(--s6); padding-top: var(--s7); }
  .hero-panel { order: -1; }
  .panel { --gauge: 104px; grid-template-columns: minmax(0, 1fr) var(--gauge) 230px; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; row-gap: var(--s2); padding: var(--s2) var(--s4); }
  .nav { order: 3; grid-column: 1 / -1; justify-content: center; }
  .hero { padding: var(--s6) var(--s4) var(--s5); }
  .hangar-grid, .school { padding-inline: var(--s4); }
  .cards { grid-template-columns: 1fr; }
  .gs-top { grid-template-columns: 1fr; }
  .gs-readiness { flex-direction: column; text-align: center; }
  .panel { --gauge: 78px; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
  .gauges { grid-template-columns: repeat(4, 1fr); }
  .tach-slot { display: none; }
  .panel-side { grid-template-columns: minmax(0, 1fr); }
  .gates-panel, .feed-panel { max-width: 44vw; width: auto; bottom: 40px; }
  .gates-panel { left: 112px; } .feed-panel { right: 6px; }
  .tape.left, .tape.right { padding: 6px; }
  .tape-num b { font-size: 26px; }
  .speed-bar { height: 120px; width: 9px; }
  .deviation { width: 130px; height: 130px; }
  .hud-bottom { gap: var(--s3); font-size: 10px; }
  .db-grade { position: static; margin-top: var(--s4); }
  .chain-item { grid-template-columns: 52px minmax(0, 1fr); }
  .chain-item::before { left: 58px; }
  .chain-item::after { left: 55px; }
  .modal { padding: 0; }
  .modal-card { max-height: 100vh; border-radius: 0; border: 0; }
}

/* ---------------------------------------------------------------- study sprint plan
   Ground School had a large dead zone below the area cards. A countdown that does not
   say what to do today is decoration, so the plan is generated from live mastery data. */
.gs-plan { margin-top: var(--s6); border-top: 1px solid rgba(255,255,255,.07); padding-top: var(--s5); }
.gs-plan-head { display: flex; align-items: baseline; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s4); }
.gs-plan-head h3 { font-size: var(--text-lg); font-weight: 500; letter-spacing: -.01em; }
.gs-plan-head p { font-size: 12px; color: var(--fg-3); max-width: 46ch; }
.plan-list { list-style: none; border: 1px solid rgba(255,255,255,.07); border-radius: var(--r); overflow: hidden; }
.plan-row {
  display: grid; grid-template-columns: 96px minmax(0,1fr) 84px 46px;
  align-items: center; gap: var(--s3);
  padding: 9px 12px; font-size: 12.5px;
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: relative;
}
.plan-row:last-child { border-bottom: 0; }
.plan-row::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
.plan-row.weak::before, .plan-row.untouched::before { background: var(--crit); }
.plan-row.shaky::before { background: var(--amber); }
.plan-row.solid::before { background: var(--phos); }
.plan-row.mock::before { background: var(--phos); }
.plan-row.mock { background: rgba(61,220,132,.05); }
.pr-days { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--fg-3); }
.pr-area { color: var(--fg-1); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); text-align: right; }
.plan-row.weak .pr-tag, .plan-row.untouched .pr-tag { color: var(--crit); }
.plan-row.shaky .pr-tag { color: var(--amber); }
.plan-row.solid .pr-tag, .plan-row.mock .pr-tag { color: var(--phos); }
.pr-n { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); text-align: right; }

.gs-facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--s4); margin-top: var(--s5); }
.gs-facts > div { border: 1px solid rgba(255,255,255,.07); border-radius: var(--r); padding: 12px 14px; }
.gs-facts b { display: block; margin: 5px 0 4px; font-size: 13px; font-weight: 500; color: var(--fg-1); }
.gs-facts small { font-size: 11px; color: var(--fg-3); line-height: 1.4; display: block; }

/* Area cards were bottom-misaligned whenever a title wrapped to two lines. */
.area { display: flex; flex-direction: column; }
.area .ar-head { min-height: 34px; align-items: flex-start; }
.area .ar-bar { margin-top: auto; }

@media (max-width: 760px) {
  .gs-facts { grid-template-columns: 1fr; }
  .plan-row { grid-template-columns: 74px minmax(0,1fr) 40px; }
  .plan-row .pr-tag { display: none; }
}

/* ═══════════════════════════════════════════════════════════════ MISSION */
.mission { padding: var(--s9) var(--s5) var(--s8); border-top: 1px solid var(--line); }
.mission-inner { max-width: 1360px; margin: 0 auto; padding: 0 var(--s5); }
.mission-lead {
  font-size: clamp(1.75rem, 3.4vw, 2.9rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -0.028em;
  max-width: 22ch; margin: var(--s4) 0 var(--s8);
  text-wrap: balance;
}
.mission-lead em { font-style: normal; color: var(--phos); }
.mission-cols {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: var(--s8); align-items: start;
}
.mission-body p {
  font-size: var(--text-md); line-height: 1.62; color: var(--ink-2);
  max-width: 62ch; margin-bottom: var(--s5); text-wrap: pretty;
}
.mission-body em { font-style: normal; color: var(--ink); font-weight: 500; }

.principles { list-style: none; display: grid; gap: var(--s3); }
.principles li {
  padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: var(--bg-1);
}
.pr-num {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .1em; color: var(--phos);
}
.principles h4 {
  font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em;
  margin: var(--s2) 0 6px;
}
.principles p { font-size: var(--text-sm); line-height: 1.55; color: var(--ink-3); }

.mission-quote {
  margin: var(--s8) 0 var(--s6);
  padding: var(--s6) 0 var(--s6) var(--s6);
  border-left: 2px solid var(--phos);
  max-width: 74ch;
}
.mission-quote p {
  font-size: clamp(1.05rem, 1.7vw, 1.4rem); line-height: 1.45;
  font-weight: 500; letter-spacing: -0.014em; color: var(--ink);
  text-wrap: pretty;
}
.mission-honest {
  font-size: var(--text-sm); line-height: 1.6; color: var(--ink-3);
  max-width: 78ch; padding-top: var(--s5); border-top: 1px solid var(--line);
}
.mission-honest b { color: var(--ink-2); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════ HOW TO FLY */
.howto { padding: var(--s8) var(--s5) var(--s9); max-width: 1360px; margin: 0 auto; }
.howto-head { max-width: 60ch; margin-bottom: var(--s7); }
.howto-head h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.4rem); font-weight: 700;
  letter-spacing: -0.028em; margin: var(--s3) 0 var(--s3);
}
.howto-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: var(--s3); margin-bottom: var(--s6);
}
.ctl-card {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background-color: var(--bg-1); padding: var(--s5);
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ctl-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.ctl-card > header { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.cc-tag {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  padding: 3px 7px; border: 1px solid var(--line-2); border-radius: 3px;
}
.ctl-card h4 { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.018em; }
.ctl-row { display: flex; gap: var(--s5); align-items: flex-start; }
.ctl-text p { font-size: var(--text-sm); line-height: 1.58; color: var(--ink-3); margin-bottom: var(--s3); }
.ctl-text p:last-child { margin-bottom: 0; }
.ctl-text b { color: var(--ink); font-weight: 600; }
.ctl-text em { font-style: normal; color: var(--phos); }

/* Key caps are milled aluminium: a tight top specular, a hard bottom edge, and
   a real contact shadow, so they read as objects you could press. */
kbd, .keycluster kbd {
  display: inline-grid; place-items: center; width: max-content;
  vertical-align: -8px;
  min-width: 30px; height: 30px; padding: 0 7px;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  color: var(--ink); background-color: var(--bg-3);
  border: 1px solid var(--line-2); border-radius: 6px;
  position: relative;
}
.keycluster {
  flex: none; display: grid; gap: 4px;
  grid-template-columns: repeat(3, 30px); grid-template-rows: repeat(2, 30px);
}
.k-up { grid-area: 1 / 2; } .k-left { grid-area: 2 / 1; }
.k-down { grid-area: 2 / 2; } .k-right { grid-area: 2 / 3; }
.keycluster.kc-stack { grid-template-columns: 58px; grid-template-rows: repeat(2, 30px); }
.keycluster kbd { width: 100%; vertical-align: baseline; }
.keycluster.kc-stack kbd { min-width: 58px; }
.keycluster.kc-pair { grid-template-columns: repeat(2, 36px); grid-template-rows: repeat(2, 30px); }
.keycluster.kc-pair kbd { min-width: 36px; }
.cc-hw .ctl-row { gap: 0; }

/* first sixty seconds — a recessed panel, like a placard screwed into the panel */
.first60 {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s6); background-color: var(--bg-2);
}
.first60 h3 {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--amber);
  margin-bottom: var(--s5);
}
.first60 ol {
  list-style: none; display: grid; gap: var(--s3);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}
.first60 li { display: flex; gap: var(--s3); align-items: flex-start; }
.first60 li > span {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  color: var(--bg); background: var(--phos); border-radius: 50%;
}
.first60 li p { font-size: var(--text-sm); line-height: 1.5; color: var(--ink-3); }
.first60 li b { color: var(--ink); font-weight: 600; }
/* Keys set inside running prose need a smaller footprint than keys in a cluster,
   and must not inflate the line box or leave a gap before the punctuation. */
.first60 kbd, .coach kbd, .mh-hint kbd, .cm-rule kbd, .veil kbd, .howto p kbd {
  min-width: 19px; height: 18px; padding: 0 4px;
  font-size: 10px; border-radius: 4px;
  vertical-align: -4px; margin: 0;
}

/* ═══════════════════════════════════════════════════════════════ sound button */
#sound-btn .snd-off { display: none; }
#sound-btn[data-on="false"] .snd-on { display: none; }
#sound-btn[data-on="false"] .snd-off { display: block; }
#sound-btn[data-on="false"] { color: var(--ink-4); }
#sound-btn[data-on="true"] { color: var(--phos); border-color: var(--phos-dim); }

/* ═══════════════════════════════════════════════════════════════ responsive */
@media (max-width: 960px) {
  .mission-cols { grid-template-columns: 1fr; gap: var(--s6); }
  .mission-lead { max-width: none; }
  .mission-quote { padding-left: var(--s4); margin: var(--s6) 0 var(--s5); }
}
@media (max-width: 700px) {
  .mission, .howto { padding-left: var(--s4); padding-right: var(--s4); }
  .howto-grid { grid-template-columns: 1fr; }
  .ctl-row { flex-direction: column; gap: var(--s4); }
  .first60 { padding: var(--s5) var(--s4); }
}

/* ═══════════════════════════════════════════════════════════ controls modal */
.cm-card { max-width: 940px; }
.mh-title {
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.mh-hint { font-size: var(--text-xs); color: var(--ink-4); display: flex; align-items: center; gap: 5px; }
.mh-hint kbd { min-width: 20px; height: 19px; font-size: 10px; }
.cm-body { padding: var(--s6); }
.cm-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s6); }
.cm-cols h5 {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--phos);
  padding-bottom: var(--s3); margin-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}
.cm-cols dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s3) var(--s4); align-items: center; }
.cm-cols dt { display: flex; gap: 4px; }
.cm-cols dd { font-size: var(--text-sm); line-height: 1.4; color: var(--ink-3); }
.cm-cols dd b { color: var(--ink); font-weight: 600; }
.cm-rule {
  margin-top: var(--s6); padding: var(--s5);
  border: 1px solid var(--amber-dim); border-radius: var(--r);
  background: color-mix(in oklab, var(--amber) 6%, transparent);
  font-size: var(--text-sm); line-height: 1.6; color: var(--ink-2);
}
.cm-rule b { color: var(--amber); font-weight: 600; }
.cm-rule em { font-style: normal; color: var(--ink); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════ first-run coach */
/* Docked as a horizontal placard in the empty sky below the mission header —
   the one region of the cockpit that no instrument or panel claims. */
.coach {
  position: absolute; z-index: 40;
  left: 50%; transform: translateX(-50%);
  top: 88px; width: min(720px, calc(100% - 2 * var(--s6)));
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  background-color: var(--bg-1); padding: var(--s4);
  animation: coach-in var(--dur-slow) var(--ease) both;
}
.coach[hidden] { display: none; }
@keyframes coach-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%); }
}
.coach > header { display: flex; align-items: center; gap: 7px; margin-bottom: var(--s3); }
.coach > header b {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-2); flex: 1;
}
.co-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--phos); animation: co-pulse 2s var(--ease) infinite; }
@keyframes co-pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.coach > header button { color: var(--ink-4); font-size: 13px; line-height: 1; padding: 2px 4px; }
.coach > header button:hover { color: var(--ink); }
.coach ol {
  list-style: none; counter-reset: co;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3) var(--s5);
}
.coach ol li {
  counter-increment: co; position: relative; padding-left: 15px;
  font-size: var(--text-xs); line-height: 1.6; color: var(--ink-2);
}
.coach ol li::before {
  content: counter(co); position: absolute; left: 0; top: 2px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; color: var(--phos);
}
.coach kbd { display: inline-grid; min-width: 20px; height: 18px; font-size: 9.5px; vertical-align: -3px; }
.coach > p { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: 10px; color: var(--ink-4); }
@media (max-width: 1080px) { .coach ol { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .coach { display: none; } }
