/* =========================================================================
 * styles.css — Compléments Tailwind
 * Thème : sombre / accent vert émeraude
 * ========================================================================= */

:root {
  --bg-base: #0a0a0a;
  --bg-card: #161616;
  --bg-elevated: #1f1f1f;
  --bg-hover: #262626;
  --border: #2a2a2a;
  --accent: #10b981;
  --accent-hover: #34d399;
  --accent-dim: rgba(16, 185, 129, 0.15);
  --danger: #ef4444;
  --warn: #f59e0b;
  --info: #38bdf8;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
}

/* ============================== HEADER ============================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.countdown-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 9999px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 0.85rem;
}

.countdown-pill.urgent {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border-color: var(--danger);
}

/* ============================== NAV ============================== */
.nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.5rem 1rem 0.75rem;
  overflow-x: auto;
}

.nav-btn {
  padding: 0.5rem 0.85rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.875rem;
  white-space: nowrap;
  transition: all 0.15s;
}

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

.nav-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================== CARDS ============================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.card-elevated {
  background: var(--bg-elevated);
}

/* ============================== BUTTONS ============================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #052e22;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

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

.btn-secondary:hover {
  background: var(--bg-elevated);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

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

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================== STATS ============================== */
.stat-block {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.5rem;
}

/* ============================== JAUGE DÉBIT ============================== */
.gauge {
  position: relative;
  width: 100%;
  height: 14px;
  background: var(--bg-elevated);
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.gauge-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--danger) 0%, var(--warn) 30%, var(--accent) 50%, var(--warn) 80%, var(--danger) 100%);
  width: 100%;
}

.gauge-marker {
  position: absolute;
  top: -3px;
  width: 4px;
  height: 20px;
  background: var(--text-primary);
  border-radius: 2px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 2px var(--bg-base);
}

.gauge-zones {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

/* ============================== BARS ============================== */
.bar-h {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.bar-label {
  width: 120px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.bar-track {
  flex: 1;
  height: 18px;
  background: var(--bg-elevated);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.4s;
}

.bar-fill.danger { background: var(--danger); }
.bar-fill.warn { background: var(--warn); }

.bar-value {
  width: 50px;
  text-align: right;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

/* ============================== QCM ============================== */
.qcm-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-primary);
  font-size: 0.925rem;
}

.qcm-option:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}

.qcm-option.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.qcm-option.correct {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.2);
}

.qcm-option.incorrect {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.15);
}

.qcm-option.disabled {
  cursor: default;
  pointer-events: none;
}

/* ============================== STT BOX ============================== */
.stt-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.stt-box.recording {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.parasite {
  background: rgba(239, 68, 68, 0.3);
  color: #fecaca;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

.ancrage-found {
  background: rgba(16, 185, 129, 0.3);
  color: #a7f3d0;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 600;
}

.ancrage-missing {
  display: inline-block;
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 2px;
  border: 1px dashed var(--danger);
}

.ancrage-ok {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.8rem;
  margin: 2px;
  border: 1px solid var(--accent);
}

/* ============================== RECORD BUTTON ============================== */
.btn-record {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.btn-record::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid var(--danger);
  opacity: 0;
}

.btn-record.recording::before {
  animation: recordPulse 1.4s ease-out infinite;
  opacity: 1;
}

@keyframes recordPulse {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.btn-record.idle {
  background: var(--accent);
  color: #052e22;
}

/* ============================== TIMER ============================== */
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 2rem;
  color: var(--accent);
}

.timer.warning { color: var(--warn); }
.timer.danger { color: var(--danger); }

/* ============================== TIMELINE SIMULATION ============================== */
.phase-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  opacity: 0.55;
  transition: all 0.2s;
}

.phase-row.active {
  opacity: 1;
  border-color: var(--accent);
  background: var(--accent-dim);
}

.phase-row.done {
  opacity: 0.4;
}

.phase-mins {
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-size: 0.85rem;
  min-width: 56px;
}

/* ============================== FLASHCARD ============================== */
.flashcard {
  perspective: 1200px;
  width: 100%;
  max-width: 480px;
  height: 280px;
  margin: 0 auto;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s;
}

.flashcard.flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-size: 1.05rem;
  line-height: 1.5;
}

.flashcard-face.back {
  transform: rotateY(180deg);
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
}

/* ============================== INPUT DRILL ============================== */
.drill-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  width: 100%;
}

.drill-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.drill-input.correct { border-color: var(--accent); }
.drill-input.incorrect { border-color: var(--danger); }

/* ============================== SCROLLBAR ============================== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-hover); }

/* ============================== TEXT UTILITIES ============================== */
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-warn { color: var(--warn); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill-accent { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
.pill-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid var(--danger); }
.pill-warn { background: rgba(245, 158, 11, 0.15); color: var(--warn); border: 1px solid var(--warn); }
.pill-info { background: rgba(56, 189, 248, 0.15); color: var(--info); border: 1px solid var(--info); }
.pill-secondary { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border); }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 640px) {
  .timer { font-size: 1.5rem; }
  .stat-value { font-size: 1.4rem; }
  .nav-bar { padding: 0.5rem; }
  .nav-btn { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

/* ============================== HIDDEN BY DEFAULT ============================== */
.hidden { display: none !important; }

.view {
  padding: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ============================== PROGRESS BAR ============================== */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

/* ============================== FEEDBACK BOX ============================== */
.feedback-block {
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.feedback-block.weak {
  border-left-color: var(--danger);
}

.feedback-block.ok {
  border-left-color: var(--accent);
}

.feedback-block.warn {
  border-left-color: var(--warn);
}

/* ============================== TABS ============================== */
.tab-bar {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab:hover:not(.active) {
  color: var(--text-primary);
}

/* ============================== TOAST ============================== */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 0.9rem;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.toast.show { opacity: 1; }
.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--accent); }

/* ============================== MODE 11 — RÉVISION ============================== */

.revision-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.revision-toc {
  position: sticky;
  top: 130px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.revision-toc .toc-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.825rem;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
}

.revision-toc .toc-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.revision-toc .toc-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.revision-toc .toc-item .toc-check {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.revision-toc .toc-item.read .toc-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #052e22;
}

.revision-toc .toc-item.read .toc-check::before {
  content: "✓";
  font-weight: bold;
}

.revision-main {
  min-width: 0;
  max-width: 820px;
}

/* Reader typography */
.reader {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.reader h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.reader h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.8rem 0 0.6rem;
  color: var(--accent);
}

.reader h4 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.2rem 0 0.4rem;
  color: var(--text-primary);
}

.reader p {
  margin: 0 0 0.85rem;
  color: var(--text-primary);
}

.reader .lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1.2rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
}

.reader strong { color: var(--accent); font-weight: 700; }

.reader ul, .reader ol {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.reader ul li, .reader ol li { margin-bottom: 0.4rem; }

.reader blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-primary);
}

.reader blockquote p { margin: 0; }

.reader .quote-box {
  background: linear-gradient(135deg, rgba(16,185,129,0.08), rgba(16,185,129,0.02));
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
  font-size: 1.02rem;
  line-height: 1.65;
  white-space: pre-wrap;
}

.reader table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.reader table th,
.reader table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

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

.reader .callout {
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
}

.reader .callout.accent { border-color: var(--accent); background: rgba(16,185,129,0.06); }
.reader .callout.warn { border-color: var(--warn); background: rgba(245,158,11,0.06); }
.reader .callout.danger { border-color: var(--danger); background: rgba(239,68,68,0.06); }

.reader .callout-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
}

.reader .callout.accent .callout-title { color: var(--accent); }
.reader .callout.warn .callout-title { color: var(--warn); }
.reader .callout.danger .callout-title { color: var(--danger); }

.reader .pitch-phrase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin: 0.85rem 0;
}

.reader .pitch-phrase-num {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #052e22;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-right: 0.5rem;
}

.reader .pitch-phrase-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.6rem 0;
  color: var(--text-primary);
  line-height: 1.55;
}

.reader .pitch-phrase-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.reader .pitch-phrase-meta strong {
  color: var(--accent);
}

.reader .kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: monospace;
}

.reader .read-marker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.95rem;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  margin-top: 1rem;
  transition: all 0.15s;
}

.reader .read-marker:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.reader .read-marker.read {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.reader .read-marker.read::before {
  content: "✓ ";
}

.reader .q-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin: 0.9rem 0;
}

.reader .q-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.reader .q-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.4rem 0 0.6rem;
  color: var(--text-primary);
}

.reader .q-card-answer {
  background: rgba(16,185,129,0.05);
  border-left: 3px solid var(--accent);
  padding: 0.75rem 0.95rem;
  border-radius: 0 8px 8px 0;
  margin-top: 0.5rem;
  white-space: pre-wrap;
}

.reader .ancrage-mini {
  display: inline-block;
  padding: 1px 7px;
  margin: 1px 2px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ============================== SCHEMAS — visuels SVG ============================== */

.schema-wrap {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.schema-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.schema-caption {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-top: 0.6rem;
  font-style: italic;
}

/* Timeline 30 min */
.timeline-ribbon {
  position: relative;
  display: flex;
  width: 100%;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.timeline-segment {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  border-right: 1px solid rgba(0,0,0,0.3);
  transition: transform 0.2s;
  cursor: default;
  padding: 0 4px;
  text-align: center;
  line-height: 1.1;
}

.timeline-segment:last-child { border-right: none; }
.timeline-segment:hover { transform: translateY(-2px); z-index: 2; }

.timeline-segment-1 { background: linear-gradient(135deg, #10b981, #059669); }
.timeline-segment-2 { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.timeline-segment-3 { background: linear-gradient(135deg, #f59e0b, #d97706); color:#1a1a1a; }
.timeline-segment-4 { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.timeline-segment-5 { background: linear-gradient(135deg, #ec4899, #db2777); }
.timeline-segment-6 { background: linear-gradient(135deg, #6366f1, #4f46e5); }

.timeline-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.timeline-segments-legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.legend-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 4px;
}

/* Pitch timeline (9 phrases) */
.pitch-timeline {
  display: flex;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-elevated);
}

.pitch-tl-cell {
  flex: 1;
  position: relative;
  height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4px 6px;
  font-size: 0.7rem;
  border-right: 1px solid rgba(0,0,0,0.25);
  color: #fff;
}

.pitch-tl-cell .num {
  position: absolute;
  top: 4px;
  left: 4px;
  font-weight: 700;
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 9px;
  font-size: 0.7rem;
}

.pitch-tl-cell .dur {
  font-weight: 700;
  font-size: 0.75rem;
}

.pitch-tl-cell:last-child { border-right: none; }

/* Roadmap of recruitment process */
.roadmap {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.roadmap-node {
  padding: 1rem 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
}

.roadmap-node.current {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: scale(1.04);
}

.roadmap-node-step {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.roadmap-node.current .roadmap-node-step {
  color: var(--accent);
}

.roadmap-node-title {
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0.3rem 0 0.2rem;
  color: var(--text-primary);
}

.roadmap-node-detail {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.roadmap-arrow {
  font-size: 1.4rem;
  color: var(--text-tertiary);
}

/* Career timeline (Maxime) */
.career-track {
  position: relative;
  padding-left: 26px;
  margin: 1rem 0;
}

.career-track::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--info));
}

.career-item {
  position: relative;
  padding: 0.6rem 0.85rem 0.6rem 1rem;
  margin-bottom: 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.career-item::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--bg-card);
}

.career-item.highlight {
  border-color: var(--accent);
  background: rgba(16,185,129,0.06);
}

.career-period {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.career-role {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.career-company {
  font-size: 0.85rem;
  color: var(--accent);
}

.career-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Verticales tree */
.verticales-tree {
  display: grid;
  gap: 1rem;
}

.verticales-root {
  text-align: center;
  background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.04));
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.verticales-root-title {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--accent);
}

.verticales-root-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.verticales-branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  position: relative;
}

.vertical-branch {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 0.95rem;
}

.vertical-branch.priority {
  border-color: var(--accent);
  background: rgba(16,185,129,0.06);
  border-style: solid;
}

.vertical-branch.future {
  border-color: var(--warn);
  background: rgba(245,158,11,0.06);
  border-style: dashed;
}

.vertical-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.vertical-status {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
}

.vertical-stats {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
  line-height: 1.4;
}

/* PO cycle (4 missions circulaires) */
.po-cycle {
  position: relative;
  width: 360px;
  max-width: 100%;
  height: 360px;
  margin: 1rem auto;
}

.po-cycle-center {
  position: absolute;
  inset: 30%;
  background: var(--accent-dim);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.5rem;
}

.po-cycle-mission {
  position: absolute;
  width: 130px;
  padding: 0.6rem 0.7rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
}

.po-cycle-mission[data-pos="top"]    { top: 0; left: 50%; transform: translateX(-50%); }
.po-cycle-mission[data-pos="right"]  { top: 50%; right: 0; transform: translateY(-50%); }
.po-cycle-mission[data-pos="bottom"] { bottom: 0; left: 50%; transform: translateX(-50%); }
.po-cycle-mission[data-pos="left"]   { top: 50%; left: 0; transform: translateY(-50%); }

.po-cycle-mission .verb {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.po-cycle-mission .name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Question matrix (24 questions visualisées) */
.qmatrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.qcell {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  cursor: default;
  position: relative;
  transition: transform 0.15s;
}

.qcell:hover { transform: scale(1.1); z-index: 3; box-shadow: 0 4px 16px rgba(0,0,0,0.4); }

.qcell-90 { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.qcell-70 { background: linear-gradient(135deg, #f59e0b, #d97706); color:#1a1a1a; }
.qcell-50 { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.qcell-30 { background: linear-gradient(135deg, #64748b, #475569); }

.qcell .qstar {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 0.6rem;
}

/* STAR diagram */
.star-diagram {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  position: relative;
}

.star-step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  text-align: center;
}

.star-step-letter {
  display: inline-flex;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #052e22;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.star-step-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.star-step-q {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

/* Closing flow */
.closing-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  position: relative;
}

.closing-step {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  position: relative;
}

.closing-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 700;
  font-size: 1.2rem;
  z-index: 2;
}

.closing-step-num {
  background: var(--accent);
  color: #052e22;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.closing-step-min {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.closing-step-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-top: 0.2rem;
}

/* Salary decision tree */
.tree {
  position: relative;
  padding: 1rem 0;
}

.tree-node {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.tree-root {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.tree-branches {
  margin-top: 0.4rem;
  padding-left: 2rem;
  border-left: 2px solid var(--border);
}

.tree-branch {
  position: relative;
  padding: 0.45rem 0;
}

.tree-branch::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 1.2rem;
  width: 1.5rem;
  height: 2px;
  background: var(--border);
}

.tree-result {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  background: rgba(16,185,129,0.05);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
  margin: 0.2rem 0 0.5rem 0.6rem;
}

.tree-result.danger { border-left-color: var(--danger); background: rgba(239,68,68,0.05); }
.tree-result.warn { border-left-color: var(--warn); background: rgba(245,158,11,0.05); }

/* Pitch anatomy (4 anchors) */
.anatomy {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  position: relative;
}

.anatomy-anchor {
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.anatomy-anchor-num {
  color: var(--accent);
  font-weight: 800;
  font-size: 0.95rem;
}

/* IA flow diagram */
.ia-flow {
  display: flex;
  align-items: stretch;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.4rem 0;
}

.ia-flow-step {
  flex: 1;
  min-width: 130px;
  padding: 0.8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  font-size: 0.82rem;
  text-align: center;
}

.ia-flow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 800;
  z-index: 2;
}

.ia-flow-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.3rem;
}

.ia-flow-label {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.ia-flow-tech {
  font-size: 0.7rem;
  color: var(--accent);
  font-family: monospace;
}

/* Vocabulaire compare visual */
.vocab-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0.7rem 0;
}

.vocab-col {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
}

.vocab-col.bad { border: 1px solid var(--danger); background: rgba(239,68,68,0.06); }
.vocab-col.good { border: 1px solid var(--accent); background: rgba(16,185,129,0.06); }

.vocab-col-title {
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.vocab-col.bad .vocab-col-title { color: var(--danger); }
.vocab-col.good .vocab-col-title { color: var(--accent); }

.vocab-arrow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  font-size: 0.82rem;
}

.vocab-arrow-row .arrow {
  color: var(--accent);
  font-weight: 800;
}

/* Voice gauge */
.voice-gauge {
  position: relative;
  margin: 0.9rem 0;
}

.voice-gauge-track {
  position: relative;
  height: 22px;
  background: linear-gradient(90deg,
    var(--danger) 0%,
    var(--warn) 22%,
    var(--accent) 35%,
    var(--accent) 55%,
    var(--warn) 75%,
    var(--danger) 100%
  );
  border-radius: 11px;
  overflow: hidden;
}

.voice-gauge-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 30px;
  background: #fafafa;
  border-radius: 2px;
  box-shadow: 0 0 0 2px var(--bg-card);
  transform: translateX(-50%);
}

.voice-gauge-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-top: 0.3rem;
}

/* ============================== DASHBOARD V2 ============================== */

.hero {
  background:
    radial-gradient(circle at 25% 30%, rgba(16,185,129,0.18) 0%, transparent 50%),
    radial-gradient(circle at 75% 70%, rgba(56,189,248,0.10) 0%, transparent 50%),
    linear-gradient(135deg, #0e0e0e 0%, #181818 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
  background-size: 24px 24px;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 700;
}

.hero-countdown {
  font-size: 4.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
  margin: 0.5rem 0 0.3rem;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--accent), #34d399);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-detail {
  color: var(--text-secondary);
  font-size: 0.95rem;
  text-transform: capitalize;
}

.hero-progress {
  margin-top: 1.4rem;
}

.hero-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.hero-progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.hero-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #34d399);
  transition: width 0.5s;
}

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.6rem;
}

.hero-msg {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  font-size: 0.85rem;
  line-height: 1.45;
  position: relative;
  padding-left: 2.4rem;
}

.hero-msg::before {
  position: absolute;
  left: 0.7rem;
  top: 0.65rem;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: #052e22;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.75rem;
}

.hero-msg-1::before { content: "1"; }
.hero-msg-2::before { content: "2"; }
.hero-msg-3::before { content: "3"; }

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-countdown { font-size: 3rem; }
}

/* Donut chart pour mastery */
.donut-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.donut {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.donut-center {
  font-size: 1.4rem;
  font-weight: 800;
  fill: var(--text-primary);
}

.donut-label {
  font-size: 0.7rem;
  fill: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.donut-info {
  flex: 1;
  min-width: 0;
}

.donut-title {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.donut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  font-size: 0.78rem;
}

.donut-list-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}

.donut-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

/* Heatmap */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  position: relative;
}

.heatmap-cell.heat-1 { background: rgba(16,185,129,0.20); }
.heatmap-cell.heat-2 { background: rgba(16,185,129,0.38); }
.heatmap-cell.heat-3 { background: rgba(16,185,129,0.58); color: #052e22; }
.heatmap-cell.heat-4 { background: rgba(16,185,129,0.82); color: #052e22; }
.heatmap-cell.heat-5 { background: var(--accent); color: #052e22; }

.heatmap-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Stat card V2 */
.stat-card-v2 {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.stat-card-v2 .stat-icon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 1.3rem;
  opacity: 0.5;
}

.stat-card-v2 .stat-eyebrow {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: 600;
}

.stat-card-v2 .stat-main {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 0.2rem 0;
}

.stat-card-v2 .stat-sub {
  font-size: 0.75rem;
  color: var(--accent);
}

.stat-card-v2.warn .stat-main { color: var(--warn); }
.stat-card-v2.danger .stat-main { color: var(--danger); }

/* Sparkline */
.sparkline {
  margin-top: 0.6rem;
  height: 28px;
  width: 100%;
}

.sparkline polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.sparkline circle { fill: var(--accent); }

/* Action cards V2 */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.85rem;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
  width: 100%;
  color: var(--text-primary);
  font-family: inherit;
}

.action-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.action-card:hover::before { opacity: 1; }

.action-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.action-card-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.action-card-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  position: relative;
  z-index: 1;
}

.action-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

/* Dashboard layout helpers */
.dash-section-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  font-weight: 700;
  margin: 1.6rem 0 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dash-section-title::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--accent);
}

/* ============================== PANIC PANEL (Mode pendant le call) ============================== */

/* Floating Action Button */
.fab-panic {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-panic:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 32px rgba(239, 68, 68, 0.55);
}

.fab-panic::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid var(--danger);
  opacity: 0.5;
  animation: fabPulse 2s ease-out infinite;
}

@keyframes fabPulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.4); opacity: 0; }
}

.fab-label {
  position: absolute;
  right: 70px;
  background: rgba(0,0,0,0.85);
  color: #fff;
  padding: 0.4rem 0.7rem;
  border-radius: 6px;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.fab-panic:hover .fab-label { opacity: 1; }

/* Panic Panel Overlay */
.panic-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 500;
  display: none;
  overflow-y: auto;
  padding: 1.5rem;
}

.panic-overlay.show { display: block; animation: panicFadeIn 0.2s ease-out; }

@keyframes panicFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.panic-container {
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

.panic-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.panic-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.panic-shortcut {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.panic-close {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panic-close:hover { background: var(--bg-hover); }

.panic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

.panic-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
}

.panic-card.urgent {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--danger);
}

.panic-card.first-line {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(16,185,129,0.06));
  border-color: var(--accent);
  grid-column: 1 / -1;
}

.panic-card-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  font-weight: 700;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.panic-card.first-line .panic-card-title { color: var(--accent); }
.panic-card.urgent .panic-card-title { color: var(--danger); }

.panic-first-line {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  margin-top: 0.4rem;
}

.panic-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.panic-list-item {
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.panic-list-item strong { color: var(--accent); }

.panic-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.panic-stat {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.panic-stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.panic-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.panic-ancrages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.panic-ancrage {
  display: inline-block;
  padding: 4px 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.panic-recovery {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #fff;
}

.panic-recovery strong {
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8rem;
  display: block;
  margin-bottom: 0.3rem;
}

/* ============================== STT LIVE HIGHLIGHTS ============================== */

.stt-counter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.stt-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 4px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.stt-counter strong { color: var(--text-primary); font-weight: 700; }

.stt-counter.parasite-counter strong { color: var(--warn); }
.stt-counter.interdit-counter strong { color: var(--danger); }
.stt-counter.duration-counter strong { color: var(--accent); }
.stt-counter.wpm-counter strong { color: var(--info); }

.stt-counter.alert {
  animation: counterFlash 0.5s ease-out;
}

@keyframes counterFlash {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); background: rgba(239, 68, 68, 0.25); }
}

/* Inline highlights in STT box (real-time) */
.stt-box .interdit {
  background: rgba(239, 68, 68, 0.4);
  color: #fecaca;
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 700;
  text-decoration: underline wavy var(--danger);
  text-underline-offset: 3px;
}

.live-alert {
  position: fixed;
  top: 90px;
  right: 1.5rem;
  background: var(--danger);
  color: #fff;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s;
  pointer-events: none;
}

.live-alert.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================== AUDIO PLAYER ============================== */

.audio-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.audio-row audio {
  flex: 1;
  height: 32px;
}

.audio-play-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #052e22;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.audio-play-btn:hover { background: var(--accent-hover); }
.audio-play-btn.playing { background: var(--danger); color: #fff; }

.audio-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.audio-indicator.has-audio { color: var(--accent); }

/* Responsive — sidebar disparaît en dropdown sur mobile */
@media (max-width: 900px) {
  .revision-layout {
    grid-template-columns: 1fr;
  }
  .revision-toc {
    position: static;
    max-height: 300px;
  }
}
