:root {
  --bg-dark: #0a0f1d;
  --bg-panel: #111827;
  --bg-card: #162035;
  --bg-card-hover: #1e2c48;
  --bg-code: #0b1120;
  --border: #243452;
  --border-light: #32476e;
  --text-main: #f3f6fc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --primary: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.25);
  --accent: #f59e0b;
  --accent-glow: rgba(245, 158, 11, 0.22);
  --emerald: #10b981;
  --emerald-bg: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --purple: #8b5cf6;
  --cyan: #06b6d4;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  width: 550px;
  height: 550px;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}
.bg-glow-1 {
  top: -150px;
  left: -100px;
  background: var(--primary);
}
.bg-glow-2 {
  bottom: -150px;
  right: -100px;
  background: var(--accent);
}

/* TOPBAR */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.brand h1 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-main);
}

.topbar-center {
  flex: 1;
  max-width: 340px;
  margin: 0 20px;
}

.progress-wrapper {
  width: 100%;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.progress-bar-bg {
  height: 8px;
  background: var(--bg-code);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-pill {
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-pill strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}
.stat-label-short {
  display: none;
}

.timer-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.btn-xs {
  background: var(--primary);
  color: white;
  border: none;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-xs:hover {
  opacity: 0.9;
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.mobile-progress-line {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--bg-code);
}
.mobile-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  transition: width 0.35s ease;
}

/* LAYOUT */
.layout {
  display: flex;
  padding-top: 64px;
  min-height: 100vh;
}

.sidebar {
  width: 290px;
  background: rgba(17, 24, 39, 0.95);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  position: fixed;
  top: 64px;
  bottom: 0;
  left: 0;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 90;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  padding: 0 10px;
  margin-bottom: 4px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border);
}
.nav-item.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 0 15px var(--primary-glow);
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-icon {
  font-size: 1.05rem;
}

.nav-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.nav-item.active .nav-badge {
  border-color: var(--primary);
  color: var(--primary);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cheat-tip {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.74rem;
  color: var(--accent);
  line-height: 1.45;
}
.cheat-tip strong {
  color: #fff;
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-danger-outline:hover {
  color: var(--danger);
  border-color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  margin-left: 290px;
  padding: 30px;
  max-width: 1100px;
  min-height: calc(100vh - 64px);
  position: relative;
  z-index: 1;
}

.page-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* CARDS & PANELS */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* HERO SECTION */
.hero-banner {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(124, 58, 237, 0.12));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--primary);
  color: #bfdbfe;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  width: fit-content;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.25;
  background: linear-gradient(120deg, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 800px;
  line-height: 1.6;
}

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

.hero-stat-card {
  background: rgba(17, 24, 39, 0.7);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hero-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent);
}
.hero-stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* PILLS & BADGES */
.badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-blue { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.badge-purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.35); }

/* CALLOUT BOXES */
.callout {
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 12px;
  margin: 12px 0;
  font-size: 0.88rem;
  line-height: 1.55;
}
.callout-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}
.callout-body strong {
  display: block;
  margin-bottom: 4px;
}
.callout-trap {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.callout-trap strong { color: #f87171; }

.callout-tip {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fde68a;
}
.callout-tip strong { color: #fbbf24; }

.callout-rule {
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #bfdbfe;
}
.callout-rule strong { color: #60a5fa; }

/* FORMULA CARDS */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.formula-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.25s;
  cursor: pointer;
  position: relative;
}
.formula-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

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

.formula-page-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-dim);
}

.formula-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-main);
}

.formula-box {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #93c5fd;
  text-align: center;
  overflow-x: auto;
}

.formula-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.formula-trap-pill {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #f87171;
  font-size: 0.72rem;
  padding: 6px 8px;
  border-radius: 6px;
  display: flex;
  gap: 6px;
  line-height: 1.4;
}

/* PIÈGES SCANNER */
.piege-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.piege-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.piege-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}
.piege-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.piege-conseil {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #a7f3d0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
}

/* EXAM / QCM QUESTIONS */
.qcm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.qcm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.qcm-num {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.bareme-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: var(--bg-code);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--accent);
}

.qcm-enonce {
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.6;
}

.qcm-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qcm-opt {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.qcm-opt:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-light);
}

.opt-letter {
  background: var(--bg-code);
  border: 1px solid var(--border);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-main);
  flex-shrink: 0;
  font-size: 0.8rem;
}

.qcm-opt.selected {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
}
.qcm-opt.selected .opt-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.qcm-opt.correct {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.15) !important;
  color: #fff !important;
}
.qcm-opt.correct .opt-letter {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.qcm-opt.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
}
.qcm-opt.wrong .opt-letter {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.qcm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-validate {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-validate:hover { opacity: 0.9; }

.qcm-solution {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.55;
}
.qcm-solution.show { display: flex; }

/* FLASHCARDS */
.fc-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 650px;
  margin: 0 auto;
}

.fc-card {
  width: 100%;
  min-height: 320px;
  perspective: 1000px;
  cursor: pointer;
}

.fc-inner {
  position: relative;
  width: 100%;
  min-height: 320px;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.fc-card.flipped .fc-inner {
  transform: rotateY(180deg);
}

.fc-front, .fc-back {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 320px;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
}

.fc-front {
  background: linear-gradient(135deg, var(--bg-card), #19253d);
}

.fc-back {
  background: linear-gradient(135deg, #131c2e, #1a2740);
  transform: rotateY(180deg);
  border-color: var(--primary);
}

.fc-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.fc-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.fc-body {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
  text-align: left;
}

.fc-hint {
  font-size: 0.76rem;
  color: var(--text-dim);
  font-style: italic;
}

.fc-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* CONTEXT TABLES & DIAGRAMS IN ANNALES */
.annale-context-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.context-box-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.context-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.context-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.exam-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-family: var(--font-sans);
  background: var(--bg-code);
  border-radius: 6px;
  overflow: hidden;
}

.exam-table th, .exam-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
}

.exam-table th {
  background: rgba(37, 99, 235, 0.16);
  color: #bfdbfe;
  font-weight: 700;
}

/* TUTEUR DE RAISONNEMENT PAS-À-PAS (MODE GUIDÉ) */
.mode-toggle-bar {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.guided-tutor-box {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(22, 32, 53, 0.95));
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guided-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.guided-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #93c5fd;
}

.guided-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.btn-guided-next {
  background: linear-gradient(135deg, #2563eb, #059669);
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.btn-guided-next:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.guided-steps-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.guided-step-item {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s;
}

.guided-step-item.unlocked {
  border-color: rgba(59, 130, 246, 0.45);
}

.guided-step-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.guided-step-item.unlocked .guided-step-header {
  background: rgba(59, 130, 246, 0.12);
  color: #fff;
}

.guided-step-body {
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.55;
  border-top: 1px solid var(--border);
  display: none;
}

.guided-step-item.unlocked .guided-step-body {
  display: block;
}

/* CALCULATEURS */
.calc-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.calc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-input, .form-textarea, .form-select {
  background: var(--bg-code);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
}

.calc-result {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #93c5fd;
  line-height: 1.5;
  white-space: pre-wrap;
  min-height: 80px;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-close:hover { color: #fff; }

/* RESPONSIVE */
@media (max-width: 900px) {
  .icon-btn { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 18px;
    padding-bottom: 80px;
  }
  .topbar-center {
    display: none;
  }
  .stat-label-full {
    display: none;
  }
  .stat-label-short {
    display: inline;
  }
  .mobile-progress-line {
    display: block;
  }
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 95;
    padding: 0 6px;
  }
  .mob-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
  }
  .mob-nav-btn.active {
    color: var(--primary);
  }
}
