/* ==========================================================================
   B2R LEARNING — FUTURISTIC ENTERPRISE AI PLATFORM STYLESHEET
   Aesthetics: Deep Cyber-Obsidian, Neon Cyan, Electric Violet, Emerald Matrix
   ========================================================================== */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0c1019;
  --bg-tertiary: #131926;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(26, 35, 56, 0.85);
  --bg-glass: rgba(15, 21, 35, 0.65);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 242, 254, 0.3);
  --border-card: rgba(100, 140, 255, 0.15);

  --cyan: #00f2fe;
  --cyan-glow: rgba(0, 242, 254, 0.4);
  --blue: #4facfe;
  --purple: #8a2be2;
  --violet: #9b51e0;
  --pink: #ff007f;
  --emerald: #00f5a0;
  --amber: #ff9f43;
  --red: #ff4757;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #8391a7;
  --text-bright: #ffffff;
  --text-body: #cbd5e1;
  --code-text: #38bdf8;
  --info-text: #bae6fd;
  --quote-text: #fef08a;

  --bg-code: #090e17;
  --bg-chip: #1a2234;
  --bg-track: #111827;
  --bg-slider: #1e293b;
  --bg-nav: rgba(7, 9, 14, 0.82);
  --bg-overlay: rgba(4, 6, 10, 0.94);
  --bg-hero-badge: rgba(13, 21, 38, 0.7);
  --bg-pill: rgba(255, 255, 255, 0.04);
  --bg-hud: #140d05;
  --btn-primary-bg: linear-gradient(135deg, #00f2fe, #4facfe);
  --btn-primary-text: #050b14;
  --gradient-text: linear-gradient(135deg, #ffffff 10%, #00f2fe 55%, #9b51e0 100%);

  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --shadow-neon-cyan: 0 0 25px rgba(0, 242, 254, 0.25);
  --shadow-neon-purple: 0 0 25px rgba(138, 43, 226, 0.25);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

:root[data-theme="light"] {
  color-scheme: light;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
}

.content-wrapper {
  position: relative;
  z-index: 1;
}

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

/* Typography Utilities */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-bright);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.mono {
  font-family: var(--font-mono);
}

/* Futuristic Navigation Bar */
.cyber-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #00f2fe, #8a2be2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px var(--cyan-glow);
  position: relative;
}

.brand-logo-icon::after {
  content: '';
  position: absolute;
  inset: 1px;
  background: var(--bg-primary);
  border-radius: 7px;
  z-index: 1;
}

.brand-logo-icon svg {
  position: relative;
  z-index: 2;
  color: var(--cyan);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--text-bright);
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span {
  color: var(--cyan);
}

.brand-status-tag {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  letter-spacing: 0.08em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  list-style: none;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
}

.nav-link:hover::after,
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Mode Switcher Pill (Learner vs Trainer) */
.mode-toggle-pill {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(138, 43, 226, 0.2));
  color: var(--text-bright);
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.2);
}

.mode-btn.trainer.active {
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.25), rgba(255, 71, 87, 0.25));
  border-color: rgba(255, 159, 67, 0.4);
  color: var(--amber);
  box-shadow: 0 0 12px rgba(255, 159, 67, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.35);
  font-weight: 700;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.6);
}

.btn-purple {
  background: linear-gradient(135deg, #8a2be2, #9b51e0);
  color: #ffffff;
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.35);
}

.btn-purple:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(138, 43, 226, 0.6);
}

.btn-glass {
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  color: var(--text-bright);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

/* Badge Styles */
.cyber-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-cyan {
  background: rgba(0, 242, 254, 0.12);
  color: var(--cyan);
  border-color: rgba(0, 242, 254, 0.3);
}

.badge-purple {
  background: rgba(138, 43, 226, 0.14);
  color: #c084fc;
  border-color: rgba(138, 43, 226, 0.35);
}

.badge-emerald {
  background: rgba(0, 245, 160, 0.12);
  color: var(--emerald);
  border-color: rgba(0, 245, 160, 0.3);
}

.badge-amber {
  background: rgba(255, 159, 67, 0.14);
  color: var(--amber);
  border-color: rgba(255, 159, 67, 0.35);
}

/* Interactive Visual Labs Showcase */
.labs-showcase-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

@media (max-width: 900px) {
  .labs-showcase-container {
    grid-template-columns: 1fr;
  }
}

.lab-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lab-menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.lab-menu-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.lab-menu-item.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(138, 43, 226, 0.15));
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.lab-menu-item :is(h3, h4) {
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.lab-menu-item p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lab-stage-viewport {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  min-height: 480px;
  display: flex;
  flex-direction: column;
}

.lab-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.lab-title-group h3 {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Individual Labs UI Controls */
.lab-control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.control-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.control-label span {
  font-family: var(--font-mono);
  color: var(--cyan);
}

.cyber-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-slider);
  outline: none;
}

.cyber-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 10px var(--cyan);
}

.cyber-select,
.cyber-input,
.cyber-textarea {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-bright);
  padding: 10px 14px;
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition);
}

.cyber-select:focus,
.cyber-input:focus,
.cyber-textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

/* Token Probability Visualizer */
.token-distribution-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.token-prob-row {
  display: grid;
  grid-template-columns: 140px 1fr 60px;
  align-items: center;
  gap: 14px;
  font-size: 0.88rem;
}

.token-chip {
  font-family: var(--font-mono);
  background: var(--bg-chip);
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-bright);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prob-track {
  height: 12px;
  background: var(--bg-track);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.prob-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #8a2be2);
  border-radius: 6px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.prob-pct {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--cyan);
  text-align: right;
}

/* Prompt Builder Lab */
.prompt-grid-builder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 768px) {
  .prompt-grid-builder {
    grid-template-columns: 1fr;
  }
}

.prompt-score-meter {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-number-badge {
  font-size: 2rem;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--emerald);
}

/* RAG Simulator Flow */
.rag-flow-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.rag-steps-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 800px) {
  .rag-steps-row {
    grid-template-columns: 1fr 1fr;
  }
}

.rag-step-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.85rem;
  transition: var(--transition);
}

.rag-step-box.active {
  border-color: var(--emerald);
  box-shadow: 0 0 12px rgba(0, 245, 160, 0.25);
  background: rgba(0, 245, 160, 0.05);
}

.rag-retrieval-results {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  max-height: 200px;
  overflow-y: auto;
}

/* Responsible AI & Guardrail Lab */
.guardrail-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.guardrail-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.guardrail-checkbox-label input {
  accent-color: var(--emerald);
  width: 16px;
  height: 16px;
}

.threat-verdict-box {
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 14px;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.threat-verdict-box.safe {
  background: rgba(0, 245, 160, 0.08);
  border-color: rgba(0, 245, 160, 0.4);
  color: var(--text-bright);
}

.threat-verdict-box.danger {
  background: rgba(255, 71, 87, 0.08);
  border-color: rgba(255, 71, 87, 0.4);
  color: var(--text-bright);
}

.topic-key-takeaway {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.08), rgba(138, 43, 226, 0.08));
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
  display: flex;
  gap: 14px;
}

/* Trainer Callout / Secret Notes */
.trainer-callout-box {
  background: rgba(255, 159, 67, 0.08);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 28px 0;
}

.trainer-callout-box :is(h2, h4) {
  color: var(--amber);
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Analogy Box */
.analogy-callout-box {
  background: rgba(0, 245, 160, 0.08);
  border-left: 4px solid var(--emerald);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 18px 22px;
  margin: 28px 0;
}

.analogy-callout-box :is(h2, h4) {
  color: var(--emerald);
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topic-theory-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-body);
}

.topic-theory-body p {
  margin-bottom: 18px;
}

.topic-theory-body ul,
.topic-theory-body ol {
  margin-left: 24px;
  margin-bottom: 18px;
}

.topic-theory-body li {
  margin-bottom: 8px;
}

.code-box {
  background: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--code-text);
  margin: 18px 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.code-box .bad {
  color: var(--red);
  font-weight: 700;
}

.code-box .good {
  color: var(--emerald);
  font-weight: 700;
}

/* Quiz Section */
.topic-quiz-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 36px 0;
}

.quiz-question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-bright);
}

.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  text-align: left;
  color: var(--text-main);
  font-size: 0.92rem;
  cursor: pointer;
  transition: var(--transition);
}

.quiz-opt-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
}

.quiz-opt-btn.correct {
  background: rgba(0, 245, 160, 0.15);
  border-color: var(--emerald);
  color: var(--text-bright);
}

.quiz-opt-btn.incorrect {
  background: rgba(255, 71, 87, 0.15);
  border-color: var(--red);
  color: var(--text-bright);
}

.quiz-explanation-box {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: none;
}

.quiz-explanation-box.show {
  display: block;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid var(--border-glow);
  color: var(--info-text);
}

/* Trainer Presentation Bar (When Trainer Mode is Active) */
.trainer-hud-bar {
  background: var(--bg-hud);
  border-bottom: 2px solid var(--amber);
  padding: 10px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
}

.trainer-hud-bar.active {
  display: flex;
}

.trainer-timer-display {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--amber);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Pricing & Commercial Packages */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  position: relative;
  transition: var(--transition);
}

.pricing-card.featured {
  border-color: var(--cyan);
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.2);
  transform: scale(1.03);
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: var(--cyan);
}

.pricing-card.featured:hover {
  transform: scale(1.03) translateY(-6px);
}

.pricing-header h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.pricing-price {
  font-size: 2.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-bright);
  margin: 18px 0;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.pricing-price span {
  font-size: 0.95rem;
  color: var(--text-dim);
  font-family: var(--font-main);
  font-weight: 400;
}

.pricing-features-list {
  list-style: none;
  margin: 24px 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pricing-features-list li {
  font-size: 0.92rem;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.pricing-features-list li svg {
  color: var(--emerald);
  flex-shrink: 0;
  margin-top: 4px;
}

/* Modal Popup (Inquiry / Booking) */
.cyber-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cyber-modal-overlay.active {
  display: flex;
}

.cyber-modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 0 50px rgba(0, 242, 254, 0.25);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}

.modal-close-btn:hover {
  color: var(--text-bright);
}

.footer-copyright {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .cyber-nav {
    padding: 12px 16px;
  }
  .nav-links {
    display: none;
  }
}

/* Presenter tools are hidden from learners until unlocked with ?trainer=1 */
.trainer-only {
  display: none !important;
}

body.trainer-unlocked .trainer-only {
  display: flex !important;
}

.topic-lab-link {
  margin: 4px 0 8px;
}

.formula {
  font-family: var(--font-mono);
  color: var(--cyan);
  white-space: nowrap;
}

/* Phone layout for the home page labs: long <select> option text and the
   off-canvas glow were forcing the page wider than the screen. */
html,
body {
  overflow-x: clip;
}

.labs-showcase-container > *,
.lab-stage-content,
.control-group {
  min-width: 0;
}

.cyber-select,
.cyber-input {
  max-width: 100%;
}

@media (max-width: 900px) {
  .labs-showcase-container {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .labs-showcase-container,
.lab-stage-viewport {
    padding: 14px;
  }
  .lab-header-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .control-group {
    flex: 1 1 100%;
  }
  .cyber-select {
    width: 100%;
  }
  .token-prob-row {
    grid-template-columns: 110px 1fr 48px;
    gap: 8px;
  }
  .rag-steps-row {
    grid-template-columns: 1fr;
  }
  .guardrail-toggle-grid {
    grid-template-columns: 1fr;
  }
  #prompt-comparison-output {
    grid-template-columns: 1fr !important;
  }
}

/* Lesson diagrams & module covers */
.topic-figure {
  margin: 0 0 28px;
}

.topic-figure a {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.topic-figure a:hover {
  border-color: var(--border-glow);
}

.topic-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.topic-figure figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================
   LIGHT THEME (default). Dark theme = the original :root values.
   ========================================================== */
:root[data-theme="light"] {
  --bg-primary: #f6f8fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f4f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --border-subtle: rgba(15, 23, 42, 0.1);
  --border-glow: rgba(8, 145, 178, 0.35);
  --border-card: rgba(15, 23, 42, 0.1);

  --cyan: #0e7490;
  --cyan-glow: rgba(14, 116, 144, 0.15);
  --blue: #2563eb;
  --purple: #6d28d9;
  --violet: #7c3aed;
  --emerald: #047857;
  --amber: #b45309;
  --red: #dc2626;

  --text-main: #1e293b;
  --text-muted: #475569;
  --text-dim: #556274;
  --text-bright: #0f172a;
  --text-body: #334155;
  --code-text: #0e7490;
  --info-text: #0c4a6e;
  --quote-text: #92400e;

  --bg-code: #f1f5f9;
  --bg-chip: #eef2f7;
  --bg-track: #e2e8f0;
  --bg-slider: #cbd5e1;
  --bg-nav: rgba(255, 255, 255, 0.88);
  --bg-overlay: rgba(246, 248, 251, 0.98);
  --bg-hero-badge: rgba(255, 255, 255, 0.9);
  --bg-pill: #ffffff;
  --bg-hud: #fff7ed;
  --btn-primary-bg: linear-gradient(135deg, #0e7490, #2563eb);
  --btn-primary-text: #ffffff;
  --gradient-text: linear-gradient(135deg, #0e7490 10%, #2563eb 55%, #7c3aed 100%);

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px -12px rgba(15, 23, 42, 0.18);
  --shadow-neon-cyan: none;
  --shadow-neon-purple: none;
}
:root[data-theme="light"] .brand-logo-icon { box-shadow: none; }
:root[data-theme="light"] .btn-primary { box-shadow: 0 4px 14px -4px rgba(37, 99, 235, 0.45); }
:root[data-theme="light"] .btn-primary:hover { box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5); }
:root[data-theme="light"] .btn-purple { box-shadow: 0 4px 14px -4px rgba(109, 40, 217, 0.45); }
:root[data-theme="light"] .btn-glass:hover { box-shadow: var(--shadow-card); }
:root[data-theme="light"] .nav-link:hover::after,
:root[data-theme="light"] .nav-link.active::after { box-shadow: none; }
:root[data-theme="light"] .lab-menu-item.active,
:root[data-theme="light"] .mode-btn.active,
:root[data-theme="light"] .cyber-select:focus,
:root[data-theme="light"] .cyber-input:focus { box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12); }
:root[data-theme="light"] .pricing-card,
:root[data-theme="light"] .topic-quiz-card,
:root[data-theme="light"] .lab-menu-item { box-shadow: var(--shadow-card); }
:root[data-theme="light"] .pricing-card.featured { box-shadow: 0 18px 40px -18px rgba(14, 116, 144, 0.45); }
:root[data-theme="light"] .cyber-modal-content { box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.35); }
:root[data-theme="light"] .cyber-modal-overlay { background: rgba(15, 23, 42, 0.45); }
:root[data-theme="light"] .cyber-slider::-webkit-slider-thumb { box-shadow: none; }
:root[data-theme="light"] .rag-step-box.active { box-shadow: none; }
:root[data-theme="light"] .badge-purple { color: #6d28d9; }
:root[data-theme="light"] .badge-cyan { background: rgba(14, 116, 144, 0.08); border-color: rgba(14, 116, 144, 0.25); }
:root[data-theme="light"] .badge-emerald { background: rgba(4, 120, 87, 0.08); border-color: rgba(4, 120, 87, 0.25); }
:root[data-theme="light"] .badge-amber { background: rgba(180, 83, 9, 0.08); border-color: rgba(180, 83, 9, 0.25); }
:root[data-theme="light"] .topic-key-takeaway { background: linear-gradient(135deg, rgba(14, 116, 144, 0.07), rgba(109, 40, 217, 0.06)); }
:root[data-theme="light"] .brand-logo-icon::after { background: #ffffff; }

/* Module colours: bright tones on dark, deeper inks on light (set inline per module) */
.mod-ink { color: var(--mod-dark); }
:root[data-theme="light"] .mod-ink { color: var(--mod-light); }

/* Lesson diagrams ship in a dark and a light version */
.theme-img-light { display: none !important; }
:root[data-theme="light"] .theme-img-light { display: block !important; }
:root[data-theme="light"] .theme-img-dark { display: none !important; }

/* Theme toggle */
.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--border-glow);
  color: var(--cyan);
}

.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ==========================================================
   HOME PAGE (simplified layout)
   ========================================================== */
.hero,
.section,
.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  align-items: center;
  gap: 56px;
  padding-top: 88px;
  padding-bottom: 72px;
}

.eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cyan);
  margin-bottom: 16px;
}

.hero-heading {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-bright);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  border-color: var(--text-dim);
  background: var(--bg-tertiary);
}

.hero-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.hero-facts li::before {
  content: "✓";
  color: var(--emerald);
  font-weight: 700;
  margin-right: 8px;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.hero-visual figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}

.section {
  padding-top: 88px;
  padding-bottom: 8px;
}

.section-head {
  max-width: 640px;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin-bottom: 10px;
}

.section-head p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Curriculum as four expandable outcome rows */
.module-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.module-row + .module-row {
  border-top: 1px solid var(--border-subtle);
}

.module-row summary {
  list-style: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  cursor: pointer;
  transition: var(--transition);
}

.module-row summary::-webkit-details-marker {
  display: none;
}

.module-row summary:hover {
  background: var(--bg-card-hover);
}

.module-row-num {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.module-row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.module-row-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-bright);
}

.module-row-outcome {
  font-size: 0.98rem;
  color: var(--text-muted);
}

.module-row-meta {
  font-size: 0.85rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.module-row-chevron {
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.module-row[open] .module-row-chevron {
  transform: rotate(180deg);
}

.module-row-body {
  padding: 0 28px 24px 96px;
}

.module-row-lessons {
  margin: 0 0 18px 18px;
  display: grid;
  gap: 6px;
  color: var(--text-dim);
}

.module-lesson-link {
  background: none;
  border: none;
  padding: 2px 0;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.module-lesson-link:hover {
  color: var(--cyan);
  text-decoration: underline;
}

/* Pricing, simplified */
.pricing-card h3 {
  font-size: 1.25rem;
}

.pricing-for {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.pricing-card .pricing-price {
  font-family: var(--font-main);
  font-size: 2.4rem;
  margin: 20px 0 4px;
}

.pricing-features-list li::before {
  content: "✓";
  color: var(--emerald);
  font-weight: 700;
  margin-right: 10px;
}

.pricing-card .pricing-features-list {
  margin: 16px 0 28px;
  flex-grow: 1;
}

.pricing-card.featured {
  transform: none;
}

.pricing-card:hover,
.pricing-card.featured:hover {
  transform: none;
}

.pricing-flag {
  position: absolute;
  top: -12px;
  left: 28px;
  background: var(--cyan);
  color: var(--bg-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Footer, one line */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 96px;
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--border-subtle);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
}

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

.site-footer .footer-copyright {
  border: none;
  padding: 0;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    padding-top: 56px;
    padding-bottom: 40px;
  }
}

@media (max-width: 640px) {
  .hero,
.section,
.site-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .section {
    padding-top: 64px;
  }
  .module-row summary {
    grid-template-columns: 32px minmax(0, 1fr) 20px;
    gap: 12px;
    padding: 20px 16px;
  }
  .module-row-meta {
    grid-column: 2;
    grid-row: 2;
  }
  .module-row-body {
    padding: 0 16px 20px 60px;
  }
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .brand-status-tag {
    display: none;
  }
  .nav-actions {
    gap: 8px;
  }
  .nav-actions .btn {
    white-space: nowrap;
  }
}

/* ==========================================================
   COURSE PAGE (learn.html): overview → module → lesson → recap
   ========================================================== */
a.module-lesson-link {
  text-decoration: none;
}

.learn-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 24px;
  background: var(--bg-nav);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.learn-header .brand-logo-icon {
  width: 34px;
  height: 34px;
}

.learn-header-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 280px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.progress-track {
  display: block;
  flex: 1;
  height: 6px;
  min-width: 48px;
  border-radius: var(--radius-full);
  background: var(--bg-track);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  border-radius: inherit;
  transition: width 0.4s ease;
}

.learn-container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.learn-narrow {
  max-width: 760px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.crumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--cyan);
}

.learn-page-head {
  margin-bottom: 40px;
}

.learn-page-head h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  letter-spacing: -0.025em;
  margin-bottom: 10px;
}

.learn-kicker {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.learn-page-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin-bottom: 12px;
}

.learn-meta {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.learn-meta a {
  color: var(--cyan);
}

.learn-page-progress {
  max-width: 420px;
  margin: 8px 0 24px;
}

.learn-section-title {
  font-size: 1.1rem;
  margin-bottom: 14px;
}

/* Overview: four module cards */
.course-module-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.course-module-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.course-module-card:hover {
  border-color: var(--mod-dark);
  transform: translateY(-2px);
}

:root[data-theme="light"] .course-module-card:hover {
  border-color: var(--mod-light);
}

.course-module-num {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.course-module-card :is(h2, h3) {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.course-module-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 20px;
}

.course-module-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.course-module-count {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.status-complete .course-module-count {
  color: var(--emerald);
  font-weight: 600;
}

/* Lesson list (module page + lesson sidebar) */
.lesson-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lesson-link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: var(--transition);
}

.lesson-link:hover {
  background: var(--bg-tertiary);
}

.lesson-link.is-active {
  background: var(--bg-tertiary);
  box-shadow: inset 3px 0 0 var(--cyan);
  font-weight: 600;
  color: var(--text-bright);
}

.lesson-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
  flex-shrink: 0;
}

.lesson-link.is-done .lesson-marker {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--bg-secondary);
}

.lesson-link.is-active .lesson-marker {
  border-color: var(--cyan);
  color: var(--cyan);
}

.lesson-link-time {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
  padding-top: 2px;
}

.learn-narrow > .lesson-list {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  padding: 8px;
}

/* Lesson page */
.lesson-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  max-width: 1180px;
  margin: 0 auto;
  --sidebar-ease: cubic-bezier(0.4, 0, 0.2, 1);
  transition: grid-template-columns 0.32s var(--sidebar-ease), max-width 0.32s var(--sidebar-ease);
}

/* Sidebar toggle: top-right of the lesson list; a slim rail when the list is hidden */
.sidebar-toggle {
  position: absolute;
  top: 20px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background: var(--bg-tertiary);
  border-color: var(--border-subtle);
  color: var(--text-bright);
}

.sidebar-collapsed .lesson-layout {
  grid-template-columns: 64px minmax(0, 1fr);
  max-width: 1280px;
}

/* The list keeps a fixed width and fades, so its text never re-wraps while the column moves */
.lesson-sidebar-body {
  width: 260px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.2s ease 0.12s, transform 0.32s var(--sidebar-ease), visibility 0s linear 0s;
}

.sidebar-collapsed .lesson-sidebar-body {
  opacity: 0;
  transform: translateX(-16px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.32s var(--sidebar-ease), visibility 0s linear 0.32s;
}

.sidebar-collapsed .lesson-main {
  max-width: 920px;
}

.lesson-sidebar {
  position: sticky;
  min-width: 0;
  top: 59px;
  align-self: start;
  max-height: calc(100vh - 59px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 16px 40px 24px;
  border-right: 1px solid var(--border-subtle);
}

.side-back {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 20px;
}

.side-back:hover {
  color: var(--cyan);
}

.side-module {
  margin-bottom: 16px;
}

.side-module-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-bright);
  text-decoration: none;
  margin-bottom: 10px;
}

.side-module-title span {
  font-size: 0.8rem;
}

.side-module-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.lesson-sidebar .lesson-link-time {
  display: none;
}

.lesson-sidebar .lesson-link {
  grid-template-columns: 28px minmax(0, 1fr);
  font-size: 0.9rem;
}

.lesson-main {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  transition: max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 40px 32px 96px;
}

.lesson-nav-mobile {
  display: none;
}

.lesson-kicker {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.lesson-title {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem);
  letter-spacing: -0.025em;
  margin-bottom: 28px;
}

.lesson-main .topic-key-takeaway {
  display: block;
  padding: 18px 22px;
}

.lesson-main .topic-key-takeaway strong {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  margin-bottom: 6px;
}

.lesson-main .topic-key-takeaway p {
  margin: 0;
  font-size: 1.02rem;
  color: var(--text-main);
}

.lesson-main .analogy-callout-box :is(h2, h4),
.lesson-main .trainer-callout-box :is(h2, h4) {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.lesson-main .analogy-callout-box p {
  margin: 0;
  color: var(--text-main);
}

.trainer-quote {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--quote-text);
  margin-bottom: 8px;
}

.trainer-notes {
  font-size: 0.9rem;
  color: var(--text-body);
}

.lesson-main .topic-theory-body {
  font-size: 1.05rem;
}

.quiz-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  margin-bottom: 10px;
}

.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.lesson-up-next {
  text-align: right;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 10px;
}

/* Milestones: module and course complete */
.milestone {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.milestone .learn-page-sub {
  margin-left: auto;
  margin-right: auto;
}

.milestone-mark {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  margin-bottom: 20px;
}

.recap-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 24px 24px 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-muted);
  line-height: 1.6;
}

.recap-list strong {
  color: var(--text-bright);
}

/* Presenter bar */
.trainer-hud-label {
  font-weight: 700;
  color: var(--amber);
}

@media (prefers-reduced-motion: reduce) {
  .lesson-layout,
  .lesson-main,
  .lesson-sidebar-body {
    transition: none !important;
  }
}

.trainer-hud-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 900px) {
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson-sidebar {
    display: none;
  }
  .sidebar-collapsed .lesson-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar-collapsed .lesson-main {
    max-width: 760px;
  }
  .lesson-main {
    padding: 20px 16px 72px;
  }
  .lesson-nav-mobile {
    display: block;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-card);
  }
  .lesson-nav-mobile summary {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
  }
  .lesson-nav-mobile[open] {
    padding-bottom: 12px;
  }
  .lesson-nav-mobile[open] > :not(summary) {
    margin-left: 12px;
    margin-right: 12px;
  }
  .course-module-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .learn-header {
    padding: 10px 16px;
    gap: 12px;
  }
  .learn-header .brand-title {
    display: none;
  }
  .learn-container {
    padding: 32px 16px 72px;
  }
  .lesson-pager .btn {
    flex: 1;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Card layouts used inside lesson text (curriculum-data.js theory HTML) */
.topic-theory-body :is(.vocab-grid,
.sdlc-grid,
.formula-cards,
.pipeline-split,
.chunking-comparison,
.five-pillars-grid,
.attack-types,
.reg-grid,
.sdlc-phases) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.topic-theory-body :is(.pipeline-split,
.reg-grid) {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.topic-theory-body :is(.vocab-card,
.sdlc-card,
.formula-item,
.pipeline-half,
.chunk-card,
.pillar-box,
.attack-card,
.reg-card,
.phase-step) {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.topic-theory-body :is(.vocab-card,
.sdlc-card,
.formula-item,
.pipeline-half,
.chunk-card,
.pillar-box,
.attack-card,
.reg-card,
.phase-step) :is(h3,
h4,
strong:first-of-type) {
  display: block;
  font-size: 1rem;
  color: var(--text-bright);
  margin-bottom: 6px;
}

.topic-theory-body :is(.vocab-card,
.sdlc-card,
.formula-item,
.pipeline-half,
.chunk-card,
.pillar-box,
.attack-card,
.reg-card,
.phase-step) p {
  margin: 0;
  color: var(--text-muted);
}

.topic-theory-body :is(.pipeline-half,
.reg-card) :is(ol,
ul) {
  margin: 8px 0 0 18px;
  color: var(--text-muted);
}

.topic-theory-body :is(.f-num,
.p-num) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--bg-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.topic-theory-body .attack-card {
  border-left: 3px solid var(--red);
}

.topic-theory-body .pillar-box {
  border-top: 3px solid var(--cyan);
}

/* ==========================================================
   Security labs (index.html)
   ========================================================== */
.lab-hint {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 12px 0 10px;
}

.lab-footnote {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 14px;
}

.lab-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.lab-trace ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 6px;
}

.lab-trace li,
.lab-table tr {
  border-left: 3px solid var(--border-subtle);
}

.lab-trace li {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-tertiary);
  font-size: 0.86rem;
}

.lab-trace li span {
  color: var(--text-muted);
}

.trace-catch { border-left-color: var(--emerald) !important; }
.trace-reduce { border-left-color: var(--amber) !important; }
.trace-danger { border-left-color: var(--red) !important; }
.trace-miss { border-left-color: var(--text-dim) !important; }
.trace-off, .trace-skip { opacity: 0.9; }

.lab-trace li.trace-catch strong::after { content: "  ✓ stops it"; color: var(--emerald); font-weight: 700; }
.lab-trace li.trace-reduce strong::after { content: "  ~ helps"; color: var(--amber); font-weight: 700; }

.threat-verdict-box strong {
  color: var(--text-bright);
}

.threat-verdict-box span {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.threat-verdict-box.danger strong { color: var(--red); }
.threat-verdict-box.safe strong { color: var(--emerald); }
:root[data-theme="light"] .threat-verdict-box.danger strong { color: #b91c1c; }

.lab-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
}

.lab-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.86rem;
}

.lab-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  padding: 0 12px;
}

.lab-table td {
  padding: 8px 12px;
  background: var(--bg-tertiary);
  vertical-align: top;
}

.lab-table td:first-child {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lab-table td:last-child {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.lab-table code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-bright);
  word-break: break-all;
}

.lab-textarea {
  width: 100%;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  resize: vertical;
}

.lab-findings {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.86rem;
  color: var(--text-main);
}

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

.lab-bar-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.lab-bar-track {
  position: relative;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--bg-track);
}

.lab-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}

.lab-bar-fill.ok { background: var(--emerald); }
.lab-bar-fill.bad { background: var(--red); }

.lab-bar-threshold {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text-bright);
  opacity: 0.6;
}

.lab-bar-value {
  font-family: var(--font-mono);
  text-align: right;
}

.lab-bar-value.ok { color: var(--emerald); }
.lab-bar-value.bad { color: var(--red); }

.lab-details {
  margin-top: 12px;
  font-size: 0.9rem;
}

.lab-details summary {
  cursor: pointer;
  color: var(--cyan);
  font-weight: 600;
}

@media (max-width: 560px) {
  .lab-trace li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .lab-bar-row {
    grid-template-columns: 100px minmax(0, 1fr) 48px;
    gap: 8px;
  }
}

/* ==========================================================
   Lab goals, practice step, lab registry UI
   ========================================================== */
button.lab-menu-item {
  width: 100%;
  font: inherit;
  color: inherit;
}

.lab-done-tick {
  color: var(--emerald);
  font-weight: 800;
}

.lab-goal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-glow);
  background: var(--bg-tertiary);
  font-size: 0.92rem;
}

.lab-goal-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.lab-goal-text {
  flex: 1 1 260px;
  color: var(--text-main);
  font-weight: 600;
}

.lab-goal-status {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
}

.lab-goal.is-done {
  border-style: solid;
  border-color: var(--emerald);
}

.lab-goal.is-done .lab-goal-status {
  color: var(--emerald);
}

.lab-goal.just-done {
  animation: lab-goal-pop 0.5s ease;
}

@keyframes lab-goal-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .lab-goal.just-done { animation: none; }
}

.lab-body {
  display: flex;
  flex-direction: column;
}

.lab-score {
  margin-top: 12px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.lab-score strong {
  color: var(--text-bright);
}

.lab-score .is-bad {
  color: var(--red);
}

.lab-run {
  align-self: flex-start;
  margin-top: 6px;
}

.lesson-practice {
  margin: 36px 0;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
  background: var(--bg-secondary);
  box-shadow: var(--shadow-card);
}

.lesson-practice-title {
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.lesson-lab-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glow);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--cyan);
  vertical-align: 1px;
}

.lesson-lab-tag.is-done {
  border-color: var(--emerald);
  color: var(--emerald);
}

/* Threat-model builder */
.tm-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.tm-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(200px, 260px);
  gap: 6px 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border-left: 3px solid var(--border-subtle);
}

.tm-num {
  font-weight: 800;
  color: var(--text-dim);
}

.tm-text {
  font-size: 0.92rem;
}

.tm-feedback {
  grid-column: 2 / -1;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tm-feedback:empty {
  display: none;
}

.tm-row.is-right, .oh-case.is-right { border-left-color: var(--emerald); }
.tm-row.is-wrong, .oh-case.is-wrong { border-left-color: var(--red); }

/* Output-handling fixer */
.oh-case {
  padding: 12px 14px 4px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border-left: 3px solid var(--border-subtle);
}

.oh-case .code-box {
  margin: 6px 0 10px;
  overflow-wrap: anywhere;
}

.oh-case select {
  width: 100%;
}

.oh-result {
  margin: 8px 0;
}

/* Capstone */
.cap-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.cap-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cap-controls .guardrail-checkbox-label span:nth-child(2) {
  flex: 1;
}

.cap-cost {
  min-width: 26px;
  text-align: center;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--bg-track);
  font-size: 0.78rem;
  font-weight: 700;
}

.cap-risks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.cap-risks li {
  display: flex;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  font-size: 0.86rem;
  color: var(--text-dim);
  border-left: 3px solid var(--border-subtle);
}

.cap-risks li.is-covered {
  color: var(--text-main);
  border-left-color: var(--emerald);
}

.cap-risks li.is-covered::after {
  content: "✓";
  margin-left: auto;
  color: var(--emerald);
  font-weight: 800;
}

.cap-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 760px) {
  .cap-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .tm-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }
  .tm-row select {
    grid-column: 2;
  }
}

@media (max-width: 560px) {
  .lesson-practice {
    padding: 16px;
    margin-left: -4px;
    margin-right: -4px;
  }
}

/* Phones/tablets: lab picker becomes a scrollable row of chips */
@media (max-width: 900px) {
  .lab-menu-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
  }
  .lab-menu-list .lab-menu-item {
    flex: 0 0 auto;
    width: auto;
    max-width: 240px;
    padding: 10px 14px;
    scroll-snap-align: start;
  }
  .lab-menu-list .lab-menu-item p {
    display: none;
  }
  .lab-menu-list .lab-menu-item :is(h3, h4) {
    margin: 0;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

/* GenAI-course labs (shared stylesheet) */
.lab-sample-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.lab-stream {
  color: var(--cyan);
  font-size: 0.9rem;
  flex: 1 1 260px;
}

.ctx-bar {
  display: flex;
  height: 34px;
  margin: 18px 0 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.ctx-seg { display: block; min-width: 2px; }
.s-system { background: var(--purple); }
.s-chat { background: var(--blue); }
.s-docs { background: var(--emerald); }
.s-answer { background: var(--amber); }
.s-free { background: var(--bg-track); }

.ctx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ctx-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

.lab-checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.lab-checklist .is-ok { color: var(--emerald); }
.lab-checklist .is-bad { color: var(--red); }

.rag-chunk {
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-family: var(--font-main);
  font-size: 0.88rem;
  color: var(--text-main);
}

.chunk-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.chunk-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--cyan);
  background: var(--bg-tertiary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.chunk-item .lab-sub {
  display: block;
  margin-bottom: 4px;
}

.chunk-item.c1 { border-left-color: var(--purple); }
.chunk-item.c2 { border-left-color: var(--emerald); }
.chunk-item.c3 { border-left-color: var(--amber); }

/* Slider labels: plain label text, monospace value */
.control-label span:first-child:not(:last-child) {
  font-family: var(--font-main);
  color: var(--text-muted);
}

/* "All courses" link, added to the course header by the B2R Academy site build */
.learn-all-courses {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.learn-all-courses:hover {
  color: var(--cyan);
}

/* ==========================================================
   Certificate of completion (learn.html#/complete, #/certificate)
   ========================================================== */
.cert-requirements {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

.cert-requirements span {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.cert-requirements span.is-done {
  border-color: var(--emerald);
  color: var(--emerald);
}

.cert-requirements span.is-done::before {
  content: "✓ ";
}

.cert-todo li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cert-todo a {
  color: var(--text-bright);
  font-weight: 600;
}

.cert-form {
  width: 100%;
  max-width: 520px;
  text-align: left;
  margin-top: 8px;
}

.cert-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.cert-form-row input {
  flex: 1 1 240px;
  font-size: 1rem;
}

.cert-error {
  min-height: 1.2em;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--red);
}

.cert-page {
  max-width: 1180px;
}

.cert-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.cert-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cert-sheet {
  background: #ffffff;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08), 0 18px 48px -18px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}

.cert-sheet svg {
  display: block;
  width: 100%;
  height: auto;
}

.cert-note {
  text-align: center;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }
  html, body {
    background: #ffffff !important;
  }
  body.learn-body > *:not(main),
  .cert-toolbar,
  .cert-note {
    display: none !important;
  }
  .learn-container.cert-page {
    max-width: none;
    padding: 0;
    margin: 0;
  }
  .cert-sheet {
    box-shadow: none;
    border-radius: 0;
    width: 297mm;
    height: 210mm;
  }
  .cert-sheet svg {
    width: 297mm;
    height: 210mm;
  }
}

/* ==========================================================
   Pass-to-complete (courseInfo.requirePass)
   ========================================================== */
.lesson-pager .btn.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.lesson-gate {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--amber);
  background: var(--bg-tertiary);
  font-size: 0.92rem;
  color: var(--text-main);
}

.lesson-gate.nudge {
  animation: gate-nudge 0.4s ease;
}

@keyframes gate-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.quiz-try-again {
  margin-top: 12px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--amber);
}

.quiz-opt-btn:disabled {
  cursor: default;
}

.quiz-opt-btn.incorrect:disabled {
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .lesson-gate.nudge { animation: none; }
}

/* ==========================================================
   Coding challenges (Python labs)
   ========================================================== */
.py-task p { margin-bottom: 10px; }
.py-task ul, .py-task ol { margin: 0 0 10px 20px; }

.py-example,
.py-given,
.py-output {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 12px;
}

.py-example,
.py-given {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-bright);
}

.py-given-label,
.py-result-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 4px 0 6px;
}

.py-label {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 6px;
}

.py-editor {
  display: block;
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 4;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: #0f172a;
  color: #e2e8f0;
  caret-color: #00f2fe;
  white-space: pre;
  overflow: auto;
}

.py-editor:focus {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.py-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 6px;
}

.py-status {
  min-height: 1.4em;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 6px 0;
}

.py-status.is-busy::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: py-spin 0.8s linear infinite;
}

@keyframes py-spin { to { transform: rotate(360deg); } }

.py-status.is-good { color: var(--emerald); }
.py-status.is-bad { color: var(--red); }
:root[data-theme="light"] .py-status.is-bad { color: #b91c1c; }

.py-output {
  background: #0f172a;
  color: #e2e8f0;
  border: 1px solid var(--border-subtle);
  max-height: 260px;
  overflow: auto;
}

.py-error { color: #fca5a5; }

.py-checks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
}

.py-checks li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-tertiary);
  border-left: 3px solid var(--border-subtle);
  font-size: 0.88rem;
}

.py-checks li span { color: var(--text-muted); }
.py-checks li.is-pass { border-left-color: var(--emerald); }
.py-checks li.is-fail { border-left-color: var(--red); }

.py-hints {
  margin: 8px 0 0 20px;
  font-size: 0.92rem;
  color: var(--text-main);
}

.py-hints li { margin-bottom: 6px; }

@media (prefers-reduced-motion: reduce) {
  .py-status.is-busy::before { animation: none; }
}

/* Code shows the characters you type: no ligatures (== must not become one long sign, != must not become ≠) */
code, pre, kbd, .code-box, .mono, .py-editor, .py-output, .py-example, .py-given, .token-chip {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
