/* ==========================================================================
   FÜHRERSCHEIN THEORIE PRO 2026 – ULTRA-MODERN GERMAN DESIGN SYSTEM
   Bespoke Glassmorphism, Luxury Obsidian Aesthetics & Mobile-First UX
   ========================================================================== */

:root {
  /* Core Obsidian Palette */
  --bg-deep: #050811;
  --bg-primary: #090e1a;
  --bg-secondary: #0f172a;
  --bg-tertiary: #162035;
  --bg-elevated: #1e2c47;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-glass: rgba(9, 14, 26, 0.82);
  --bg-glass-card: rgba(22, 32, 53, 0.65);

  /* Text Hierarchy */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #050811;

  /* Borders & Micro-Lines */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(59, 130, 246, 0.45);

  /* Vibrant Accents */
  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  --accent-glow: rgba(59, 130, 246, 0.35);
  --accent-subtle: rgba(59, 130, 246, 0.12);

  /* Status Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.35);
  --success-subtle: rgba(16, 185, 129, 0.12);
  --success-border: rgba(16, 185, 129, 0.35);

  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.35);
  --warning-subtle: rgba(245, 158, 11, 0.12);
  --warning-border: rgba(245, 158, 11, 0.35);

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.35);
  --danger-subtle: rgba(239, 68, 68, 0.15);
  --danger-border: rgba(239, 68, 68, 0.35);

  --purple: #a855f7;
  --purple-glow: rgba(168, 85, 247, 0.35);
  --purple-subtle: rgba(168, 85, 247, 0.14);

  /* Typography */
  --font-main: 'Outfit', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-ar: 'Cairo', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* Geometry & Shadows */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.35);

  --transition-fast: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-deep: #eef2f6;
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-elevated: #e2e8f0;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-card: rgba(255, 255, 255, 0.9);

  --text-primary: #090e1a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-glass: rgba(0, 0, 0, 0.12);
  --border-highlight: rgba(59, 130, 246, 0.4);

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-body);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

h1, h2, h3, h4, .brand-title {
  font-family: var(--font-main);
  letter-spacing: -0.02em;
}

.lang-ar-text {
  font-family: var(--font-ar);
  line-height: 1.8;
}

/* Ambient Animated Glow Canvas */
.ambient-glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.22;
}

.glow-orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: -100px;
  left: -100px;
}

.glow-orb-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  bottom: 10%;
  right: -150px;
}

.glow-orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.12;
}

/* ==========================================================================
   App Header (Sleek Floating Island Design)
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.header-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
}

.brand-logo-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.brand-name-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.2;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: var(--accent-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Nav Tabs (Desktop) */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(15, 23, 42, 0.7);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-main);
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-btn.active {
  color: #ffffff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 14px var(--accent-glow);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 42px;
  transition: all var(--transition-fast);
}

.user-avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  flex-shrink: 0;
}

.user-chip-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

.desktop-only-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.control-btn, .lang-select, .scope-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 42px;
  transition: all var(--transition-fast);
}

.control-btn:hover, .lang-select:hover, .scope-select:hover {
  border-color: var(--accent-primary);
}

.mobile-settings-btn {
  display: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-size: 1.35rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.mobile-settings-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Progress Subbar (Live Statistics Ribbon)
   ========================================================================== */
.progress-subbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.6rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
}

.progress-subbar-container {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.stats-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
}

.stat-pill-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.stat-pill-label strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 800;
}

.stat-badge-pill {
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
}

.stat-badge-pill.green {
  color: var(--success);
  border-color: var(--success-border);
  background: var(--success-subtle);
}

.stat-badge-pill.orange {
  color: var(--warning);
  border-color: var(--warning-border);
  background: var(--warning-subtle);
}

.stat-badge-pill.yellow {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
}

.progress-bar-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 240px;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  width: 0%;
  border-radius: var(--radius-full);
  transition: width var(--transition-smooth);
}

.progress-percent-badge {
  font-size: 0.88rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--success);
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.main-content {
  flex: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 110px 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  position: relative;
  z-index: 1;
}

.view-section {
  display: none;
  animation: fadeInView 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.section-header {
  margin-bottom: 1.75rem;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.section-title {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.4rem;
  line-height: 1.55;
  max-width: 850px;
}

.btn-return-home {
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all var(--transition-fast);
}

.btn-return-home:hover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}

/* ==========================================================================
   VIEW 0: Home Hub (The 4 Core Interactive Cards)
   ========================================================================== */
.home-hero-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.hero-left {
  flex: 1;
}

.hero-chip-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.hero-badge-live {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.hero-badge-class {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--accent-subtle);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.home-hero-card h1 {
  font-size: 1.9rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
}

.home-hero-card p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 0.45rem;
  max-width: 780px;
}

.streak-circle-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.streak-icon {
  font-size: 2.2rem;
  margin-bottom: 0.25rem;
}

.streak-num {
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-main);
  color: #f59e0b;
}

.streak-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* The 4 Core Hub Cards Grid */
.hub-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.35rem;
  margin-bottom: 2rem;
}

.hub-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.hub-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.hub-card:active {
  transform: scale(0.98);
}

.hub-card.card-training:hover {
  border-color: #3b82f6;
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.3);
}

.hub-card.card-exam:hover {
  border-color: #a855f7;
  box-shadow: 0 12px 40px rgba(168, 85, 247, 0.3);
}

.hub-card.card-stats:hover {
  border-color: #10b981;
  box-shadow: 0 12px 40px rgba(16, 185, 129, 0.3);
}

.hub-card.card-feedback:hover {
  border-color: #f59e0b;
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.3);
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-icon-box {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.hub-icon-box.bg-blue {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(59, 130, 246, 0.1));
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.hub-icon-box.bg-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.hub-icon-box.bg-green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.hub-icon-box.bg-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.hub-tag {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.hub-tag.highlight {
  background: var(--purple-subtle);
  color: #d8b4fe;
  border-color: rgba(168, 85, 247, 0.4);
}

.hub-card-body h3 {
  font-size: 1.35rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.45rem;
  line-height: 1.3;
}

.hub-card-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hub-card-footer {
  display: flex;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-subtle);
}

.hub-action-btn {
  font-size: 0.98rem;
  font-weight: 900;
  font-family: var(--font-main);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

/* Quick Shortcuts */
.quick-shortcuts-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.quick-chip {
  padding: 0.8rem 1.35rem;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: var(--font-main);
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--transition-fast);
}

.quick-chip:hover {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}

/* ==========================================================================
   VIEW 1: 50-Question Daily Cards Grid
   ========================================================================== */
.days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.day-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-card);
}

.day-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.day-card.current {
  border-color: var(--accent-primary);
  background: linear-gradient(180deg, var(--bg-tertiary) 0%, rgba(59, 130, 246, 0.12) 100%);
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.day-badge-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.day-num-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  font-family: var(--font-mono);
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.day-title-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: #ffffff;
}

.day-range-pill {
  font-size: 0.85rem;
  font-weight: 900;
  padding: 0.3rem 0.75rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
}

.day-stats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.day-progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.day-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  width: 0%;
  transition: width var(--transition-smooth);
}

.day-btn-start {
  width: 100%;
  padding: 0.9rem;
  font-size: 1rem;
  font-weight: 900;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: none;
  background: var(--bg-tertiary);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition: all var(--transition-fast);
}

.day-card:hover .day-btn-start {
  background: var(--accent-gradient);
  box-shadow: 0 4px 18px var(--accent-glow);
}

/* ==========================================================================
   VIEW 3: Study Runner / Question Card
   ========================================================================== */
.study-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.study-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.study-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass-card);
  padding: 0.95rem 1.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  font-size: 0.95rem;
  font-weight: 700;
}

.study-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

/* Question Card */
.question-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-card);
}

.question-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
}

.meta-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.qid-pill {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 900;
  padding: 0.35rem 0.85rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.points-pill {
  font-size: 0.88rem;
  font-weight: 900;
  font-family: var(--font-mono);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.points-pill.pts-5 {
  background: var(--danger-subtle);
  color: #f87171;
  border: 1px solid var(--danger-border);
}

.points-pill.pts-4 {
  background: var(--warning-subtle);
  color: #fbbf24;
  border: 1px solid var(--warning-border);
}

.points-pill.pts-3, .points-pill.pts-2 {
  background: var(--accent-subtle);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.status-badge {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-full);
}

.status-badge.mastered {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.status-badge.review {
  background: var(--warning-subtle);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.status-badge.unseen {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.question-title {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.5;
  color: #ffffff;
}

.question-title-dual {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
}

/* Media Showcase */
.media-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

.media-image {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.media-video {
  width: 100%;
  max-height: 420px;
  background: #000000;
}

.video-controls-overlay {
  width: 100%;
  background: rgba(0, 0, 0, 0.85);
  padding: 0.6rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #ffffff;
}

/* Options List */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
  user-select: none;
  min-height: 64px;
}

.option-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-elevated);
}

.option-checkbox {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 900;
  font-size: 1.05rem;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
}

.option-text-group {
  flex: 1;
}

.option-main-text {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.5;
}

.option-sub-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
}

/* Selected State */
.option-item.is-selected {
  background: rgba(59, 130, 246, 0.18) !important;
  border-color: var(--accent-primary) !important;
}
.option-item.is-selected .option-checkbox {
  background: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #ffffff !important;
}

/* Revealed Correct State */
.option-item.is-correct {
  background: var(--success-subtle) !important;
  border-color: var(--success) !important;
}
.option-item.is-correct .option-checkbox {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #ffffff !important;
}

/* Revealed Incorrect Selected State */
.option-item.is-incorrect-selected {
  background: var(--danger-subtle) !important;
  border-color: var(--danger) !important;
}
.option-item.is-incorrect-selected .option-checkbox {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #ffffff !important;
}

/* Big "Show Correct Answer" Button */
.btn-reveal-answer {
  width: 100%;
  padding: 1.25rem 1.75rem;
  font-size: 1.15rem;
  font-weight: 900;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  box-shadow: 0 4px 24px var(--accent-glow);
  transition: all var(--transition-fast);
  margin-top: 0.65rem;
  min-height: 56px;
}

.btn-reveal-answer:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.55);
}

.btn-reveal-answer:active {
  transform: scale(0.98);
}

/* Explanation Box */
.explanation-box {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.explanation-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #60a5fa;
  font-weight: 900;
  font-size: 1.1rem;
}

.explanation-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.explanation-content-de {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-subtle);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Study Action Buttons Toolbar */
.study-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.65rem;
}

.action-btn-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-mastered {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid var(--success-border);
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
}

.btn-mastered:hover, .btn-mastered.active {
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--success-glow);
}

.btn-review {
  background: var(--warning-subtle);
  color: var(--warning);
  border: 1px solid var(--warning-border);
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
}

.btn-review:hover, .btn-review.active {
  background: var(--warning);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--warning-glow);
}

.btn-bookmark {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.98rem;
  font-weight: 800;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 48px;
}

.btn-bookmark.active {
  color: #facc15;
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.15);
}

.nav-arrows-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.btn-nav-arrow {
  padding: 0.75rem 1.45rem;
  font-size: 0.98rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
}

.btn-nav-arrow:hover {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-nav-arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Sidebar Navigator */
.study-sidebar {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 95px;
}

.sidebar-header {
  font-size: 1.05rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.question-grid-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
  max-height: 380px;
  overflow-y: auto;
}

.grid-nav-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
}

.grid-nav-item.current {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
  color: #ffffff;
}

.grid-nav-item.mastered {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.grid-nav-item.review {
  background: var(--warning);
  color: #ffffff;
  border-color: var(--warning);
}

/* ==========================================================================
   VIEW 4: Official Exam Simulation Styles (TÜV / DEKRA)
   ========================================================================== */
.exam-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.35rem;
  margin-bottom: 1.35rem;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.exam-timer-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 900;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.exam-timer-box.warning {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  animation: timerPulse 1s infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-submit-exam {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.45rem;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 900;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 16px var(--success-glow);
}

/* Exam Result Card */
.exam-result-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
  box-shadow: var(--shadow-lg);
}

.exam-result-banner {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  width: 100%;
}

.exam-result-banner.passed {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(5, 150, 105, 0.35));
  border: 2px solid var(--success-border);
  color: var(--success);
}

.exam-result-banner.failed {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(220, 38, 38, 0.35));
  border: 2px solid var(--danger-border);
  color: #f87171;
}

.result-badge-big {
  font-size: 4rem;
  margin-bottom: 0.5rem;
}

.result-title-big {
  font-size: 2.2rem;
  font-weight: 900;
}

.result-error-points {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-top: 0.5rem;
}

.exam-stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  width: 100%;
}

.exam-stat-mini-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.exam-stat-mini-box strong {
  font-size: 1.45rem;
  font-family: var(--font-mono);
  color: #ffffff;
}

.exam-stat-mini-box span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   VIEW 5: Statistics Dashboard
   ========================================================================== */
.stats-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-kpi-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  box-shadow: var(--shadow-card);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 800;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #ffffff;
}

.exam-history-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.history-item-row {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ==========================================================================
   VIEW 6: Help, FAQ & Reviews Hub
   ========================================================================== */
.feedback-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

.feedback-card, .faq-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}

.card-section-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.45rem;
}

.card-section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.star-rating-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.star-btn {
  padding: 0.65rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: var(--font-main);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
}

.star-btn.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: rgba(245, 158, 11, 0.7);
  color: #fbbf24;
}

.community-feed-wrap {
  margin-top: 2.25rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.5rem;
}

.community-feed-title {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.community-review-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin-bottom: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.review-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.faq-item h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ==========================================================================
   VIEW 7 & 8: Search & Formulas
   ========================================================================== */
.search-bar-container {
  display: flex;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  flex: 1;
  position: relative;
}

.search-input {
  width: 100%;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.15rem 0.95rem 2.85rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-pills-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.filter-pill {
  padding: 0.55rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.filter-pill.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.search-result-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.15rem;
  cursor: pointer;
  touch-action: manipulation;
  transition: all var(--transition-fast);
}

.search-result-card:hover {
  border-color: var(--accent-primary);
  transform: translateX(6px);
}

/* Formulas Grid */
.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.formula-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.formula-card h3 {
  font-size: 1.15rem;
  font-weight: 900;
}

.formula-equation {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 0.95rem;
  border-radius: var(--radius-md);
  font-size: 1.15rem;
  font-weight: 900;
  color: #60a5fa;
  text-align: center;
  border: 1px solid var(--border-subtle);
}

.formula-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.calculator-box {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.calc-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  margin: 1.5rem 0;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.speed-val-badge {
  font-size: 1.65rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: #60a5fa;
}

.speed-slider {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  outline: none;
  cursor: pointer;
  accent-color: var(--accent-primary);
}

.calc-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.95rem;
}

.calc-result-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-item-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.calc-result-val {
  font-size: 1.75rem;
  font-weight: 900;
  font-family: var(--font-mono);
  color: var(--success);
}

.calc-result-val.hazard-val {
  color: var(--warning);
}

.calc-result-val.stop-val {
  color: #60a5fa;
}

.calc-result-val.hazstop-val {
  color: #38bdf8;
}

.calc-sub-formula {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals & Login Overlay
   ========================================================================== */
.user-login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 17, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  pointer-events: auto;
}

.user-login-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

.user-login-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-align: center;
}

.login-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.flag-pill {
  background: var(--bg-tertiary);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 900;
  border: 1px solid var(--border-subtle);
}

.edition-pill {
  background: var(--accent-subtle);
  color: #60a5fa;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 800;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.login-header h2 {
  font-size: 1.6rem;
  font-weight: 900;
}

.login-header p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 0.45rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  margin-bottom: 1.15rem;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 800;
}

.form-input {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.25rem;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  outline: none;
  min-height: 52px;
}

.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-primary-glow {
  width: 100%;
  padding: 1.1rem;
  font-size: 1.1rem;
  font-weight: 900;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-gradient);
  color: #ffffff;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 4px 20px var(--accent-glow);
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

.login-footer-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* Settings Modal */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2500;
  display: none;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.settings-modal-overlay.open {
  display: flex !important;
  pointer-events: auto !important;
}

.settings-sheet {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-glass);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-width: 520px;
  width: 100%;
  padding: 1.5rem 1.75rem 2.5rem 1.75rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideUpSheet 260ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.settings-sheet-handle {
  width: 46px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--border-highlight);
  opacity: 0.7;
  margin: 0 auto 1.5rem auto;
}

.settings-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.sheet-title-group h3 {
  font-size: 1.35rem;
  font-weight: 900;
}

.sheet-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.settings-close-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.settings-sheet-body {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.settings-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.settings-item label {
  font-size: 0.95rem;
  font-weight: 800;
}

.settings-subtext {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.theme-toggle-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.theme-option-btn {
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
  min-height: 50px;
}

.theme-option-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.btn-logout-user {
  width: 100%;
  padding: 1rem;
  font-size: 0.98rem;
  font-weight: 800;
  font-family: var(--font-main);
  border-radius: var(--radius-md);
  border: 1px solid var(--danger-border);
  background: var(--danger-subtle);
  color: #f87171;
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
}

/* Lightbox */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 3500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

.lightbox-modal.open {
  display: flex !important;
  pointer-events: auto !important;
}

.lightbox-img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius-md);
}

.lightbox-close {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top));
  right: max(1.25rem, env(safe-area-inset-right));
  background: var(--bg-secondary);
  color: #ffffff;
  border: none;
  font-size: 1.6rem;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  cursor: pointer;
  touch-action: manipulation;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Mobile Floating Dock Navigation Bar
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  z-index: 1200;
  padding: 0.45rem 0.35rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  font-family: var(--font-main);
  cursor: pointer;
  touch-action: manipulation;
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  gap: 0.2rem;
  flex: 1;
  min-height: 50px;
}

.mobile-nav-item:active {
  transform: scale(0.92);
}

.mobile-nav-item.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.14);
}

.mobile-nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

/* ==========================================================================
   Mobile Responsive Rules (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .nav-tabs {
    display: none !important;
  }

  .desktop-only-controls {
    display: none !important;
  }

  .mobile-settings-btn {
    display: flex !important;
  }

  .mobile-bottom-nav {
    display: flex !important;
  }

  .main-content {
    padding: 1rem;
    padding-bottom: 110px;
  }

  .app-header {
    padding: 0.65rem 1rem;
    padding-top: max(0.65rem, env(safe-area-inset-top));
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .brand-title {
    font-size: 1rem;
  }

  .user-chip-btn {
    max-width: 120px;
    font-size: 0.82rem;
    padding: 0.35rem 0.75rem;
  }

  .home-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem 1.25rem;
  }

  .streak-circle-card {
    width: 100%;
    flex-direction: row;
    gap: 1rem;
    padding: 0.85rem;
  }

  .home-hero-card h1 {
    font-size: 1.45rem;
  }

  .hub-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .hub-card {
    padding: 1.5rem;
  }

  .study-layout {
    grid-template-columns: 1fr;
  }

  .study-sidebar {
    display: none;
  }

  .question-card {
    padding: 1.35rem;
  }

  .question-title {
    font-size: 1.25rem;
  }

  .media-image, .media-video {
    max-height: 260px;
  }

  .option-item {
    padding: 1rem 1.15rem;
    min-height: 60px;
  }

  .option-main-text {
    font-size: 1.05rem;
  }

  .study-actions-row {
    flex-direction: column;
    width: 100%;
  }

  .action-btn-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .action-btn-group button {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.9rem;
  }

  .nav-arrows-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .btn-nav-arrow {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
  }

  .feedback-layout {
    grid-template-columns: 1fr;
  }
}
