/* Premium CSS Design System - Aviation Recall App */
/* Imports Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-primary: #080b10;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-glass: rgba(13, 17, 23, 0.65);
  --border-glass: rgba(255, 255, 255, 0.08);

  --color-text: #f3f4f6;
  --color-muted: #9ca3af;

  /* Neon Accent Colors */
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --accent-red: #ef4444;
  --accent-orange: #f97316;
  --accent-yellow: #facc15;

  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --glow-cyan: 0 0 15px rgba(6, 182, 212, 0.4);
  --glow-green: 0 0 15px rgba(16, 185, 129, 0.4);
  --glow-pink: 0 0 15px rgba(236, 72, 153, 0.4);
  --glow-amber: 0 0 15px rgba(245, 158, 11, 0.4);

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Reset and Scrollbar styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

/* Form controls don't inherit fonts by default — without this, answer options,
   the report button and banner close buttons render in the browser's Arial. */
button, input, select, textarea {
  font-family: inherit;
}

body {
  background-color: #030712;
  color: var(--color-text);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Scrollbar customizations */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* APP SHELL — full-window responsive (real app on mobile, centered column on desktop) */
.device-container {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Desktop: present as a centered app column with subtle side framing */
@media (min-width: 768px) {
  .device-container {
    max-width: 760px;
    border-left: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
  }
}

/* No phone notch */
.device-container::before {
  display: none;
}

/* Slim top bar — real clock only (no fake signal/battery icons) */
.status-bar {
  height: 34px;
  background-color: rgba(8, 11, 16, 0.8);
  backdrop-filter: blur(5px);
  padding: max(8px, env(safe-area-inset-top)) 20px 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  z-index: 999;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.status-bar .icons {
  display: none;
}

/* hide fake wifi/signal/battery */
@media (min-width: 768px) {
  .status-bar {
    display: none;
  }
}

/* desktop: no phone bar */

/* MAIN CONTENT WORKSPACE */
.app-screen {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 86px;
  /* Spacing for bottom navbar */
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* BOTTOM NAVIGATION BAR */
.nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 68px;
  background: rgba(11, 15, 22, 0.85);
  backdrop-filter: blur(15px);
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 998;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 20%;
  gap: 4px;
}

.nav-item i {
  font-size: 18px;
  transition: var(--transition-spring);
  padding: 4px 12px;
  border-radius: 16px;
}

.nav-item.active {
  color: var(--accent-cyan);
}

.nav-item.active i {
  background-color: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  box-shadow: inset 0 0 5px rgba(6, 182, 212, 0.1);
  transform: translateY(-2px);
}

/* GLASSMORPHISM CARDS */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* NEON BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-spring);
  width: 100%;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.2);
}

.btn:active {
  transform: scale(0.96);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-glass);
  box-shadow: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.25);
}

.btn-success {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

/* DYNAMIC ACCURACY METRICS */
.metric-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.metric-card {
  flex: 1;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px;
}

.metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* APP PANEL CONTROL (SHOW/HIDE) */
.app-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.app-panel.active {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* DASHBOARD TARGET AND PROGRESS GRAPH */
.timeline-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-muted);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  width: 0%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.1, 0.8, 0.2, 1);
  box-shadow: var(--glow-cyan);
}

/* ═══ SHARED STUDY FILTER BAR (category chips + subject dropdown) ═══ */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-chip-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chip-row::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  white-space: nowrap;
}

.cat-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

.cat-chip.active {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.chip-count {
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0.7;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 1px 5px;
}

.subject-select {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.subject-select:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* ═══ LEARNED vs RETAINED BARS ═══ */
.lr-row {
  margin-bottom: 12px;
}

.lr-row:last-child {
  margin-bottom: 0;
}

.lr-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.lr-cat {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
}

.lr-nums {
  font-size: 10px;
  font-family: var(--font-mono);
}

.lr-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
}

.lr-learned {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(59, 130, 246, 0.55);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.lr-retained {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #059669, #10b981);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ═══ STUDY MODE TOGGLE (Recall / Learn / Challenge) ═══ */
.mode-toggle {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
}

.mode-toggle-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 6px;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mode-toggle-btn:hover {
  color: var(--color-text);
}

.mode-toggle-btn.active {
  background: rgba(6, 182, 212, 0.18);
  color: #fff;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.15);
}

.mode-toggle-btn.challenge {
  color: var(--accent-pink);
}

.mode-toggle-btn.challenge:hover {
  background: rgba(236, 72, 153, 0.15);
  color: #fff;
}

/* ═══ LEARN MODE (absorb answers + ask the handbook) ═══ */
.learn-answer-card {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 14px;
}

.learn-answer-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-green);
  margin-bottom: 6px;
}

.learn-answer-text {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

.learn-explain {
  margin-top: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-muted);
}

.learn-ask {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Learn Mode Answer & Rating UI */
.learn-answer-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
}

.learn-answer-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  text-transform: uppercase;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.learn-answer-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.rate-label {
  text-align: center;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.learn-rate-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 12px;
}

.rate-btn {
  flex: 1;
  padding: 10px 4px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.rate-btn.rate-again {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--accent-red);
}

.rate-btn.rate-again:hover {
  background: rgba(239, 68, 68, 0.15);
}

.rate-btn.rate-hard {
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

.rate-btn.rate-hard:hover {
  background: rgba(245, 158, 11, 0.15);
}

.rate-btn.rate-good {
  border-color: rgba(56, 189, 248, 0.4);
  color: var(--accent-cyan);
}

.rate-btn.rate-good:hover {
  background: rgba(56, 189, 248, 0.15);
}

.rate-btn.rate-easy {
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.rate-btn.rate-easy:hover {
  background: rgba(16, 185, 129, 0.15);
}

.learn-explain-text {
  font-size: 12px;
  color: var(--color-muted);
  line-height: 1.5;
}

.learn-ask-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.learn-ask-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.learn-ask-row .text-input {
  flex: 1;
}

.ask-mic-btn {
  flex: 0 0 auto;
  width: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-glass);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.ask-mic-btn:hover {
  background: rgba(6, 182, 212, 0.22);
}

.ask-mic-btn.listening {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-red));
  color: #fff;
  animation: micThrob 1.2s infinite;
}

@keyframes micThrob {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.5);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(236, 72, 153, 0);
  }
}

/* Learn-mode tap prompt */
.learn-prompt {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.06);
  border: 1px dashed rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.learn-prompt:hover {
  background: rgba(6, 182, 212, 0.12);
}

/* Speaker button inside the explanation box (bottom-right) */
.learn-explain {
  position: relative;
}

.explain-speaker {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(6, 182, 212, 0.3);
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition-smooth);
}

.explain-speaker:hover {
  background: rgba(6, 182, 212, 0.3);
  color: #fff;
}

/* Tutor Entrance & Shimmer Keyframes */
@keyframes tutorReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes themeSpinPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.12);
    opacity: 1;
    text-shadow: 0 0 8px currentColor;
  }
}

/* Tutor answer block */
.tutor-answer {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px;
  animation: tutorReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  transition: all 0.3s ease;
}

.rag-loading i {
  animation: themeSpinPulse 1.5s infinite ease-in-out;
}

/* General (Cyan/Blue Theme) */
.tutor-answer.theme-general {
  background: rgba(6, 182, 212, 0.06);
  border: 1px solid rgba(6, 182, 212, 0.25);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.08);
}

.tutor-answer.theme-general .tutor-q {
  color: var(--accent-cyan);
}

.rag-loading.theme-general {
  color: var(--accent-cyan);
}

/* Airframe (Orange/Amber Theme) */
.tutor-answer.theme-airframe {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.08);
}

.tutor-answer.theme-airframe .tutor-q {
  color: var(--accent-amber);
}

.rag-loading.theme-airframe {
  color: var(--accent-amber);
}

/* Powerplant (Red/Orange Theme) */
.tutor-answer.theme-powerplant {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.08);
}

.tutor-answer.theme-powerplant .tutor-q {
  color: var(--accent-red);
}

.rag-loading.theme-powerplant {
  color: var(--accent-red);
}

/* Pilot (Pink/Purple Theme) */
.tutor-answer.theme-pilot {
  background: rgba(236, 72, 153, 0.06);
  border: 1px solid rgba(236, 72, 153, 0.25);
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.08);
}

.tutor-answer.theme-pilot .tutor-q {
  color: var(--accent-pink);
}

.rag-loading.theme-pilot {
  color: var(--accent-pink);
}

.tutor-q {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.tutor-body {
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text);
}

.tutor-ref {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-amber);
}

/* ═══ CHALLENGE FULLSCREEN FOCUS MODE ═══ */
.challenge-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1500;
  background: linear-gradient(160deg, #0b1018, #060a10);
  display: flex;
  flex-direction: column;
  padding: 18px 18px 24px 18px;
  animation: fadeIn 0.3s ease-out;
}

.challenge-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.challenge-exit {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.challenge-exit:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

.challenge-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.challenge-track {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.challenge-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 3px;
  transition: width 0.5s ease;
}

.challenge-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-muted);
}

.challenge-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow-y: auto;
  padding: 10px 0;
}

.challenge-question {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  color: #fff;
}

.challenge-diagram {
  width: 100%;
  max-width: 320px;
}

.challenge-diagram svg {
  max-height: 130px;
}

.challenge-hint {
  font-size: 13px;
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

.challenge-feedback {
  width: 100%;
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.5;
  animation: slideDown 0.3s ease-out;
  max-height: 38vh;
  overflow-y: auto;
}

.challenge-feedback.fb-ok {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

.challenge-feedback.fb-no {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
}

.challenge-bottom {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.challenge-input-row .text-input {
  flex: 1;
  font-size: 15px;
  padding: 14px 16px;
}

.challenge-actions {
  display: flex;
  gap: 8px;
}

.challenge-actions .btn {
  flex: 1;
}

/* ═══ SCAN EXAM CODES ═══ */
.scan-status {
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  padding: 10px;
}

.scan-found {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  padding: 12px;
}

.scan-chip {
  display: inline-block;
  background: rgba(6, 182, 212, 0.18);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 6px;
  margin: 2px 2px 0 0;
}

.scan-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.scan-banner-x {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--color-text);
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
}

/* ═══ VOICE MARKETPLACE ═══ */
.voice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-bottom: 8px;
}

.voice-flag {
  font-size: 22px;
  flex: 0 0 auto;
}

.voice-info {
  flex: 1;
  min-width: 0;
}

.voice-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.voice-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.voice-label {
  font-size: 9px;
  text-transform: capitalize;
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-muted);
  padding: 1px 6px;
  border-radius: 6px;
}

.voice-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.voice-prev-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  cursor: pointer;
  font-size: 11px;
}

.voice-prev-btn:hover {
  background: rgba(6, 182, 212, 0.25);
}

.voice-use-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* ═══ REFERENCE LIBRARY ═══ */
.lib-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.lib-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.lib-icon {
  font-size: 20px;
  color: var(--accent-cyan);
  width: 24px;
  text-align: center;
}

.lib-info {
  flex: 1;
}

.lib-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.lib-file {
  font-size: 10px;
  color: var(--color-muted);
  font-family: var(--font-mono);
}

/* ═══ PDF READER ═══ */
.reader-stage {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 0;
  background: #20242b;
  border-radius: 8px;
  margin: 6px 0;
}

.reader-canvas {
  max-width: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
  background: #fff;
}

.reader-canvas.flip-next {
  animation: pageFlipNext 0.35s ease;
  transform-origin: left center;
}

.reader-canvas.flip-prev {
  animation: pageFlipPrev 0.35s ease;
  transform-origin: right center;
}

@keyframes pageFlipNext {
  0% {
    transform: perspective(1200px) rotateY(-25deg);
    opacity: 0.3;
  }

  100% {
    transform: perspective(1200px) rotateY(0);
    opacity: 1;
  }
}

@keyframes pageFlipPrev {
  0% {
    transform: perspective(1200px) rotateY(25deg);
    opacity: 0.3;
  }

  100% {
    transform: perspective(1200px) rotateY(0);
    opacity: 1;
  }
}

.reader-loading,
.reader-missing {
  color: var(--color-muted);
  text-align: center;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reader-missing code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ═══ COMBO STREAK TOAST ═══ */
.combo-toast {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 1700;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-pink));
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.combo-toast i {
  margin-right: 6px;
}

/* ═══ HAMBURGER MENU ═══ */
.hamburger-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.app-menu {
  position: absolute;
  top: 80px;
  right: 16px;
  z-index: 1400;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(13, 17, 23, 0.97);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  min-width: 190px;
  animation: scaleUp 0.18s ease;
}

.app-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.app-menu button:hover {
  background: rgba(6, 182, 212, 0.15);
  color: #fff;
}

.app-menu button i {
  width: 16px;
  text-align: center;
  color: var(--accent-cyan);
}

/* ═══ EXAM MAP extras ═══ */
.exam-suggestion {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fde68a;
}

.exam-suggestion i {
  margin-right: 6px;
}

.exam-hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.exam-hist-row:last-child {
  border-bottom: none;
}

.exam-hist-cat {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}

.exam-hist-score {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.exam-hist-score.pass {
  color: var(--accent-green);
}

.exam-hist-score.fail {
  color: var(--accent-red);
}

/* 5-button mode toggle: tighten so labels fit on narrow screens */
.mode-toggle-btn {
  padding: 8px 3px;
  font-size: 11px;
  gap: 4px;
}

.mode-toggle-btn i {
  font-size: 12px;
}

/* ═══ TRACK SELECTOR (Mechanic vs Pilot) ═══ */
.track-selector {
  display: flex;
  gap: 8px;
}

.beta-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(6, 182, 212, 0.10));
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.beta-strip-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.beta-badge {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  padding: 3px 7px;
  border-radius: 6px;
}

.beta-text {
  font-size: 11px;
  color: var(--color-text);
  line-height: 1.35;
}

.beta-strip-x {
  flex: 0 0 auto;
  background: none;
  border: none;
  color: var(--color-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

.beta-strip-x:hover {
  color: #fff;
}

.diag-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.14), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.3);
  font-size: 12px;
  color: var(--color-text);
}

.diag-nudge i.fa-clipboard-question {
  color: var(--accent-cyan);
  margin-right: 4px;
}

.diag-nudge i.fa-chevron-right {
  color: var(--color-muted);
  flex: 0 0 auto;
}

/* STUDY HOME — mode picker */
.study-home {
  display: none;              /* opened via .open so CSS owns the layout */
  flex-direction: column;
  gap: 10px;
}

.study-home.open {
  display: flex;
}

.study-session {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.study-mode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.study-mode-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.smc-icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
}

.smc-info {
  flex: 1;
  min-width: 0;
}

.smc-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.smc-desc {
  font-size: 11px;
  color: var(--color-muted);
  line-height: 1.4;
  margin-top: 2px;
}

.smc-rec {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #041014;
  background: var(--accent-cyan);
  padding: 2px 6px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 4px;
}

.smc-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.smc-stat {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--color-muted);
  white-space: nowrap;
}

.smc-side i {
  color: var(--color-muted);
  font-size: 11px;
}

/* LEARN MODE — auto-reveal statement + flow */
.learn-statement {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.09), rgba(59, 130, 246, 0.06));
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 12px;
  padding: 13px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
}

.learn-statement b {
  color: var(--accent-cyan);
}

/* Solo variant — the statement IS the card in Learn mode: bigger, airier */
.learn-statement-solo {
  padding: 22px 18px;
  font-size: 15.5px;
  line-height: 1.75;
  margin: 6px 0 16px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.learn-statement-solo .learn-stmt-q { font-size: 15.5px; line-height: 1.65; }
.learn-statement-solo .learn-stmt-a { margin-top: 14px; font-size: 16px; }

/* Onboarding AI-tutor key box */
.onb-ai-box {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.10), rgba(124, 58, 237, 0.07));
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
}

/* Scrollable 8083 figure strip (learn / explain) */
.fig-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.fig-item {
  flex: 0 0 auto;
  width: 210px;
  margin: 0;
  background: #fff;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  overflow: hidden;
  cursor: zoom-in;
  transition: var(--transition-smooth);
}
.fig-item img { width: 100%; display: block; }
.fig-item figcaption {
  font-size: 9.5px;
  color: #1e293b;
  padding: 5px 7px;
  line-height: 1.35;
  background: #f1f5f9;
}
.fig-item.zoomed {
  position: fixed;
  top: 4vh; left: 50%;
  transform: translateX(-50%);
  width: min(94vw, 720px);
  max-height: 92vh;
  overflow-y: auto;
  z-index: 3200;
  cursor: zoom-out;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.75);
}
.fig-item.zoomed figcaption { font-size: 12px; }

.learn-stmt-q {
  font-weight: 600;
  color: #fff;
}

.learn-stmt-a {
  margin-top: 7px;
}

.learn-stmt-a i {
  color: var(--accent-green);
  font-size: 11px;
  margin-right: 4px;
}

.learn-rate-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase;
  color: var(--color-muted); margin-bottom: 6px;
}

/* 1-4 strength-of-understanding scale (maps to FSRS Again/Hard/Good/Easy).
   Traffic-light ramp: red -> orange -> yellow -> green. */
.strength-btn {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 11px 3px 9px;
  border-radius: 13px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  transition: var(--transition-smooth);
}

/* glass sheen along the top edge */
.strength-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
}

.strength-btn .s-num {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 3px;
}
.strength-btn .s-num i { font-size: 9px; opacity: 0.85; }

.strength-btn .s-word {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.5);
}

.strength-btn:hover { transform: translateY(-2px); }
.strength-btn:hover .s-word { color: rgba(255, 255, 255, 0.8); }
.strength-btn:active { transform: translateY(0) scale(0.95); }

/* 1 — Didn't know (red) */
.strength-btn.s1 {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(160deg, rgba(239, 68, 68, 0.20), rgba(239, 68, 68, 0.04));
}
.strength-btn.s1 .s-num { color: var(--accent-red); text-shadow: 0 0 12px rgba(239, 68, 68, 0.6); }
.strength-btn.s1:hover { border-color: rgba(239, 68, 68, 0.85); box-shadow: 0 0 16px rgba(239, 68, 68, 0.35); }

/* 2 — Shaky (orange) */
.strength-btn.s2 {
  border-color: rgba(249, 115, 22, 0.45);
  background: linear-gradient(160deg, rgba(249, 115, 22, 0.20), rgba(249, 115, 22, 0.04));
}
.strength-btn.s2 .s-num { color: var(--accent-orange); text-shadow: 0 0 12px rgba(249, 115, 22, 0.6); }
.strength-btn.s2:hover { border-color: rgba(249, 115, 22, 0.85); box-shadow: 0 0 16px rgba(249, 115, 22, 0.35); }

/* 3 — Got it (yellow) */
.strength-btn.s3 {
  border-color: rgba(250, 204, 21, 0.45);
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.18), rgba(250, 204, 21, 0.04));
}
.strength-btn.s3 .s-num { color: var(--accent-yellow); text-shadow: 0 0 12px rgba(250, 204, 21, 0.55); }
.strength-btn.s3:hover { border-color: rgba(250, 204, 21, 0.85); box-shadow: 0 0 16px rgba(250, 204, 21, 0.32); }

/* 4 — Locked in (green) */
.strength-btn.s4 {
  border-color: rgba(16, 185, 129, 0.5);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.20), rgba(16, 185, 129, 0.04));
}
.strength-btn.s4 .s-num { color: var(--accent-green); text-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
.strength-btn.s4:hover { border-color: rgba(16, 185, 129, 0.85); box-shadow: var(--glow-green); }

/* Flow toggle sits flush with the scale */
.learn-next-row .flow-pill {
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 13px;
  font-size: 13px;
}

/* Narrow phones: keep all five controls on one row */
@media (max-width: 380px) {
  .strength-btn { padding: 10px 2px 8px; border-radius: 11px; }
  .strength-btn .s-num { font-size: 15px; }
  .strength-btn .s-word { font-size: 7px; letter-spacing: 0.2px; }
  .learn-next-row { gap: 4px; }
  .learn-next-row .flow-pill { padding: 0 9px; }
}

.learn-next-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.flow-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.flow-pill.on {
  color: #041014;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

/* ── TABLET LAYOUT (iPad landscape + 12.9" portrait, >=1000px) ────────
   Below this the single column is correct — 820px portrait is too narrow for
   two columns of cards. Above it, a 760px column left ~40% of an iPad
   landscape screen empty, so widen the shell and flow cards two-up.
   Question text stays in its own narrow column for readability. */
@media (min-width: 1000px) {
  .device-container { max-width: 1080px; }

  /* Dashboard + Exam Map: two-column card flow.
     #id.active out-specifies .app-panel.active, which sets flex. */
  #panel-dashboard.active,
  #panel-exammap.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-content: start;
  }

  /* Headers, banners and the metric strip stay full width */
  #panel-dashboard.active > :nth-child(-n+6),
  #panel-exammap.active > :nth-child(-n+2),
  #panel-exammap.active > #heatmapContainer {
    grid-column: 1 / -1;
  }

  /* Empty placeholders must not hold open a grid cell */
  #queueCards:empty,
  #examSuggestion:empty,
  #betaStrip[style*="display: none"],
  #diagNudge[style*="display: none"],
  #examResumeBar[style*="display: none"] { display: none; }

  /* Study mode picker reads better two-up on a tablet */
  .study-home.open { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

  /* Browse: wider rows, but keep the tree single-column so nesting stays clear */
  .browse-q-text { font-size: 13px; }

  /* Keep the reading measure comfortable even though the shell is wider */
  .learn-statement, #cardAnswerInputs, .flashcard-deck {
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* REPORT-A-QUESTION (study header flag + inline note) */
.report-btn {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.report-btn:hover { color: var(--accent-amber); border-color: rgba(245, 158, 11, 0.5); }
.report-btn.on {
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.7);
  background: rgba(245, 158, 11, 0.15);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.report-note-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 7px;
}
.report-note-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 700; color: var(--color-text);
}
.report-note-x {
  background: none; border: none; color: var(--color-muted);
  cursor: pointer; font-size: 13px; padding: 0 2px;
}
.report-note-x:hover { color: #fff; }
.report-note-box .text-input { padding: 7px 9px !important; font-size: 11px !important; }
.report-note-hint { font-size: 9.5px; color: var(--color-muted); }

/* BROWSE THE BANK */
.browse-controls { display: flex; align-items: center; gap: 8px; }
.browse-controls .onb-chips { flex: 1; }

.flag-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-radius: 12px; font-size: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(236, 72, 153, 0.07));
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.browse-cat { margin-bottom: 8px; }
.browse-cat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-radius: 11px; cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  font-size: 13px; font-weight: 700; color: #fff;
}
.browse-cat-head:hover { background: rgba(255, 255, 255, 0.08); }
.browse-cat-name { flex: 1; }
.browse-cat-n {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: var(--color-muted); background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px; border-radius: 8px;
}
.browse-flag-count {
  font-size: 10px; font-weight: 700; color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.15); padding: 2px 7px; border-radius: 8px;
}

.browse-sub {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; color: var(--accent-cyan);
  padding: 10px 4px 5px 6px;
}
.browse-sub .browse-cat-n { margin-left: auto; }

.browse-q {
  border-radius: 10px; margin: 5px 0 5px 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-glass);
  border-left: 2px solid transparent;
}
.browse-q.flagged { border-left-color: var(--accent-amber); background: rgba(245, 158, 11, 0.06); }
.browse-q-head { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; cursor: pointer; }
.browse-q-text { flex: 1; font-size: 12px; line-height: 1.45; color: var(--color-text); }
.browse-flag-btn {
  flex: 0 0 auto; background: none; border: none; cursor: pointer;
  color: var(--color-muted); font-size: 13px; padding: 2px 4px;
}
.browse-flag-btn.on { color: var(--accent-amber); }
.browse-flag-btn:hover { color: var(--accent-amber); }

.browse-controls { flex-wrap: wrap; }
.browse-choices { display: flex; flex-direction: column; gap: 4px; padding: 0 11px 10px 11px; }
.browse-choice {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; line-height: 1.4; color: var(--color-muted);
  padding: 6px 9px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid transparent;
}
.browse-choice i { font-size: 9px; margin-top: 4px; flex: 0 0 auto; opacity: 0.5; }
.browse-choice.correct {
  color: var(--accent-green); font-weight: 700;
  background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.45);
}
.browse-choice.correct i { opacity: 1; font-size: 10px; }

.browse-q-body { padding: 0 11px 11px 11px; display: flex; flex-direction: column; gap: 8px; }
.browse-a { font-size: 12px; font-weight: 700; color: var(--accent-green); line-height: 1.45; }
.browse-a i { font-size: 10px; margin-right: 4px; }
.browse-expl { font-size: 11px; line-height: 1.5; color: var(--color-muted); }
.browse-meta { font-size: 9px; font-family: var(--font-mono); color: var(--color-muted); opacity: 0.75; }
.browse-note { padding: 7px 9px !important; font-size: 11px !important; }

.study-back-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.study-back-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.study-back-btn:hover {
  color: #fff;
}

.mode-toggle-mini {
  flex: 0 0 auto;
}

.mode-toggle-mini .mode-toggle-btn {
  padding: 7px 14px;
  font-size: 11px;
}

.exam-resume-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(236, 72, 153, 0.08));
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 12px;
  color: var(--color-text);
}

/* Floating full-A&P diagnostic button (Exam Map, bottom-right, frame-aligned) */
.ap150-fab {
  position: fixed;
  right: max(16px, calc(50% - 364px));
  bottom: 84px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 900;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
  transition: var(--transition-spring);
}

.ap150-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.6);
}

.track-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.track-btn i {
  font-size: 18px;
}

.track-btn .track-count {
  font-size: 10px;
  font-weight: 500;
  font-family: var(--font-mono);
  opacity: 0.7;
}

.track-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

.track-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(59, 130, 246, 0.12));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.18);
}

/* Track label above the study filter chips */
.filter-track-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══ TODAY RING (daily goal) ═══ */
.today-ring {
  --pct: 0;
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--accent-green) calc(var(--pct) * 1%), rgba(255, 255, 255, 0.08) 0);
  position: relative;
}

.today-ring::before {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #0c1118;
}

.today-ring span {
  position: relative;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

/* ═══ MODAL ═══ */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 1600;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: scaleUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ═══ EXAM SIMULATOR ═══ */
.exam-timer {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  padding: 4px 10px;
}

.exam-timer.low {
  color: #fff;
  background: rgba(239, 68, 68, 0.25);
  border-color: var(--accent-red);
  animation: micThrob 1s infinite;
}

.exam-option.selected {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
}

.exam-palette-wrap {
  flex: 0 0 auto;
  max-height: 92px;
  overflow-y: auto;
  padding: 6px 0;
  margin: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.exam-palette {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

.pal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-muted);
  font-size: 10px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.pal-cell.answered {
  background: rgba(6, 182, 212, 0.2);
  color: #fff;
  border-color: rgba(6, 182, 212, 0.4);
}

.pal-cell.flagged {
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

.pal-cell.current {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 1px;
}

.btn.flagged,
#examFlagBtn.flagged {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--accent-amber);
  color: var(--accent-amber);
}

/* Exam report */
.exam-report {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.exam-report-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 0 20px;
}

.exam-score-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  border: 4px solid;
}

.exam-score-ring.pass {
  border-color: var(--accent-green);
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.4);
}

.exam-score-ring.fail {
  border-color: var(--accent-red);
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.exam-score-ring.diag {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.35);
}

.exam-score-ring.diag .exam-score-label {
  color: var(--accent-cyan);
}

.exam-score-num {
  font-size: 34px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
}

.exam-score-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.exam-score-ring.pass .exam-score-label {
  color: var(--accent-green);
}

.exam-score-ring.fail .exam-score-label {
  color: var(--accent-red);
}

.exam-score-sub {
  font-size: 12px;
  color: var(--color-muted);
}

.exam-report-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

.exam-report-actions .btn {
  flex: 1;
}

/* ═══ KNOWLEDGE MAP (the gap finder) ═══ */
.km-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--color-text);
  padding: 10px 4px 6px 4px;
  margin-top: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.km-cat-header:first-child {
  margin-top: 0;
}

.km-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.km-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.km-icon {
  width: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--accent-cyan);
  flex: 0 0 auto;
}

.km-info {
  flex: 1;
  min-width: 0;
}

.km-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.km-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  overflow: hidden;
}

.km-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.km-bar-high {
  background: linear-gradient(90deg, #059669, #10b981);
}

.km-bar-mid {
  background: linear-gradient(90deg, #d97706, #f59e0b);
}

.km-bar-low {
  background: linear-gradient(90deg, #dc2626, #ef4444);
}

.km-bar-new {
  background: rgba(255, 255, 255, 0.15);
}

.km-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted);
  flex: 0 0 auto;
  min-width: 38px;
  text-align: right;
}

.km-go {
  font-size: 10px;
  color: var(--color-muted);
  flex: 0 0 auto;
  opacity: 0.5;
}

/* FLASHCARD LAYOUT & ANIMATIONS */
.flashcard-deck {
  perspective: 1000px;
  width: 100%;
  height: 280px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flashcard-deck.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.flashcard-front {
  background: linear-gradient(135deg, rgba(20, 27, 41, 0.95), rgba(10, 14, 22, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.flashcard-back {
  background: linear-gradient(135deg, rgba(13, 27, 42, 0.98), rgba(8, 15, 24, 0.98));
  border: 1px solid var(--accent-cyan);
  transform: rotateY(180deg);
}

.card-tag {
  align-self: flex-start;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent-cyan);
}

.card-question-text {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 500;
  margin-top: 10px;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Question illustrations */
.q-diagram {
  max-height: 90px;
  display: block;
  margin: 8px auto 0 auto;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sodium-glow {
  animation: glowRed 2s infinite ease-in-out;
}

@keyframes glowRed {

  0%,
  100% {
    fill: #f39c12;
    filter: drop-shadow(0 0 1px #e67e22);
  }

  50% {
    fill: #ff7675;
    filter: drop-shadow(0 0 5px #ff7675);
  }
}

/* MULTIPLE CHOICE / INPUT PANELS */
.mc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.mc-option {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  font-size: 13px;
  text-align: left;
  color: var(--color-text);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.mc-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

.mc-option.correct {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  color: #a7f3d0;
  box-shadow: var(--glow-green);
}

.mc-option.incorrect {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: #fecaca;
}

/* TEXT AREA ACTIVE RECALL INPUT */
.text-input-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.text-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

/* SEMANTIC FEEDBACK STYLING */
.feedback-box {
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
}

.feedback-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}

.concept-matched {
  color: #10b981;
  font-weight: 700;
  text-decoration: underline;
}

.concept-missed {
  color: #f59e0b;
  font-weight: 700;
}

/* 3D INTERACTIVE LAB CANVAS */
.lab-canvas-container {
  position: relative;
  width: 100%;
  height: 300px;
  background: radial-gradient(circle, #1a2230 0%, #0d121c 100%);
  border-radius: 20px;
  border: 1px solid var(--border-glass);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.lab-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.lab-overlay-hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hud-panel {
  background: rgba(11, 15, 22, 0.8);
  backdrop-filter: blur(5px);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  font-size: 11px;
  color: var(--color-text);
  font-weight: 600;
}

.hud-part-name {
  color: var(--accent-cyan);
  font-weight: 700;
}

/* ONBOARDING DIALOG WINDOWS */
/* WELCOME / SPLASH SCREEN */
.welcome-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 34%, #0e1726, #05070d 72%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.welcome-screen.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px;
}

.welcome-logo {
  width: 116px;
  height: 116px;
  border-radius: 27px;
  box-shadow: 0 14px 44px rgba(59, 130, 246, 0.4);
  animation: welcomePop 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.welcome-title {
  margin-top: 20px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #22d3ee, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: welcomeUp 0.6s 0.15s ease both;
}

.welcome-tagline {
  margin-top: 6px;
  font-size: 13px;
  color: var(--color-muted);
  animation: welcomeUp 0.6s 0.28s ease both;
}

.welcome-dots {
  display: flex;
  gap: 7px;
  margin-top: 26px;
  animation: welcomeUp 0.6s 0.4s ease both;
}

.welcome-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: welcomeBlink 1.2s infinite ease-in-out;
}

.welcome-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.welcome-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes welcomePop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes welcomeUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes welcomeBlink {

  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.85);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.onboarding-overlay {
  /* Fixed (not absolute) so it pins to the viewport and never scrolls away to
     reveal the dashboard behind it — that scroll-reveal looked like a doubled
     screen on mobile. Scrolls internally when the card is taller than the screen. */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.95);
  z-index: 1000;
  display: flex;
  overflow-y: auto;
  padding: 20px;
  transition: var(--transition-smooth);
}

.onboarding-card {
  width: 100%;
  max-width: 420px;
  /* margin:auto centers the card AND keeps the top reachable when the card is
     taller than the viewport (flex justify/align-center would clip it). */
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleUp {
  from {
    transform: scale(0.9);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

.goal-option {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  gap: 12px;
}

.goal-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent-cyan);
}

.goal-icon {
  font-size: 20px;
  color: var(--accent-cyan);
}

/* LISTENING MODE PULSING MICROPHONE */
.voice-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.reader-stage {
  flex: 1;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: auto;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.reader-canvas {
  max-width: 100%;
  height: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: #fff;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mic-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.mic-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--accent-cyan);
  opacity: 0.15;
  z-index: 1;
}

.mic-wrapper.listening .mic-pulse-ring {
  animation: pulseMic 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseMic {
  0% {
    transform: scale(1);
    opacity: 0.3;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.05;
  }

  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.mic-btn {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 28px;
  z-index: 2;
  box-shadow: var(--glow-cyan);
  transition: var(--transition-spring);
  border: none;
}

.mic-wrapper.listening .mic-btn {
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-red));
  box-shadow: var(--glow-pink);
  transform: scale(0.95);
}

.voice-status-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  text-align: center;
}

.transcript-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  font-size: 13px;
  min-height: 50px;
  font-style: italic;
  color: var(--color-muted);
  text-align: center;
}

/* SETTINGS INPUT SLIDERS */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
}

.settings-input-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  outline: none;
  transition: var(--transition-smooth);
}

.settings-input-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  transition: var(--transition-spring);
}

.settings-input-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.settings-select {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 12px;
  outline: none;
}

/* CONFETTI & SCREEN SHAKE GFX */
.screen-shake {
  animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-4px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(4px, 0, 0);
  }
}

.flash-glow-green {
  animation: flashGreen 0.6s ease-out;
}

@keyframes flashGreen {
  0% {
    box-shadow: 0 0 0px var(--accent-green);
  }

  30% {
    box-shadow: 0 0 35px var(--accent-green);
  }

  100% {
    box-shadow: 0 0 0px var(--accent-green);
  }
}

.flash-glow-red {
  animation: flashRed 0.6s ease-out;
}

@keyframes flashRed {
  0% {
    box-shadow: 0 0 0px var(--accent-red);
  }

  30% {
    box-shadow: 0 0 35px var(--accent-red);
  }

  100% {
    box-shadow: 0 0 0px var(--accent-red);
  }
}

/* RESPONSIVE MEDIA QUERIES (MOBILE RESCUE) */
@media (max-width: 767px) {
  body {
    background-color: var(--bg-primary);
  }

  /* honor the bottom safe area (iPhone home indicator) for the nav bar */
  .nav-bar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(68px + env(safe-area-inset-bottom));
  }

  .app-screen {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }
}

/* ── iPad / iOS safe areas (>=768px) ─────────────────────────────
   At this width the faux .status-bar is hidden, and the PWA runs with a
   translucent iOS status bar, so the content must clear it itself. The home
   indicator needs bottom clearance too. On desktop every env() here resolves
   to 0, so nothing changes there. */
@media (min-width: 768px) {
  .app-screen {
    padding-top: calc(16px + env(safe-area-inset-top));
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .nav-bar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(68px + env(safe-area-inset-bottom));
  }

  .floating-accessory-btn,
  .ap150-fab {
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
}

/* iPad landscape — keep content off the rounded corners / camera housing */
@media (min-width: 768px) and (orientation: landscape) {
  .app-screen {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

/* FLOATING ACCESSORY TOGGLE BUTTON */
.floating-accessory-btn {
  /* Fixed so it stays reachable while scrolling; aligned to the device frame's
     right edge on desktop, 16px from the screen edge on mobile. */
  position: fixed;
  right: max(16px, calc(50% - 364px));
  bottom: 84px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  z-index: 997;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.35);
  transition: var(--transition-spring);
}

.floating-accessory-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.6);
}

/* SLIDE-UP DRAWER */
.scratchpad-drawer {
  /* Fixed (not absolute) so the off-screen drawer never adds to the page's scroll
     height — previously its 480px sat below the fold and showed the calculator
     when scrolling the home screen. Centered to the device frame on desktop. */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  height: 480px;
  background: rgba(8, 11, 16, 0.98);
  backdrop-filter: blur(25px);
  border-top: 2px solid var(--accent-purple);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.1, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
}

.scratchpad-drawer.open {
  transform: translateY(0);
}

/* DRAWER HEADER & TABS */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.02);
}

.drawer-tab-btn {
  padding: 6px 12px;
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--color-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drawer-tab-btn.active {
  background: rgba(139, 92, 246, 0.2);
  border-color: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.btn-close-drawer {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
  transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
}

/* DRAWER CONTENT PANELS */
.drawer-tab-content {
  display: none;
  flex: 1;
  padding: 12px;
  overflow: hidden;
}

.drawer-tab-content.active-content {
  display: flex;
  flex-direction: column;
}

/* SCIENTIFIC CALCULATOR */
.calc-display-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
  text-align: right;
}

.calc-history {
  font-size: 11px;
  color: var(--color-muted);
  height: 16px;
  overflow: hidden;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.calc-screen {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  overflow-x: auto;
  white-space: nowrap;
  margin-top: 2px;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  flex: 1;
}

.calc-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
}

.calc-btn:active {
  transform: scale(0.92);
}

.calc-btn.btn-num {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 500;
}

.calc-btn.btn-num:hover {
  background: rgba(255, 255, 255, 0.12);
}

.calc-btn.btn-operator {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

.calc-btn.btn-operator:hover {
  background: rgba(59, 130, 246, 0.2);
}

.calc-btn.btn-func {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.25);
  color: #22d3ee;
}

.calc-btn.btn-func:hover {
  background: rgba(6, 182, 212, 0.2);
}

.calc-btn.btn-meta {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.25);
  color: #a78bfa;
  font-size: 11px;
}

.calc-btn.btn-meta:hover {
  background: rgba(139, 92, 246, 0.2);
}

.calc-btn.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.calc-btn.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.calc-btn.btn-accent {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  border: none;
}

/* SKETCHPAD CONTROLS */
.sketch-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  gap: 8px;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.color-dot:active {
  transform: scale(0.85);
}

.color-dot.active {
  border-color: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

/* ═══ RAG HANDBOOK PASSAGES (AI tutor) ═══ */
.rag-loading {
  font-size: 12px;
  color: var(--color-muted);
  padding: 10px;
  text-align: center;
}

.rag-passage {
  margin-top: 4px;
}

.rag-passage-card {
  background: rgba(6, 182, 212, 0.07);
  border: 1px solid rgba(6, 182, 212, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-text);
}

.rag-passage-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ═══ ONBOARDING QUESTIONNAIRE ═══ */
.onb-hint {
  font-size: 10.5px;
  color: var(--color-muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

.onb-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-muted);
  margin-bottom: 5px;
}

.onb-more-toggle {
  background: none;
  border: none;
  color: var(--accent-cyan);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}

.onb-chips {
  display: flex;
  gap: 8px;
}

.onb-chip {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--color-muted);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.onb-chip.active {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--accent-cyan);
  color: #fff;
}

.onb-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}

.onb-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.onb-switch span {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  transition: 0.3s;
}

.onb-switch span:before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}

.onb-switch input:checked+span {
  background: var(--accent-green);
}

.onb-switch input:checked+span:before {
  transform: translateX(18px);
}

/* ═══ DUE / MISTAKES QUEUE CARDS ═══ */
.queue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
}

.queue-icon {
  font-size: 20px;
  flex: 0 0 auto;
  width: 24px;
  text-align: center;
}

.queue-info {
  flex: 1;
}

.queue-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.queue-sub {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

.queue-go {
  color: var(--color-muted);
  font-size: 12px;
}

/* Friendly empty-state hint */
.empty-hint {
  font-size: 12px;
  color: var(--color-muted);
  text-align: center;
  padding: 10px 4px;
  line-height: 1.5;
}

/* ═══ DAILY GOAL CELEBRATION BANNER ═══ */
.goal-banner {
  position: absolute;
  top: 38%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  z-index: 2100;
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-pink));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  padding: 16px 26px;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5);
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.goal-banner.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.goal-banner i {
  margin-right: 8px;
}

.flashcard-deck,
#cardAnswerInputs {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

#queueCards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ═══ HANGAR PAPERWORK BATTLE MINI-GAME ═══ */
.pw-battle-container {
  background: #0b0f19;
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pw-battle-header {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.pw-battle-entity {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pw-hp-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.pw-hp-fill {
  height: 100%;
  background: var(--accent-green);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pw-hp-fill.boss {
  background: var(--accent-red);
}

.pw-battle-log {
  height: 90px;
  overflow-y: auto;
  background: #05070c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
  line-height: 1.4;
  scroll-behavior: smooth;
}

.pw-battle-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pw-battle-btn {
  padding: 10px 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pw-battle-btn:hover:not(:disabled) {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.pw-battle-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══ FAA FORM 337 PDF LAYOUT ═══ */
.pdf-form-container {
  border: 1.5px solid #0f172a;
  background: #ffffff;
  color: #0f172a;
  font-family: "Courier New", Courier, monospace;
}

.pdf-label {
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  color: #334155;
  margin-bottom: 2px;
  font-family: sans-serif;
}

.pdf-input {
  width: 100%;
  border: none;
  background: transparent;
  color: #000;
  font-size: 12px;
  font-weight: bold;
  font-family: monospace;
  padding: 2px 0;
}

.pdf-input:focus {
  outline: none;
  background: rgba(6, 182, 212, 0.08);
}
/* ── Verbatim school exam: answer-key disputes in the score report ── */
.key-disputes { width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(250, 204, 21, 0.06); border: 1px solid rgba(250, 204, 21, 0.3); }
.key-disputes h3 { font-size: 13px; font-weight: 700; color: var(--accent-yellow); margin: 0 0 4px; }
.key-disputes p { font-size: 11px; color: var(--color-muted); line-height: 1.45; margin: 0 0 8px; }
.key-dispute { padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.kd-q { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.kd-line { font-size: 11.5px; line-height: 1.45; margin-top: 2px; }
.kd-tag { display: inline-block; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; padding: 1px 6px; border-radius: 6px; margin-right: 4px; }
.kd-tag.school { background: rgba(249, 115, 22, 0.18); color: var(--accent-orange); }
.kd-tag.faa { background: rgba(16, 185, 129, 0.18); color: #34d399; }
.kd-you { color: var(--color-muted); }
.key-dispute-note { width: 100%; font-size: 11px; color: var(--color-muted); margin-top: 8px; }

.browse-atl-note { font-size: 11px; color: var(--color-muted); padding: 4px 4px 8px; line-height: 1.5; }
.browse-choice.faa { border-color: rgba(16, 185, 129, 0.25); }
.browse-choice.faa i { color: #34d399; opacity: 1; }

/* ── Browse: hands-free listening ── */
.listen-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass);
}
.listen-bar { position: sticky; top: 0; z-index: 20; background: rgba(8, 11, 16, 0.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.listen-bar.active { border-color: rgba(6, 182, 212, 0.5); background: rgba(6, 182, 212, 0.08); }
.listen-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.06); color: var(--color-text); cursor: pointer; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.listen-btn.main { width: 40px; height: 40px; font-size: 14px; border: none; color: #fff; background: linear-gradient(135deg, var(--accent-purple, #8b5cf6), var(--accent-pink, #ec4899)); }
.listen-label { flex: 1; font-size: 11px; color: var(--color-muted); font-family: var(--font-mono); white-space: nowrap; }
.browse-q.listening { outline: 2px solid rgba(6, 182, 212, 0.7); outline-offset: 1px; box-shadow: 0 0 18px rgba(6, 182, 212, 0.18); }

/* ── Previous tests + exam review ── */
.exam-hist-row.clickable { cursor: pointer; border-radius: 8px; }
.exam-hist-row.clickable:hover { background: rgba(255, 255, 255, 0.05); }
.exam-hist-go { font-size: 10px; color: var(--color-muted); margin-left: 6px; }
.exam-hist-hint { font-size: 10.5px; color: var(--color-muted); margin-top: 8px; }
.rv-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: -18px; z-index: 5; padding: 6px 0 10px; background: #080b10; }
.rv-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 12px; }
.rv-score { min-width: 76px; height: 76px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; border: 3px solid; }
.rv-score span { font-size: 9px; letter-spacing: 1px; font-weight: 700; }
.rv-score.pass { color: var(--accent-green); border-color: var(--accent-green); }
.rv-score.fail { color: #ef4444; border-color: #ef4444; }
.rv-title { font-size: 15px; font-weight: 700; }
.rv-sub { font-size: 11px; color: var(--color-muted); margin-top: 2px; line-height: 1.4; }
.rv-filters { margin-bottom: 10px; flex-wrap: wrap; }
.rv-q { padding: 10px 11px 2px; margin: 8px 0; border-left-width: 3px; }
.rv-q.ok { border-left-color: var(--accent-green); }
.rv-q.bad { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.05); }
.rv-q.skip { border-left-color: var(--accent-amber); }
.rv-qhead { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rv-qnum { font-size: 11px; font-weight: 700; font-family: var(--font-mono); color: var(--color-muted); }
.rv-tag { font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 8px; }
.rv-tag.ok { background: rgba(16, 185, 129, 0.16); color: var(--accent-green); }
.rv-tag.bad { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.rv-tag.skip { background: rgba(245, 158, 11, 0.16); color: var(--accent-amber); }
.rv-flag { color: var(--accent-amber); font-size: 11px; margin-left: auto; }
.rv-qtext { font-size: 12.5px; line-height: 1.5; margin-bottom: 8px; white-space: pre-line; }
.rv-you { font-size: 10px; font-weight: 700; margin-left: 4px; opacity: 0.9; }
.browse-choice.wrong { color: #f87171; font-weight: 700; background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.45); }
.browse-choice.wrong i { opacity: 1; font-size: 10px; }

/* ── Hangar Training Manual (docked reference in the Paperwork game) ── */
#paperworkOverlay { display: none; }
#paperworkOverlay > * { flex-shrink: 0; }
.pw-ref {
  border: 1px solid #94a3b8; background: #fff; color: #0b3d91; border-radius: 6px;
  width: 22px; height: 20px; font-size: 10px; cursor: pointer; padding: 0; margin-left: 4px; vertical-align: middle;
}
.pw-ref:hover { background: #dbeafe; }
.pw-manual {
  position: sticky; bottom: -20px; z-index: 30; margin: 16px auto 0; width: 100%; max-width: 600px; margin-top: auto;
  border-radius: 14px 14px 0 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0f172a; box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
}
.pwm-bar {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 11px 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #1e3a8a, #0f172a); color: #fff; font-size: 13px; font-weight: 700; text-align: left;
}
.pwm-bar-hint { flex: 1; font-size: 10.5px; font-weight: 500; color: #93c5fd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pwm-tabs, .pwm-body { display: none; }
.pw-manual.open .pwm-tabs { display: flex; }
.pw-manual.open .pwm-body { display: block; }
.pwm-tabs { gap: 6px; padding: 8px 10px; overflow-x: auto; background: #111c33; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.pwm-tab {
  flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, 0.16); background: transparent; color: #cbd5e1;
  border-radius: 14px; padding: 5px 10px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pwm-tab.active { background: #2563eb; border-color: #2563eb; color: #fff; }
.pwm-tab.mine:not(.active) { border-color: #f59e0b; color: #fbbf24; }
.pwm-body {
  max-height: 34vh; overflow-y: auto; padding: 12px 14px 18px; background: #faf8f1; color: #1f2937;
  font-size: 12.5px; line-height: 1.55; -webkit-overflow-scrolling: touch;
}
.pwm-body h3 { font-size: 15px; color: #0b3d91; margin: 2px 0 8px; }
.pwm-body h4 { font-size: 12.5px; color: #0b3d91; margin: 14px 0 6px; border-bottom: 1px solid #d6d3c4; padding-bottom: 3px; }
.pwm-body p { margin: 6px 0; }
.pwm-body a { color: #1d4ed8; text-decoration: underline; }
.pwm-note, .pwm-warn, .pwm-caution { border-left: 4px solid; padding: 7px 10px; margin: 8px 0; border-radius: 4px; font-size: 11.5px; }
.pwm-note { background: #e0ecff; border-color: #2563eb; }
.pwm-warn { background: #fee2e2; border-color: #dc2626; }
.pwm-caution { background: #fef3c7; border-color: #d97706; }
.pwm-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 11.5px; background: #fff; }
.pwm-table th, .pwm-table td { border: 1px solid #d6d3c4; padding: 5px 7px; vertical-align: top; text-align: left; }
.pwm-table th { background: #e7e3d3; }
.pwm-table tr.pwm-hl td { background: #fef9c3; }
.pwm-steps, .pwm-list { margin: 6px 0 6px 18px; padding: 0; }
.pwm-steps li, .pwm-list li { margin: 4px 0; }
.pwm-fig { margin: 12px 0; background: #fff; border: 1px solid #d6d3c4; border-radius: 8px; overflow: auto; cursor: zoom-in; }
.pwm-fig img, .pwm-fig svg { display: block; width: 100%; height: auto; }
.pwm-fig.zoom img { width: 220%; max-width: none; }
.pwm-fig figcaption { font-size: 10.5px; padding: 5px 8px; background: #f1efe3; color: #374151; }
.pwm-fig figcaption span { color: #6b7280; }
.pwm-fig.svg { cursor: default; }
.pwm-job { margin: 10px 0 16px; }
.pwm-plate { background: linear-gradient(135deg, #cbd5e1, #94a3b8); border: 2px solid #475569; border-radius: 8px; padding: 9px 12px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35); }
.pwm-plate-h { font-size: 9.5px; letter-spacing: 0.6px; font-weight: 800; color: #1e293b; }
.pwm-plate-reg { font-family: var(--font-mono, monospace); font-size: 24px; font-weight: 900; color: #0f172a; margin: 2px 0 4px; letter-spacing: 1px; }
.pwm-kv { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.pwm-kv th { text-align: left; width: 40%; color: #334155; font-weight: 600; padding: 2px 0; }
.pwm-kv td { font-weight: 700; color: #0f172a; padding: 2px 0; }
.pwm-wo { background: #fff; border: 1px dashed #94a3b8; border-radius: 6px; padding: 7px 10px; margin-top: 6px; }
.pwm-wo p { margin: 3px 0 0; }
.pw-manual[data-job="rivet"] .pwm-job[data-job="cylinder"],
.pw-manual[data-job="cylinder"] .pwm-job[data-job="rivet"] { opacity: 0.45; }
.pwm-calc { background: #fff; border: 1px solid #d6d3c4; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.pwm-calc small { display: block; color: #6b7280; margin-top: 4px; font-size: 10.5px; }
.pwm-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pwm-row input { width: 92px; padding: 5px 6px; border: 1px solid #94a3b8; border-radius: 5px; font-size: 12px; background: #fff; color: #0f172a; }
.pwm-row label { display: flex; flex-direction: column; font-size: 10px; font-weight: 700; gap: 2px; }
.pwm-out { margin-top: 6px; font-weight: 800; color: #0b3d91; }
.pwm-sample { background: #fff; border: 1px solid #94a3b8; border-left: 4px solid #0b3d91; padding: 8px 10px; font-family: var(--font-mono, monospace); font-size: 11px; line-height: 1.5; }

.pw-manual.tall .pwm-body { max-height: 72vh; }
.pwm-tab.size { padding: 5px 9px; }

/* ── Hangar Walk (top-down pixel hangar) ── */
.hg-wrap { display: flex; flex-direction: column; gap: 8px; }
.hg-top { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.hg-link { background: none; border: none; color: var(--accent-cyan); font-size: 11px; cursor: pointer; text-decoration: underline; padding: 2px 4px; }
.hg-screen { position: relative; width: 100%; aspect-ratio: 3 / 2; background: #0b1220; border: 4px solid #1f2937; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 2px #475569, 0 10px 24px rgba(0, 0, 0, 0.5); user-select: none; -webkit-user-select: none; }
.hg-screen canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.hg-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: linear-gradient(#000a, #0000); font-family: ui-monospace, "Courier New", monospace; font-size: 10px; font-weight: 800; color: #fff; pointer-events: none; }
.hg-hp { display: flex; align-items: center; gap: 6px; }
.hg-hp-track { width: 74px; height: 8px; background: #1f2937; border: 1px solid #000; border-radius: 4px; overflow: hidden; }
#hgHpFill { height: 100%; background: #22c55e; transition: width 0.25s; }
#hgHpFill.mid { background: #eab308; } #hgHpFill.low { background: #ef4444; }
.hg-tasknum { background: #000a; border: 1px solid #fff3; border-radius: 6px; padding: 2px 6px; }
.hg-dialog { position: absolute; left: 6px; right: 6px; bottom: 6px; max-height: 94%; overflow-y: auto; background: #f8fafc; color: #111827; border: 3px solid #1f2937; border-radius: 10px; padding: 8px 10px 10px; font-family: ui-monospace, "Courier New", monospace; font-weight: 700; font-size: 12.5px; line-height: 1.4; box-shadow: 0 0 0 2px #fff, 0 6px 14px rgba(0, 0, 0, 0.5); cursor: pointer; }
.hg-dlg-text { min-height: 34px; white-space: pre-line; }
.hg-next { position: absolute; right: 10px; bottom: 4px; animation: hgBlink 0.8s steps(2) infinite; color: #1d4ed8; font-size: 12px; }
@keyframes hgBlink { 50% { opacity: 0; } }
.hg-choices { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.hg-choices:empty { display: none; }
.hg-choice { display: flex; align-items: center; gap: 8px; text-align: left; background: #fff; color: #111827; border: 2px solid #1f2937; border-radius: 8px; padding: 7px 9px; font: inherit; cursor: pointer; }
.hg-choice:hover, .hg-choice:focus { background: #dbeafe; border-color: #2563eb; outline: none; }
.hg-choice .n { width: 20px; height: 20px; border-radius: 50%; background: #1f2937; color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.hg-choice .ic { font-size: 20px; flex: 0 0 auto; }
.hg-game { position: absolute; inset: 0; background: rgba(11, 18, 32, 0.97); color: #fff; display: flex; flex-direction: column; padding: 10px 12px; gap: 8px; font-family: ui-monospace, "Courier New", monospace; }
.hgg-title { font-size: 12px; font-weight: 800; color: #facc15; text-align: center; letter-spacing: 0.4px; }
.hgg-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 0; }
.hgg-foot { display: flex; justify-content: center; align-items: center; min-height: 34px; }
.hgg-result { font-weight: 800; font-size: 12px; padding: 6px 10px; border-radius: 8px; text-align: center; }
.hgg-result.ok { background: #14532d; color: #bbf7d0; } .hgg-result.bad { background: #7f1d1d; color: #fecaca; }
.hg-btn { background: linear-gradient(135deg, #f59e0b, #ef4444); color: #fff; border: 2px solid #fff3; border-radius: 10px; padding: 8px 16px; font: 800 12px ui-monospace, monospace; cursor: pointer; }
.m-dmg { position: relative; height: 36px; background: #1f2937; border-radius: 6px; overflow: hidden; }
.m-patch { position: absolute; left: 0; top: 0; height: 100%; background: repeating-linear-gradient(45deg, #7f1d1d, #7f1d1d 6px, #991b1b 6px, #991b1b 12px); display: flex; align-items: center; justify-content: flex-end; font-size: 9px; padding-right: 4px; color: #fecaca; }
.m-bar { position: absolute; left: 0; top: 0; height: 100%; width: 20%; background: rgba(250, 204, 21, 0.18); border-right: 3px solid #facc15; }
.m-range { width: 100%; accent-color: #facc15; }
.m-read { text-align: center; font-size: 20px; font-weight: 800; color: #fff; }
.st-track { position: relative; height: 44px; background: #1f2937; border-radius: 8px; overflow: hidden; }
.st-zone { position: absolute; top: 0; bottom: 0; background: rgba(34, 197, 94, 0.45); border-left: 2px solid #22c55e; border-right: 2px solid #22c55e; }
.st-bit { position: absolute; top: 8px; transform: translateX(-50%); font-size: 24px; filter: grayscale(0.4); } .st-bit.good { filter: none; }
.st-prog { height: 8px; background: #334155; border-radius: 4px; overflow: hidden; } .st-prog.big { height: 16px; }
#stFill, #scFill, #ptFill, #sqFill { height: 100%; width: 0; background: #38bdf8; } #scFill { background: #f97316; }
.st-hint { text-align: center; font-size: 10px; color: #94a3b8; }
.sc-stage { height: 70px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #1f2937; border-radius: 8px; }
.sc-tool { transition: transform 0.05s; }
.pt-grid { display: grid; gap: 3px; height: 96px; touch-action: none; }
.pt-cell { background: repeating-linear-gradient(135deg, #9ca3af, #9ca3af 4px, #b6bcc6 4px, #b6bcc6 8px); border-radius: 4px; }
.pt-cell.on { background: #a3e635; }
#rhC { width: 100%; max-width: 280px; margin: 0 auto; display: block; border-radius: 8px; image-rendering: auto; }
.sq-flange { position: relative; width: 220px; max-width: 100%; height: 104px; margin: 0 auto; background: #475569; border-radius: 22px; border: 2px solid #94a3b8; }
.sq-cyl { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 70px; height: 44px; border-radius: 50%; background: #94a3b8; color: #0f172a; font-size: 9px; display: flex; align-items: center; justify-content: center; }
.sq-nut { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 6px; background: #fef3c7; color: #7c2d12; border: 2px solid #b45309; font: 800 12px ui-monospace, monospace; cursor: pointer; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); border-radius: 0; }
.sq-nut.done { background: #4ade80; border-color: #166534; color: #052e16; } .sq-nut.shake { animation: hgShake 0.3s; }
@keyframes hgShake { 25% { transform: translate(-60%, -50%); } 75% { transform: translate(-40%, -50%); } }
.nd-scale { position: relative; height: 28px; background: #1f2937; border-radius: 8px; margin-top: 10px; }
.nd-zone { position: absolute; top: 0; bottom: 0; background: rgba(34, 197, 94, 0.65); border-left: 2px solid #86efac; border-right: 2px solid #86efac; }
.nd-needle { position: absolute; top: -6px; bottom: -6px; width: 4px; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff; transform: translateX(-50%); }
.nd-ends { display: flex; justify-content: space-between; font-size: 9px; color: #94a3b8; }
.hg-over { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.82); display: flex; align-items: center; justify-content: center; padding: 14px; }
.hg-over-card { background: #fff; color: #111827; border: 4px solid #dc2626; border-radius: 12px; padding: 14px; text-align: center; font-family: ui-monospace, monospace; }
.hg-over-card h3 { color: #dc2626; margin: 0 0 6px; font-size: 18px; } .hg-over-card p { font-size: 12px; margin: 0 0 10px; }
.hg-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 6px; }
.hg-dpad { display: grid; grid-template-columns: 46px 46px 46px; grid-template-rows: 46px 46px 46px; grid-template-areas: ". u ." "l . r" ". d ."; gap: 2px; touch-action: none; }
.hg-dpad button { background: #374151; color: #e5e7eb; border: 2px solid #111827; border-radius: 8px; font-size: 16px; touch-action: none; cursor: pointer; }
.hg-dpad button:active { background: #6b7280; }
.hg-help { flex: 1; font-size: 10px; color: var(--color-muted); text-align: center; line-height: 1.5; }
.hg-actions { display: flex; gap: 10px; align-items: flex-end; touch-action: none; }
.hg-ab { width: 58px; height: 58px; border-radius: 50%; border: 3px solid #111827; font: 800 18px ui-monospace, monospace; color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; touch-action: none; box-shadow: 0 3px 0 #111827; }
.hg-ab small { font-size: 8px; font-weight: 600; opacity: 0.85; }
.hg-ab.a { background: #dc2626; } .hg-ab.b { background: #2563eb; width: 48px; height: 48px; margin-bottom: 10px; }
.hg-ab:active { transform: translateY(2px); box-shadow: 0 1px 0 #111827; }
.hg-tasks { margin: 0; padding: 8px 10px 8px 26px; font-size: 11px; line-height: 1.6; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border-glass); border-radius: 10px; list-style: none; padding-left: 12px; }
.hg-tasks li { color: var(--color-muted); } .hg-tasks li.done { color: var(--accent-green); } .hg-tasks li.now { color: #facc15; font-weight: 700; } .hg-tasks small { color: var(--color-muted); font-weight: 400; }
.hg-game[hidden], .hg-over[hidden], .hg-dialog[hidden], .hg-next[hidden] { display: none !important; }

.hg-notes { background: #fef9c3; border: 2px solid #ca8a04; border-radius: 8px; padding: 5px 8px; margin-bottom: 6px; font-size: 11px; line-height: 1.4; font-weight: 600; }
.hg-plate { background: linear-gradient(135deg, #cbd5e1, #94a3b8); border: 2px solid #475569; border-radius: 8px; padding: 5px 9px; margin-bottom: 6px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4); }
.hg-plate-h { font-size: 8.5px; letter-spacing: 0.6px; font-weight: 800; color: #1e293b; }
.hg-plate-reg { font-size: 20px; font-weight: 900; letter-spacing: 1.5px; color: #0f172a; line-height: 1.2; }
.hg-plate-row { display: flex; justify-content: space-between; font-size: 10.5px; color: #334155; } .hg-plate-row b { color: #0f172a; }
.hg-q { font-weight: 800; }
.hg-plate-row { display: inline-flex; gap: 5px; margin-right: 12px; } .hg-plate-row span::after { content: ':'; }
.hg-plate { padding: 4px 8px; margin-bottom: 4px; } .hg-plate-reg { font-size: 17px; line-height: 1.1; }
.hg-dialog .hg-choices { gap: 3px; margin-top: 4px; } .hg-dialog .hg-choice { padding: 4px 8px; font-size: 11.5px; }
.hg-dialog { padding: 6px 8px 8px; font-size: 11.5px; } .hg-notes { padding: 3px 7px; margin-bottom: 4px; font-size: 10.5px; }
@media (min-width: 560px) { .hg-dialog .hg-choice { padding: 7px 10px; font-size: 12.5px; } .hg-dialog { font-size: 12.5px; } .hg-plate-reg { font-size: 20px; } }

/* Data plates that look like the real thing: brushed aluminum, corner rivets, stamped lettering */
.hg-plate, .pwm-plate {
  position: relative;
  background:
    radial-gradient(circle at 7px 7px, #6b7280 0 2.2px, #e5e7eb 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at calc(100% - 7px) 7px, #6b7280 0 2.2px, #e5e7eb 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at 7px calc(100% - 7px), #6b7280 0 2.2px, #e5e7eb 2.6px 3.4px, transparent 3.8px),
    radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #6b7280 0 2.2px, #e5e7eb 2.6px 3.4px, transparent 3.8px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 1px, rgba(0,0,0,0.05) 1px 3px),
    linear-gradient(135deg, #d4d9e0 0%, #aab2bd 45%, #cdd3db 100%);
  border: 1px solid #6b7280; border-radius: 5px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.45), inset 0 0 0 3px rgba(0,0,0,0.18), 0 2px 5px rgba(0,0,0,0.45);
}
.hg-plate { padding: 5px 18px 5px 18px; }
.hg-plate-h, .hg-plate-reg, .hg-plate-row, .pwm-plate-h, .pwm-plate-reg, .pwm-kv th, .pwm-kv td {
  font-family: "Courier New", ui-monospace, monospace; color: #1f2937; text-shadow: 0 1px 0 rgba(255,255,255,0.65), 0 -1px 0 rgba(0,0,0,0.12);
}
.hg-plate-h { font-size: 8px; margin: 0; text-align: center; letter-spacing: 1.4px; }
.hg-plate-reg { font-size: 16px; text-align: center; letter-spacing: 3px; border-top: 1px solid rgba(0,0,0,0.25); border-bottom: 1px solid rgba(255,255,255,0.6); margin: 1px 0 2px; }
.hg-plate-row { font-size: 10px; margin-right: 10px; } .hg-plate-row b { font-weight: 900; }
.hg-plate-rows { text-align: center; }
.pwm-plate { padding: 10px 22px; } .pwm-plate-h { text-align: center; letter-spacing: 1.4px; } .pwm-plate-reg { text-align: center; letter-spacing: 3px; }
.hg-dialog .hg-choice { padding: 3px 8px; }

/* ── Full window / fullscreen ── */
.hg-top-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.hg-stage { width: 100%; }
html.hg-noscroll, html.hg-noscroll body { overflow: hidden !important; }
.hg-wrap.full {
  position: fixed; inset: 0; z-index: 6000; background: #05080f; gap: 6px; overflow: hidden;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  display: flex; flex-direction: column; color: #fff;
}
.hg-wrap.full .hg-top { flex: 0 0 auto; }
.hg-wrap.full .hg-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.hg-wrap.full .hg-screen { aspect-ratio: auto; flex: 0 0 auto; }
.hg-wrap.full .hg-tasks { display: none; }
.hg-wrap.full .hg-controls { flex: 0 0 auto; }
.hg-wrap.full .hg-help { font-size: 10px; }
.hg-wrap.full .pw-manual { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 680px; z-index: 40; }
.hg-wrap.full .pwm-body { max-height: 42vh; }
.hg-wrap.full .hg-dialog { font-size: clamp(11px, 1.7vw, 17px); } .hg-wrap.full .hg-dialog .hg-choice { font-size: clamp(11px, 1.6vw, 16px); padding: clamp(3px, 0.7vw, 9px) 10px; }
/* landscape phones / short windows: the pad and buttons float over the screen like a handheld */
@media (orientation: landscape) and (max-height: 560px) {
  .hg-wrap.full .hg-top { position: absolute; top: 6px; right: 8px; z-index: 12; background: #000a; border-radius: 8px; padding: 2px 8px; }
  .hg-wrap.full .hg-top b { display: none; }
  .hg-wrap.full .hg-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 12; pointer-events: none; padding: 0 14px 10px; align-items: flex-end; }
  .hg-wrap.full .hg-dpad, .hg-wrap.full .hg-actions { pointer-events: auto; opacity: 0.8; }
  .hg-wrap.full .hg-help { display: none; }
  .hg-wrap.full { padding-top: 0; padding-bottom: 0; }
}

/* ── Cooking-Mama mini-games ── */
.hgg-svg { width: 100%; height: 100%; max-height: 100%; display: block; }
.hgg-body { position: relative; }
.hgg-row { display: flex; gap: 8px; height: 100%; min-height: 0; } .hgg-row > svg { flex: 1 1 52%; min-width: 0; }
.hgg-tip { font-size: 10.5px; color: #cbd5e1; text-align: center; } .hgg-tip b { color: #facc15; }
.hgg-intro { position: absolute; inset: 0; z-index: 5; background: rgba(11,18,32,0.94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; text-align: center; }
.hgg-how { font-size: 13px; color: #e5e7eb; max-width: 90%; line-height: 1.4; }
.hgg-ready { font: 900 30px ui-monospace, monospace; color: #facc15; text-shadow: 0 3px 0 #92400e; animation: hgPop .35s; } .hgg-ready.go { color: #4ade80; text-shadow: 0 3px 0 #14532d; }
@keyframes hgPop { from { transform: scale(.4); opacity: 0; } }
.hgg-grade-card { position: absolute; inset: 0; z-index: 6; background: rgba(11,18,32,0.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; animation: hgPop .3s; }
.hgg-grade { font: 900 30px ui-monospace, monospace; } .hgg-grade.perfect { color: #facc15; text-shadow: 0 0 12px #f59e0b; } .hgg-grade.great { color: #4ade80; } .hgg-grade.ok { color: #38bdf8; } .hgg-grade.fail { color: #f87171; }
.hgg-msg { font-size: 12px; color: #e5e7eb; max-width: 92%; } .hgg-mo { font-size: 11px; color: #fde68a; background: #0008; border-radius: 10px; padding: 5px 10px; }
.tab { flex: 0 0 46%; min-width: 0; background: #111827; border: 3px solid #374151; border-radius: 12px; padding: 5px; display: flex; flex-direction: column; gap: 4px; }
.tab-scr { background: #e0f2fe; color: #0f172a; border-radius: 6px; padding: 4px 6px; font: 700 10px ui-monospace, monospace; }
.tab-h { font-size: 9px; color: #0369a1; margin-bottom: 2px; }
.tab-row { display: flex; gap: 5px; align-items: center; padding: 1px 3px; border-radius: 4px; cursor: pointer; } .tab-row.sel { background: #fef08a; }
.tab-val { min-width: 30px; text-align: center; border-bottom: 1px solid #0f172a; } .tab-unit { color: #475569; font-size: 9px; }
.tab-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; flex: 1; }
.tab-k { background: #374151; color: #fff; border: 1px solid #111827; border-radius: 5px; font: 800 12px ui-monospace, monospace; min-height: 20px; cursor: pointer; } .tab-k.ok { background: #16a34a; }
.pt-wrap { position: relative; } .pt-brush { position: absolute; pointer-events: none; transform: translate(-30%, -90%); opacity: 0; }
.sq-flange { overflow: visible; }
.sq-sock { position: absolute; pointer-events: none; transform: translate(-50%, -50%); opacity: 0; } .sq-sock.turn { animation: hgSock .4s; }
@keyframes hgSock { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(0); } 100% { opacity: 0; transform: translate(-50%,-50%) rotate(-90deg); } }

/* ── Hard mode, failure animations, roll-cab, click wrench ── */
.hg-game.hard .hgg-tip { visibility: hidden; }
.hg-wrap.hard #hgBtnRails { color: #f87171; font-weight: 800; }
.hg-tasks li.wo { color: #94a3b8; font-size: 11px; list-style: none; }
.hg-fail { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(127,29,29,.62); animation: hgFailIn .3s; pointer-events: none; }
.hg-fail-art { width: 46%; max-height: 58%; overflow: visible; }
.hg-fail-art g { transform-box: fill-box; transform-origin: center; }
.hg-fail-t { font: 900 clamp(18px, 5vw, 34px) ui-monospace, monospace; color: #fff; text-shadow: 0 3px 0 #7f1d1d, 0 0 12px #ef4444; animation: hgPop .35s; }
@keyframes hgFailIn { 0% { background: rgba(255,255,255,.9); } 100% { background: rgba(127,29,29,.62); } }
.hg-shake { animation: hgShake .42s; }
@keyframes hgShake { 0%,100% { transform: translate(0,0); } 20% { transform: translate(-5px,2px); } 40% { transform: translate(5px,-2px); } 60% { transform: translate(-4px,-1px); } 80% { transform: translate(3px,1px); } }
.fx-spin { animation: hgSpin .12s linear infinite; } @keyframes hgSpin { to { transform: rotate(360deg); } }
.fx-fly { animation: hgFly 1.2s ease-out forwards; } @keyframes hgFly { to { transform: translate(40px,-50px) rotate(200deg); opacity: .25; } }
.fx-left { animation: hgSplitL 1s ease-out forwards; } @keyframes hgSplitL { to { transform: translate(-24px,8px) rotate(-25deg); } }
.fx-right { animation: hgSplitR 1s ease-out forwards; } @keyframes hgSplitR { to { transform: translate(24px,8px) rotate(25deg); } }
.hg-fail-art .fx-fall { transform-origin: center bottom; animation: hgFall .8s ease-in forwards; } @keyframes hgFall { 55% { transform: translateY(16px); } 100% { transform: translateY(16px) rotate(70deg); } }
.fx-tilt { animation: hgTilt .5s ease-out forwards; } @keyframes hgTilt { to { transform: rotate(-14deg) translateY(4px); } }
.cw-btn { cursor: pointer; }
.oil-wrap { height: 100%; }
.tb { display: flex; gap: 8px; height: 100%; min-height: 0; }
.tb-cab { flex: 1 1 64%; min-width: 0; background: linear-gradient(#b91c1c, #7f1d1d); border: 2px solid #450a0a; border-radius: 6px; padding: 3px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.tb-top { font: 900 8px Arial, sans-serif; color: #fecaca; letter-spacing: 1px; text-align: center; } .tb-top span { color: #fff; }
.tb-front { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 6px; background: linear-gradient(#dc2626, #b91c1c); border: 1px solid #7f1d1d; border-radius: 3px; padding: 1px 6px; color: #fff; font: 800 8.5px ui-monospace, monospace; cursor: pointer; min-height: 15px; }
.tb-handle { width: 38%; height: 4px; border-radius: 2px; background: linear-gradient(#f8fafc, #94a3b8); box-shadow: 0 1px 0 #0006; }
.tb-dr.open .tb-front { background: linear-gradient(#ef4444, #dc2626); box-shadow: 0 3px 6px #0008; }
.tb-tray { display: none; gap: 3px; padding: 3px; background: #111827; border-radius: 0 0 4px 4px; overflow-x: auto; }
.tb-dr.open .tb-tray { display: flex; animation: tbOut .2s ease-out; }
@keyframes tbOut { from { transform: translateY(-6px); opacity: .3; } }
.tb-tool { flex: 0 0 auto; width: 52px; display: flex; flex-direction: column; align-items: center; gap: 1px; background: none; border: 2px solid transparent; border-radius: 6px; color: #e5e7eb; cursor: pointer; padding: 1px; }
.tb-foam { background: #1f2937; box-shadow: inset 0 2px 6px #000; border-radius: 6px; display: flex; padding: 1px; }
.tb-foam svg { width: 30px; height: 30px; }
.tb-tool small { font-size: 7px; line-height: 1.05; text-align: center; }
.tb-tool.foc { border-color: #facc15; }
.tb-tool.taken .tb-foam svg { opacity: .2; filter: brightness(0); }
.tb-side { flex: 1 1 36%; display: flex; flex-direction: column; gap: 5px; font-size: 10px; min-width: 0; overflow-y: auto; }
.tb-task { background: #f8fafc; color: #0f172a; border-radius: 6px; padding: 4px 5px; font-size: 9.5px; line-height: 1.3; }
.tb-need div { color: #cbd5e1; } .tb-need .ok { color: #4ade80; }
.tb-msg { font-size: 9.5px; line-height: 1.3; } .tb-msg.ok { color: #86efac; } .tb-msg.bad { color: #fca5a5; }

/* ── Paperwork: fix it, don't redo it (frustrated Chief Mo) ── */
.pw-bad { outline: 2px solid #ef4444 !important; outline-offset: 1px; background: #fee2e2 !important; }
label.pw-bad { border-radius: 4px; }
.pw-chief { display: flex; gap: 10px; align-items: flex-start; background: #fff7ed; border: 2px solid #ef4444; border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; color: #0f172a; font-family: sans-serif; }
.pw-chief-face { flex: 0 0 64px; width: 64px; height: 64px; overflow: visible; }
.pw-chief.go .pw-head { animation: pwHeadShake .5s ease-in-out 2; transform-box: fill-box; transform-origin: center bottom; }
.pw-chief.go { animation: pwStomp .35s; }
.pw-flush { opacity: 0; } .pw-chief.mad2 .pw-flush { opacity: .25; } .pw-chief.mad3 .pw-flush { opacity: .45; animation: pwFlush 1s ease-in-out infinite alternate; }
.pw-steam path { stroke: #94a3b8; stroke-width: 3; fill: none; stroke-linecap: round; opacity: 0; }
.pw-chief.go .pw-steam path { animation: pwSteam 1.1s ease-out infinite; }
.pw-chief.go .pw-steam path:nth-child(2) { animation-delay: .3s; } .pw-chief.go .pw-steam path:nth-child(3) { animation-delay: .6s; }
.pw-chief.mad1 .pw-steam path:nth-child(1), .pw-chief.mad1 .pw-steam path:nth-child(3) { display: none; }
.pw-chief-bubble { flex: 1; min-width: 0; font-size: 12px; line-height: 1.4; }
.pw-chief-say span { color: #475569; }
.pw-chief-tag { display: inline-block; margin: 4px 0; background: #ef4444; color: #fff; font-weight: 800; font-size: 10px; letter-spacing: .5px; padding: 1px 7px; border-radius: 4px; transform: rotate(-2deg); }
.pw-chief ul { margin: 2px 0 0; padding-left: 18px; } .pw-chief li { margin-top: 3px; }
@keyframes pwHeadShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes pwStomp { 0% { transform: translateY(-6px); } 60% { transform: translateY(2px); } 100% { transform: translateY(0); } }
@keyframes pwSteam { 0% { opacity: 0; transform: translateY(6px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes pwFlush { from { opacity: .3; } to { opacity: .55; } }

/* full window: the manual is a row under the game (it used to float over the dialogue box) */
.hg-wrap.full .pw-manual { position: relative; left: auto; right: auto; bottom: auto; flex: 0 0 auto; width: 100%; max-width: 760px; margin: 0 auto; z-index: 2; }
.hg-wrap.full .pwm-body { max-height: 34vh; }
.hg-wrap.full .hg-dialog { z-index: 20; }
@media (orientation: landscape) and (max-height: 560px) {
  .hg-wrap.full .hg-dialog { left: 21%; right: 21%; bottom: 4px; max-height: 70%; }
  .hg-wrap.full .pwm-body { max-height: 45vh; }
}
.hg-wrap.full { display: flex !important; }   /* applyMode() sets an inline display:block */
@media (orientation: landscape) and (max-height: 560px) {
  .hg-wrap.full .hg-top { left: 6px; right: auto; max-width: 19%; }
  .hg-wrap.full .hg-top-btns { flex-direction: column; align-items: flex-start; gap: 3px; }
  .hg-wrap.full .hg-controls { bottom: 42px; }
}

/* ── Shop radio ── */
#hgBtnRadio.on { color: #4ade80; font-weight: 800; }
.hg-radio { position: relative; z-index: 25; background: #0f172a; border: 1px solid #334155; border-radius: 10px; padding: 8px; margin: 4px 0 6px; color: #e5e7eb; font-size: 12px; }
.hg-radio[hidden] { display: none !important; }
.hg-wrap.full .hg-radio { position: absolute; top: 34px; right: 8px; width: min(360px, 92vw); box-shadow: 0 8px 24px #000a; }
.hr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.hr-x { background: none; border: none; color: #94a3b8; font-size: 14px; cursor: pointer; }
.hr-genres { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.hr-g { background: #1e293b; color: #e5e7eb; border: 1px solid #334155; border-radius: 999px; padding: 3px 9px; font-size: 11px; cursor: pointer; }
.hr-g.sel { background: #16a34a; border-color: #16a34a; color: #fff; }
.hr-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hr-b { background: #1e293b; color: #fff; border: 1px solid #334155; border-radius: 8px; width: 34px; height: 30px; cursor: pointer; font-size: 14px; } .hr-b:disabled { opacity: .35; }
#hgRadioVol { width: 90px; }
.hr-now { flex: 1 1 120px; min-width: 0; font-size: 11px; color: #a7f3d0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-note { margin-top: 6px; font-size: 10px; color: #94a3b8; } .hr-note a { color: #93c5fd; }

/* controller focus */
.tab-k.pf { outline: 3px solid #facc15; outline-offset: -1px; }
.pt-cell.kc { outline: 3px dashed #facc15; outline-offset: -3px; }
.hg-choice:focus { outline: 3px solid #facc15; }
.hg-toast { position: absolute; left: 50%; top: 34px; transform: translateX(-50%); z-index: 40; background: #0f172aee; color: #e5e7eb; border: 1px solid #475569; border-radius: 999px; padding: 5px 12px; font-size: 11px; white-space: nowrap; animation: hgPop .3s; pointer-events: none; }

/* ── Hangar Walk featured on Home ── */
.hgf { display: flex; gap: 12px; align-items: stretch; margin: 12px 0; padding: 12px; border-radius: 16px; border: 1px solid rgba(250,204,21,0.35);
  background: radial-gradient(circle at 15% 20%, rgba(250,204,21,0.16), transparent 55%), linear-gradient(135deg, #1e3a8a 0%, #0f172a 70%); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.hgf-art { flex: 0 0 34%; max-width: 170px; min-height: 120px; border-radius: 12px; background: linear-gradient(#a9bad0, #8ea2bd 60%, #64748b); }
.hgf-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hgf-kick { font-size: 10px; font-weight: 800; letter-spacing: .6px; color: #fde68a; }
.hgf-title { font-size: 20px; font-weight: 900; color: #fff; line-height: 1.1; }
.hgf-desc { font-size: 12px; color: #cbd5e1; line-height: 1.35; }
.hgf-go { align-self: flex-start; display: flex; gap: 6px; align-items: center; background: #facc15; color: #111827; border: none; border-radius: 10px; padding: 8px 12px; font-weight: 800; font-size: 12.5px; cursor: pointer; box-shadow: 0 3px 0 #a16207; }
.hgf-go small { font-weight: 600; opacity: .75; }
.hgf-jobs { display: flex; flex-direction: column; gap: 5px; }
.hgf-job { display: flex; align-items: center; gap: 8px; text-align: left; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; padding: 6px 9px; color: #fff; cursor: pointer; }
.hgf-job:hover { background: rgba(255,255,255,0.13); }
.hgf-job b { display: block; font-size: 12.5px; } .hgf-job small { display: block; font-size: 10.5px; color: #94a3b8; }
.hgf-ic { font-size: 18px; } .hgf-st { margin-left: auto; color: #facc15; font-size: 12px; white-space: nowrap; } .hgf-st i { color: #475569; font-style: normal; }
.hgf-foot { font-size: 10px; color: #94a3b8; }
@media (max-width: 420px) { .hgf-art { flex-basis: 30%; min-height: 100px; } .hgf-title { font-size: 18px; } }
.study-mode-card.smc-featured { border-color: rgba(250,204,21,0.45); background: linear-gradient(135deg, rgba(30,58,138,0.55), rgba(15,23,42,0.6)); }
.nav-item.nav-hangar i { color: #facc15; }
@media (max-width: 520px) {
  .hgf { flex-direction: column; }
  .hgf-art { flex: 0 0 auto; width: 100%; max-width: none; height: 118px; min-height: 0; }
  .hgf-go { align-self: stretch; justify-content: center; }
}

/* onboarding / AI-setup choices: make the picked one unmistakable */
.goal-option { position: relative; }
.goal-option.active { background: rgba(6,182,212,0.16); border-color: var(--accent-cyan); box-shadow: 0 0 0 2px rgba(6,182,212,0.35) inset; }
.goal-option.active::after { content: '✓'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; background: var(--accent-cyan); color: #0f172a; font-weight: 900; font-size: 13px; display: flex; align-items: center; justify-content: center; }
