/* ==========================================================================
   SPHERE: MISSION CONTROL - ADVANCED DESIGN SYSTEM
   Theme: Aerospace Telemetry & Deep Space Glassmorphism
   ========================================================================== */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@400;600;700;900&family=Roboto+Mono:wght@300;400;500;700&display=swap');

:root {
  /* Telemetry Palette - Light & Dark Mix Theme */
  --bg-deep: #0b1329;
  --bg-grid: #1e293b;
  --bg-panel: #ffffff;
  --bg-panel-solid: #ffffff;
  --bg-input: #ffffff;
  
  /* Accent Colors & Glowing Glows */
  --cyan: #0284c7;
  --cyan-bright: #0284c7;
  --cyan-glow: rgba(2, 132, 199, 0.25);
  --cyan-border: #cbd5e1;
  
  --blue: #2563eb;
  --blue-glow: rgba(37, 99, 235, 0.25);
  
  --orange: #d97706;
  --orange-glow: rgba(217, 119, 6, 0.25);
  --orange-border: #fde68a;
  
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.25);
  
  --red: #e11d48;
  --red-glow: rgba(225, 29, 72, 0.25);
  
  --amber: #f59e0b;
  --amber-glow: rgba(245, 158, 11, 0.25);
  
  /* Text Colors for High-Contrast Readability */
  --text-pure: #0f172a;
  --text-bright: #1e293b;
  --text-normal: #334155;
  --text-dimmed: #64748b;
  --text-dark: #0f172a;
  
  /* Typography Variables */
  --font-hud: 'Orbitron', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  --font-sans: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   1. Core Reset & Global Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Author-level guarantee: component display rules must never expose hidden quiz screens. */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  background: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%, #020617 100%);
  color: var(--text-bright);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  /* Cybernetic telemetry grid background overlay */
  background-image: 
    linear-gradient(rgba(2, 132, 199, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(2, 132, 199, 0.04) 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: center;
}

/* Scrollbar Hardening */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
}

/* Global Typography Elements */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* Glowing text base */
.glow-cyan {
  color: var(--cyan);
  text-shadow: 0 0 10px var(--cyan-glow);
}
.glow-orange {
  color: var(--orange);
  text-shadow: 0 0 10px var(--orange-glow);
}
.glow-green {
  color: var(--green);
  text-shadow: 0 0 10px var(--green-glow);
}
.glow-red {
  color: var(--red);
  text-shadow: 0 0 10px var(--red-glow);
}

/* ==========================================================================
   2. Main Layout Framework (Mission HUD)
   ========================================================================== */
.hud-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0 20px 20px 20px;
}

/* Header Telemetry */
/* Master Compact Command Header Framework */
.hud-header.compact-hud-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(2, 132, 199, 0.4);
  border-bottom: 3px solid #0284c7;
  border-radius: 12px;
  margin-top: 10px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(2, 132, 199, 0.15);
}

.hud-header::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 10%;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, var(--blue), transparent);
  box-shadow: 0 0 15px rgba(2, 132, 199, 0.4);
}

.hud-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

/* Logo */
.logo-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px var(--cyan-glow);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon svg {
  color: var(--bg-deep);
  width: 20px;
  height: 20px;
}

.logo-text h1 {
  font-family: var(--font-hud);
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  margin: 0;
  line-height: 1;
}

.logo-text span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--cyan);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  display: block;
  margin-top: 2px;
}

.header-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
  margin-left: 8px;
}

.header-utilities {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-telemetry-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clock-ticker {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--cyan);
}

.btn-audio-compact {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(2, 132, 199, 0.1);
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-audio-compact:hover {
  background: rgba(2, 132, 199, 0.25);
  border-color: var(--cyan);
  color: #ffffff;
}

/* System Stats Sub-header (Dedicated Telemetry Bar) */
.hud-stats-ticker {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 16px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.ticker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-normal);
}

.ticker-label {
  color: var(--text-dimmed);
}

.ticker-value {
  color: var(--cyan);
  font-weight: bold;
}

.ticker-status-dot {
  width: 6px;
  height: 6px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green-glow);
  display: inline-block;
  animation: pulse 1.5s infinite alternate;
}

.ticker-status-dot.simulating {
  background-color: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

.ticker-status-dot.offline {
  background-color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

/* Navigation Links (Mission Control Terminals) */
.hud-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
}

.nav-tab {
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  padding: 7px 14px;
  color: #cbd5e1;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.nav-tab i {
  width: 14px;
  height: 14px;
}

.nav-tab:hover {
  background: rgba(2, 132, 199, 0.25);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.35);
}

.nav-tab.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #7dd3fc;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.45);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2.5px;
  background: #7dd3fc;
  box-shadow: 0 0 8px rgba(2, 132, 199, 0.4);
}

.nav-tab.tab-admin {
  border-color: rgba(217, 119, 6, 0.45);
  background: rgba(30, 20, 10, 0.85);
  color: #fcd34d;
}

.nav-tab.tab-admin:hover {
  background: rgba(217, 119, 6, 0.3);
  border-color: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.nav-tab.tab-admin.active {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  border-color: #fbbf24;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.5);
}

.nav-tab.tab-admin.active::after {
  background: #fbbf24;
  box-shadow: 0 0 10px #fbbf24;
}

/* Header & Nav Responsiveness */
@media (max-width: 850px) {
  .hud-header {
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .hud-nav {
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
  }
  .nav-tab {
    flex: 1 1 calc(50% - 10px);
    justify-content: center;
    font-size: 0.75rem;
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .hud-stats-ticker {
    flex-direction: column;
    gap: 8px;
    align-items: center;
  }
  .nav-tab {
    flex: 1 1 100%;
  }
}

/* ==========================================================================
   3. Common HUD Panel System (Glassmorphism Components)
   ========================================================================== */
.hud-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex: 1;
}

@media(min-width: 1024px) {
  .hud-grid-2-1 {
    grid-template-columns: 2fr 1fr;
  }
  .hud-grid-1-1 {
    grid-template-columns: 1fr 1fr;
  }
  .hud-grid-3-col {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.hud-panel {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2), 0 0 15px rgba(2, 132, 199, 0.08);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.hud-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0284c7, #7dd3fc, transparent);
}

.hud-panel:hover {
  border-color: #0284c7;
  box-shadow: 0 12px 35px -5px rgba(2, 132, 199, 0.2);
}

.hud-panel.panel-orange {
  border-color: #fde68a;
}
.hud-panel.panel-orange::before {
  background: linear-gradient(90deg, #d97706, #fbbf24, transparent);
}
.hud-panel.panel-orange:hover {
  border-color: #d97706;
  box-shadow: 0 12px 35px -5px rgba(217, 119, 6, 0.2);
}

/* Panel Header Decoration */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  color: #0f172a;
  font-weight: 700;
}

.panel-title svg {
  color: #0284c7;
  width: 20px;
  height: 20px;
}

.hud-panel.panel-orange .panel-title svg {
  color: #d97706;
}

.panel-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dimmed);
  letter-spacing: 0.1em;
}

/* ==========================================================================
   4. Module Specific Layouts & Views
   ========================================================================== */
.view-section {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.view-section.active {
  display: block;
}

/* Tab 1: Briefing Style */
.briefing-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 30px;
}

@media(min-width: 768px) {
  .briefing-hero {
    grid-template-columns: 3fr 2fr;
  }
}

.briefing-lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #0f172a;
  font-weight: 600;
  margin-bottom: 15px;
}

.briefing-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 20px;
}

.space-suit-visualizer {
  position: relative;
  border: 1px solid var(--cyan-border);
  border-radius: 12px;
  height: 350px;
  background: radial-gradient(circle at center, rgba(16, 24, 48, 0.9) 0%, #060913 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.space-suit-visualizer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0px, rgba(0, 0, 0, 0.1) 1px, transparent 1px, transparent 2px);
  pointer-events: none;
}

/* Crosshair overlay in visualizer */
.hud-crosshair {
  position: absolute;
  width: 80%;
  height: 80%;
  border: 1px dashed rgba(0, 242, 254, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.hud-crosshair::before, .hud-crosshair::after {
  content: '';
  position: absolute;
  background-color: rgba(0, 242, 254, 0.2);
}
.hud-crosshair::before {
  top: 50%;
  left: -5%;
  width: 110%;
  height: 1px;
}
.hud-crosshair::after {
  left: 50%;
  top: -5%;
  height: 110%;
  width: 1px;
}

.capsule-illustration {
  position: relative;
  z-index: 2;
  width: 120px;
  height: 180px;
  border: 2px solid var(--text-normal);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.05);
  animation: float 4s ease-in-out infinite alternate;
}

.capsule-water {
  position: absolute;
  bottom: 10px;
  width: 80%;
  height: 60%;
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.4) 0%, rgba(239, 68, 68, 0.1) 100%);
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: heat-glow 2s ease-in-out infinite alternate;
}

.thermometer-wire {
  position: absolute;
  top: -50px;
  width: 3px;
  height: 120px;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange-glow);
}

.telemetry-node-text {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(6, 9, 19, 0.85);
  border: 1px solid var(--cyan-border);
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 10;
}

#node-temp { top: 30%; right: 10%; color: var(--red); }
#node-env { bottom: 20%; left: 10%; color: var(--cyan); }
#node-flow { top: 15%; left: 15%; color: var(--orange); }

/* Tab 2: Assembly Step-by-Step Card Flow */
/* Standalone animated workflow images in Assembly. */
.assembly-illustrations { margin: 30px 0; }
.assembly-illustrations h2 { margin-bottom: 12px; font-size: 1.15rem; }
.assembly-illustration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 20px;
}
.assembly-illustration {
  margin: 0;
  overflow: hidden;
  border: 1px solid #d5e4ee;
  border-radius: 12px;
  background: #fff;
}
.assembly-illustration picture { display: block; }
.assembly-illustration img { display: block; width: 100%; height: auto; }
.assembly-illustration figcaption {
  padding: 15px 18px;
  color: #334155;
  font-size: 0.86rem;
  line-height: 1.55;
  border-top: 1px solid #e2e8f0;
}
@media (max-width: 767px) {
  .assembly-illustration-grid { grid-template-columns: 1fr; gap: 18px; }
}

.hardware-step-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 768px) {
  .hardware-step-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.step-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  gap: 15px;
  transition: all var(--transition-normal);
}

.step-card:hover {
  background: #ffffff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.12);
}

.step-number {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #7dd3fc;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.1);
}

.step-content {
  flex-grow: 1;
}

.step-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-desc {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.5;
}

.step-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 2px 6px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 4px;
  margin-top: 10px;
  font-weight: 700;
}

/* Tab 3: Thermodynamic Simulator (Prediction Engine) */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: #0f172a;
  font-weight: 700;
  margin-bottom: 8px;
}

.label-hint {
  color: #0284c7;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.hud-select {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 16px;
  color: #0f172a;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  outline: none;
}

.hud-select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.hud-select option {
  background-color: #ffffff;
  color: #0f172a;
}

.hud-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.hud-input-wrapper {
  position: relative;
}

.hud-input {
  width: 100%;
  background-color: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 12px 35px 12px 16px;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition: all var(--transition-fast);
}

.hud-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2);
}

.hud-input:read-only {
  background-color: #ffffff;
  color: #64748b;
  border-color: #e2e8f0;
}

.input-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  pointer-events: none;
}

/* Buttons System - Refined Modern Aerospace Styling */
.btn-hud {
  width: 100%;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  position: relative;
  text-decoration: none;
}

.btn-hud:hover {
  background: #1e293b;
  border-color: #334155;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
  color: #ffffff;
}

.btn-hud:active {
  transform: translateY(0);
}

.btn-hud.btn-orange {
  background: #ea580c;
  border: 1px solid #c2410c;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25);
}

.btn-hud.btn-orange:hover {
  background: #c2410c;
  border-color: #9a3412;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  color: #ffffff;
}

.btn-hud.btn-outline {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-hud.btn-outline:hover {
  background: #ffffff;
  border-color: #0284c7;
  color: #0284c7;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15);
}

.btn-hud.btn-danger {
  background: #e11d48;
  border: 1px solid #be123c;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
  color: #ffffff;
}

.btn-hud.btn-danger:hover {
  background: #be123c;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.35);
  color: #ffffff;
}

.chart-viewport {
  position: relative;
  width: 100%;
  height: 320px;
  min-width: 0;
}

.chart-viewport canvas {
  display: block;
  max-width: 100%;
}

/* Simulation Status Details Panel */
.sim-stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-top: 20px;
}

.sim-stat-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
}

.sim-stat-title {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 5px;
}

.sim-stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: bold;
  color: #0284c7;
}

/* Tab 4: Live Telemetry Logbook Layout */
.telemetry-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media(min-width: 1200px) {
  .telemetry-dashboard-layout {
    grid-template-columns: 350px 1fr;
  }
}

/* Live Telemetry Panel Harmonization */
#telemetry .hud-panel {
  background: #ffffff;
  color: #0f172a;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.08), 0 0 15px rgba(2, 132, 199, 0.06);
}

#telemetry .hud-panel::before {
  background: linear-gradient(90deg, #0284c7, #7dd3fc, transparent);
}

#telemetry .hud-panel:hover {
  border-color: #0284c7;
  box-shadow: 0 12px 35px -5px rgba(2, 132, 199, 0.18);
}

#telemetry .hud-panel.panel-orange {
  background: #ffffff;
  border-color: #fde68a;
}

#telemetry .hud-panel.panel-orange::before {
  background: linear-gradient(90deg, #d97706, #fbbf24, transparent);
}

#telemetry .hud-panel.panel-orange:hover {
  border-color: #d97706;
  box-shadow: 0 12px 35px -5px rgba(217, 119, 6, 0.18);
}

#telemetry .panel-header {
  border-bottom: 2px solid #e2e8f0;
}

#telemetry .panel-title {
  color: #0f172a;
  font-weight: 700;
}

#telemetry .panel-title svg {
  color: #0284c7;
}

#telemetry .hud-panel.panel-orange .panel-title svg {
  color: #d97706;
}

#telemetry .panel-meta {
  color: #64748b;
}

#telemetry .form-label {
  color: #0f172a;
  font-weight: 700;
}

#telemetry .hud-input {
  background-color: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  font-weight: 600;
}

#telemetry .hud-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

#telemetry .hud-input::placeholder {
  color: #94a3b8;
}

#telemetry .input-suffix {
  color: #64748b;
}

#telemetry .sim-stat-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

#telemetry .sim-stat-title {
  color: #64748b;
  font-weight: 700;
}

#telemetry .sim-stat-value {
  color: #0284c7;
}

#telemetry .autofill-panel {
  background: #f0f9ff;
  border: 1px dashed #7dd3fc;
  border-radius: 8px;
  padding: 10px 14px;
}

#telemetry .autofill-text {
  color: #0369a1;
  font-weight: 600;
}

/* Digital Mission Timer Cockpit */
.timer-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #ffffff;
  border: 1.5px solid #fde68a;
}

.digital-hud-clock {
  font-family: var(--font-mono);
  font-size: 2.8rem;
  color: #d97706;
  text-shadow: none;
  padding: 10px 24px;
  border-radius: 10px;
  background: #fffbeb;
  border: 2px solid #fcd34d;
  margin: 15px 0;
  letter-spacing: 0.05em;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
}

.timer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

/* Collapsible measurement entry panel */
.measurement-collapse-toggle {
  width: 100%;
  padding: 0 0 12px;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 2px solid #e2e8f0;
  border-radius: 0;
  font: inherit;
  text-align: left;
  cursor: default;
}

.measurement-collapse-toggle:focus-visible {
  outline: 3px solid rgba(2, 132, 199, 0.25);
  outline-offset: 4px;
}

.measurement-collapse-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.measurement-collapse-icon {
  display: none;
  width: 18px;
  height: 18px;
  color: #0284c7;
  transition: transform var(--transition-fast);
}

.measurement-collapse-toggle[aria-expanded="false"] {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom-color: transparent;
}

.measurement-collapse-toggle[aria-expanded="false"] .measurement-collapse-icon {
  transform: rotate(180deg);
}

/* Compact table actions */
.telemetry-action-bar {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.telemetry-action-bar .telemetry-action-btn {
  width: auto;
}

/* Live Terminal Logging Box */
.terminal-console {
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  height: 120px;
  padding: 10px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--green);
  line-height: 1.5;
  width: 100%;
}

.terminal-line {
  margin-bottom: 4px;
}

.terminal-line .timestamp {
  color: var(--text-dimmed);
  margin-right: 8px;
}

.terminal-line.sys {
  color: var(--blue);
}

.terminal-line.warn {
  color: var(--orange);
}

/* Table Telemetry Structure */
.telemetry-table-container {
  overflow-x: auto;
  margin-top: 20px;
}

.telemetry-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.telemetry-table th {
  font-family: var(--font-hud);
  font-size: 0.75rem;
  text-align: left;
  background: #0f172a;
  border-bottom: 2px solid #0284c7;
  color: #7dd3fc;
  padding: 12px 16px;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.telemetry-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.telemetry-table tr:hover td {
  background: rgba(2, 132, 199, 0.15);
  color: #ffffff;
}

.table-row-prediction {
  color: #94a3b8 !important;
  font-style: italic;
}

#telemetry .telemetry-table th {
  background: #ffffff;
  border-bottom: 2px solid #0284c7;
  color: #0369a1;
}

#telemetry .telemetry-table td {
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
}

#telemetry .telemetry-table tr:hover td {
  background: #f0f9ff;
  color: #0f172a;
}

#telemetry .table-row-prediction {
  color: #64748b !important;
  font-style: italic;
}

.btn-table-delete {
  background: transparent;
  border: none;
  color: var(--red);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-table-delete:hover {
  background: rgba(244, 63, 94, 0.15);
}

/* Logbook Quick Autofill Panel */
.autofill-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(2, 132, 199, 0.12);
  border: 1px dashed #0284c7;
  padding: 12px 20px;
  border-radius: 8px;
  margin-top: 15px;
}

.autofill-text {
  font-size: 0.8rem;
  color: #7dd3fc;
  font-weight: 600;
}

/* Tab 5: Admin / Teacher Gate screen */
.admin-gate-wrapper {
  max-width: 450px;
  margin: 50px auto;
}

.gate-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 159, 67, 0.1);
  border: 1px solid var(--orange-border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
  color: var(--orange);
  box-shadow: 0 0 20px rgba(255, 159, 67, 0.2);
}

.gate-icon svg {
  width: 32px;
  height: 32px;
}

.gate-title {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.gate-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dimmed);
  margin-bottom: 25px;
}

/* Math Card styling */
.math-card {
  background: #ffffff;
  border-left: 4px solid #0284c7;
  border: 1px solid #e2e8f0;
  border-left-width: 4px;
  border-left-color: #0284c7;
  padding: 20px;
  margin: 20px 0;
  border-radius: 0 8px 8px 0;
}

.math-equation {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: #0f172a;
  text-align: center;
  margin: 15px 0;
  letter-spacing: 0.05em;
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid #cbd5e1;
  font-weight: bold;
}

/* Safety Risk Matrix */
.risk-matrix-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 0.85rem;
}

.risk-matrix-table th {
  background: #fef3c7;
  border-bottom: 2px solid #f59e0b;
  color: #b45309;
  font-family: var(--font-hud);
  padding: 12px;
  text-align: left;
  font-weight: 700;
}

.risk-matrix-table td {
  padding: 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
}

.risk-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: bold;
  text-transform: uppercase;
}

.risk-high {
  background: rgba(244, 63, 94, 0.15);
  color: var(--red);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.risk-medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.risk-low {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   5. Footer Status Bar Decoration
   ========================================================================== */
.hud-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dimmed);
}

.footer-link-group {
  display: flex;
  gap: 20px;
}

.footer-link {
  color: var(--text-dimmed);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--cyan);
}

/* ==========================================================================
   6. Keyframe Animations
   ========================================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 12px var(--green-glow);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px) rotate(0deg);
  }
  100% {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes heat-glow {
  0% {
    opacity: 0.6;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  }
  100% {
    opacity: 0.95;
    box-shadow: 0 0 25px rgba(239, 68, 68, 0.5);
  }
}

/* Custom Alert / Toast styling */
.hud-notification {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 9999;
  background: var(--bg-panel-solid);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
  border-radius: 8px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateY(150%);
  transition: transform var(--transition-normal);
}

.hud-notification.show {
  transform: translateY(0);
}

.hud-notification.error {
  border-color: var(--red);
  box-shadow: 0 0 15px var(--red-glow);
}

.hud-notification.success {
  border-color: var(--green);
  box-shadow: 0 0 15px var(--green-glow);
}

/* =======================================================
   Mission Hero Image
======================================================= */

.hero-astronaut {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.space-suit-visualizer {
  overflow: hidden;
  border-radius: 12px;
}


.hero-astronaut {
  filter:
    contrast(1.05)
    saturate(1.05)
    brightness(0.95);
}

/* ==========================================================================
   7. Light/Dark Mix Theme Components & High School Space Project Styling
   ========================================================================== */

/* High-Contrast Light Panel */
.hud-panel-light {
  background: #ffffff;
  color: #0f172a;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

.hud-panel-light:hover {
  border-color: var(--cyan);
  box-shadow: 0 12px 30px -5px rgba(0, 242, 254, 0.25);
}

.hud-panel-light .panel-header {
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.hud-panel-light .panel-title {
  color: #0f172a;
  font-weight: 700;
}

.hud-panel-light .panel-title svg {
  color: #0284c7;
}

.hud-panel-light p {
  color: #334155;
  line-height: 1.6;
}

/* Badges for Light/Dark Mix */
.badge-mix {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.badge-mix-cyan {
  background: rgba(0, 242, 254, 0.15);
  color: #0284c7;
  border: 1px solid rgba(0, 242, 254, 0.4);
}

.badge-mix-orange {
  background: rgba(255, 159, 67, 0.15);
  color: #d97706;
  border: 1px solid rgba(255, 159, 67, 0.4);
}

.badge-mix-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #7e22ce;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.badge-mix-green {
  background: rgba(16, 185, 129, 0.15);
  color: #15803d;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* 3D Interactive Flashcards Hub */
.flashcards-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 25px;
  background: rgba(16, 24, 48, 0.7);
  border: 1px solid var(--cyan-border);
  padding: 15px 20px;
  border-radius: 10px;
}

.filter-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-filter {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #475569;
  padding: 6px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-filter:hover {
  background: #ffffff;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-filter.active {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.flashcard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 20px;
}

.flashcard {
  perspective: 1000px;
  height: 240px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-radius: 20px;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

.flashcard-front {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  border: 2px solid #0284c7;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 15px rgba(2, 132, 199, 0.2);
}

.flashcard-front .flashcard-icon {
  width: 44px;
  height: 44px;
  background: rgba(2, 132, 199, 0.2);
  border: 1px solid #0284c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7dd3fc;
  margin-bottom: 12px;
}

.flashcard-front .flashcard-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: #ffffff;
  margin-bottom: 8px;
  font-weight: 700;
}

.flashcard-front .flashcard-desc {
  font-size: 0.85rem;
  color: #cbd5e1;
  line-height: 1.45;
}

.flashcard-back {
  background: linear-gradient(135deg, #0284c7 0%, #0f172a 100%);
  color: #ffffff;
  border: 2px solid #0284c7;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.3);
  transform: rotateY(180deg);
}

.flashcard-back .flashcard-icon {
  width: 44px;
  height: 44px;
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid #34d399;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #34d399;
  margin-bottom: 12px;
}

.flashcard-back .flashcard-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: #7dd3fc;
  margin-bottom: 8px;
  font-weight: 700;
}

.flashcard-back .flashcard-desc {
  font-size: 0.82rem;
  color: #ffffff;
  line-height: 1.45;
}

/* Question & Evaluation Sheet Quiz Components */
.quiz-arena {
  --quiz-purple: #46178f;
  --quiz-purple-dark: #24104f;
  --quiz-yellow: #ffd43b;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 10%, rgba(79, 70, 229, 0.9), transparent 34%),
    radial-gradient(circle at 90% 92%, rgba(219, 39, 119, 0.65), transparent 34%),
    linear-gradient(145deg, #28105d 0%, #14072f 100%);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.5);
  color: #fff;
}

.quiz-game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 20px;
  background: rgba(18, 8, 45, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.quiz-game-brand,
.quiz-topbar-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-hud);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quiz-live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.14), 0 0 18px #4ade80;
}

.quiz-topbar-button {
  min-height: 40px;
  padding: 8px 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  cursor: pointer;
}

.quiz-topbar-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.quiz-topbar-button svg {
  width: 17px;
  height: 17px;
  color: var(--quiz-yellow);
}

.quiz-lobby {
  width: min(680px, calc(100% - 32px));
  margin: 64px auto;
  padding: 36px;
  text-align: center;
  background: #fff;
  color: #111827;
  border-radius: 18px;
  box-shadow: 0 20px 0 rgba(10, 3, 28, 0.28), 0 28px 70px rgba(0, 0, 0, 0.25);
}

.quiz-lobby-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: -67px auto 18px;
  border-radius: 18px;
  color: #24104f;
  background: var(--quiz-yellow);
  box-shadow: 0 9px 24px rgba(255, 212, 59, 0.35);
  transform: rotate(-4deg);
}

.quiz-lobby-icon svg {
  width: 31px;
  height: 31px;
}

.quiz-eyebrow,
.quiz-result-kicker {
  margin-bottom: 8px;
  color: #6d28d9;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.quiz-lobby h2 {
  margin-bottom: 10px;
  font-family: var(--font-hud);
  font-size: clamp(2rem, 6vw, 3.4rem);
  color: #24104f;
}

.quiz-lobby-copy {
  max-width: 550px;
  margin: 0 auto 26px;
  color: #475569;
  font-size: 1rem;
  line-height: 1.6;
}

.quiz-lobby-fields {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 12px;
  text-align: left;
}

.quiz-lobby-fields label {
  display: block;
  margin-bottom: 6px;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quiz-lobby-fields .hud-input {
  min-height: 52px;
  background: #f8fafc;
  color: #0f172a;
  border: 2px solid #cbd5e1;
  font-size: 1rem;
}

.quiz-lobby-fields .hud-input:focus {
  border-color: #6d28d9;
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.13);
}

.quiz-start-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  margin-top: 18px;
  color: #24104f;
  background: var(--quiz-yellow);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 7px 0 #d3a900;
  font-family: var(--font-hud);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 9px 0 #d3a900;
}

.quiz-play-hud {
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  background: rgba(18, 8, 45, 0.78);
}

.quiz-hud-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 92px;
}

.quiz-hud-stat span {
  color: #c4b5fd;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.quiz-hud-stat strong {
  color: #fff;
  font-family: var(--font-hud);
  font-size: 1rem;
}

.quiz-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.quiz-progress-track span {
  display: block;
  width: 10%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #a3e635);
  transition: width 0.35s ease;
}

.quiz-timer {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 5px solid var(--quiz-yellow);
  border-radius: 50%;
  background: #fff;
  color: #24104f;
  font-family: var(--font-hud);
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: 0 0 25px rgba(255, 212, 59, 0.3);
}

.quiz-timer.is-urgent {
  border-color: #fb7185;
  color: #be123c;
  animation: pulse 0.65s infinite alternate;
}

.quiz-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 32px;
}

.quiz-card {
  background: #ffffff;
  border: 0;
  border-radius: 18px;
  padding: clamp(20px, 4vw, 38px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  animation: quizCardIn 0.35s ease-out;
}

.quiz-game-board .quiz-card:not(.is-active) {
  display: none;
}

.quiz-q-num {
  font-family: var(--font-sans);
  font-size: 0.76rem;
  color: #6d28d9;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.quiz-question-text {
  max-width: 1000px;
  margin: 0 auto 24px;
  font-size: clamp(1.15rem, 2.3vw, 1.65rem);
  font-weight: 750;
  color: #0f172a;
  text-align: center;
  line-height: 1.42;
}

.quiz-options-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quiz-option-label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 108px;
  padding: 20px;
  background: #1368ce;
  border: 3px solid transparent;
  border-radius: 10px;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 650;
  color: #fff;
  line-height: 1.45;
  text-align: left;
  transition: all var(--transition-fast);
  overflow: hidden;
}

.quiz-option-label span {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  text-wrap: pretty;
}

.quiz-option-label::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.18) 48%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.45s ease;
}

.quiz-option-label:nth-child(2) { background: #d01937; }
.quiz-option-label:nth-child(3) { background: #d89e00; }
.quiz-option-label:nth-child(4) { background: #26890c; }

.quiz-option-label:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.quiz-option-label:hover::after {
  transform: translateX(120%);
}

.quiz-option-label:has(input:checked) {
  border-color: #fff;
  outline: 4px solid #24104f;
  transform: translateY(-3px) scale(1.012);
  animation: quizAnswerSelect 0.32s ease-out;
}

.quiz-option-label:has(input:focus-visible) {
  outline: 4px solid #fef08a;
  outline-offset: 3px;
}

.quiz-option-label.is-correct {
  background: #26890c;
  border-color: #bbf7d0;
}

.quiz-option-label.is-wrong {
  filter: grayscale(0.75) brightness(0.65);
}

.quiz-option-label input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.quiz-textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: #0f172a;
  outline: none;
  transition: border-color var(--transition-fast);
  resize: vertical;
}

.quiz-textarea:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.quiz-feedback {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  display: none;
}

.quiz-feedback.correct {
  display: block;
  background: #166534;
  color: #fff;
  border: 1px solid #4ade80;
  animation: quizFeedbackIn 0.28s ease-out;
}

.quiz-feedback.incorrect {
  display: block;
  background: #9f1239;
  color: #fff;
  border: 1px solid #fb7185;
  animation: quizFeedbackIn 0.28s ease-out;
}

/* Score Result Box */
.quiz-score-banner {
  max-width: 920px;
  margin: 52px auto;
  background: #ffffff;
  border: 0;
  border-radius: 18px;
  padding: 38px;
  text-align: center;
  color: #0f172a;
  box-shadow: 0 20px 0 rgba(10, 3, 28, 0.28), 0 28px 70px rgba(0, 0, 0, 0.25);
  display: none;
}

.quiz-score-banner.show {
  display: block;
  animation: fadeIn 0.5s ease-out;
}

.quiz-final-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 1040px;
  padding: clamp(24px, 5vw, 48px);
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 212, 59, 0.18), transparent 34%),
    #ffffff;
}

.quiz-final-screen > *:not(.quiz-winner-effects) {
  position: relative;
  z-index: 1;
}

.quiz-final-screen h2 {
  margin: 0;
  color: #24104f;
  font-family: var(--font-hud);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -0.03em;
}

.quiz-final-screen.is-winner {
  box-shadow:
    0 0 0 4px #ffd43b,
    0 20px 0 rgba(10, 3, 28, 0.28),
    0 28px 90px rgba(255, 212, 59, 0.38);
  animation: winnerFinalIn 0.6s ease-out;
}

.quiz-final-screen.is-winner .quiz-result-kicker {
  color: #a16207;
  text-shadow: 0 0 20px rgba(255, 212, 59, 0.5);
}

.quiz-winner-effects {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.quiz-winner-effects::before,
.quiz-winner-effects::after {
  content: '★';
  position: absolute;
  top: 20px;
  color: #ffd43b;
  font-size: clamp(3rem, 8vw, 6rem);
  opacity: 0.25;
  filter: drop-shadow(0 0 18px rgba(255, 212, 59, 0.8));
  animation: winnerStarPulse 1.4s ease-in-out infinite alternate;
}

.quiz-winner-effects::before { left: 4%; }
.quiz-winner-effects::after { right: 4%; animation-delay: 0.35s; }

.quiz-winner-effects i {
  position: absolute;
  top: -24px;
  left: var(--winner-left);
  width: 9px;
  height: 16px;
  border-radius: 2px;
  background: var(--winner-color);
  opacity: 0;
  animation: winnerConfettiFall var(--winner-duration) linear var(--winner-delay) 2;
}

.quiz-final-leaderboard-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 210px;
  min-height: 54px;
  margin-top: 28px;
  padding: 12px 24px;
  border: 0;
  border-radius: 10px;
  color: #24104f;
  background: #ffd43b;
  box-shadow: 0 6px 0 #d3a900;
  font-family: var(--font-hud);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.quiz-final-leaderboard-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #d3a900;
}

.score-number {
  font-family: var(--font-hud);
  font-size: clamp(3.2rem, 9vw, 5.5rem);
  font-weight: 900;
  color: #6d28d9;
  line-height: 1;
}

.quiz-result-group {
  margin: 10px 0 20px;
  color: #24104f;
  font-family: var(--font-hud);
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 900;
}

.quiz-result-points {
  display: inline-flex;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-family: var(--font-hud);
  font-weight: 900;
}

#quiz-score-summary {
  margin-top: 16px;
  color: #475569;
  font-size: 1rem;
}

.quiz-answer-review {
  margin-top: 26px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
  text-align: left;
}

.quiz-answer-review h3 {
  margin-bottom: 14px;
  color: #24104f;
  font-family: var(--font-hud);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.quiz-answer-review ol {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  list-style: none;
}

.quiz-answer-review li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.4;
}

.quiz-answer-review li.is-correct {
  border-color: #86efac;
  background: #f0fdf4;
}

.quiz-answer-review li.is-missed {
  border-color: #fda4af;
  background: #fff1f2;
}

.quiz-review-status {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  background: #6d28d9;
  color: #fff;
  font-weight: 900;
}

.quiz-review-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.quiz-review-content strong {
  color: #172033;
  font-size: 0.93rem;
  line-height: 1.45;
}

.quiz-review-content span {
  padding-top: 7px;
  border-top: 1px dashed rgba(71, 85, 105, 0.24);
  color: #475569;
  font-weight: 700;
}

.quiz-answer-review li.is-correct .quiz-review-content span {
  color: #166534;
}

.quiz-answer-review li.is-missed .quiz-review-content span {
  color: #9f1239;
}

.quiz-game-actions {
  display: flex;
  gap: 14px;
  padding: 0 32px 32px;
  flex-wrap: wrap;
}

.quiz-game-actions #btn-grade-quiz {
  background: var(--quiz-yellow);
  color: #24104f;
  border-color: var(--quiz-yellow);
  box-shadow: 0 5px 0 #d3a900;
}

@keyframes quizCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes quizAnswerSelect {
  0% { transform: scale(1); }
  55% { transform: translateY(-3px) scale(1.035); }
  100% { transform: translateY(-3px) scale(1.012); }
}

@keyframes quizFeedbackIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-card.leaderboard-modal-card {
  max-width: 760px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-color: #7c3aed;
  box-shadow: 0 24px 80px rgba(24, 8, 61, 0.55);
}

.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  min-height: 190px;
  margin: 20px 0 28px;
  padding: 28px 16px 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 212, 59, 0.22), transparent 45%),
    linear-gradient(145deg, #24104f, #4c1d95);
}

.leaderboard-podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 18px 10px 16px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  text-align: center;
  animation: podiumRise 0.5s ease-out both;
}

.leaderboard-podium-card.rank-1 {
  min-height: 172px;
  background: linear-gradient(180deg, #ca8a04, #854d0e);
  animation-delay: 0.12s;
}

.leaderboard-podium-card.rank-2 {
  min-height: 140px;
  background: linear-gradient(180deg, #94a3b8, #475569);
  animation-delay: 0.05s;
}

.leaderboard-podium-card.rank-3 {
  min-height: 118px;
  background: linear-gradient(180deg, #c2410c, #7c2d12);
  animation-delay: 0.2s;
}

.leaderboard-podium-stars {
  min-height: 24px;
  color: #fde047;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.8);
}

.leaderboard-podium-medal {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 7px 0;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: #fff;
  color: #24104f;
  font-family: var(--font-hud);
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);
}

.leaderboard-podium-card strong {
  width: 100%;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-podium-card > span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.82rem;
  font-weight: 700;
}

.leaderboard-full-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #475569;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.leaderboard-answer-review {
  margin-top: 24px;
}

@keyframes podiumRise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes winnerFinalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes winnerStarPulse {
  from { transform: scale(0.86) rotate(-8deg); opacity: 0.18; }
  to { transform: scale(1.08) rotate(8deg); opacity: 0.42; }
}

@keyframes winnerConfettiFall {
  0% { opacity: 0; transform: translate3d(0, -15px, 0) rotate(0); }
  10% { opacity: 0.9; }
  100% { opacity: 0; transform: translate3d(28px, 620px, 0) rotate(var(--winner-spin)); }
}

.leaderboard-table-wrap {
  overflow-x: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  color: #0f172a;
  font-size: 0.9rem;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.leaderboard-table tbody tr:nth-child(1) td {
  color: #854d0e;
  background: #fef9c3;
  font-weight: 900;
}

.leaderboard-table tbody tr:nth-child(2) td {
  background: #f1f5f9;
  font-weight: 800;
}

.leaderboard-table tbody tr:nth-child(3) td {
  background: #fff7ed;
  font-weight: 750;
}

.leaderboard-table th {
  color: #475569;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard-table td:nth-child(4) {
  font-weight: 700;
}

.leaderboard-empty {
  margin: 20px 0;
  color: #64748b;
  text-align: center;
}

.quiz-leaderboard-continue {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  color: #24104f;
  background: #ffd43b;
  border: 0;
  border-radius: 9px;
  box-shadow: 0 5px 0 #d3a900;
  font-family: var(--font-hud);
  font-weight: 900;
  cursor: pointer;
  animation: quizCountdownPulse 1s ease-in-out infinite;
}

.quiz-leaderboard-continue strong {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #24104f;
  color: #fff;
  font-size: 1rem;
}

@keyframes quizCountdownPulse {
  50% { box-shadow: 0 7px 0 #d3a900, 0 0 24px rgba(255, 212, 59, 0.4); }
}

.quiz-leaderboard-continue[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .quiz-game-topbar {
    align-items: flex-start;
    padding: 12px;
  }

  .quiz-game-brand {
    font-size: 0.66rem;
  }

  .quiz-topbar-button {
    padding: 8px;
    font-size: 0;
  }

  .quiz-topbar-button svg {
    width: 21px;
    height: 21px;
  }

  .quiz-lobby {
    margin-block: 52px 32px;
    padding: 26px 18px;
  }

  .quiz-lobby-fields,
  .quiz-options-group,
  .quiz-answer-review ol {
    grid-template-columns: 1fr;
  }

  .leaderboard-podium {
    gap: 5px;
    min-height: 160px;
    padding-inline: 7px;
  }

  .leaderboard-podium-card {
    padding-inline: 5px;
  }

  .leaderboard-podium-card.rank-1 { min-height: 145px; }
  .leaderboard-podium-card.rank-2 { min-height: 122px; }
  .leaderboard-podium-card.rank-3 { min-height: 105px; }

  .quiz-play-hud {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 12px;
  }

  .quiz-hud-points {
    grid-column: 1 / 3;
    grid-row: 2;
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .quiz-timer {
    grid-column: 3;
    grid-row: 1 / 3;
    width: 52px;
    height: 52px;
  }

  .quiz-wrapper {
    padding: 16px;
  }

  .quiz-card {
    padding: 18px 14px;
  }

  .quiz-option-label {
    min-height: 72px;
    font-size: 0.96rem;
  }

  .quiz-game-actions {
    padding: 0 16px 22px;
  }

  .quiz-final-screen {
    margin-block: 28px;
    padding-inline: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quiz-winner-effects i,
  .quiz-winner-effects::before,
  .quiz-winner-effects::after {
    animation: none;
  }
}

/* ==========================================================================
   Centered Screen Telemetry Input Modal (Active Timer Checkpoint)
   ========================================================================== */
/* ==========================================================================
   Centered Screen Telemetry Input Modal (Active Timer Checkpoint)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 19, 41, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.25s ease-out;
}

.modal-card {
  max-width: 480px;
  width: 100%;
  background: #ffffff;
  border: 2px solid #d97706;
  border-radius: 16px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 35px rgba(217, 119, 6, 0.3);
  padding: 26px 30px;
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-modal {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  font-size: 1.5rem;
  color: #475569;
  cursor: pointer;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-close-modal:hover {
  color: #e11d48;
  background: #ffe4e6;
  border-color: #fca5a5;
}

.modal-desc {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 22px;
  text-align: center;
  font-weight: 500;
}

.modal-time-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid #fde68a;
  margin-left: 6px;
  font-size: 0.9rem;
}

.modal-temp-input {
  font-size: 1.8rem !important;
  padding: 14px 45px 14px 18px !important;
  text-align: center !important;
  border: 2px solid #d97706 !important;
  border-radius: 10px !important;
  height: auto !important;
  background-color: #fff8f1 !important;
  color: #0f172a !important;
  font-family: var(--font-mono) !important;
  font-weight: bold !important;
}

.modal-temp-input:focus {
  border-color: #d97706 !important;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.25) !important;
  background-color: #ffffff !important;
  outline: none !important;
}

/* ==========================================================================
   Project Deliverable Suite - Master Toolbar & Workflow Styling
   ========================================================================== */

/* Top Metadata & Role Bar */
.hud-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-top: 10px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-pill-blue {
  background: rgba(2, 132, 199, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.meta-pill-amber {
  background: rgba(217, 119, 6, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.meta-pill-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

/* Quick Deliverables Action Hub */
.deliverables-hub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.deliverable-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 6px;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.deliverable-btn-student {
  background: rgba(2, 132, 199, 0.15);
  color: #7dd3fc;
  border: 1px solid rgba(2, 132, 199, 0.4);
}

.deliverable-btn-student:hover {
  background: #0284c7;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.deliverable-btn-task {
  background: rgba(217, 119, 6, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(217, 119, 6, 0.5);
}

.deliverable-btn-task:hover {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(217, 119, 6, 0.4);
}

.deliverable-btn-flashcards {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.deliverable-btn-flashcards:hover {
  background: #d97706;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.deliverable-btn-teacher {
  background: rgba(217, 119, 6, 0.18);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.5);
}

.deliverable-btn-teacher:hover,
.deliverable-btn-teacher.active {
  background: #d97706;
  color: #ffffff;
  border-color: #fbbf24;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* Interactive 6-Stage Lab Workflow Pipeline */
.lab-workflow-container {
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 25px;
  margin-bottom: 25px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.workflow-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.workflow-title {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workflow-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.workflow-step-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
}

.workflow-step-card:hover {
  background: #ffffff;
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.15);
}

.step-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.workflow-stage-pill {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 800;
  color: #0369a1;
  background: #e0f2fe;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid #bae6fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.step-icon {
  color: #0284c7;
  display: flex;
  align-items: center;
}

.step-title {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.step-desc {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 8px;
}

.step-action-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #0284c7;
  display: flex;
  align-items: center;
  gap: 4px;
}

.step-card-teacher {
  border-color: #fde68a;
  background: #fffdf5;
}

.step-card-teacher:hover {
  border-color: #d97706;
  box-shadow: 0 8px 18px rgba(217, 119, 6, 0.15);
}

.step-card-teacher .step-number {
  color: #b45309;
  background: #fef3c7;
}

.step-card-teacher .step-icon,
.step-card-teacher .step-action-tag {
  color: #d97706;
}

/* Quick Export & Action Bar in Telemetry */
.telemetry-export-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
}

/* ==========================================================================
   VISUAL GUIDES & INTERACTIVE SCHEMATICS STYLING
   ========================================================================== */

.visual-guide-box {
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.08);
}

.visual-guide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.visual-guide-title {
  font-family: var(--font-hud);
  font-size: 0.95rem;
  font-weight: 800;
  color: #0369a1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.visual-guide-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: #0284c7;
  background: #e0f2fe;
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.visual-schematic-svg {
  width: 100%;
  height: auto;
  max-height: 320px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.visual-legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.visual-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #334155;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.visual-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Layer Stack Visualizer */
.layer-stack-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.layer-stack-card {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s ease;
}

.layer-stack-card:hover {
  border-color: #0284c7;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.1);
}

.layer-stack-header {
  font-family: var(--font-hud);
  font-size: 0.82rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.layer-bars-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
}

.layer-bar {
  height: 14px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* Responsive Navigation Bar Adjustments */
@media (max-width: 900px) {
  .hud-header {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  
  .hud-nav {
    overflow-x: auto;
    padding-bottom: 6px;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  .hud-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   8. Mobile layout and touch ergonomics
   ========================================================================== */
@media (max-width: 768px) {
  .hud-wrapper {
    padding: 0 12px 16px;
  }

  .hud-header.compact-hud-header {
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 14px;
    padding: 12px;
    border-radius: 10px;
  }

  .hud-header-top,
  .header-utilities {
    width: 100%;
  }

  .hud-header-top {
    align-items: flex-start;
  }

  .header-utilities {
    align-items: stretch;
    gap: 10px;
  }

  .deliverables-hub {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .deliverable-btn {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.68rem;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
  }

  .header-telemetry-tools {
    justify-content: space-between;
    width: 100%;
  }

  .clock-ticker,
  .btn-audio-compact {
    min-height: 36px;
  }

  .mobile-menu-toggle {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    background: rgba(2, 132, 199, 0.16);
    border: 1px solid rgba(125, 211, 252, 0.45);
    border-radius: 7px;
    font-family: var(--font-hud);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
  }

  .mobile-menu-toggle-label,
  .mobile-menu-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-menu-toggle-label svg,
  .mobile-menu-chevron {
    width: 14px;
    height: 14px;
  }

  .mobile-menu-current {
    margin-left: auto;
    color: #7dd3fc;
    font-family: var(--font-sans);
    letter-spacing: 0.02em;
  }

  .mobile-menu-chevron {
    transition: transform var(--transition-fast);
  }

  .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-chevron {
    transform: rotate(180deg);
  }

  .hud-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    padding: 2px 0 0;
    overflow: visible;
  }

  .hud-nav.is-open {
    display: grid;
  }

  .nav-tab {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    justify-content: flex-start;
    font-size: 0.66rem;
    white-space: normal;
    line-height: 1.15;
  }

  .btn-hud {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.78rem;
    gap: 6px;
  }

  button[type="submit"].btn-hud,
  #btn-submit-quiz,
  #btn-grade-quiz {
    width: auto !important;
    max-width: 100%;
    min-height: 34px;
    padding: 7px 12px !important;
    font-size: 0.74rem;
    align-self: center;
  }

  .chart-viewport {
    height: 290px;
    min-height: 290px;
  }

  .btn-filter {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.68rem;
  }

  .hud-grid,
  .briefing-hero,
  .hardware-step-grid,
  .telemetry-dashboard-layout {
    gap: 16px;
  }

  .briefing-hero {
    margin-bottom: 20px;
  }

  .hud-panel,
  .hud-panel-light {
    padding: 18px;
    border-radius: 12px;
  }

  .lab-workflow-container,
  .visual-guide-box {
    padding: 18px;
  }

  .panel-header,
  .workflow-header,
  .visual-guide-header,
  .flashcards-header-bar,
  .autofill-panel,
  .hud-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-header {
    gap: 6px;
    margin-bottom: 16px;
  }

  .measurement-collapse-toggle {
    align-items: center;
    flex-direction: row;
    cursor: pointer;
  }

  .measurement-collapse-icon {
    display: block;
  }

  .telemetry-action-bar {
    gap: 8px;
    margin-top: 16px;
  }

  .telemetry-action-bar .telemetry-action-btn {
    min-height: 34px;
    padding: 7px 12px;
    gap: 6px;
    font-size: 0.74rem;
  }

  .telemetry-action-bar .telemetry-action-btn svg {
    width: 16px;
    height: 16px;
  }

  .panel-title,
  .workflow-title,
  .visual-guide-title {
    line-height: 1.35;
  }

  .workflow-grid,
  .flashcard-grid,
  .visual-legend-grid,
  .layer-stack-card-grid {
    grid-template-columns: 1fr;
  }

  .space-suit-visualizer {
    height: clamp(240px, 72vw, 340px);
  }

  .hud-input-group,
  .sim-stats-container {
    grid-template-columns: 1fr !important;
  }

  .sim-stats-container > * {
    grid-column: auto !important;
  }

  .timer-controls {
    grid-template-columns: 1fr;
  }

  .digital-hud-clock {
    max-width: 100%;
    font-size: clamp(2rem, 12vw, 2.8rem);
    padding: 10px 16px;
  }

  .telemetry-export-bar,
  .filter-btn-group {
    width: 100%;
  }

  .telemetry-export-bar .btn-hud,
  .filter-btn-group .btn-filter {
    flex: 1 1 140px;
    min-height: 36px;
  }

  .telemetry-table {
    min-width: 680px;
  }

  .risk-matrix-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .hud-panel > div[style*="height: 320px"] { height: 290px !important; }

  .math-equation,
  .katex-display {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-card {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 22px 18px;
    border-radius: 16px 16px 10px 10px;
  }

  .hud-notification {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .footer-link-group {
    flex-wrap: wrap;
    gap: 12px 18px;
  }
}

@media (max-width: 520px) {
  .hud-wrapper {
    padding-inline: 8px;
  }

  .hud-header.compact-hud-header {
    gap: 8px;
    margin-bottom: 10px;
    padding: 9px;
  }

  .logo-container {
    width: 100%;
    gap: 8px;
  }

  .logo-text h1 {
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 30px;
    height: 30px;
  }

  .logo-icon svg {
    width: 18px;
    height: 18px;
  }

  .logo-text span {
    font-size: 0.56rem;
  }

  .header-status-pill {
    margin-left: auto;
    padding: 3px 7px;
    font-size: 0.62rem;
  }

  .deliverables-hub {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .deliverable-btn {
    flex: 0 0 auto;
    min-height: 38px;
    justify-content: center;
    padding: 6px 10px;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .header-telemetry-tools {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .clock-ticker,
  .btn-audio-compact {
    flex: 1 1 0;
    min-height: 38px;
    justify-content: center;
    padding-inline: 7px;
    font-size: 0.64rem;
  }

  .hud-panel,
  .hud-panel-light,
  .lab-workflow-container,
  .visual-guide-box,
  .quiz-card {
    padding: 14px;
  }

  .hud-grid,
  .briefing-hero,
  .hardware-step-grid,
  .telemetry-dashboard-layout,
  .quiz-wrapper {
    gap: 12px;
  }

  .panel-header {
    padding-bottom: 9px;
    margin-bottom: 12px;
  }

  .nav-tab {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 0.62rem;
  }

  .mobile-menu-toggle {
    min-height: 36px;
    padding-block: 6px;
  }

  .btn-hud {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 0.74rem;
  }

  button[type="submit"].btn-hud,
  #btn-submit-quiz,
  #btn-grade-quiz {
    min-height: 32px;
    padding: 6px 10px !important;
    font-size: 0.7rem;
  }

  .chart-viewport {
    height: 270px;
    min-height: 270px;
  }

  .briefing-lead {
    font-size: 1rem;
  }

  .briefing-text,
  .quiz-question-text,
  .quiz-option-label,
  .hud-input,
  .hud-select {
    font-size: 1rem;
  }

  .step-card {
    align-items: flex-start;
    padding: 16px;
  }

  .workflow-step-card {
    min-width: 0;
  }

  .visual-schematic-svg {
    min-height: 180px;
  }

  .flashcard {
    height: 250px;
  }

  .flashcard-front,
  .flashcard-back {
    padding: 18px;
  }

  .quiz-option-label {
    min-height: 48px;
    padding: 12px;
  }

  .quiz-option-label input[type="radio"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
  }
}

@media (pointer: coarse) {
  button,
  select,
  input[type="button"],
  input[type="submit"],
  .workflow-nav-btn,
  .flashcard {
    touch-action: manipulation;
  }

  .btn-close-modal {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Readability refinement: retain the original HUD, palette and layout. */
body { -webkit-font-smoothing: antialiased; }
.hud-header.compact-hud-header { gap: 14px; padding: 16px 20px; }
.hud-header-top { gap: 16px; padding-bottom: 12px; }
.logo-text span { font-size: 0.7rem; letter-spacing: 0.12em; line-height: 1.6; }
.header-utilities { gap: 14px; }
.deliverable-btn { font-size: 0.8rem; min-height: 44px; padding: 9px 12px; }
.btn-audio-compact, .clock-ticker { min-height: 44px; font-size: 0.75rem; }
.nav-tab { min-height: 44px; padding: 10px 14px; font-size: 0.8rem; letter-spacing: 0.025em; }
.hud-panel, .hud-panel-light { padding: 28px; }
.panel-header { gap: 12px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 22px; }
.panel-meta { font-size: 0.75rem; line-height: 1.6; letter-spacing: 0.04em; }
.briefing-lead { font-size: 1.12rem; line-height: 1.8; margin-bottom: 20px; }
.briefing-text { font-size: 1rem; line-height: 1.75; margin-bottom: 20px; }
.lab-workflow-container { padding: 24px; }
.workflow-header { gap: 14px; padding-bottom: 16px; margin-bottom: 20px; }
.workflow-subtitle { font-size: 0.9rem; line-height: 1.65; margin-top: 4px; }
.workflow-grid { gap: 18px; }
.workflow-step-card { padding: 20px; }
.step-title { font-size: 1rem; line-height: 1.5; }
.step-desc { font-size: 0.9rem; line-height: 1.7; }
.step-action-tag { font-size: 0.78rem; line-height: 1.6; }
.btn-hud { min-height: 44px; font-size: 0.86rem; padding: 10px 14px; }
.hud-input, .hud-select { min-height: 44px; line-height: 1.5; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid #38bdf8; outline-offset: 3px; }
@media (min-width: 769px) and (max-width: 1000px) {
  .hud-nav { flex-wrap: wrap; overflow: visible; }
  .nav-tab { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 768px) {
  .hud-header.compact-hud-header { padding: 16px; gap: 14px; }
  .hud-panel, .hud-panel-light, .lab-workflow-container, .visual-guide-box, .quiz-card { padding: 20px; }
  .panel-title { font-size: 1rem; line-height: 1.5; }
  .panel-header { margin-bottom: 18px; padding-bottom: 12px; }
  .logo-text span { font-size: 0.62rem; letter-spacing: 0.05em; }
  .deliverable-btn { min-height: 44px; font-size: 0.75rem; padding: 9px 10px; }
  .clock-ticker, .btn-audio-compact { min-height: 44px; font-size: 0.72rem; }
  .mobile-menu-toggle { min-height: 46px; font-size: 0.8rem; }
  .nav-tab { min-height: 44px; font-size: 0.76rem; padding: 10px; }
  .btn-hud { min-height: 44px; font-size: 0.85rem; padding: 10px 12px; }
  .hud-input, .hud-select { font-size: 1rem; }
  .briefing-lead { font-size: 1.05rem; }
  .briefing-text { font-size: 0.98rem; }
  .workflow-step-card { padding: 18px; }
  .hud-grid, .briefing-hero, .hardware-step-grid, .telemetry-dashboard-layout, .quiz-wrapper { gap: 18px; }
}
@media (max-width: 380px) {
  .logo-container { flex-wrap: wrap; }
  .header-status-pill { margin-left: 0; }
}
@media (max-width: 768px) {
  .deliverables-hub { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; overflow: visible; padding-bottom: 0; }
  .deliverable-btn { min-width: 0; white-space: normal; line-height: 1.45; text-align: center; justify-content: center; font-size: 0.7rem; padding: 8px 6px; }
  .header-telemetry-tools .clock-ticker, .header-telemetry-tools .btn-audio-compact { flex: 1 1 0; min-width: 0; justify-content: center; }
}

/* Visual polish within the original SPHERE design system. */
.hud-header.compact-hud-header {
  background: linear-gradient(120deg, #172238 0%, #0f172a 80%);
  border-color: #315575;
  box-shadow: 0 10px 24px #0f172a20, inset 0 1px 0 #ffffff08;
}
.logo-icon { box-shadow: 0 4px 12px #0284c730; }
.logo-text h1 { text-shadow: 0 0 10px #ffffff12; }
.hud-panel { border-color: #d5e0ea; box-shadow: 0 4px 8px #0f172a04, 0 14px 32px #0f172a09; }
.hud-panel:hover { border-color: #a4c6df; box-shadow: 0 8px 26px #0f172a0f; }
.hud-panel::before { height: 3px; }
.panel-header { border-bottom: 1px solid #dce5ed; }
.panel-title { letter-spacing: 0.01em; }
.briefing-project-panel .briefing-lead { border-left: 3px solid #38a6d7; padding-left: 16px; }
.briefing-project-panel .briefing-text { color: #405166; }
.briefing-lab-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 26px; }
.briefing-lab-actions .btn-hud { font-size: 0.78rem; letter-spacing: 0.025em; gap: 8px; }
.briefing-lab-actions svg { width: 16px; height: 16px; flex-shrink: 0; }
.briefing-hero .space-suit-visualizer { border: 1px solid #b7c9d9; box-shadow: 0 12px 32px #0f172a12; }
.briefing-image-caption { position: absolute; bottom: 0; left: 0; right: 0; z-index: 3; padding: 32px 18px 16px; background: linear-gradient(transparent, #06101cef); color: #e2eef7; font: 500 0.72rem/1.6 var(--font-mono); letter-spacing: 0.04em; pointer-events: none; }
.briefing-image-caption > span:last-child { display: block; color: #a6bfd2; font: 400 0.8rem/1.6 var(--font-sans); letter-spacing: 0; margin-left: 14px; }
.briefing-image-dot { display: inline-block; width: 5px; height: 5px; margin-right: 8px; border-radius: 50%; background: #7dd3fc; box-shadow: 0 0 8px #7dd3fc60; }
.lab-workflow-container { border: 1px solid #d5e0ea; border-radius: 14px; box-shadow: 0 8px 24px #0f172a08; }
.workflow-step-card { border-radius: 12px; background: linear-gradient(145deg, #fff, #f8fafc); border: 1px solid #dce5ed; box-shadow: 0 2px 4px #0f172a03; transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.workflow-stage-pill { padding: 5px 10px; font-size: 0.75rem; background: #edf6fc; border: 1px solid #d4e9f6; }
.step-card-top { margin-bottom: 14px; }
.step-action-tag { border-top: 1px solid #e2e8f0; padding-top: 12px; margin-top: 16px; }
.hud-input, .hud-select { border-width: 1px; border-color: #b8c8d8; background: #fcfdff; }
.btn-hud { border-radius: 9px; }
@media (hover: hover) {
  .btn-hud:hover { box-shadow: 0 5px 14px #0284c724; }
  .workflow-step-card:hover { background: #fff; border-color: #7bb4d8; box-shadow: 0 8px 20px #0284c714; }
}
@media (max-width: 768px) {
  .briefing-lab-actions .btn-hud { flex: 1 1 160px; justify-content: center; }
  .briefing-image-caption { padding-inline: 14px; font-size: 0.65rem; }
}
@media (prefers-reduced-motion: reduce) { .workflow-step-card { transition: none; } .workflow-step-card:hover { transform: none; } }
.workflow-step-card:focus-visible { outline: 2px solid #0284c7; outline-offset: 4px; }
@media (min-width: 768px) {
  .briefing-hero { align-items: start; }
  .briefing-hero .space-suit-visualizer { margin-top: 0; height: clamp(350px, 38vw, 490px); }
}

/* Compact laboratory views, with manual navigation rather than auto-advance. */
.compact-overview-details { border-top: 1px solid #e2e8f0; padding-top: 14px; }
.compact-overview-details summary, .study-practice-details summary { padding: 10px 0; cursor: pointer; color: #0369a1; font-size: 0.9rem; font-weight: 600; }
.compact-overview-details[open] summary { margin-bottom: 16px; }
.briefing-project-panel .briefing-lab-actions { margin: 16px 0; }
@media (min-width: 768px) { .briefing-hero .space-suit-visualizer { height: 340px; } }
.assembly-slider-controls, .flashcard-deck-controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 16px 0; }
#assembly-slide-status, #flashcard-position { color: #475569; font: 500 0.85rem/1.5 var(--font-mono); }
.assembly-step-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; }
.assembly-step-tabs button { min-height: 44px; padding: 9px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #f8fafc; color: #475569; font: 500 0.82rem/1.4 var(--font-sans); white-space: nowrap; cursor: pointer; }
.assembly-step-tabs button[aria-current] { background: #e0f2fe; border-color: #0284c7; color: #0369a1; }
#assembly-slider { position: relative; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; margin-top: 4px; padding-bottom: 8px; scrollbar-width: thin; }
#assembly-slider .assembly-illustration { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
#assembly-slider picture { background: #f3f8fc; }
#assembly-slider img { height: clamp(240px, 35vw, 380px); object-fit: contain; }
#assembly-slider figcaption { min-height: 62px; font-size: 0.95rem; line-height: 1.6; }
button:disabled { opacity: 0.45; cursor: default; }
#main-flashcard-grid { display: block; max-width: 660px; margin: 20px auto; }
#main-flashcard-grid .flashcard { height: 320px; }
#main-flashcard-grid .flashcard-front .flashcard-desc, #main-flashcard-grid .flashcard-back .flashcard-desc { font-size: 1rem; line-height: 1.65; }
#main-flashcard-grid .flashcard-title { font-size: 1.1rem; line-height: 1.5; }
#main-flashcard-grid .flashcard-front, #main-flashcard-grid .flashcard-back { padding: 24px; overflow-y: auto; }
.study-practice-details { margin-top: 24px; border-top: 1px solid #e2e8f0; padding-top: 12px; }
@media (max-width: 520px) {
  .flashcard-deck-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  #flashcard-position { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .flashcard-deck-controls .btn-hud { padding: 8px 6px; font-size: 0.78rem; }
  #main-flashcard-grid .flashcard { height: 350px; }
  #main-flashcard-grid .flashcard-front, #main-flashcard-grid .flashcard-back { padding: 18px; }
  #assembly-slider img { height: 240px; }
}
@media print {
  .assembly-slider-controls, .assembly-step-tabs, .flashcard-deck-controls { display: none !important; }
  #assembly-slider { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  #assembly-slider img { height: auto; }
}
.assembly-slider-controls .btn-hud, .flashcard-deck-controls .btn-hud, .briefing-lab-actions .btn-hud { width: auto; }
.briefing-lab-actions .btn-hud { flex: 1 1 210px; justify-content: center; }
.hud-grid > .view-section { min-width: 0; }
.assembly-illustrations { min-width: 0; max-width: 100%; }
.flashcard-topic-label { display: flex; align-items: center; gap: 12px; color: #475569; font-size: 0.85rem; }
#flashcard-topic { width: auto; min-width: 220px; padding: 9px 12px; }
.flashcards-header-bar .btn-hud { flex: 0 1 auto; }
@media (max-width: 768px) {
  .flashcards-header-bar { gap: 12px; }
  .flashcard-topic-label { width: 100%; }
  #flashcard-topic { flex: 1; min-width: 0; }
  .flashcards-header-bar > div:last-child { flex-direction: row; }
  .flashcards-header-bar .btn-hud { width: auto !important; font-size: 0.7rem !important; padding: 8px 10px !important; }
  .assembly-slider-controls { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .assembly-slider-controls .btn-hud { padding: 8px 6px; font-size: 0.75rem; }
  #assembly-slide-status { font-size: 0.75rem; }
}
.assembly-reference { border: 1px solid #d5e0ea; border-radius: 10px; margin: 18px 0; background: #f8fafc; }
.assembly-reference > summary { padding: 16px 18px; color: #0369a1; font-size: 0.9rem; font-weight: 600; cursor: pointer; line-height: 1.6; }
.assembly-reference > .visual-guide-box { margin: 0 16px 16px !important; }
.assembly-reference > h2, .assembly-reference > .sim-stats-container { margin: 16px !important; }
#assembly-slider figcaption strong { color: #0f172a; }
@media (max-width: 520px) { .assembly-reference > summary { padding: 12px 14px; } }

/* Illustrative layer construction and outward heat-transfer markers. */
.layer-stack-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 28px 0 10px; }
.layer-stack-heading h2 { font-size: 1.1rem; line-height: 1.5; }
.layer-stack-heading h2 svg { width: 20px; height: 20px; vertical-align: middle; }
.layer-animation-note { font-size: 0.8rem; color: #64748b; line-height: 1.65; margin-bottom: 16px; }
#layer-stack-grid .layer-bars-container { position: relative; padding-right: 16px; gap: 5px; }
#layer-stack-grid .layer-bar { height: auto; min-height: 24px; padding: 4px 6px; font-size: 0.64rem; line-height: 1.45; text-align: center; }
#layer-stack-grid .layer-bars-container::before { content: ''; position: absolute; right: 4px; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: linear-gradient(#f59e0b50, #0284c730); }
#layer-stack-grid .layer-bars-container::after { content: ''; position: absolute; right: 2px; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 7px #f59e0b50; opacity: 0; }
#layer-stack-grid.is-layer-active .layer-bar { animation: layer-build-in 550ms cubic-bezier(.2,.7,.3,1) both; animation-delay: calc(var(--layer-order) * 160ms); }
#layer-stack-grid.is-layer-active .layer-bars-container::after { animation: layer-heat-travel 3s ease-in-out infinite; animation-delay: 900ms; }
@keyframes layer-build-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes layer-heat-travel { 0% { top: 3px; opacity: 0; } 15% { opacity: 0.8; } 75% { opacity: 0.65; } 100% { top: calc(100% - 9px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  #layer-stack-grid.is-layer-active .layer-bar, #layer-stack-grid.is-layer-active .layer-bars-container::after { animation: none; }
}
@media print {
  #layer-stack-grid .layer-bar { animation: none !important; }
  #layer-stack-grid .layer-bars-container::after { display: none; }
}
