/* STEM Academy only: command interface, modal systems, and the Academy dock. */
:root {
  --stem-ink: #f2f7fc;
  --stem-muted: #9baec3;
  --stem-panel: rgba(5, 13, 24, .82);
  --stem-panel-solid: #071321;
  --stem-line: rgba(164, 197, 226, .18);
  --stem-cyan: #80e7ff;
  --stem-blue: #4fa9ff;
  --stem-gold: #f5cb75;
  --stem-green: #7ee7b2;
  --stem-red: #ff9299;
  --stem-shadow: 0 28px 90px rgba(0, 0, 0, .55);
  --stem-radius: 22px;
}

html.stem-academy-page,
body.stem-academy-page { background: #030711; color: var(--stem-ink); }
body.stem-academy-page { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body.stem-academy-page #drev-ai-panel,
body.stem-academy-page #drev-chatbar,
body.stem-academy-page #global-dock-container,
body.stem-academy-page .global-dock,
body.stem-academy-page [data-global-dock],
body.stem-academy-page #drev-global-dock { display: none !important; visibility: hidden !important; pointer-events: none !important; }
body.stem-academy-page:not(.stem-engaged) .stem-only-ui,
body.stem-academy-page:not(.stem-engaged) #hero-main-content,
body.stem-academy-page:not(.stem-engaged) #drev-dock { display: none !important; }
body.stem-academy-page.stem-engaged #hero-main-content { display: none !important; }
/* Free Play is the solar system, not the command deck. */
body.stem-freeplay #stem-topbar,
body.stem-freeplay #stem-home-panel,
body.stem-freeplay #hero-main-content,
body.stem-freeplay #academy-btn,
body.stem-freeplay #VRButton,
body.stem-freeplay #multiplayer-status { display: none !important; }
body.stem-freeplay #hangar-btn { top: 12px; bottom: auto; left: 12px; z-index: 50; }
body.stem-academy-page.stem-engaged #drev-dock {
  display: flex !important; visibility: visible !important; pointer-events: auto !important;
}
body.stem-academy-page .hero-overlay-bg { background: radial-gradient(ellipse at 15% 72%, rgba(10, 40, 70, .27), transparent 56%), linear-gradient(180deg, rgba(0, 3, 10, .18), rgba(0, 3, 10, .12)); }
body.stem-academy-page #solarCanvas { z-index: 1; }

/* Cinematic first, then a single-choice engagement gate. */
#stem-cinematic { z-index: 20000; overflow: hidden; background: #02050a; }
#stem-cinematic::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(2,5,10,.12), transparent 44%, rgba(2,5,10,.62)); }
#drev-stem-video { object-fit: cover; }
#stem-cinematic .cine-status,
#stem-cinematic .cine-skip,
#stem-cinematic .cine-play { z-index: 2; }
#stem-cinematic .cine-status { bottom: 26px; font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .22em; }
#stem-cinematic .cine-skip,
#stem-cinematic .cine-play { min-height: 44px; display: inline-flex; align-items: center; font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; cursor: pointer; }
#stem-cinematic .cine-skip.hidden,
#stem-cinematic .cine-play.hidden { display: none; }
#stem-cinematic .cine-play { position: absolute; left: 24px; bottom: 24px; padding: 0 18px; border: 1px solid rgba(128,231,255,.52); border-radius: 999px; color: #c8f4ff; background: rgba(3,12,22,.6); backdrop-filter: blur(10px); }
#stem-gate,
#stem-login-card {
  z-index: 19000; gap: 0; color: var(--stem-ink); text-align: left;
  background: radial-gradient(ellipse at 50% 36%, rgba(13, 43, 68, .74), rgba(2, 7, 14, .96) 70%), #030711;
}
.gate-card,
.auth-card {
  position: relative; width: min(520px, calc(100vw - 32px)); padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(132, 191, 230, .24); border-radius: 28px;
  background: linear-gradient(145deg, rgba(11, 25, 41, .9), rgba(4, 12, 22, .95));
  box-shadow: 0 34px 120px rgba(0, 0, 0, .56), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(26px) saturate(145%); -webkit-backdrop-filter: blur(26px) saturate(145%);
}
.gate-card::before,
.auth-card::before { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(123,226,255,.76), transparent); }
#stem-gate .gate-eyebrow,
#stem-login-card .gate-eyebrow { display: flex; align-items: center; gap: 10px; color: #91dbf4; font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .22em; }
#stem-gate .gate-eyebrow::before,
#stem-login-card .gate-eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--stem-cyan); opacity: .8; }
#stem-gate .gate-title,
#stem-login-card .gate-title { margin: 23px 0 12px; color: #f5f9fc; font-size: clamp(32px, 6vw, 48px); line-height: 1.02; letter-spacing: -.045em; }
#stem-gate .gate-sub,
.auth-card .gate-sub { max-width: 42ch; color: #b2c2d3; font-size: 13px; line-height: 1.65; }
#stem-gate .gate-sub { font-size: 15px; }
.gate-actions { justify-content: stretch; gap: 10px; margin-top: 28px; }
.gate-btn {
  min-height: 54px; flex: 1; display: inline-flex; justify-content: center; align-items: center; gap: 10px;
  padding: 14px 20px; border-radius: 14px; color: #d7effa; font: 650 12px/1.15 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em; text-transform: uppercase; border: 1px solid rgba(145, 204, 235, .27);
  background: rgba(27, 64, 90, .28); transition: transform .18s ease, border-color .18s, background .18s, box-shadow .18s;
}
.gate-btn:hover { transform: translateY(-2px); border-color: rgba(128, 231, 255, .78); background: rgba(38, 97, 131, .35); box-shadow: 0 14px 30px rgba(0, 0, 0, .24); }
.gate-btn.primary { color: #08131c; border-color: #f0d18c; background: linear-gradient(130deg, #ffedbd, #e7bc63); box-shadow: 0 8px 30px rgba(234, 190, 98, .15); }
.gate-btn.primary:hover { border-color: #fff1c6; background: linear-gradient(130deg, #fff1c6, #f0c76b); }
.gate-btn.ghost { flex: 0 0 auto; background: transparent; color: #9eafc0; }
.gate-note { min-height: 19px; margin-top: 14px; color: #91d7f4; font: 11px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.gate-reassurance { margin-top: 8px; color: #71879a; font-size: 11px; line-height: 1.6; }
.auth-card { width: min(490px, calc(100vw - 32px)); }
.auth-card .auth-form { display: grid; gap: 13px; margin-top: 24px; }
#stem-auth-name-wrap[hidden],
#academy-profile-panel [hidden] { display: none !important; }
.auth-card label { display: grid; gap: 7px; color: #9eb2c6; font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.auth-card input { width: 100%; min-height: 50px; text-align: left; padding: 12px 15px; border-radius: 12px; border: 1px solid rgba(138, 179, 208, .22); color: #f2f7fc; background: rgba(1, 7, 14, .55); font: 14px/1.4 Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; }
.auth-card input::placeholder { color: #62788d; }
.auth-card input:focus { outline: none; border-color: rgba(128, 231, 255, .7); box-shadow: 0 0 0 3px rgba(79,169,255,.12); }
.auth-card .auth-mode-toggle { display: flex; gap: 8px; margin-top: 20px; }
.auth-mode-toggle button { flex: 1; min-height: 42px; border: 1px solid transparent; border-radius: 10px; color: #8da2b6; background: transparent; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; letter-spacing: .1em; cursor: pointer; }
.auth-mode-toggle button.active { color: var(--stem-cyan); border-color: rgba(128,231,255,.23); background: rgba(128,231,255,.07); }
.auth-footnote { color: #768ba0; font-size: 11px; line-height: 1.6; margin-top: 12px; }
.auth-back-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.auth-submit { width: 100%; }
.auth-submit[disabled] { opacity: .6; cursor: progress; }

/* Persistent Academy command interface — no other site's dock is loaded here. */
#stem-topbar {
  position: fixed; left: 24px; right: 24px; top: 18px; z-index: 5000; height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 8px 13px 8px 16px; border: 1px solid var(--stem-line); border-radius: 18px;
  background: rgba(3, 10, 19, .72); box-shadow: 0 14px 42px rgba(0,0,0,.2);
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.stem-brand-lockup { display: flex; align-items: center; min-width: 0; gap: 12px; }
.stem-brand-mark { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; color: #a9eeff; border: 1px solid rgba(128,231,255,.26); background: linear-gradient(145deg, rgba(66,172,221,.2), rgba(28,50,82,.22)); box-shadow: inset 0 1px rgba(255,255,255,.08), 0 0 26px rgba(79,169,255,.08); }
.stem-brand-copy { min-width: 0; display: grid; gap: 3px; }
.stem-brand-name { overflow: hidden; color: #eff8ff; font-size: 12px; font-weight: 750; letter-spacing: .12em; text-overflow: ellipsis; white-space: nowrap; }
.stem-brand-context { color: #8ba0b5; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
.stem-topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stem-online-pill { display: inline-flex; align-items: center; gap: 7px; color: #94aaBF; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.stem-online-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #78e3ad; box-shadow: 0 0 10px rgba(120,227,173,.55); }
.stem-online-pill.offline::before { background: #f2bf72; box-shadow: 0 0 10px rgba(242,191,114,.45); }
.stem-account-chip { min-width: 0; max-width: min(35vw, 265px); display: flex; align-items: center; gap: 9px; padding: 6px 10px 6px 6px; border: 1px solid rgba(180,204,225,.16); border-radius: 12px; background: rgba(255,255,255,.035); color: #eaf4fa; cursor: pointer; text-align: left; }
.stem-account-avatar { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; color: #d9c48d; background: rgba(230,196,120,.1); font-size: 15px; }
.stem-account-copy { min-width: 0; display: grid; gap: 2px; }
.stem-account-name { overflow: hidden; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.stem-account-sub { overflow: hidden; color: #869bae; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.stem-account-chevron { color: #7791a7; font-size: 11px; }

/* ── Home panel: drag bar and minimise ─────────────────────────────────────
   The panel covers the left 440px of the cosmos permanently, which hides the
   inner planets a student is trying to click. It can now be dragged anywhere
   and collapsed to its bar. Position and collapsed state persist per device. */
.home-panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: -6px -4px 2px; padding: 2px 4px 6px;
  cursor: grab; touch-action: none; user-select: none;
  border-bottom: 1px solid rgba(151,191,221,.12);
}
.home-panel-bar:active { cursor: grabbing; }
.home-panel-grip { color: rgba(151,191,221,.5); font-size: 15px; letter-spacing: 2px; }
.home-panel-min {
  width: 28px; height: 28px; flex: none; cursor: pointer;
  display: grid; place-items: center;
  font: 600 17px/1 Inter, system-ui, sans-serif; color: rgba(215,235,255,.85);
  background: rgba(151,191,221,.10); border: 1px solid rgba(151,191,221,.22);
  border-radius: 9px; transition: background .15s, color .15s;
}
.home-panel-min:hover { background: rgba(151,191,221,.2); color: #fff; }
.home-panel-min:focus-visible { outline: 2px solid #7fd3ff; outline-offset: 2px; }

/* Collapsed: only the bar remains, and the panel stops reserving height so it
   cannot keep covering the scene. */
#stem-home-panel.is-min { bottom: auto !important; max-height: none; overflow: visible; padding-bottom: 10px; }
#stem-home-panel.is-min > *:not(.home-panel-bar) { display: none; }
#stem-home-panel.is-min .home-panel-bar { border-bottom: 0; margin-bottom: -2px; padding-bottom: 0; }

/* Dragged: JS sets left/top inline, so the default anchoring must yield. */
#stem-home-panel.is-dragged { right: auto; bottom: auto; max-height: calc(100vh - 140px); }

#stem-home-panel {
  position: fixed; left: clamp(18px, 4vw, 64px); top: 104px; bottom: 104px; z-index: 120;
  display: flex; flex-direction: column; gap: 13px; width: min(440px, calc(100vw - 36px)); max-height: calc(100vh - 208px);
  overflow-y: auto; padding: 22px 17px 18px; border: 1px solid rgba(151,191,221,.2); border-radius: 25px;
  background: linear-gradient(160deg, rgba(6,16,29,.83), rgba(4,10,20,.72));
  box-shadow: 0 26px 80px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.05);
  backdrop-filter: blur(22px) saturate(140%); -webkit-backdrop-filter: blur(22px) saturate(140%);
  scrollbar-width: thin; scrollbar-color: rgba(153,186,210,.25) transparent;
}
.home-kicker { display: flex; align-items: center; gap: 8px; color: #95dff5; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; text-transform: uppercase; }
.home-kicker::before { content: ""; width: 17px; height: 1px; background: var(--stem-cyan); }
.home-title { margin-top: 7px; color: #f2f7fc; font-size: clamp(27px, 3vw, 36px); font-weight: 650; line-height: 1.05; letter-spacing: -.045em; }
.home-intro { max-width: 39ch; margin-top: 8px; color: #a7b8c9; font-size: 12px; line-height: 1.6; }
.home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 5px 0 0; }
.home-stat { padding: 11px 10px; border: 1px solid rgba(178,204,224,.11); border-radius: 12px; background: rgba(255,255,255,.025); }
.home-stat strong { display: block; color: #eef7ff; font-size: 16px; letter-spacing: -.03em; }
.home-stat span { display: block; margin-top: 4px; color: #8599ad; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.home-action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.stem-action-button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(148,198,224,.22); background: rgba(57,121,157,.13); color: #c9ecf7; font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; transition: transform .16s, border-color .16s, background .16s; }
.stem-action-button:hover { transform: translateY(-1px); border-color: rgba(128,231,255,.5); background: rgba(57,121,157,.24); }
.stem-action-button.primary { color: #07121c; border-color: rgba(245,203,117,.86); background: linear-gradient(130deg, #f8e1a6, #ddb660); font-weight: 800; }
.classroom-button { grid-column: 1 / -1; }
.stem-action-button.primary:hover { background: linear-gradient(130deg, #fff0c4, #efc66f); }
.stem-progress-card { display: grid; gap: 9px; padding: 13px 14px; border: 1px solid rgba(159,190,216,.13); border-radius: 15px; background: rgba(255,255,255,.025); }
.stem-progress-heading { display: flex; justify-content: space-between; gap: 8px; color: #a5b6c7; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.stem-progress-heading strong { color: #e7f5fd; font-size: 10px; letter-spacing: .04em; }
.stem-progress-track { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(179,206,227,.12); }
.stem-progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4fa9ff, #88ebdf); transition: width .5s; }
.stem-progress-caption { color: #8399ad; font-size: 10px; line-height: 1.5; }
.certificate-card { position: relative; display: grid; grid-template-columns: 55px 1fr; gap: 13px; padding: 14px; overflow: hidden; border: 1px solid rgba(245,203,117,.2); border-radius: 16px; background: linear-gradient(125deg, rgba(93,70,31,.2), rgba(28,24,21,.23) 56%, rgba(255,255,255,.025)); }
.certificate-card.unlocked { border-color: rgba(126,231,178,.36); background: linear-gradient(125deg, rgba(31,90,70,.2), rgba(18,30,31,.22) 56%, rgba(255,255,255,.025)); }
.certificate-medallion { width: 54px; height: 64px; display: grid; place-items: center; align-self: center; color: #f1cc7d; border: 1px solid rgba(245,203,117,.37); border-radius: 15px 15px 19px 19px; background: radial-gradient(circle at 50% 35%, rgba(245,203,117,.19), rgba(245,203,117,.025) 72%); font-size: 27px; }
.certificate-card.unlocked .certificate-medallion { color: #84e7b4; border-color: rgba(126,231,178,.42); background: radial-gradient(circle at 50% 35%, rgba(126,231,178,.2), rgba(126,231,178,.025) 72%); }
.certificate-copy { align-self: center; min-width: 0; }
.certificate-kicker { color: #e4c579; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
.unlocked .certificate-kicker { color: #82e6b4; }
.certificate-title { margin-top: 4px; color: #f7f3e8; font-size: 15px; font-weight: 720; letter-spacing: -.02em; }
.certificate-desc { margin-top: 4px; color: #a49f91; font-size: 10px; line-height: 1.5; }
.certificate-action { grid-column: 1 / -1; min-height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid rgba(245,203,117,.16); border-radius: 10px; color: #dbd0b0; background: rgba(245,203,117,.05); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: left; cursor: pointer; }
.certificate-action:disabled { color: #858477; border-color: rgba(180,180,170,.12); background: rgba(255,255,255,.018); cursor: not-allowed; }
.certificate-card.unlocked .certificate-action { color: #a8efcb; border-color: rgba(126,231,178,.22); background: rgba(126,231,178,.065); }
.flight-teaser { min-height: 115px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; padding: 14px; overflow: hidden; border: 1px solid rgba(156,200,229,.16); border-radius: 16px; background: linear-gradient(90deg, rgba(2,8,14,.9), rgba(2,8,14,.34) 72%), linear-gradient(0deg, rgba(2,8,14,.86), transparent 62%), url('/assets/stem-flight-lab/starship-flight-09-liftoff.png') center 53% / cover; cursor: pointer; transition: border-color .18s, transform .18s; }
.flight-teaser:hover { transform: translateY(-1px); border-color: rgba(128,231,255,.4); }
.flight-teaser-kicker { color: #a7ddef; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .17em; text-transform: uppercase; }
.flight-teaser-title { color: #f1f6fa; font-size: 15px; font-weight: 700; }
.flight-teaser-copy { max-width: 37ch; color: #a8b6c2; font-size: 9px; line-height: 1.5; }

/* Floating dock: Academy routes only. */
#stem-academy-dock {
  position: fixed; left: 50%; bottom: 17px; z-index: 8000; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 24px); padding: 8px 10px;
  border: 1px solid rgba(0,212,255,.35); border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(20,70,120,.55), rgba(8,16,40,.92)),
    radial-gradient(120% 80% at 10% 0%, rgba(255,80,180,.25), transparent 50%),
    radial-gradient(120% 80% at 90% 100%, rgba(80,255,180,.18), transparent 50%);
  box-shadow: 0 14px 50px rgba(0,0,0,.52), 0 0 28px rgba(0,180,255,.28), inset 0 1px rgba(255,255,255,.18);
  backdrop-filter: blur(25px) saturate(180%); -webkit-backdrop-filter: blur(25px) saturate(180%);
  animation: stemDockGlow 4.5s ease-in-out infinite;
}
@keyframes stemDockGlow {
  0%,100% { box-shadow: 0 14px 50px rgba(0,0,0,.52), 0 0 22px rgba(0,180,255,.22); }
  50% { box-shadow: 0 14px 50px rgba(0,0,0,.52), 0 0 36px rgba(255,90,200,.32); }
}
body.stem-freeplay #stem-academy-dock { display: none !important; }
.stem-dock-item { position: relative; display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 72px; min-height: 58px; border: 1px solid transparent; border-radius: 13px; color: #c8ecff; background: transparent; cursor: pointer; transition: color .18s, background .18s, transform .18s, border-color .18s; }
.stem-dock-item:hover, .stem-dock-item:focus-visible { transform: translateY(-8px) scale(1.08); color: #fff; border-color: rgba(128,231,255,.45); background: rgba(128,231,255,.16); outline: none; }
.stem-dock-item.active { color: #8ce5fa; background: rgba(79,169,255,.1); }
.stem-dock-icon { width: 19px; height: 19px; display: grid; place-items: center; }
.stem-dock-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.stem-dock-label { max-width: 100%; overflow: hidden; color: inherit; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.stem-dock-item .dock-dot { position: absolute; top: 8px; right: 18px; width: 5px; height: 5px; border-radius: 50%; background: #e8c873; box-shadow: 0 0 9px rgba(232,200,115,.65); }

/* Premium overlay shell shared by flight lab, account/certificates, and teacher tools. */
.stem-modal { position: fixed; inset: 0; z-index: 15000; display: none; place-items: center; padding: clamp(10px, 2.5vw, 28px); background: rgba(1,5,10,.76); backdrop-filter: blur(16px) saturate(130%); -webkit-backdrop-filter: blur(16px) saturate(130%); }
.stem-modal.open { display: grid; }
.stem-modal-backdrop { position: absolute; inset: 0; }
.stem-modal-sheet { position: relative; z-index: 1; display: flex; flex-direction: column; width: min(1120px, 100%); max-height: min(850px, calc(100vh - 32px)); min-height: min(540px, calc(100vh - 32px)); overflow: hidden; border: 1px solid rgba(153,197,228,.24); border-radius: 25px; background: linear-gradient(145deg, rgba(9,22,37,.97), rgba(3,10,19,.98)); box-shadow: var(--stem-shadow); }
.stem-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex: 0 0 auto; padding: 20px 23px; border-bottom: 1px solid rgba(161,194,220,.12); }
.stem-modal-heading { display: grid; gap: 5px; min-width: 0; }
.stem-modal-eyebrow { color: #8bdcf3; font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; text-transform: uppercase; }
.stem-modal-title { color: #f3f8fc; font-size: clamp(18px, 2.5vw, 24px); font-weight: 700; letter-spacing: -.035em; }
.stem-modal-subtitle { color: #91a5b8; font-size: 11px; line-height: 1.5; }
.stem-modal-close { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(176,201,221,.17); border-radius: 13px; color: #afc1d1; background: rgba(255,255,255,.035); font-size: 20px; cursor: pointer; }
.stem-modal-close:hover { color: white; border-color: rgba(128,231,255,.45); background: rgba(128,231,255,.08); }
.stem-modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; }

/* SpaceX Flight Lab: documentary photography first, with accurate attribution. */
#stem-flight-lab .stem-modal-sheet { width: min(1240px, 100%); min-height: min(650px, calc(100vh - 32px)); }
.flight-lab-content { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.flight-catalog { display: flex; flex-direction: column; gap: 5px; overflow-y: auto; padding: 14px; border-right: 1px solid rgba(161,194,220,.12); }
.flight-catalog-label { padding: 5px 8px 9px; color: #7890a4; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
.flight-catalog-item { display: grid; grid-template-columns: 37px minmax(0,1fr); align-items: center; gap: 10px; min-height: 60px; padding: 8px; border: 1px solid transparent; border-radius: 13px; color: #dce8f0; background: transparent; cursor: pointer; text-align: left; transition: background .18s, border-color .18s; }
.flight-catalog-item:hover { background: rgba(255,255,255,.04); }
.flight-catalog-item.active { border-color: rgba(128,231,255,.24); background: linear-gradient(110deg, rgba(61,137,173,.16), rgba(255,255,255,.025)); }
.flight-catalog-thumb { width: 37px; height: 37px; overflow: hidden; border-radius: 10px; background: #152334; }
.flight-catalog-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.flight-catalog-name { overflow: hidden; color: #e7f1f7; font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.flight-catalog-type { margin-top: 4px; color: #8ba1b4; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
.flight-feature { min-width: 0; overflow-y: auto; padding: 20px; }
.flight-media-pair { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(0,.95fr); align-items: stretch; gap: 10px; }
.flight-media-pair:not(:has(.flight-video-panel)) { grid-template-columns: minmax(0,1fr); }
.flight-media-pair .flight-photo-frame { min-width: 0; min-height: 235px; height: 100%; aspect-ratio: auto; }
.flight-video-panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(167,205,232,.18); border-radius: 18px; background: linear-gradient(150deg,rgba(12,27,43,.94),rgba(3,9,16,.97)); }
.flight-video-heading { display: grid; gap: 6px; padding: 12px 13px; border-bottom: 1px solid rgba(160,190,214,.12); }
.flight-video-heading span { color: #8bdcf3; font: 8px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .16em; }
.flight-video-heading strong { color: #eaf4f9; font-size: 10px; font-weight: 650; }
.flight-video-frame { flex: 1 1 auto; min-height: 130px; aspect-ratio: 16/9; overflow: hidden; background: #000; }
.flight-video-frame iframe { width: 100%; height: 100%; display: block; border: 0; }
.flight-video-credit { padding: 8px 11px; color: #8298aa; font-size: 8px; line-height: 1.45; }
.flight-video-credit a { margin-left: 4px; color: #a2dff0; text-decoration: underline; text-underline-offset: 3px; }
.flight-photo-frame { position: relative; min-height: 270px; aspect-ratio: 16 / 8.2; overflow: hidden; border: 1px solid rgba(167,205,232,.18); border-radius: 18px; background: #07101a; }
.flight-photo-frame::after { content: ""; position: absolute; inset: 35% 0 0; pointer-events: none; background: linear-gradient(0deg, rgba(2,7,12,.78), transparent); }
.flight-photo { width: 100%; height: 100%; display: block; object-fit: cover; transition: opacity .2s; }
.flight-photo-meta { position: absolute; right: 12px; top: 12px; z-index: 1; padding: 6px 9px; border: 1px solid rgba(255,255,255,.17); border-radius: 999px; color: #e8f1f8; background: rgba(0,0,0,.42); backdrop-filter: blur(10px); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .11em; text-transform: uppercase; }
.flight-photo-caption { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: flex; align-items: end; justify-content: space-between; gap: 12px; color: rgba(238,247,253,.82); font: 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.flight-thumbnails { display: flex; gap: 7px; margin-top: 9px; overflow-x: auto; }
.flight-thumbnail { width: 64px; height: 42px; flex: 0 0 auto; overflow: hidden; padding: 0; border: 1px solid rgba(163,191,212,.17); border-radius: 8px; background: #0c1826; cursor: pointer; opacity: .72; }
.flight-thumbnail.active { border-color: rgba(128,231,255,.78); opacity: 1; }
.flight-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; }
.flight-detail-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-top: 17px; }
.flight-title { color: #f1f7fb; font-size: clamp(21px, 3vw, 30px); line-height: 1.07; font-weight: 700; letter-spacing: -.04em; }
.flight-classification { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid rgba(145,191,217,.17); border-radius: 999px; color: #adc1d1; background: rgba(255,255,255,.035); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .07em; text-transform: uppercase; }
.flight-classification.concept { color: #f1d08a; border-color: rgba(241,208,138,.23); }
.flight-description { max-width: 74ch; margin-top: 8px; color: #9fb2c3; font-size: 11px; line-height: 1.7; }
.flight-specs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.flight-spec { display: grid; gap: 3px; min-width: 102px; padding: 8px 10px; border: 1px solid rgba(157,190,216,.12); border-radius: 10px; background: rgba(255,255,255,.025); }
.flight-spec strong { color: #deeff7; font-size: 11px; font-weight: 650; }
.flight-spec span { color: #7890a4; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
.flight-lab-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid rgba(155,188,214,.11); }
.flight-credit { max-width: 58ch; color: #8398aa; font-size: 9px; line-height: 1.55; }
.flight-credit a { color: #a2dff0; text-decoration: underline; text-underline-offset: 3px; }
.flight-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.flight-action { min-height: 39px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(128,231,255,.24); border-radius: 11px; color: #bbefff; background: rgba(68,144,177,.1); font: 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; text-decoration: none; cursor: pointer; }
.flight-action:hover { border-color: rgba(128,231,255,.55); background: rgba(68,144,177,.2); }
.flight-action.subtle { color: #a9b7c2; border-color: rgba(164,189,210,.13); background: rgba(255,255,255,.025); }
.flight-action:disabled { cursor: not-allowed; opacity: .45; }
.flight-footnote { margin-top: 11px; color: #687e91; font-size: 9px; line-height: 1.55; }

/* Multiplayer room interface: explicit room IDs, statuses, and no fake online list. */
#multiplayer-room-panel { z-index: 14900; }
.multiplayer-sheet { width: min(690px, 100%); min-height: auto; }
.multiplayer-content { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 19px; }
.multiplayer-card { padding: 17px; border: 1px solid rgba(162,194,219,.14); border-radius: 16px; background: rgba(255,255,255,.025); }
.multiplayer-card h3 { color: #eaf5fc; font-size: 14px; }
.multiplayer-card p { margin-top: 7px; color: #8ea3b6; font-size: 10px; line-height: 1.65; }
.multiplayer-form { display: grid; gap: 9px; margin-top: 15px; }
.multiplayer-form input { min-height: 43px; padding: 10px 12px; border: 1px solid rgba(155,191,215,.19); border-radius: 10px; color: #eef6fb; background: rgba(0,0,0,.18); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.multiplayer-status { min-height: 19px; margin-top: 12px; color: #8bdcf3; font: 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.multiplayer-room-card { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid rgba(126,231,178,.22); border-radius: 13px; color: #a8efcb; background: rgba(126,231,178,.06); }
.multiplayer-room-card[hidden] { display: none !important; }
.multiplayer-room-id { color: #e6fff2; font: 14px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; }
.multiplayer-mode-note { color: #91a3b4; font-size: 9px; line-height: 1.6; }

/* Official teacher dashboard — real account + classes only. */
#stem-teacher-dashboard .stem-modal-sheet { width: min(1050px, 100%); }
.teacher-dashboard-body { display: grid; grid-template-columns: 280px minmax(0,1fr); min-height: 0; flex: 1 1 auto; }
.teacher-sidebar { display: flex; flex-direction: column; gap: 12px; padding: 17px; border-right: 1px solid rgba(161,194,220,.12); }
.teacher-identity { padding: 13px; border: 1px solid rgba(128,231,255,.19); border-radius: 14px; background: rgba(58,132,164,.08); }
.teacher-identity-label { color: #87dff6; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .16em; text-transform: uppercase; }
.teacher-identity-name { margin-top: 7px; color: #edf7fd; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.teacher-identity-email { margin-top: 4px; color: #8298aa; font-size: 9px; overflow-wrap: anywhere; }
.teacher-create-form { display: grid; gap: 8px; padding: 13px; border: 1px solid rgba(158,190,213,.13); border-radius: 14px; background: rgba(255,255,255,.02); }
.teacher-create-form label { color: #8ca2b5; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-transform: uppercase; }
.teacher-create-form input,.teacher-create-form select { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid rgba(150,185,208,.18); border-radius: 9px; color: #eaf4fa; background: #071321; font: 10px Inter,system-ui,sans-serif; }
.teacher-content { min-width: 0; overflow: auto; padding: 18px; }
.teacher-overview { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.teacher-metric { padding: 11px; border: 1px solid rgba(163,191,213,.12); border-radius: 12px; background: rgba(255,255,255,.025); }
.teacher-metric strong { display: block; color: #edf7fd; font-size: 18px; }
.teacher-metric span { display: block; margin-top: 4px; color: #8398aa; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; }
.teacher-class-list { display: grid; gap: 11px; margin-top: 15px; }
.teacher-class-card { overflow: hidden; border: 1px solid rgba(155,190,215,.14); border-radius: 15px; background: rgba(255,255,255,.023); }
.teacher-class-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px; border-bottom: 1px solid rgba(155,190,215,.1); }
.teacher-class-title { color: #eff7fc; font-size: 13px; font-weight: 700; }
.teacher-class-course { margin-top: 4px; color: #8298aa; font-size: 9px; }
.teacher-code { padding: 7px 9px; border: 1px solid rgba(245,203,117,.22); border-radius: 9px; color: #f5d98f; background: rgba(245,203,117,.055); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; white-space: nowrap; }
.teacher-table-wrap { width: 100%; overflow-x: auto; }
.teacher-roster { width: 100%; border-collapse: collapse; min-width: 440px; }
.teacher-roster th { padding: 9px 12px; color: #7890a3; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.teacher-roster td { padding: 9px 12px; border-top: 1px solid rgba(155,190,215,.08); color: #b6c7d5; font-size: 9px; }
.teacher-student-name { color: #edf6fb; font-weight: 650; }
.teacher-student-email { margin-top: 3px; color: #7e93a6; font-size: 8px; }
.teacher-empty,.teacher-error { padding: 27px 16px; border: 1px dashed rgba(153,185,208,.2); border-radius: 13px; color: #94a8ba; font-size: 10px; line-height: 1.7; text-align: center; }
.teacher-error { color: #ffc0a7; }
.teacher-assignment { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 10px 12px; border-top: 1px solid rgba(155,190,215,.08); color: #a9bed0; font-size: 9px; }
.teacher-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.teacher-toolbar-title { color: #ecf5fb; font-size: 12px; font-weight: 700; }
.teacher-toolbar-sub { margin-top: 4px; color: #8499ac; font-size: 9px; }
.teacher-refresh { min-height: 34px; padding: 8px 10px; border: 1px solid rgba(148,190,217,.18); border-radius: 9px; color: #a7dff0; background: rgba(255,255,255,.03); font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; }

/* Profile panel tuned to the same Academy finish. */
#academy-profile-panel { z-index: 6100 !important; top: 92px !important; right: 22px !important; width: min(330px, calc(100vw - 28px)) !important; border-radius: 20px !important; border-color: rgba(150,195,223,.2) !important; background: rgba(5,14,25,.96) !important; }
#academy-leaderboard-panel { z-index: 6500 !important; }
#mission-overlay { z-index: 9000 !important; }

/* The mission briefing carries the selected training craft into the 3D mission. */
.mission-vehicle-deck {
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(190px, .56fr) minmax(0, 1.8fr);
  align-items: center; gap: 18px; padding: 12px 32px 13px;
  border-bottom: 1px solid rgba(255,255,255,.07); background: linear-gradient(90deg, rgba(17,39,57,.4), rgba(4,12,22,.12));
}
.mission-vehicle-copy { min-width: 0; }
.mission-vehicle-kicker { color: #88d9f1; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .17em; }
.mission-vehicle-copy h3 { margin-top: 5px; color: #edf7fc; font-size: 15px; font-weight: 680; letter-spacing: -.02em; }
.mission-vehicle-copy p { max-width: 42ch; margin-top: 5px; color: #879cae; font-size: 9px; line-height: 1.45; }
.mission-vehicle-selected { margin-top: 6px; color: #b7e6f4; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; }
.mission-vehicle-picker { min-width: 0; display: flex; gap: 7px; overflow-x: auto; padding: 3px 1px 8px; scrollbar-width: thin; scrollbar-color: rgba(128,231,255,.24) transparent; }
.mission-vehicle-option { min-width: 158px; flex: 0 0 158px; min-height: 57px; display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 9px; padding: 6px; border: 1px solid rgba(165,196,219,.15); border-radius: 11px; color: #deebf3; background: rgba(255,255,255,.025); cursor: pointer; text-align: left; transition: background .16s, border-color .16s, transform .16s; }
.mission-vehicle-option:hover { transform: translateY(-1px); border-color: rgba(128,231,255,.42); background: rgba(128,231,255,.06); }
.mission-vehicle-option.active { border-color: rgba(128,231,255,.72); background: linear-gradient(115deg, rgba(58,150,191,.18), rgba(255,255,255,.035)); box-shadow: inset 0 0 0 1px rgba(128,231,255,.12); }
.mission-vehicle-option:focus-visible { outline: 2px solid var(--stem-cyan); outline-offset: 2px; }
.mission-vehicle-option img { width: 48px; height: 43px; display: block; object-fit: cover; border-radius: 7px; background: #101d2b; }
.mission-vehicle-option-copy { min-width: 0; display: grid; gap: 4px; }
.mission-vehicle-option-copy strong { overflow: hidden; color: #eef6fb; font-size: 9px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; }
.mission-vehicle-option-copy small { color: #8298ab; font: 7px ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.25; }

.planet-mission-card { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); z-index: 5200; width: min(520px, calc(100vw - 28px)); display: none; padding: 22px 24px 19px; transform: translateX(-50%); border: 1px solid rgba(128,231,255,.26); border-radius: 18px; color: #edf7fc; background: linear-gradient(145deg, rgba(6,17,29,.96), rgba(2,8,15,.94)); box-shadow: 0 22px 70px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.05); backdrop-filter: blur(23px) saturate(145%); text-align: center; }
.planet-mission-close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border: 1px solid rgba(183,210,230,.15); border-radius: 50%; color: #a2b6c6; background: rgba(255,255,255,.035); font-size: 21px; line-height: 1; cursor: pointer; }
.planet-mission-close:hover { color: #fff; border-color: rgba(128,231,255,.45); }
.planet-mission-title { color: var(--stem-cyan); font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.planet-mission-zone { margin-top: 5px; color: #7e96aa; font: 8px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; text-transform: uppercase; }
.planet-mission-count { min-height: 18px; margin: 12px 0 14px; color: #b4c4d1; font-size: 11px; line-height: 1.5; }
.planet-mission-launch { min-height: 42px; padding: 10px 22px; border: 1px solid rgba(128,231,255,.48); border-radius: 999px; color: #07131b; background: linear-gradient(120deg, #b6f1ff, #68c9eb); font: 700 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; cursor: pointer; }
.planet-mission-launch:hover { filter: brightness(1.07); }
.planet-mission-close:focus-visible, .planet-mission-launch:focus-visible { outline: 2px solid #f3cf7b; outline-offset: 3px; }

#mission-hud { z-index: 4200 !important; }
#mission-score-hud { z-index: 4300 !important; }
#spacex-telemetry { z-index: 4500 !important; }
#stem-teacher-button { display: none; }

@media (max-width: 760px) {
  .mission-overlay-header { padding: 14px 13px 11px; }
  .mission-overlay-header h2 { font-size: 20px; }
  .mission-overlay-header p { max-width: 45ch; font-size: 10px; }
  #close-mission-overlay { width: 34px; height: 34px; margin-left: 9px; margin-top: 0; }
  .filter-tabs { gap: 6px; padding: 8px 13px; }
  .filter-tab { padding: 6px 10px; font-size: 8px; }
  .mission-grid-scroll { padding: 12px 13px 28px; }
  .mission-vehicle-deck { grid-template-columns: minmax(0,1fr); gap: 7px; padding: 10px 13px 9px; }
  .mission-vehicle-copy { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 8px; }
  .mission-vehicle-kicker { grid-column: 1 / -1; }
  .mission-vehicle-copy h3 { font-size: 13px; }
  .mission-vehicle-copy p { display: none; }
  .mission-vehicle-selected { margin-top: 0; text-align: right; font-size: 7px; }
  .mission-vehicle-picker { gap: 6px; padding-bottom: 7px; }
  .mission-vehicle-option { min-width: 145px; flex-basis: 145px; min-height: 52px; grid-template-columns: 40px minmax(0,1fr); gap: 7px; padding: 5px; }
  .mission-vehicle-option img { width: 40px; height: 38px; }
  .planet-mission-card { bottom: calc(95px + env(safe-area-inset-bottom)); padding: 20px 17px 15px; }
  .planet-mission-title { font-size: 16px; }
  #stem-topbar { left: 10px; right: 10px; top: 10px; height: 55px; padding: 6px 8px 6px 10px; border-radius: 15px; }
  .stem-brand-mark { width: 33px; height: 33px; }
  .stem-brand-name { font-size: 10px; }
  .stem-brand-context { font-size: 7px; }
  .stem-online-pill { display: none; }
  .stem-account-chip { max-width: 50vw; padding-right: 7px; }
  #stem-home-panel { left: 10px; right: 10px; top: 77px; bottom: 88px; width: auto; max-height: none; padding: 16px 13px; gap: 10px; border-radius: 19px; }
  @media (orientation: landscape) {
    #stem-home-panel { top: 64px; bottom: auto; max-height: 46vh; }
  }
  .home-title { font-size: 28px; }
  .home-intro { font-size: 11px; }
  .home-stat { padding: 8px; }
  .home-stat strong { font-size: 14px; }
  .home-stat span { font-size: 7px; }
  #stem-academy-dock { bottom: 8px; width: calc(100vw - 14px); max-width: none; justify-content: space-around; padding: 5px; border-radius: 17px; }
  .stem-dock-item { width: 60px; min-height: 52px; }
  .stem-dock-label { font-size: 7px; }
  .stem-modal { padding: 7px; }
  .stem-modal-sheet { max-height: calc(100vh - 14px); min-height: 0; border-radius: 19px; }
  .stem-modal-header { padding: 14px; }
  .flight-lab-content { grid-template-columns: minmax(0,1fr); }
  .flight-catalog { flex-direction: row; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 9px 11px; border-right: 0; border-bottom: 1px solid rgba(161,194,220,.12); }
  .flight-catalog-label { display: none; }
  .flight-catalog-item { min-width: 128px; min-height: 50px; grid-template-columns: 30px minmax(0,1fr); }
  .flight-catalog-thumb { width: 30px; height: 30px; }
  .flight-feature { padding: 11px; }
  .flight-photo-frame { min-height: 185px; aspect-ratio: 16/9; }
  .flight-title { font-size: 22px; }
  .flight-classification { font-size: 7px; }
  .flight-spec { min-width: 82px; }
  .multiplayer-content { grid-template-columns: 1fr; padding: 12px; }
  .multiplayer-room-card { grid-column: auto; }
  .teacher-dashboard-body { grid-template-columns: 1fr; }
  .teacher-sidebar { display: grid; grid-template-columns: 1fr 1fr; padding: 11px; border-right: 0; border-bottom: 1px solid rgba(161,194,220,.12); }
  .teacher-identity { grid-column: 1/-1; }
  .teacher-content { padding: 11px; }
}
@media (max-width: 560px) {
  .flight-media-pair { grid-template-columns: minmax(0,1fr); }
  .flight-media-pair .flight-photo-frame { min-height: 185px; aspect-ratio: 16/9; }
}
@media (max-width: 440px) {
  #stem-gate .gate-title, #stem-login-card .gate-title { font-size: 32px; }
  .gate-actions { flex-direction: column; }
  .gate-btn { width: 100%; }
  .home-action-row { grid-template-columns: 1fr; }
  .certificate-card { grid-template-columns: 45px 1fr; padding: 11px; }
  .certificate-medallion { width: 44px; height: 55px; font-size: 23px; }
  .stem-brand-context { display: none; }
  .stem-account-sub { max-width: 105px; }
  .stem-dock-item { width: 53px; }
  .stem-dock-label { font-size: 6.5px; }
}

@media (prefers-reduced-motion: reduce) {
  #stem-cinematic *, .stem-dock-item, .stem-action-button, .flight-photo { transition: none !important; animation: none !important; }
}

/* Mission Control surfaces: keyboard-visible actions and documentary media labels. */
button.mission-card {
  width: 100%; min-width: 0; appearance: none; -webkit-appearance: none;
  color: #f1f7fb; font: inherit; text-align: left;
}
button.mission-card:focus-visible,
.flight-catalog-item:focus-visible,
.flight-thumbnail:focus-visible,
.flight-action:focus-visible,
.multiplayer-form button:focus-visible,
.teacher-refresh:focus-visible,
.teacher-code:focus-visible,
#academy-chat-panel button:focus-visible,
#academy-chat-panel input:focus-visible {
  outline: 2px solid var(--stem-cyan); outline-offset: 3px;
}
button.mission-card:disabled { cursor: not-allowed; opacity: .62; }
.mission-empty-state {
  grid-column: 1 / -1; padding: 42px 22px; border: 1px dashed rgba(145,190,220,.24);
  border-radius: 18px; color: #9aafc1; background: rgba(255,255,255,.025);
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center;
}
.objective-list { max-height: min(42vh, 430px); overflow: auto; padding: 0; margin: 0; }
.objective-item { cursor: default; align-items: flex-start; line-height: 1.55; text-decoration: none !important; }
.objective-marker {
  flex: 0 0 auto; min-width: 55px; padding: 3px 5px; border: 1px solid rgba(145,190,220,.2);
  border-radius: 6px; color: #8ca9be; font: 7px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .08em; text-align: center;
}
.objective-item.completed .objective-marker { color: #84e7b4; border-color: rgba(126,231,178,.35); background: rgba(126,231,178,.07); }
.objective-item.completed > span:last-child { color: #b6e8d2; text-decoration: none; }
.flight-video-panel { box-shadow: inset 0 1px rgba(255,255,255,.035), 0 12px 38px rgba(0,0,0,.18); }
.flight-video-panel.related-footage { border-color: rgba(241,208,138,.25); }
.flight-video-panel.related-footage .flight-video-heading span { color: #f1d08a; }
.flight-video-note { padding: 0 11px 10px; color: #8ca0b0; font-size: 8px; line-height: 1.55; }
.flight-video-panel.related-footage .flight-video-note { color: #dfc993; }
/* Flight read-out. A chip in the top-right corner, not a panel: the pad
   handles thrust, so the only data worth permanent screen space is airspeed,
   thrust state and range. The keyboard map that used to live here is gone —
   on a phone it was a paragraph sitting over the objective. */
#spacex-telemetry { display:none; }
#spacex-telemetry {
  position:fixed !important; z-index:4500 !important;
  top:calc(12px + env(safe-area-inset-top,0px)) !important;
  right:calc(14px + env(safe-area-inset-right,0px)) !important;
  bottom:auto !important; left:auto !important;
  min-width:0 !important; padding:6px 10px !important;
  display:none; align-items:center; gap:8px;
  border:1px solid rgba(140,215,255,.28) !important; border-radius:9px !important;
  background:rgba(4,13,25,.62) !important; color:#bfeeff;
  font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace !important;
  letter-spacing:.04em; pointer-events:none;
  -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px);
}
.telemetry-vehicle-code { display:grid; place-items:center; min-width:24px; height:19px;
  padding:0 4px; border:1px solid rgba(128,231,255,.35); border-radius:5px;
  color:#9beaff; font-size:9px; }
.telemetry-speed { color:#eafcff; font-size:14px; font-variant-numeric:tabular-nums; }
.telemetry-unit { color:rgba(150,205,230,.62); font-size:9px; margin-left:-4px; }
.telemetry-state { padding-left:8px; border-left:1px solid rgba(140,215,255,.22);
  color:rgba(150,205,230,.72); font-size:9px; letter-spacing:.1em; }
.telemetry-state.live { color:#8ef0c4; }

/* The legacy button grid is retired: the two on-screen pads own every axis.
   It stays in the DOM (other code queries it) but never paints. */
#spacex-touch-controls { display:none !important; }

/* ── Mission HUD, rebuilt for a phone ─────────────────────────────────────
   The old panel was a 320px card pinned top-right that stacked the mission
   title, a full objective list, an NPC dialogue box and an Abort button. In
   landscape on a phone that is half the screen, and it sat exactly where the
   objective markers appear. It is now one collapsed bar that expands on tap,
   and it never takes pointer events except on its own controls. */
#mission-hud {
  position:fixed; z-index:4200 !important;
  top:calc(10px + env(safe-area-inset-top,0px));
  left:calc(10px + env(safe-area-inset-left,0px));
  right:auto; width:min(300px, calc(100vw - 20px));
  padding:0; gap:0; border-radius:13px;
  border:1px solid rgba(150,215,245,.2); background:rgba(4,12,22,.72);
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  box-shadow:0 10px 34px rgba(0,0,0,.45);
  display:none; flex-direction:column; overflow:hidden;
  pointer-events:none;
}
#mission-hud.active { display:flex; }
#mission-hud .hud-header {
  display:grid; grid-template-columns:auto minmax(0,1fr) auto; align-items:center;
  gap:8px; padding:9px 10px; border:0; pointer-events:auto; cursor:pointer;
  background:none; width:100%; text-align:left; color:inherit; font:inherit;
}
#mission-hud .hud-header:focus-visible { outline:2px solid #80e7ff; outline-offset:-2px; }
.hud-progress { display:grid; place-items:center; min-width:40px; height:26px;
  border:1px solid rgba(140,215,255,.3); border-radius:7px;
  color:#a9eaff; font:800 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.hud-title { font-size:11px; font-weight:700; color:#e7f6ff; line-height:1.25;
  letter-spacing:.01em; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; }
.hud-timer { font:800 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace; color:#bfe9ff;
  font-variant-numeric:tabular-nums; }
.hud-timer.warning-80 { color:#ffc46a; }
.hud-timer.warning-100 { color:#ff8b7a; animation:pulse 1s infinite; }
.hud-progress.complete { color:#8ef0c4; border-color:rgba(126,231,178,.45); }
.hud-toggle { color:rgba(160,215,240,.55); font-size:10px; margin-left:2px; }
#mission-hud.expanded .hud-toggle { transform:rotate(180deg); }

/* Objectives: capped, scrollable, and out of the way until asked for. */
#mission-hud .objective-list {
  max-height:0; overflow:hidden; padding:0 10px; margin:0;
  display:flex; flex-direction:column; gap:5px;
  transition:max-height .28s ease, padding .28s ease;
}
#mission-hud.expanded .objective-list {
  max-height:min(38vh, 260px); overflow:auto; padding:0 10px 9px;
  pointer-events:auto;
}
.objective-item { display:flex; align-items:flex-start; gap:7px; font-size:10.5px;
  line-height:1.45; color:rgba(219,238,250,.72); cursor:default; }
.objective-item.completed { color:rgba(126,231,178,.72); }
.objective-item.completed > span:last-child { text-decoration:line-through; }
.objective-marker { flex:0 0 auto; min-width:44px; padding:2px 4px;
  border:1px solid rgba(145,190,220,.2); border-radius:5px; color:#8ca9be;
  font:7px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.07em;
  text-align:center; }
.objective-item.completed .objective-marker { color:#84e7b4;
  border-color:rgba(126,231,178,.35); background:rgba(126,231,178,.07); }

#mission-hud .npc-dialogue-area { display:none !important; }

/* Abort moves out of the card and into the expanded footer, so the collapsed
   bar is a single 40px row. */
#quit-mission-btn {
  display:none; margin:0 10px 9px; padding:8px 10px; border-radius:8px;
  border:1px solid rgba(239,120,120,.35); background:rgba(90,26,30,.35);
  color:#ffb0a8; font:700 9px/1 ui-monospace,SFMono-Regular,Menlo,monospace;
  letter-spacing:.1em; cursor:pointer; min-height:34px;
}
#mission-hud.expanded #quit-mission-btn { display:block; }
#quit-mission-btn:focus-visible { outline:2px solid #ff9a90; outline-offset:2px; }

/* ── Score chip ──────────────────────────────────────────────────────────
   It used to be a five-row panel in the top-right, directly under the mission
   card, printing SCORE / TIME / OBJECTIVES / DIFFICULTY / MULTIPLIER on top of
   the flight telemetry. Two of those five rows are already in the mission bar,
   so this is now a single line under it. */
#mission-score-hud {
  position:fixed !important; z-index:4300 !important;
  top:calc(52px + env(safe-area-inset-top,0px)) !important;
  left:calc(10px + env(safe-area-inset-left,0px)) !important;
  right:auto !important; min-width:0 !important; width:auto !important;
  margin:0; padding:4px 9px !important; border-radius:8px !important;
  border:1px solid rgba(150,215,245,.16) !important;
  background:rgba(4,12,22,.6) !important;
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  font:700 9px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace !important;
  color:rgba(205,232,246,.8) !important; display:none;
  pointer-events:none;
}
#mission-score-hud.active, #mission-score-hud[style*="block"] { display:flex !important;
  align-items:center; gap:9px; }
#mission-score-hud > div { margin:0 !important; display:flex; gap:4px; }
#mission-score-hud > div > span:first-child { color:rgba(150,195,220,.5) !important; }
#mission-score-hud #hud-score { color:#8ef0c4 !important; }
#mission-score-hud #score-time-remaining { color:#bfe9ff !important; }
/* Difficulty and multiplier are static for the whole mission; they belong in
   the debrief, not in a chip that updates every frame. */
#mission-score-hud #hud-difficulty,
#mission-score-hud #hud-multiplier,
#mission-score-hud > div:nth-child(4) { display:none !important; }

/* ── One-time play-state chrome: hide the Academy's own launcher buttons
   while a mission or free flight is running, so the only things on screen are
   the scene, the controls and the flight read-out. ─────────────────────── */
/* In flight the Academy's launcher buttons are gone. In a mission the hangar
   stays reachable but moves out from under the mission bar, so the two never
   stack on a 360px-wide screen. */
body.stem-flying #hangar-btn,
body.stem-flying #academy-btn,
body.stem-flying #academy-hud,
body.stem-flying .hero-content { display:none !important; }
body.mission-running #academy-btn,
body.mission-running #academy-hud,
body.mission-running .hero-content { display:none !important; }
body.mission-running #hangar-btn {
  top:calc(92px + env(safe-area-inset-top,0px)) !important;
  bottom:auto !important; left:calc(10px + env(safe-area-inset-left,0px)) !important;
  transform:scale(.9); transform-origin:top left; z-index:46;
}
body.mission-running #hangar-btn .hangar-btn-label small { display:none; }

/* Portrait phones: mission bar spans the width it needs, nothing else. */
/* ── Free play ───────────────────────────────────────────────────────────
   The hangar chip is the only way back to the craft picker, so it stays. It
   moves down out of the way of the FLY/EXIT chip rather than being hidden. */
body.stem-freeplay #hangar-btn {
  top: calc(12px + env(safe-area-inset-top,0px)) !important;
  left: calc(10px + env(safe-area-inset-left,0px)) !important;
  bottom: auto !important;
  max-width: 44vw;
}
body.stem-freeplay #hangar-btn .hangar-btn-label small { display:none; }
@media (max-width: 380px) {
  body.stem-freeplay #hangar-btn .hangar-btn-label { display:none; }
  body.stem-freeplay #hangar-btn { padding:8px; }
}

@media (max-width:560px) {
  #mission-hud { width:calc(100vw - 20px); }
  /* On a narrow screen the hangar chip moves under the bar, so the score
     line moves under *it* rather than colliding. */
  #mission-score-hud { top:calc(96px + env(safe-area-inset-top,0px)) !important; }
  #mission-hud .hud-title { font-size:10px; }
  #hangar-btn { max-width:46vw; overflow:hidden; }
  #hangar-btn .hangar-btn-label small { display:none; }
}
@media (orientation:landscape) and (max-height:520px) {
  #mission-hud { width:min(258px, 44vw); }
  #mission-hud .hud-header { padding:6px 8px; }
  #mission-score-hud { top:calc(44px + env(safe-area-inset-top,0px)) !important; }
}

#mission-start-gate {
  position: fixed; inset: 0; z-index: 12000; display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  color: #eef8fd; background: rgba(1,6,12,.82); backdrop-filter: blur(15px);
}
.mission-start-sheet {
  width: min(720px, 100%); max-height: calc(100vh - 24px); overflow: auto;
  padding: clamp(18px, 4vw, 34px); border: 1px solid rgba(128,231,255,.25);
  border-radius: 20px; background: linear-gradient(145deg,rgba(9,24,40,.98),rgba(3,10,18,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.6),inset 0 1px rgba(255,255,255,.05);
}
.mission-start-kicker { color: #8bdcf3; font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .18em; }
.mission-start-title { margin: 9px 0 8px; color: #f3f8fc; font-size: clamp(20px,4vw,30px); line-height: 1.15; letter-spacing: -.035em; }
.mission-start-description { margin: 0; color: #afc0cd; font-size: 13px; line-height: 1.65; }
.mission-start-simulation { margin: 12px 0 0; color: #a8e8f5; font-size: 11px; line-height: 1.55; }
.mission-start-extension { margin: 6px 0 0; padding: 9px 11px; border: 1px solid rgba(154,188,211,.14); border-radius: 9px; color: #94aaba; background: rgba(255,255,255,.025); font-size: 10px; line-height: 1.55; }
.mission-start-section-title { margin: 19px 0 8px; color: #d9edf6; font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .12em; text-transform: uppercase; }
.mission-start-objectives { display: grid; gap: 7px; max-height: 24vh; overflow: auto; margin: 0; padding: 0 0 0 27px; color: #d7e5ed; font-size: 12px; line-height: 1.5; }
.mission-start-objectives li { padding-left: 3px; }
.mission-start-resume { margin: 12px 0 0; color: #8fe0bd; font-size: 11px; line-height: 1.5; }
.mission-start-controls { margin: 7px 0 0; color: #9bc6d6; font-size: 11px; line-height: 1.55; }
.mission-start-status { min-height: 1.4em; margin: 8px 0 0; color: #ffcf8e; font-size: 11px; line-height: 1.45; }
.mission-start-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.mission-start-action { min-height: 44px; padding: 10px 15px; border: 1px solid rgba(166,198,220,.2); border-radius: 11px; color: #c2d5e1; background: rgba(255,255,255,.04); font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.mission-start-action.primary { border-color: rgba(128,231,255,.45); color: #04131a; background: linear-gradient(125deg,#a4efff,#68cce8); font-weight: 800; }
.mission-start-action:hover:not(:disabled) { border-color: rgba(128,231,255,.7); filter: brightness(1.08); }
.mission-start-action:focus-visible { outline: 2px solid #80e7ff; outline-offset: 3px; }
.mission-start-action:disabled { opacity: .55; cursor: wait; }
@media (max-width: 520px) {
  .mission-start-sheet { padding: 17px; border-radius: 16px; }
  .mission-start-objectives { max-height: 28vh; font-size: 11px; }
  .mission-start-actions { display: grid; grid-template-columns: 1fr; }
}

/* Objective checks turn every catalog mission into a self-contained, assessed simulation. */
#mission-assessment-dialog {
  position: fixed; inset: 0; z-index: 12010; display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  color: #eef8fd; background: rgba(1,6,12,.86); backdrop-filter: blur(15px);
}
.mission-assessment-sheet {
  width: min(720px,100%); max-height: calc(100vh - 24px); overflow: auto;
  padding: clamp(18px,4vw,32px); border: 1px solid rgba(128,231,255,.28); border-radius: 20px;
  background: radial-gradient(ellipse at 100% 0,rgba(71,169,202,.11),transparent 45%),linear-gradient(145deg,rgba(9,24,40,.99),rgba(3,10,18,.995));
  box-shadow: 0 28px 90px rgba(0,0,0,.65),inset 0 1px rgba(255,255,255,.06);
}
.mission-assessment-kicker { color: #8bdcf3; font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .16em; }
.mission-assessment-title { margin: 10px 0 4px; color: #f4f9fc; font-size: clamp(21px,4vw,29px); line-height: 1.15; letter-spacing: -.03em; }
.mission-assessment-case-title { margin-top: 13px; color: #d7e8f1; font: 10px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .06em; }
.mission-assessment-case { margin: 6px 0 0; color: #98adbd; font-size: 11px; line-height: 1.6; }
.mission-assessment-objective { margin: 14px 0 0; padding: 10px 12px; border-left: 2px solid #80e7ff; color: #c9dce8; background: rgba(128,231,255,.055); font-size: 11px; line-height: 1.55; }
.mission-assessment-prompt { margin: 15px 0 10px; color: #f2f7fb; font-size: 14px; font-weight: 650; line-height: 1.5; }
.mission-assessment-choices { display: grid; gap: 8px; }
.mission-assessment-choice {
  display: grid; grid-template-columns: 28px 1fr; align-items: start; gap: 10px; width: 100%; min-height: 48px;
  padding: 11px 12px; border: 1px solid rgba(153,190,214,.18); border-radius: 11px; color: #d9e7ef;
  background: rgba(255,255,255,.035); font: 11px/1.5 Inter,system-ui,sans-serif; text-align: left; cursor: pointer;
  transition: border-color .15s,background .15s,transform .15s;
}
.mission-assessment-choice:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(128,231,255,.52); background: rgba(67,142,171,.12); }
.mission-assessment-choice:focus-visible,.mission-assessment-action:focus-visible { outline: 2px solid #80e7ff; outline-offset: 3px; }
.mission-assessment-choice:disabled { cursor: default; opacity: .62; }
.mission-assessment-choice.incorrect { border-color: rgba(248,133,130,.38); background: rgba(126,38,41,.12); }
.mission-assessment-choice.correct { border-color: rgba(126,231,178,.52); color: #ddfff0; background: rgba(33,118,86,.18); opacity: 1; }
.mission-assessment-choice-marker { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid rgba(151,190,215,.25); border-radius: 7px; color: #8eb2c7; font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; }
.mission-assessment-status { min-height: 2.8em; margin: 11px 0 0; color: #efc987; font-size: 10px; line-height: 1.55; }
.mission-assessment-status.success { color: #91e7bd; }
.mission-assessment-notice { margin: 6px 0 0; color: #71899c; font-size: 9px; line-height: 1.5; }
.mission-assessment-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.mission-assessment-action { min-height: 42px; padding: 10px 15px; border: 1px solid rgba(166,198,220,.2); border-radius: 10px; color: #c2d5e1; background: rgba(255,255,255,.04); font: 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.mission-assessment-action.primary { border-color: rgba(128,231,255,.45); color: #04131a; background: linear-gradient(125deg,#a4efff,#68cce8); font-weight: 800; }
.mission-assessment-action:hover { border-color: rgba(128,231,255,.68); }
@media (max-width: 520px) {
  .mission-assessment-sheet { padding: 17px; border-radius: 16px; }
  .mission-assessment-prompt { font-size: 13px; }
  .mission-assessment-choice { grid-template-columns: 25px 1fr; gap: 8px; padding: 10px; font-size: 10px; }
  .mission-assessment-actions { display: grid; }
  .mission-assessment-action { width: 100%; }
}

/* Educator Mission Control: sharper hierarchy while retaining server-only data and role checks. */
#stem-teacher-dashboard .teacher-dashboard-sheet {
  width: min(1380px, 100%); min-height: min(760px, calc(100vh - 32px));
  border-color: rgba(129,187,219,.28);
  background: radial-gradient(ellipse at 88% 0%,rgba(37,104,144,.16),transparent 36%),linear-gradient(145deg,rgba(8,21,36,.985),rgba(3,9,17,.99));
}
.teacher-dashboard-header { position: relative; overflow: hidden; min-height: 91px; }
.teacher-dashboard-header::after { content: ""; position: absolute; right: 96px; top: 0; width: 230px; height: 100%; opacity: .28; pointer-events: none; background: repeating-linear-gradient(135deg,transparent 0 14px,rgba(128,231,255,.12) 14px 15px); mask-image: linear-gradient(90deg,transparent,#000); }
.teacher-dashboard-sheet .stem-modal-title { letter-spacing: -.045em; }
.teacher-dashboard-body { grid-template-columns: 292px minmax(0,1fr); }
.teacher-sidebar { position: relative; gap: 13px; background: linear-gradient(180deg,rgba(13,31,48,.48),rgba(5,13,22,.15)); }
.teacher-identity { position: relative; overflow: hidden; padding: 16px; background: linear-gradient(135deg,rgba(51,126,163,.14),rgba(255,255,255,.018)); box-shadow: inset 0 1px rgba(255,255,255,.045); }
.teacher-identity::after { content: ""; position: absolute; width: 110px; height: 110px; right: -56px; top: -56px; border: 1px solid rgba(128,231,255,.14); border-radius: 50%; box-shadow: 0 0 0 12px rgba(128,231,255,.025),0 0 0 25px rgba(128,231,255,.018); }
.teacher-identity-label { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; }
.teacher-identity-label::before { content: ""; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #7ee7b2; box-shadow: 0 0 12px rgba(126,231,178,.6); }
.teacher-identity-name,.teacher-identity-email { position: relative; z-index: 1; }
.teacher-create-form { padding: 15px; border-color: rgba(151,187,211,.17); background: linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.012)); box-shadow: inset 0 1px rgba(255,255,255,.025); }
.teacher-create-form .stem-action-button { margin-top: 4px; }
.teacher-content { padding: 20px 22px; }
.teacher-console-banner { position: relative; overflow: hidden; margin-bottom: 18px; padding: 18px 19px; border: 1px solid rgba(128,231,255,.16); border-radius: 17px; background: linear-gradient(105deg,rgba(30,85,116,.19),rgba(9,23,37,.62) 58%,rgba(14,30,43,.25)); }
.teacher-console-banner::after { content: ""; position: absolute; right: 24px; top: 50%; width: 72px; height: 72px; transform: translateY(-50%); border: 1px solid rgba(128,231,255,.18); border-radius: 50%; box-shadow: 0 0 0 9px rgba(128,231,255,.025),0 0 0 21px rgba(128,231,255,.02); }
.teacher-console-kicker { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #88dff4; font: 8px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .17em; }
.teacher-console-kicker span { padding: 4px 7px; border: 1px solid rgba(126,231,178,.18); border-radius: 5px; color: #93dcb8; background: rgba(126,231,178,.045); font-size: 7px; letter-spacing: .1em; }
.teacher-console-banner h3 { position: relative; z-index: 1; margin: 10px 0 4px; color: #edf7fc; font-size: 20px; letter-spacing: -.035em; }
.teacher-console-banner p { position: relative; z-index: 1; max-width: 66ch; margin: 0; color: #91a7b8; font-size: 10px; line-height: 1.6; }
.teacher-toolbar { margin-bottom: 11px; padding: 0 1px; }
.teacher-toolbar-title { font-size: 13px; letter-spacing: -.02em; }
.teacher-toolbar-sub { display: flex; align-items: center; gap: 7px; }
.teacher-toolbar-sub::before { content: ""; width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: #d8b56f; box-shadow: 0 0 8px rgba(216,181,111,.45); }
.teacher-toolbar-sub[data-state="live"]::before { background: #7ee7b2; box-shadow: 0 0 9px rgba(126,231,178,.58); }
.teacher-toolbar-sub[data-state="error"]::before { background: #ff9299; box-shadow: 0 0 8px rgba(255,146,153,.4); }
.teacher-overview { gap: 10px; }
.teacher-metric { position: relative; overflow: hidden; min-height: 77px; padding: 14px; background: linear-gradient(145deg,rgba(255,255,255,.04),rgba(255,255,255,.015)); }
.teacher-metric::after { content: ""; position: absolute; right: 12px; bottom: -23px; width: 56px; height: 56px; border: 1px solid rgba(128,231,255,.1); border-radius: 50%; box-shadow: 0 0 0 8px rgba(128,231,255,.018); }
.teacher-metric strong { position: relative; z-index: 1; color: #f2f8fc; font-size: 23px; font-weight: 620; letter-spacing: -.04em; }
.teacher-metric span { position: relative; z-index: 1; color: #8fa4b6; font-size: 7px; letter-spacing: .13em; }
.teacher-class-list { gap: 12px; margin-top: 13px; }
.teacher-class-card { border-color: rgba(151,187,211,.18); background: linear-gradient(145deg,rgba(255,255,255,.035),rgba(255,255,255,.014)); transition: border-color .18s,transform .18s; }
.teacher-class-card:hover { border-color: rgba(128,231,255,.28); transform: translateY(-1px); }
.teacher-class-head { padding: 15px 16px; background: linear-gradient(95deg,rgba(255,255,255,.02),transparent); }
.teacher-class-title { font-size: 14px; letter-spacing: -.02em; }
.teacher-code { min-height: 35px; cursor: pointer; transition: border-color .16s,background .16s; }
.teacher-code:hover { border-color: rgba(245,203,117,.55); background: rgba(245,203,117,.11); }
.teacher-roster th { position: sticky; top: 0; background: #0a1724; }
.teacher-roster tbody tr:hover { background: rgba(128,231,255,.035); }
.teacher-roster td { vertical-align: top; }
.teacher-empty,.teacher-error { background: rgba(255,255,255,.018); }

/* Multiplayer: command-style room handoff with honest connection state. */
.multiplayer-sheet { width: min(790px,100%); overflow: hidden; border-color: rgba(128,231,255,.22); }
.multiplayer-sheet::before { content: ""; position: absolute; left: 8%; right: 8%; top: 0; height: 1px; background: linear-gradient(90deg,transparent,rgba(128,231,255,.58),transparent); pointer-events: none; }
.multiplayer-content { position: relative; gap: 12px; padding: 20px; background: radial-gradient(ellipse at 50% 0%,rgba(38,104,143,.08),transparent 60%); }
.multiplayer-card { position: relative; overflow: hidden; min-height: 185px; padding: 20px; border-color: rgba(151,187,211,.18); background: linear-gradient(145deg,rgba(17,39,58,.61),rgba(7,17,29,.8)); box-shadow: inset 0 1px rgba(255,255,255,.035); }
.multiplayer-card::after { content: ""; position: absolute; top: -37px; right: -28px; width: 105px; height: 105px; border: 1px solid rgba(128,231,255,.1); border-radius: 50%; box-shadow: 0 0 0 10px rgba(128,231,255,.018),0 0 0 22px rgba(128,231,255,.014); pointer-events: none; }
.multiplayer-card h3 { color: #edf7fc; font-size: 15px; letter-spacing: -.025em; }
.multiplayer-card p { max-width: 43ch; font-size: 10px; }
.multiplayer-form input { min-width: 0; background: rgba(0,5,11,.48); }
.multiplayer-form input:focus { outline: 1px solid rgba(128,231,255,.56); outline-offset: 1px; }
.multiplayer-room-card { box-shadow: inset 0 1px rgba(255,255,255,.04); }
.multiplayer-status[data-state="connected"] { color: #91e0b9; }
.multiplayer-status[data-state="error"] { color: #ffaaa4; }
.multiplayer-status[data-state="pending"] { color: #f0d18c; }
.multiplayer-mode-note { grid-column: 1/-1; margin: 0; padding: 11px 13px; border-left: 1px solid rgba(128,231,255,.28); background: rgba(128,231,255,.025); }

/* Login terminal and squad communications share the Academy visual language. */
#stem-gate .gate-card,#stem-login-card .auth-card { overflow: hidden; }
#stem-login-card[role="dialog"]:focus { outline: none; }
.auth-card .auth-mode-toggle { padding: 4px; border: 1px solid rgba(138,179,208,.14); border-radius: 13px; background: rgba(1,7,14,.34); }
.auth-mode-toggle button { transition: color .16s,border-color .16s,background .16s,box-shadow .16s; }
.auth-mode-toggle button.active { box-shadow: inset 0 1px rgba(255,255,255,.035),0 6px 18px rgba(0,0,0,.14); }
.auth-submit { min-height: 52px; }
.auth-card .auth-back-row .gate-btn { min-height: 40px; padding: 9px 11px; font-size: 8px; }
#academy-chat-panel.squad-comms-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 8800; width: min(382px,calc(100vw - 28px)); height: min(570px,calc(100vh - 125px));
  display: none; flex-direction: column; overflow: hidden; border: 1px solid rgba(128,231,255,.23); border-radius: 22px;
  color: #ecf5fb; background: radial-gradient(ellipse at 100% 0%,rgba(39,107,146,.14),transparent 42%),linear-gradient(145deg,rgba(8,20,34,.98),rgba(3,9,17,.99));
  box-shadow: 0 24px 80px rgba(0,0,0,.58),inset 0 1px rgba(255,255,255,.05); backdrop-filter: blur(25px) saturate(150%); -webkit-backdrop-filter: blur(25px) saturate(150%);
  font-family: Inter,ui-sans-serif,system-ui,sans-serif;
}
#academy-chat-panel.squad-comms-panel.open { display: flex; animation: comms-panel-in .22s cubic-bezier(.2,.8,.2,1) both; }
@keyframes comms-panel-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
#academy-chat-panel .chat-header { min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-bottom: 1px solid rgba(161,194,220,.13); background: linear-gradient(100deg,rgba(255,255,255,.025),transparent); }
#academy-chat-panel .comms-signal { position: relative; width: 35px; height: 35px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(128,231,255,.24); border-radius: 12px; background: rgba(70,159,195,.09); }
#academy-chat-panel .comms-signal::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #80e7ff; box-shadow: 0 0 12px rgba(128,231,255,.75); }
#academy-chat-panel .comms-signal::after { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(128,231,255,.22); border-radius: 50%; }
#academy-chat-panel .chat-heading { display: grid; flex: 1; min-width: 0; gap: 4px; }
#academy-chat-panel .chat-title { color: #eef8fd; font: 700 10px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .16em; }
#academy-chat-panel .chat-subtitle { color: #7f98ab; font: 7px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .15em; }
#academy-chat-panel .chat-unread { display: none; min-width: 22px; padding: 4px 6px; border: 1px solid rgba(255,146,153,.25); border-radius: 7px; color: #ffc2c5; background: rgba(255,106,124,.09); font: 8px ui-monospace,SFMono-Regular,Menlo,monospace; text-align: center; }
#academy-chat-panel .chat-unread.show { display: inline-flex; align-items: center; justify-content: center; }
#academy-chat-panel .chat-close { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid rgba(161,194,220,.14); border-radius: 9px; color: #9db0c0; background: rgba(255,255,255,.025); font: 19px/1 Inter,system-ui,sans-serif; cursor: pointer; }
#academy-chat-panel .chat-close:hover { color: #eff8fc; border-color: rgba(128,231,255,.36); background: rgba(128,231,255,.06); }
#academy-chat-panel .chat-messages { flex: 1; min-height: 0; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: rgba(143,179,203,.22) transparent; }
#academy-chat-panel .chat-message { padding: 10px 11px; border: 1px solid rgba(161,194,220,.09); border-radius: 12px; color: #d5e1e9; background: rgba(255,255,255,.025); font: 11px/1.55 Inter,ui-sans-serif,system-ui,sans-serif; overflow-wrap: anywhere; }
#academy-chat-panel .chat-message.own { border-color: rgba(128,231,255,.15); background: linear-gradient(110deg,rgba(70,159,195,.085),rgba(255,255,255,.018)); }
#academy-chat-panel .chat-message.system { padding: 8px 10px; border-style: dashed; color: #94a8b9; background: transparent; font-size: 9px; }
#academy-chat-panel .msg-user { color: #91e3f7; font: 700 9px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .04em; }
#academy-chat-panel .msg-time { margin-left: 7px; color: #71879a; font: 8px ui-monospace,SFMono-Regular,Menlo,monospace; }
#academy-chat-panel .msg-text { color: inherit; }
#academy-chat-panel .chat-compose-status { min-height: 27px; padding: 4px 14px 7px; color: #7d93a5; font: 8px/1.45 ui-monospace,SFMono-Regular,Menlo,monospace; }
#academy-chat-panel .chat-compose-status[data-state="error"] { color: #ffaaa4; }
#academy-chat-panel .chat-compose-status[data-state="sent"] { color: #91e0b9; }
#academy-chat-panel .chat-input-row { display: flex; gap: 8px; align-items: center; padding: 12px; border-top: 1px solid rgba(161,194,220,.13); background: rgba(255,255,255,.018); }
#academy-chat-panel .chat-input-row input { flex: 1; min-width: 0; min-height: 42px; padding: 10px 12px; border: 1px solid rgba(155,191,215,.17); border-radius: 11px; color: #f0f7fc; background: rgba(0,5,12,.44); font: 11px Inter,ui-sans-serif,system-ui,sans-serif; }
#academy-chat-panel .chat-input-row input::placeholder { color: #667e91; }
#academy-chat-panel .chat-input-row input:focus { outline: none; border-color: rgba(128,231,255,.52); box-shadow: 0 0 0 3px rgba(79,169,255,.09); }
#academy-chat-panel .chat-input-row button { min-width: 61px; min-height: 42px; padding: 8px 10px; border: 1px solid rgba(128,231,255,.27); border-radius: 10px; color: #c5f1fb; background: linear-gradient(130deg,rgba(62,141,173,.28),rgba(27,68,94,.3)); font: 8px ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing: .1em; cursor: pointer; }
#academy-chat-panel .chat-input-row button:disabled { opacity: .55; cursor: progress; }

@media (max-width: 760px) {
  #stem-teacher-dashboard .teacher-dashboard-sheet { min-height: 0; max-height: calc(100vh - 14px); }
  .teacher-dashboard-body { grid-template-columns: minmax(0,1fr); }
  .teacher-sidebar { grid-template-columns: minmax(0,1fr); }
  .teacher-identity { grid-column: auto; }
  .teacher-content { padding: 12px; }
  .teacher-console-banner { padding: 14px; }
  .teacher-console-banner::after { right: 6px; opacity: .55; }
  .teacher-overview { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .teacher-metric { padding: 10px; }
  .teacher-metric strong { font-size: 19px; }
  #academy-chat-panel.squad-comms-panel { right: 9px; bottom: 73px; width: min(400px,calc(100vw - 18px)); height: min(570px,calc(100vh - 92px)); border-radius: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  #academy-chat-panel.squad-comms-panel.open { animation: none; }
}
