/* ============================================================
   THE RISK BLUEPRINT — style.css
   Design Token System v1.0
   A6 Aurora Red+Amber · C8 Thick Frost Glass · T1 Bebas+DM Sans
   ============================================================ */

/* ----------------------------------------------------------
   1. GOOGLE FONTS IMPORT
   ---------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

/* ----------------------------------------------------------
   2. DESIGN TOKENS — CSS CUSTOM PROPERTIES
   ---------------------------------------------------------- */
:root {

  /* === PALETTE — A6 Red + Amber === */
  --bg:             #090300;
  --bg-deep:        #050200;
  --surface:        rgba(255, 255, 255, 0.04);
  --surface-hover:  rgba(255, 255, 255, 0.07);

  /* Accent Colors */
  --red:            #ef4444;
  --red-dark:       #dc2626;
  --red-glow:       rgba(220, 38, 38, 0.24);
  --amber:          #f59e0b;
  --amber-dark:     #d97706;
  --amber-glow:     rgba(245, 158, 11, 0.18);
  --orange:         #f97316;
  --orange-glow:    rgba(234, 88, 12, 0.11);

  /* Accent primary (used for active states, highlights) */
  --accent:         #ef4444;
  --accent-dim:     rgba(239, 68, 68, 0.15);
  --accent-border:  rgba(239, 68, 68, 0.35);
  --accent-gold:    #f59e0b;
  --accent-gold-dim: rgba(245, 158, 11, 0.12);

  /* Text */
  --text:           #f5f0eb;
  --text-muted:     rgba(245, 240, 235, 0.45);
  --text-subtle:    rgba(245, 240, 235, 0.25);
  --text-inverse:   #090300;

  /* Borders */
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(255, 255, 255, 0.15);
  --border-accent:  rgba(239, 68, 68, 0.3);
  --border-gold:    rgba(245, 158, 11, 0.3);

  /* Status Colors */
  --status-done:    #22c55e;
  --status-active:  #ef4444;
  --status-locked:  rgba(245, 240, 235, 0.2);
  --status-warn:    #f59e0b;

  /* === AURORA MESH GLOWS === */
  --glow-red:       rgba(220, 38, 38, 0.24);
  --glow-amber:     rgba(245, 158, 11, 0.18);
  --glow-orange:    rgba(234, 88, 12, 0.11);

  /* === C8 GLASS CARD === */
  --glass-bg:       rgba(255, 255, 255, 0.07);
  --glass-bg-dark:  rgba(0, 0, 0, 0.25);
  --glass-blur:     blur(30px) saturate(180%);
  --glass-border:   1px solid rgba(255, 255, 255, 0.15);
  --glass-shadow:   inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.3);
  --glass-shadow-lg: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.4);

  /* === TYPOGRAPHY — T1 === */
  --font-display:   'Bebas Neue', sans-serif;
  --font-body:      'DM Sans', sans-serif;
  --font-mono:      'Space Mono', monospace;

  /* Type Scale */
  --text-display:   clamp(48px, 8vw, 80px);
  --text-h1:        clamp(32px, 5vw, 56px);
  --text-h2:        clamp(24px, 3.5vw, 40px);
  --text-h3:        clamp(18px, 2.5vw, 28px);
  --text-h4:        20px;
  --text-body-lg:   17px;
  --text-body:      15px;
  --text-body-sm:   13px;
  --text-label:     11px;
  --text-mono-lg:   24px;
  --text-mono:      14px;
  --text-mono-sm:   11px;

  /* Line Heights */
  --lh-tight:       0.95;
  --lh-display:     1.0;
  --lh-heading:     1.1;
  --lh-body:        1.65;
  --lh-label:       1.4;

  /* Letter Spacing */
  --ls-display:     2px;
  --ls-heading:     1px;
  --ls-label:       3px;
  --ls-mono:        0.5px;

  /* === SPACING === */
  --sp-1:   4px;
  --sp-2:   8px;
  --sp-3:   12px;
  --sp-4:   16px;
  --sp-5:   20px;
  --sp-6:   24px;
  --sp-7:   28px;
  --sp-8:   32px;
  --sp-10:  40px;
  --sp-12:  48px;
  --sp-16:  64px;
  --sp-20:  80px;
  --sp-24:  96px;

  /* === BORDER RADIUS === */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 999px;

  /* === TRANSITIONS === */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;
  --transition-spring: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === LAYOUT — N8 Wide Chapter Sidebar === */
  --sidebar-width:     220px;
  --sidebar-collapsed: 60px;
  --header-height:     0px;   /* no top header in N8 */
  --content-max:       900px;
  --content-padding:   var(--sp-10);

  /* === Z-INDEX === */
  --z-sidebar:    100;
  --z-modal:      200;
  --z-toast:      300;
  --z-tooltip:    400;
}

/* ----------------------------------------------------------
   3. RESET & BASE
   ---------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--lh-body);
  min-height: 100vh;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }

/* ----------------------------------------------------------
   4. AURORA MESH BACKGROUND
   ---------------------------------------------------------- */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  overflow: hidden;
  pointer-events: none;
}

.aurora-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%,  var(--glow-red)   0%, transparent 65%),
    radial-gradient(ellipse 60% 50% at 85% 75%,  var(--glow-amber) 0%, transparent 60%),
    radial-gradient(ellipse 50% 70% at 50% 50%,  var(--glow-orange) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 10%,  rgba(220, 38, 38, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse 35% 35% at 10% 85%,  rgba(245, 158, 11, 0.08) 0%, transparent 50%);
  animation: aurora-shift 20s ease-in-out infinite alternate;
}

.aurora-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 30% 30% at 60% 15%, rgba(239, 68, 68, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse 40% 25% at 25% 60%, rgba(234, 88, 12, 0.06) 0%, transparent 50%);
  animation: aurora-shift 28s ease-in-out infinite alternate-reverse;
}

@keyframes aurora-shift {
  0%   { transform: scale(1) translate(0%, 0%); opacity: 1; }
  33%  { transform: scale(1.05) translate(-2%, 1%); opacity: 0.85; }
  66%  { transform: scale(0.98) translate(2%, -1%); opacity: 0.95; }
  100% { transform: scale(1.03) translate(-1%, 2%); opacity: 0.9; }
}

/* ----------------------------------------------------------
   5. LAYOUT — N8 WIDE CHAPTER SIDEBAR
   ---------------------------------------------------------- */

/* App wrapper */
.app {
  display: flex;
  min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Glass */
  background: rgba(9, 3, 0, 0.7);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-right: 1px solid var(--border);
}

/* Sidebar logo / brand */
.sidebar-brand {
  padding: var(--sp-6) var(--sp-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1;
}

.sidebar-brand-name span {
  color: var(--accent);
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-4) 0;
  scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar { display: none; }

/* Nav section label */
.sidebar-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: var(--sp-4) var(--sp-5) var(--sp-2);
}

/* Nav item (module link) */
.sidebar-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition-fast);
  position: relative;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: inherit;
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-item.active {
  background: rgba(239, 68, 68, 0.08);
  border-left-color: var(--accent);
}

.sidebar-item.done {
  opacity: 0.7;
}

.sidebar-item.locked {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Module number */
.sidebar-item-num {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  min-width: 30px;
  color: var(--text-subtle);
  transition: color var(--transition-fast);
  flex-shrink: 0;
  margin-top: 1px;
}

.sidebar-item.active .sidebar-item-num {
  color: var(--accent);
}

.sidebar-item.done .sidebar-item-num {
  color: var(--status-done);
}

/* Module info */
.sidebar-item-info {
  flex: 1;
  min-width: 0;
}

.sidebar-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.3;
  transition: color var(--transition-fast);
  word-break: break-word;
}

.sidebar-item.active .sidebar-item-title {
  color: var(--text);
}

.sidebar-item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: 0.5px;
  margin-top: 3px;
}

/* Status badge in sidebar */
.sidebar-status {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  font-size: 8px;
}

.sidebar-status.done {
  background: rgba(34, 197, 94, 0.15);
  color: var(--status-done);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.sidebar-status.active {
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}

.sidebar-status.active::after {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar-status.locked {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 7px;
}

/* Sidebar divider */
.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: var(--sp-3) var(--sp-5);
}

/* Sidebar footer — progress */
.sidebar-footer {
  flex-shrink: 0;
  padding: var(--sp-5);
  border-top: 1px solid var(--border);
}

.sidebar-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.sidebar-progress-text {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sidebar-progress-pct {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
}

.sidebar-progress-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-dark), var(--amber));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Lesson items (aufgeklappt wenn im Modul) */
.sidebar-lessons {
  margin: 2px 0 4px 0;
  border-left: 1px solid var(--border);
  margin-left: calc(var(--sp-5) + 30px);
}

.sidebar-lesson-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 7px var(--sp-3) 7px var(--sp-3);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  position: relative;
}

.sidebar-lesson-item:hover {
  background: rgba(255,255,255,0.04);
}

.sidebar-lesson-item.active {
  background: rgba(239,68,68,0.08);
}

.sidebar-lesson-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 0; bottom: 0;
  width: 1px;
  background: var(--accent);
}

.sidebar-lesson-num {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--text-subtle);
  min-width: 16px;
  flex-shrink: 0;
}

.sidebar-lesson-item.active .sidebar-lesson-num { color: var(--accent); }

.sidebar-lesson-title {
  font-size: 11px;
  color: var(--text-subtle);
  flex: 1;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-lesson-item.active .sidebar-lesson-title { color: var(--text-muted); }
.sidebar-lesson-item.done .sidebar-lesson-title { color: var(--text-subtle); }

.sidebar-lesson-check {
  font-size: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.sidebar-lesson-item.done .sidebar-lesson-check { color: var(--accent); }

/* Locked status dot — kein Emoji */
.sidebar-status.locked {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
}

/* Hub link in sidebar */
.sidebar-hub {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 2px solid transparent;
  text-decoration: none;
  color: inherit;
}

.sidebar-hub:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-hub.active {
  background: var(--accent-dim);
  border-left-color: var(--accent);
}

.sidebar-hub-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-hub-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.sidebar-hub.active .sidebar-hub-label {
  color: var(--text);
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: var(--sp-10) var(--content-padding);
  max-width: calc(var(--content-max) + var(--sidebar-width) + var(--content-padding) * 2);
}

.content-inner {
  max-width: var(--content-max);
  overflow-x: hidden;
}

/* Compare Table — Scroll-Wrapper (IMMER aktiv, nicht nur mobile) */
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ----------------------------------------------------------
   6. GLASS CARD — C8 Thick Frost Glass
   ---------------------------------------------------------- */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: var(--sp-7) var(--sp-8);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
  box-shadow: var(--glass-shadow-lg);
}

/* Card variants */
.card-sm {
  padding: var(--sp-5) var(--sp-6);
  border-radius: var(--radius-md);
}

.card-accent {
  border-color: var(--border-accent);
  background: rgba(239, 68, 68, 0.06);
}

.card-gold {
  border-color: var(--border-gold);
  background: rgba(245, 158, 11, 0.06);
}

.card-dark {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Stat card */
.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-7);
}

.stat-label {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.stat-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: var(--ls-heading);
  line-height: var(--lh-tight);
  color: var(--text);
}

.stat-value.red   { color: var(--accent); }
.stat-value.amber { color: var(--accent-gold); }
.stat-value.green { color: var(--status-done); }

.stat-sub {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-subtle);
  margin-top: var(--sp-1);
}

/* ----------------------------------------------------------
   7. TYPOGRAPHY UTILITIES
   ---------------------------------------------------------- */

/* Display */
.text-display {
  font-family: var(--font-display);
  font-size: var(--text-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

/* Headings */
h1, .h1 {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-display);
}

h2, .h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}

h3, .h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  line-height: 1.2;
  letter-spacing: var(--ls-heading);
}

h4, .h4 {
  font-family: var(--font-body);
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: 1.3;
}

/* Body */
.text-lg   { font-size: var(--text-body-lg); }
.text-base { font-size: var(--text-body); }
.text-sm   { font-size: var(--text-body-sm); }

/* Mono */
.mono {
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  letter-spacing: var(--ls-mono);
}

.mono-lg {
  font-family: var(--font-mono);
  font-size: var(--text-mono-lg);
  letter-spacing: 0;
  font-weight: 700;
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  letter-spacing: var(--ls-mono);
}

/* Label */
.label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.label-accent { color: var(--accent); }
.label-gold   { color: var(--accent-gold); }

/* Color utilities */
.text-muted  { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-accent { color: var(--accent); }
.text-gold   { color: var(--accent-gold); }
.text-green  { color: var(--status-done); }
.text-warn   { color: var(--status-warn); }

/* ----------------------------------------------------------
   8. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  font-weight: 700;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}

/* Primary */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

/* Gold / Amber */
.btn-gold {
  background: var(--amber);
  color: var(--text-inverse);
  border-color: var(--amber);
}

.btn-gold:hover {
  background: var(--amber-dark);
  border-color: var(--amber-dark);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Subtle */
.btn-subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-color: var(--border);
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-strong);
}

/* Sizes */
.btn-sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: 9px;
}

.btn-lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: 12px;
}

/* ----------------------------------------------------------
   9. BADGE / TAG
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  white-space: nowrap;
}

.badge-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-gold {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-green {
  background: rgba(34, 197, 94, 0.12);
  color: var(--status-done);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.badge-neutral {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ----------------------------------------------------------
   10. CALCULATOR / INPUT COMPONENTS
   ---------------------------------------------------------- */

/* Calculator card */
.calculator {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow-lg);
  border-radius: var(--radius-xl);
  padding: var(--sp-8);
}

.calculator-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: var(--sp-2);
}

.calculator-desc {
  font-size: var(--text-body-sm);
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
  line-height: var(--lh-body);
}

/* Input group */
.input-group {
  margin-bottom: var(--sp-5);
}

.input-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--sp-2);
}

.input-label-text {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  letter-spacing: var(--ls-mono);
}

.input-label-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
}

.input-field {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
}

.input-field:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-field::placeholder {
  color: var(--text-subtle);
}

/* Input with suffix/prefix */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix,
.input-suffix {
  position: absolute;
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-subtle);
  pointer-events: none;
}

.input-prefix { left: var(--sp-4); }
.input-suffix { right: var(--sp-4); }

.input-field.has-prefix { padding-left: var(--sp-8); }
.input-field.has-suffix { padding-right: var(--sp-8); }

/* Range slider */
.input-range {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  margin: var(--sp-3) 0;
}

.input-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
  transition: box-shadow var(--transition-fast);
}

.input-range::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.25);
}

.input-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* Result display */
.result-box {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin-top: var(--sp-6);
}

.result-box.gold {
  background: rgba(245, 158, 11, 0.06);
  border-color: var(--border-gold);
}

.result-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.result-value {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: 1px;
  line-height: 1;
  color: var(--accent);
}

.result-value.gold {
  color: var(--accent-gold);
}

.result-value.green {
  color: var(--status-done);
}

.result-sub {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--text-muted);
  margin-top: var(--sp-2);
}

/* ----------------------------------------------------------
   11. PAGE HEADER
   ---------------------------------------------------------- */
.page-header {
  margin-bottom: var(--sp-10);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border);
}

.page-header-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-mono-sm);
  color: var(--accent);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  margin-bottom: var(--sp-3);
}

.page-header-title {
  font-family: var(--font-display);
  font-size: var(--text-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  margin-bottom: var(--sp-4);
}

.page-header-title .highlight {
  color: var(--accent);
}

.page-header-desc {
  font-size: var(--text-body-lg);
  color: var(--text-muted);
  line-height: var(--lh-body);
  max-width: 560px;
}

/* ----------------------------------------------------------
   12. MODULE PROGRESS / LESSON FLOW
   ---------------------------------------------------------- */
.lesson-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-6);
  background: var(--glass-bg);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lesson-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.lesson-item.active {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--accent-border);
}

.lesson-item.done {
  opacity: 0.7;
}

.lesson-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-subtle);
  min-width: 24px;
  letter-spacing: 1px;
}

.lesson-title {
  flex: 1;
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.lesson-item.active .lesson-title {
  color: var(--text);
}

.lesson-type {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-subtle);
  letter-spacing: 1px;
}

.lesson-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
}

.lesson-item.done .lesson-check {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--status-done);
}

/* ----------------------------------------------------------
   13. CONTENT — LESSON TEXT TYPOGRAPHY
   ---------------------------------------------------------- */
.lesson-content {
  max-width: 680px;
}

.lesson-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-h2);
  letter-spacing: var(--ls-heading);
  margin-bottom: var(--sp-4);
  margin-top: var(--sp-10);
  color: var(--text);
}

.lesson-content h2:first-child {
  margin-top: 0;
}

.lesson-content h3 {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  letter-spacing: var(--ls-heading);
  margin-bottom: var(--sp-3);
  margin-top: var(--sp-8);
  color: var(--text);
}

.lesson-content p {
  font-size: var(--text-body-lg);
  color: var(--text-muted);
  line-height: var(--lh-body);
  margin-bottom: var(--sp-5);
}

.lesson-content strong {
  color: var(--text);
  font-weight: 600;
}

.lesson-content em {
  color: var(--accent-gold);
  font-style: normal;
}

.lesson-content .callout {
  background: rgba(239, 68, 68, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
}

.lesson-content .callout p {
  margin-bottom: 0;
  font-size: var(--text-body);
}

.lesson-content .formula {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-5) var(--sp-6);
  margin: var(--sp-6) 0;
  font-family: var(--font-mono);
  font-size: var(--text-mono);
  color: var(--accent-gold);
  letter-spacing: var(--ls-mono);
  line-height: 1.8;
}

/* ----------------------------------------------------------
   14. DIVIDERS & SEPARATORS
   ---------------------------------------------------------- */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: var(--sp-8) 0;
}

.divider-accent {
  background: linear-gradient(90deg, var(--accent), transparent);
  height: 1px;
  margin: var(--sp-8) 0;
}

/* ----------------------------------------------------------
   15. GRID UTILITIES
   ---------------------------------------------------------- */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-5);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
}

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

/* ----------------------------------------------------------
   16. TOOLTIP
   ---------------------------------------------------------- */
[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(9, 3, 0, 0.95);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ----------------------------------------------------------
   17. SCROLLBAR
   ---------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 68, 68, 0.2) transparent;
}

*::-webkit-scrollbar { width: 4px; height: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(239, 68, 68, 0.2);
  border-radius: 2px;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(239, 68, 68, 0.4);
}

/* ----------------------------------------------------------
   18. ANIMATIONS
   ---------------------------------------------------------- */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@keyframes number-tick {
  0%   { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fade-in var(--transition-slow) forwards;
}

.animate-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ----------------------------------------------------------
   19. RESPONSIVE
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 180px;
    --content-padding: var(--sp-6);
  }
}

/* ── Tablet & Mobile: Sidebar ausblenden ── */
@media (max-width: 700px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  }

  /* Content — Platz für Mobile Top Bar (56px) */
  .main-content {
    margin-left: 0;
    padding: 70px var(--sp-4) var(--sp-8);
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Mobile: Basis-Schriftgrösse rauf */
  body { font-size: 16px; }

  /* iOS: Input-Felder müssen mind. 16px haben — sonst zoomt Safari automatisch rein! */
  input, input[type="number"], input[type="text"],
  input[type="email"], input[type="password"],
  textarea, select, .input-field {
    font-size: 16px !important;
  }

  /* Page Header kompakter */
  .page-header { padding: 16px 0 20px; }
  .page-header-title { font-size: clamp(34px, 10vw, 56px); }
  .page-header-desc  { font-size: 15px; line-height: 1.65; }
  .page-header-eyebrow { margin-bottom: 6px; }

  /* Karten */
  .card { padding: 18px 16px; border-radius: 12px; }

  /* Grids */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Inline-Grid Overrides (Calculator-Grids mit inline style) */
  .mob-grid-2 { grid-template-columns: 1fr !important; }
  .mob-grid-3 { grid-template-columns: 1fr !important; }

  /* Module-Cards auf Dashboard */
  .module-card { padding: 18px 16px; }

  /* Buttons touch-friendly */
  .btn { padding: 10px 16px; min-height: 40px; }
  .btn-primary { padding: 12px 20px; }

  /* Progress Bar */
  .progress-bar { height: 3px; }

  /* Hubpage Stats */
  .hub-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
}

/* ── Mobile: Kleine Screens ── */
@media (max-width: 480px) {
  .main-content {
    padding: 60px var(--sp-4) var(--sp-6);
  }

  /* Typografie — Page Header */
  .page-header-title { font-size: clamp(34px, 10vw, 52px); }
  .page-header-eyebrow { font-size: 11px; letter-spacing: 3px; }
  .page-header-desc { font-size: 15px; line-height: 1.7; }

  /* Karten — etwas kompakter aber nicht zu eng */
  .card { padding: 20px 16px; border-radius: 12px; }

  /* Lesson Content */
  .lesson-content p  { font-size: 16px; line-height: 1.85; margin-bottom: 20px; }
  .lesson-content h3 { font-size: 24px; margin: 36px 0 14px; }
  .lesson-content h4 { font-size: 18px; margin: 26px 0 10px; }
  .lesson-content li { font-size: 16px; line-height: 1.75; }

  /* Big Quote */
  .big-quote {
    font-size: clamp(18px, 4.8vw, 24px);
    padding: 16px 18px;
    margin: 28px 0;
  }

  /* Callouts */
  .callout, .callout-warning, .callout-gold {
    padding: 16px 18px;
    margin: 24px 0;
  }

  /* Number Callout */
  .number-callout {
    flex-direction: column;
    gap: 14px;
    padding: 20px 22px;
  }
  .number-callout-num { font-size: 48px; min-width: auto; }

  /* Stat Rows */
  .stat-row   { grid-template-columns: 1fr 1fr; gap: 10px; margin: 26px 0; }
  .stat-row-2 { grid-template-columns: 1fr; }
  .stat-row-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-box   { padding: 16px 12px; }
  .stat-box-num { font-size: 30px; }

  /* Scenario Block */
  .scenario-block { padding: 20px 18px; }
  .scenario-block-title { font-size: 17px; }

  /* Compare Table — horizontaler Scroll, KEIN negativer Margin (würde Overflow triggern) */
  .compare-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    width: 100%;
  }
  .compare-table {
    white-space: nowrap !important;
    min-width: unset !important;
    width: auto;
  }

  /* Lesson Footer */
  .lesson-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 36px;
    padding-top: 22px;
  }
  .lesson-counter { order: -1; text-align: center; }
  .lesson-footer > div { display: flex; gap: 8px; }
  .btn-complete, .lesson-footer .btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }

  /* Rechner / Calculator Inputs */
  .calc-grid, .input-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .result-box { padding: 16px; }
  input[type="number"], input[type="text"], select {
    font-size: 16px; /* verhindert zoom auf iOS */
    padding: 12px 14px;
  }

  /* Condition List */
  .condition-item { padding: 14px 16px; gap: 12px; }

  /* Hub keine 2-Spalten Stats */
  .hub-stats { grid-template-columns: 1fr 1fr; }
}

/* ----------------------------------------------------------
   20. UTILITY CLASSES
   ---------------------------------------------------------- */
.flex        { display: flex; }
.flex-col    { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2       { gap: var(--sp-2); }
.gap-3       { gap: var(--sp-3); }
.gap-4       { gap: var(--sp-4); }
.gap-6       { gap: var(--sp-6); }
.gap-8       { gap: var(--sp-8); }
.flex-1      { flex: 1; }
.shrink-0    { flex-shrink: 0; }
.w-full      { width: 100%; }
.h-full      { height: 100%; }
.relative    { position: relative; }
.overflow-hidden { overflow: hidden; }
.mt-2        { margin-top: var(--sp-2); }
.mt-4        { margin-top: var(--sp-4); }
.mt-6        { margin-top: var(--sp-6); }
.mt-8        { margin-top: var(--sp-8); }
.mb-2        { margin-bottom: var(--sp-2); }
.mb-4        { margin-bottom: var(--sp-4); }
.mb-6        { margin-bottom: var(--sp-6); }
.mb-8        { margin-bottom: var(--sp-8); }
.p-4         { padding: var(--sp-4); }
.p-6         { padding: var(--sp-6); }
.p-8         { padding: var(--sp-8); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.opacity-50  { opacity: 0.5; }
.opacity-0   { opacity: 0; }
.pointer-events-none { pointer-events: none; }
.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }
.truncate    { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
