/* =============================================================
   States by Borvo — Stylesheet
   ============================================================= */

/* ============= SPLASH SCREEN ============= */
.splash {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: #0a0a0f;
  overflow: hidden;
  pointer-events: none;
}
.splash.is-leaving {
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.95s ease, transform 1.1s ease;
}

/* Cosmic radial background */
.splash-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(45, 31, 78, 0.85) 0%, rgba(26, 15, 58, 0.6) 35%, #0a0a0f 75%),
    radial-gradient(circle at 80% 20%, rgba(155, 114, 207, 0.18) 0%, transparent 40%),
    radial-gradient(circle at 18% 80%, rgba(201, 168, 76, 0.06) 0%, transparent 50%);
  opacity: 0;
  animation: splashBgIn 0.25s ease forwards;
}
@keyframes splashBgIn { to { opacity: 1; } }

/* Twinkling particles */
.splash-particles {
  position: absolute; inset: 0;
  pointer-events: none;
}
.splash-particles span {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #e8e4f0;
  opacity: 0;
  animation: splashTwinkle 3.6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  left: var(--x, 50%);
  top:  var(--y, 50%);
}
.splash-particles span.gold { background: #c9a84c; }
@keyframes splashTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  40%, 70% { opacity: var(--peak, 0.7); transform: scale(1); box-shadow: 0 0 6px rgba(232, 228, 240, 0.55); }
}

/* Stage groups symbol + text + rings */
.splash-stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

/* Dotted concentric arcs echoing the logo's dotted arc */
.splash-rings {
  position: absolute;
  top: -50px; left: 50%;
  width: 340px; height: 340px;
  transform: translateX(-50%);
  pointer-events: none;
}
.splash-ring {
  stroke: rgba(155, 114, 207, 0.55);
  stroke-width: 1.4;
  stroke-dasharray: 1.5 7;
  stroke-linecap: round;
  transform-origin: 200px 200px;
  opacity: 0;
  animation: splashRing 2.0s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.splash-ring.r1 { animation-delay: 0.55s; }
.splash-ring.r2 { animation-delay: 0.80s; stroke: rgba(201, 168, 76, 0.40); }
.splash-ring.r3 { animation-delay: 1.05s; stroke: rgba(155, 114, 207, 0.30); }
@keyframes splashRing {
  0%   { opacity: 0;    transform: scale(0.45) rotate(0deg); }
  25%  { opacity: 0.9;  }
  100% { opacity: 0;    transform: scale(1.9)  rotate(45deg); }
}

/* Logo (icon-512, no text — text is rendered separately for animation) */
.splash-symbol {
  width: 144px; height: 144px;
  border-radius: 50%;
  object-fit: contain;
  margin-bottom: 26px;
  opacity: 0;
  transform: scale(0.62);
  filter: drop-shadow(0 0 40px rgba(155, 114, 207, 0.0));
  animation:
    splashSymbolIn 1.05s 0.35s cubic-bezier(0.22, 1, 0.36, 1) forwards,
    splashSymbolBreath 4.5s 1.6s ease-in-out infinite;
  mix-blend-mode: lighten;
}
@keyframes splashSymbolIn {
  to {
    opacity: 1;
    transform: scale(1);
    filter: drop-shadow(0 0 48px rgba(155, 114, 207, 0.55));
  }
}
@keyframes splashSymbolBreath {
  0%, 100% { filter: drop-shadow(0 0 40px rgba(155, 114, 207, 0.45)); }
  50%      { filter: drop-shadow(0 0 64px rgba(155, 114, 207, 0.80)); }
}

/* "States" title — Cormorant Garamond, large with letter-spacing reveal */
.splash-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 54px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: #e8e4f0;
  margin: 0;
  opacity: 0;
  transform: translateY(10px);
  animation: splashTitleIn 0.85s 1.10s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  text-shadow: 0 0 22px rgba(155, 114, 207, 0.35);
  line-height: 1;
}
@keyframes splashTitleIn {
  to { opacity: 1; letter-spacing: 0.10em; transform: translateY(0); }
}

/* "By Borvo" subtitle — Outfit, tracked, discrete */
.splash-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 200;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: #c9a84c;
  margin-top: 10px;
  margin-bottom: 0;
  padding-left: 0.45em; /* compensate centered tracking */
  opacity: 0;
  transform: translateY(8px);
  animation: splashSubIn 0.7s 1.55s ease forwards;
}
@keyframes splashSubIn {
  to { opacity: 0.92; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .splash-bg, .splash-symbol, .splash-title, .splash-sub, .splash-ring, .splash-particles span {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
  }
}

/* =============================================================
   App stylesheet — proper start below
   ============================================================= */

:root {
  /* Dark theme (default) */
  --bg: #0a0a0f;
  --bg-2: #12121a;
  --bg-3: #1a1a26;
  --gold: #c9a84c;
  --gold-light: #e8c96d;
  --violet: #7c6f9b;
  --violet-deep: #4a3f6b;
  --icon: #8b5cf6;
  --icon-glow: #a78bfa;
  --icon-deep: #6d28d9;
  --text: #e2d9f3;
  --text-dim: #7c6f9b;
  --border: rgba(201, 168, 76, 0.15);
  --border-hi: rgba(201, 168, 76, 0.35);
  --shadow: 0 0 24px rgba(139, 92, 246, 0.10);
  --shadow-hi: 0 0 32px rgba(139, 92, 246, 0.20);
  --body-grad-1: rgba(124, 111, 155, 0.12);
  --body-grad-2: rgba(201, 168, 76, 0.06);
  --nav-bg: rgba(18, 18, 26, 0.92);
  --r-card: 16px;
  --r-btn: 8px;
  --t-fast: 0.18s ease;
  --t-mid: 0.3s ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

/* Light theme — palette beige chaleureuse avec accents violets.
   Vars définies sur :root.light-mode ET body.light-mode pour que <html>
   (le canvas peint par le navigateur) hérite aussi des bonnes valeurs. */
:root.light-mode,
body.light-mode {
  --bg: #efe6d2;          /* parchemin chaud */
  --bg-2: #f8f1de;         /* card surface plus claire */
  --bg-3: #e4d9bf;         /* alternate / hover beige plus profond */
  --gold: #a07a2a;
  --gold-light: #b8943c;
  --violet: #6a5a8a;
  --violet-deep: #4a3f6b;
  --icon: #7b52af;
  --icon-glow: #9b72cf;
  --icon-deep: #5e3e8c;
  --text: #2e2138;         /* prune profond, chaud */
  --text-dim: #7a6a7e;     /* violet-beige doux */
  --border: rgba(123, 82, 175, 0.22);
  --border-hi: rgba(123, 82, 175, 0.45);
  --shadow: 0 4px 18px rgba(74, 50, 96, 0.10);
  --shadow-hi: 0 8px 28px rgba(74, 50, 96, 0.18);
  --body-grad-1: rgba(155, 114, 207, 0.08);
  --body-grad-2: rgba(184, 148, 60, 0.06);
  --nav-bg: rgba(248, 241, 222, 0.92);
}

/* Force html background to match in light mode (the canvas) */
html.light-mode { background: var(--bg); }

/* Theme transition smooth */
body, .card, .tool-card, .cs-slide, .radio-card, .bottom-nav,
.tq-card, .tq-detail, .news-event-card, .news-video-card,
.flux-instruction, .timer-instruction, .borvo-portrait,
.tq-resume-box, .tq-borvo, .tq-info, .flux-markers, .flux-hint, .news-info {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

/* Theme toggle button (floating, top-right) */
.theme-toggle {
  position: fixed;
  top: calc(12px + var(--safe-top));
  right: 14px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--icon-glow);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: pointer;
  z-index: 70;
  transition: background var(--t-mid), border-color var(--t-mid), transform var(--t-fast), box-shadow var(--t-mid);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.theme-toggle:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.theme-toggle:active { transform: scale(0.92); }
body.light-mode .theme-toggle { box-shadow: 0 2px 12px rgba(123, 82, 175, 0.15); }

/* ====== Light mode component overrides (beige + violet) ====== */

/* Body background — warm parchment gradient */
body.light-mode {
  background:
    radial-gradient(circle at 50% -10%, rgba(155, 114, 207, 0.12), transparent 45%),
    radial-gradient(circle at 80% 110%, rgba(184, 148, 60, 0.10), transparent 55%),
    var(--bg);
}

/* Bottom nav — beige clair semi-transparent */
body.light-mode .bottom-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 14px rgba(74, 50, 96, 0.06);
}
body.light-mode .nav-btn { color: #8a7080; }
body.light-mode .nav-btn.active { color: var(--icon); }
body.light-mode .nav-btn.active svg { filter: drop-shadow(0 0 6px rgba(123, 82, 175, 0.45)); }

/* Logo — pas de mix-blend-mode en clair (fond non sombre) */
body.light-mode .home-logo {
  mix-blend-mode: normal;
  filter: brightness(0.95) saturate(0.85) drop-shadow(0 0 22px rgba(123, 82, 175, 0.35));
}

/* Portrait Borvo — fond beige doux */
body.light-mode .borvo-portrait {
  background: radial-gradient(circle at 50% 35%, #fbf5e6, #efe6d2);
}

/* Cards — beige clair avec liseré violet subtil */
body.light-mode .tool-card,
body.light-mode .cs-slide,
body.light-mode .card,
body.light-mode .news-event-card,
body.light-mode .news-video-card,
body.light-mode .radio-card,
body.light-mode .tq-card,
body.light-mode .tq-resume-box,
body.light-mode .timer-instruction,
body.light-mode .flux-hint,
body.light-mode .flux-markers,
body.light-mode .news-info,
body.light-mode .tq-info,
body.light-mode .tq-detail-contexts {
  background: var(--bg-2);
  border-color: var(--border);
}
body.light-mode .tool-card { background: linear-gradient(180deg, #fbf5e6 0%, #f3eada 100%); }
body.light-mode .cs-slide { background: linear-gradient(180deg, #fbf5e6 0%, #f3eada 100%); }
body.light-mode .cs-slide.active {
  border-color: var(--icon);
  box-shadow:
    0 12px 32px rgba(74, 50, 96, 0.18),
    0 0 0 1px rgba(123, 82, 175, 0.30),
    0 0 40px rgba(155, 114, 207, 0.15);
}
body.light-mode .radio-card.selected {
  background: linear-gradient(180deg, rgba(155, 114, 207, 0.10), var(--bg-2));
  border-color: var(--icon);
  box-shadow: 0 8px 22px rgba(74, 50, 96, 0.12);
}

/* Btn primary — violet sur beige (fort contraste) */
body.light-mode .btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--icon-glow) 0%, var(--icon-deep) 100%);
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.30);
}
body.light-mode .btn-primary:hover { box-shadow: 0 8px 28px rgba(109, 40, 217, 0.45); }

/* Btn secondary — beige profond, texte prune */
body.light-mode .btn-secondary {
  background: var(--bg-3);
  color: var(--text);
  border-color: var(--border);
}
body.light-mode .btn-secondary:hover {
  background: var(--bg-2);
  border-color: var(--icon);
  color: var(--icon-deep);
}

/* Section titles — or terreux */
body.light-mode .section-title,
body.light-mode .news-section-title { color: var(--gold); }

/* Card labels — violet vif */
body.light-mode .card-label,
body.light-mode .tq-info-label { color: var(--icon); }

/* Card titles — prune chaleureux */
body.light-mode .card-title,
body.light-mode .tq-detail-title,
body.light-mode .news-event-title,
body.light-mode .flux-phase-title,
body.light-mode .timer-time,
body.light-mode .flux-time { color: var(--text); }

/* Greeting (Cormorant gradient) — adapter en violet/prune */
body.light-mode .greeting,
body.light-mode .brand { color: var(--text); }
body.light-mode .brand { color: var(--text-dim); }

/* Badges techniques — beige profond avec texte violet */
body.light-mode .tq-badge { background: rgba(123, 82, 175, 0.10); border-color: rgba(123, 82, 175, 0.30); color: var(--icon-deep); }
body.light-mode .tq-cat.cat-induction { background: rgba(123, 82, 175, 0.18); color: var(--icon-deep); }
body.light-mode .tq-cat.cat-decorp    { background: rgba(184, 148, 60, 0.20); color: #7a5e1e; border-color: rgba(184, 148, 60, 0.45); }
body.light-mode .tq-cat.cat-mixte     { background: linear-gradient(90deg, rgba(123, 82, 175, 0.18), rgba(184, 148, 60, 0.18)); color: var(--icon-deep); }

/* News event type badges */
body.light-mode .news-event-card.type-stage   .news-event-type { background: rgba(123, 82, 175, 0.16); color: var(--icon-deep); border-color: rgba(123, 82, 175, 0.35); }
body.light-mode .news-event-card.type-atelier .news-event-type { background: rgba(184, 148, 60, 0.18); color: #7a5e1e; border-color: rgba(184, 148, 60, 0.40); }
body.light-mode .news-event-card.type-retreat .news-event-type { background: rgba(155, 114, 207, 0.18); color: #5e3e8c; border-color: rgba(155, 114, 207, 0.40); }
body.light-mode .news-event-card.type-live    .news-event-type { background: rgba(45, 113, 207, 0.14); color: #1d4f9c; border-color: rgba(45, 113, 207, 0.35); }
body.light-mode .news-event-card.type-autre   .news-event-type { background: rgba(122, 106, 126, 0.18); color: #4a4060; border-color: rgba(122, 106, 126, 0.35); }

/* Inputs (time picker values, textarea note, search) */
body.light-mode .time-value,
body.light-mode .prof-lucidity-value,
body.light-mode .timer-time { color: var(--text); }
body.light-mode #tq-search,
body.light-mode .prof-note-area {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--border);
}
body.light-mode #tq-search:focus,
body.light-mode .prof-note-area:focus { border-color: var(--icon); }

/* Profile / Calendar */
body.light-mode .cal-cell { background: var(--bg-2); border-color: var(--border); color: var(--text); }
body.light-mode .cal-cell.today { border-color: var(--icon); }
body.light-mode .cal-cell.empty { background: transparent; border-color: transparent; }
body.light-mode .cal-cell[disabled] { background: rgba(123, 82, 175, 0.04); color: var(--text-dim); opacity: 0.6; }

/* Sheet — fond plus blanc-beige avec backdrop chaud */
body.light-mode .prof-sheet { background: var(--bg-2); }
body.light-mode .prof-sheet-backdrop { background: rgba(46, 33, 56, 0.45); }
body.light-mode .prof-tech-toggle,
body.light-mode .prof-exp-toggle,
body.light-mode .prof-shc-toggle { background: var(--bg-3); border-color: var(--border); color: var(--text-dim); }
body.light-mode .prof-tech-toggle.selected,
body.light-mode .prof-exp-toggle.selected {
  background: linear-gradient(135deg, rgba(155, 114, 207, 0.22), rgba(123, 82, 175, 0.12));
  border-color: var(--icon);
  color: var(--text);
}
body.light-mode .prof-shc-toggle.active {
  background: linear-gradient(135deg, rgba(184, 148, 60, 0.25), rgba(123, 82, 175, 0.10));
  color: var(--text);
}

/* Wizard / radio progress dots */
body.light-mode .wizard-progress span { background: rgba(123, 82, 175, 0.18); }
body.light-mode .wizard-progress span.active { background: var(--icon); }
body.light-mode .analysis-progress span { background: rgba(123, 82, 175, 0.18); }
body.light-mode .analysis-progress span.active { background: var(--icon); }

/* Theme toggle — bg beige clair, halo doré-violet */
body.light-mode .theme-toggle {
  background: var(--bg-2);
  border-color: var(--border-hi);
  box-shadow: 0 2px 12px rgba(74, 50, 96, 0.12);
  color: var(--icon-deep);
}

/* Floating timer badge garde son look violet (lisible sur fond beige) */
body.light-mode .timer-badge {
  box-shadow:
    0 10px 24px rgba(109, 40, 217, 0.35),
    0 0 0 3px rgba(248, 241, 222, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Curved selector / mound — beige avec liseré violet */
body.light-mode .cs-bar {
  background: rgba(248, 241, 222, 0.92);
  border-color: var(--border);
  box-shadow: inset 0 1px 0 rgba(155, 114, 207, 0.10), 0 4px 18px rgba(74, 50, 96, 0.08);
}
body.light-mode .cs-mound {
  background: rgba(248, 241, 222, 0.95);
  border-color: var(--border);
}
body.light-mode .cs-mound::after { background: rgba(248, 241, 222, 1); }

/* Splash always dark, even in light mode */
body.light-mode .splash { background: #0a0a0f; }
body.light-mode .splash .splash-title { color: #e8e4f0; }
body.light-mode .splash .splash-sub { color: #c9a84c; }

/* ====== Light mode — fixes contraste texte/sélection ====== */

/* Texte introductif Techniques — couleurs sombres lisibles sur beige */
body.light-mode .tq-strong-induction { color: #5e3e8c; }
body.light-mode .tq-strong-decorp    { color: #7a5e1e; }
body.light-mode .tq-strong-mixte     {
  background: linear-gradient(90deg, #5e3e8c, #7a5e1e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.light-mode .tq-intro-body p,
body.light-mode .tq-intro-body .muted { color: var(--text); }
body.light-mode .tq-intro-body .muted { color: var(--text-dim); }

/* Filtres techniques — actif en light mode (au lieu de violet glow trop pâle) */
body.light-mode .tq-filter {
  background: var(--bg-2);
  color: var(--text-dim);
  border-color: var(--border);
}
body.light-mode .tq-filter:hover { color: var(--text); }
body.light-mode .tq-filter.active {
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  color: #fff;
  border-color: var(--icon-deep);
}

/* Niveaux — couleurs vives sur fond clair → versions plus sombres */
body.light-mode .tq-level.level-beginner     { color: #1f7a3a; border-color: rgba(31, 122, 58, 0.35); background: rgba(31, 122, 58, 0.08); }
body.light-mode .tq-level.level-intermediate { color: #8a5a07; border-color: rgba(138, 90, 7, 0.35); background: rgba(138, 90, 7, 0.08); }
body.light-mode .tq-level.level-advanced     { color: #9c1f2e; border-color: rgba(156, 31, 46, 0.35); background: rgba(156, 31, 46, 0.08); }

/* Catégories techniques — induction en violet vif sur beige */
body.light-mode .tq-cat.cat-induction {
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  color: #fff;
  border-color: var(--icon-deep);
}
body.light-mode .tq-cat.cat-mixte {
  background: linear-gradient(90deg, var(--icon-glow), #7a5e1e);
  color: #fff;
}

/* Canaux et contextes — bordure violette sur fond beige */
body.light-mode .tq-canal,
body.light-mode .tq-context {
  background: rgba(123, 82, 175, 0.08);
  color: var(--icon-deep);
  border-color: rgba(123, 82, 175, 0.25);
}

/* Pages texte (about-obe, about-borvo) — paragraphes en prune sombre,
   sauf classes d'accent gold/lead qui gardent leur teinte dorée */
body.light-mode .text-page p:not(.gold):not(.lead) {
  color: var(--text);
}
body.light-mode .text-page p.lead { color: var(--gold); }
body.light-mode .text-page p.gold,
body.light-mode .gold { color: var(--gold); }
body.light-mode .text-page p em,
body.light-mode .text-page p strong { color: var(--text); }
body.light-mode .text-page .section-title { color: var(--gold); }

/* Section dividers — visibles sur beige */
body.light-mode .section-divider {
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
}

/* Lock-style search input + textarea note */
body.light-mode #tq-search::placeholder,
body.light-mode .prof-note-area::placeholder {
  color: rgba(74, 64, 96, 0.55);
}

/* Wizard step1 — quality buttons et fatigue sliders */
body.light-mode .prof-quality-btn { background: var(--bg-3); color: var(--text-dim); }
body.light-mode .prof-quality-btn.selected {
  background: linear-gradient(135deg, rgba(123, 82, 175, 0.20), rgba(155, 114, 207, 0.08));
  border-color: var(--icon);
}
body.light-mode .prof-quality-num { color: var(--text-dim); }

/* Sheet wizard — backdrop plus opaque, header lisible */
body.light-mode .prof-sheet-wizard {
  background: var(--bg-2);
  color: var(--text);
}
body.light-mode .prof-sheet-header h3,
body.light-mode .prof-wiz-title { color: var(--text); }
body.light-mode .prof-sheet-source {
  background: rgba(123, 82, 175, 0.10);
  border-color: rgba(123, 82, 175, 0.30);
  color: var(--icon-deep);
}
body.light-mode .prof-wiz-hint {
  background: rgba(123, 82, 175, 0.08);
  color: var(--text-dim);
}
body.light-mode .prof-summary { background: var(--bg-3); }
body.light-mode .prof-summary-row { color: var(--text); }

/* Insights cards en light */
body.light-mode .prof-insight-card { background: linear-gradient(180deg, var(--bg-2), var(--bg-3)); }
body.light-mode .prof-insight-text { color: var(--text); }
body.light-mode .prof-insights-progress { background: var(--bg-2); border-color: var(--border); }

/* Calendrier — couleurs lune et expé en light */
body.light-mode .cal-moon { opacity: 0.55; color: var(--icon-deep); }
body.light-mode .cal-cell.has-shc .cal-day-num { color: #fff; }
body.light-mode .cal-pred-mid { color: var(--gold); }

/* Profile stats blocks (RPG) */
body.light-mode .prof-stat,
body.light-mode .prof-fav,
body.light-mode .prof-elem-desc,
body.light-mode .prof-elem-recos { color: var(--text); }
body.light-mode .prof-stat-label,
body.light-mode .prof-stat-value { color: var(--text); }

/* Tie-breaker UI in light mode */
body.light-mode .prof-tie-card { background: var(--bg-2); color: var(--text); border-color: var(--border); }

/* Reset / restart confirmation in light mode */
body.light-mode .btn-ghost { color: var(--text-dim); border-color: var(--border); }
body.light-mode .btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }

/* Range thumbs on light backgrounds */
body.light-mode .prof-lucidity-range::-webkit-slider-thumb,
body.light-mode .prof-fatigue-range::-webkit-slider-thumb {
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(123, 82, 175, 0.30);
}
body.light-mode .prof-lucidity-range::-moz-range-thumb,
body.light-mode .prof-fatigue-range::-moz-range-thumb {
  border: 2px solid var(--bg-2);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(123, 82, 175, 0.30);
}

/* Borvo intro pixel portrait — adapt frame */
body.light-mode .borvo-portrait::after {
  box-shadow: inset 0 0 24px rgba(74, 50, 96, 0.2);
}

/* Lock secondary buttons et confirming */
body.light-mode .btn-ghost.confirming {
  border-color: rgba(180, 60, 60, 0.65);
  color: #b43c3c;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 200;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(circle at 50% -10%, rgba(124, 111, 155, 0.12), transparent 40%),
    radial-gradient(circle at 80% 110%, rgba(201, 168, 76, 0.06), transparent 50%),
    var(--bg);
  min-height: 100vh;
  min-height: 100dvh;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input { font: inherit; color: inherit; }
a { color: var(--gold-light); text-decoration: none; }
a:hover { color: var(--gold); }

[hidden] { display: none !important; }

/* ============= TYPO HELPERS ============= */
.serif { font-family: 'Cormorant Garamond', serif; letter-spacing: 0.05em; }
.sans { font-family: 'Outfit', sans-serif; }

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  letter-spacing: 0.05em;
}

/* ============= BUTTONS ============= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: var(--r-btn);
  font-family: 'Outfit', sans-serif;
  font-weight: 400;
  font-size: 15px;
  letter-spacing: 0.03em;
  transition: transform var(--t-fast), box-shadow var(--t-mid), background var(--t-mid), border-color var(--t-mid);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: #1a1410;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.btn-primary:hover { box-shadow: var(--shadow-hi); }

.btn-secondary {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-hi); background: var(--bg-3); }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }

.btn-block { width: 100%; }

@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 24px rgba(139, 92, 246, 0.25)); }
  50%      { filter: drop-shadow(0 0 36px rgba(139, 92, 246, 0.55)); }
}

/* ============= APP SHELL ============= */
.app {
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(76px + var(--safe-bot));
}

.page {
  padding: 24px 20px 16px;
  animation: fadeIn 0.35s ease;
  max-width: 720px;
  margin: 0 auto;
}

/* ============= HOME ============= */
.home-header {
  text-align: center;
  padding: 16px 0 24px;
  display: flex; flex-direction: column; align-items: center;
}
.home-logo {
  width: 128px; height: 128px;
  object-fit: contain;
  border-radius: 50%;
  margin-bottom: 16px;
  mix-blend-mode: lighten;
  filter: brightness(0.85) saturate(0.8) drop-shadow(0 0 22px rgba(139, 92, 246, 0.45));
  animation: pulseGlow 5s ease-in-out infinite;
}
.brand {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-weight: 200;
  margin-bottom: 18px;
}
.greeting {
  font-size: 26px;
  font-weight: 300;
  color: var(--text);
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 12px 0 24px;
}

.tool-card {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), border-color var(--t-mid), box-shadow var(--t-mid);
  min-height: 160px;
}
.tool-card:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.tool-card:active { transform: scale(0.98); }

.tool-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
  color: var(--icon);
  filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.30));
}
.tool-icon svg { width: 40px; height: 40px; }

.tool-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  color: var(--text);
}
.tool-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.secondary-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

/* ============= PAGE COMMON ============= */
.page-header {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0 24px;
}
.back-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--text-dim);
  transition: color var(--t-mid), background var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.back-btn:hover, .back-btn:focus-visible { color: var(--icon-glow); background: var(--bg-2); }
.back-btn:active { transform: scale(0.92); }

.page-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--text);
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 24px 0 8px;
}
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hi), transparent);
  margin: 12px 0 16px;
}

/* ============= CARDS ============= */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 8px;
}
.card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
  color: var(--text);
}
.card-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}
.card-text + .card-text { margin-top: 10px; }

/* ============= WIZARD ============= */
.wizard-progress {
  display: flex; gap: 6px;
  margin-bottom: 24px;
}
.wizard-progress span {
  flex: 1; height: 3px;
  background: var(--bg-3);
  border-radius: 3px;
  transition: background var(--t-mid);
}
.wizard-progress span.active { background: var(--icon); }
.wizard-progress span.done { background: var(--icon-deep); }

.wizard-step {
  text-align: center;
  padding: 12px 0;
}
.wizard-question {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 28px;
  color: var(--text);
}
.wizard-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: -16px;
  margin-bottom: 24px;
}

/* time picker */
.time-picker {
  display: flex; align-items: center; justify-content: center;
  gap: 16px;
  margin: 32px 0;
  font-family: 'Cormorant Garamond', serif;
}
.time-unit {
  display: flex; flex-direction: column; align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 0;
  min-width: 96px;
}
.time-btn {
  color: var(--icon);
  width: 32px; height: 32px;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.time-btn:hover { color: var(--icon-glow); }
.time-value {
  font-size: 42px;
  font-weight: 300;
  color: var(--text);
  letter-spacing: 0.04em;
  min-width: 64px; text-align: center;
}
.time-sep {
  font-size: 32px;
  color: var(--icon);
  font-weight: 300;
}

/* radio cards */
.radio-list {
  display: flex; flex-direction: column; gap: 10px;
  margin: 8px 0 24px;
}
.radio-card {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
  font-size: 15px;
  color: var(--text);
  transition: border-color var(--t-mid), background var(--t-mid);
  display: flex; flex-direction: column; gap: 4px;
}
.radio-card:hover { border-color: var(--border-hi); background: var(--bg-3); }
.radio-card.selected {
  border-color: var(--icon);
  background: linear-gradient(180deg, var(--bg-3), var(--bg-2));
  box-shadow: var(--shadow);
}
.radio-card .label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
}
.radio-card .desc {
  font-size: 13px;
  color: var(--text-dim);
}

.wizard-controls {
  display: flex; gap: 10px;
  margin-top: 16px;
}
.wizard-controls .btn { flex: 1; }

/* ============= TIMER ============= */
.timer-stage {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0;
}
.timer-ring {
  position: relative;
  width: 280px; height: 280px;
  margin: 12px 0 24px;
}
.timer-ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.timer-ring circle { fill: none; stroke-width: 4; stroke-linecap: round; }
.timer-ring .track { stroke: var(--bg-3); }
.timer-ring .progress {
  stroke: url(#timerGrad);
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.40));
}
.timer-display {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.timer-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 56px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.timer-phase-name {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--icon-glow);
  margin-top: 4px;
}

.timer-phases-bar {
  width: 100%;
  display: flex;
  gap: 4px;
  margin: 8px 0 24px;
}
.timer-phases-bar .seg {
  flex: 1;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  transition: background var(--t-mid);
}
.timer-phases-bar .seg.active { background: var(--icon); }
.timer-phases-bar .seg.done { background: var(--icon-deep); }

.timer-instruction {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  margin-bottom: 16px;
}
.timer-instruction .ins-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--gold-light);
  margin-bottom: 8px;
}
.timer-instruction .ins-text {
  font-size: 15px; line-height: 1.6;
  color: var(--text);
}
.timer-instruction .ins-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-style: italic;
}

.timer-controls {
  display: flex; gap: 10px;
  width: 100%;
}
.timer-controls .btn { flex: 1; }

.timer-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 15, 0.96);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  z-index: 200;
  animation: fadeIn 0.5s ease;
}
.timer-overlay-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 80px;
  color: var(--gold-light);
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}
.timer-overlay-label {
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 32px;
}
.timer-end {
  text-align: center;
  padding: 24px;
}
.timer-end-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 36px;
  color: var(--gold-light);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  animation: pulseGlow 3s ease-in-out infinite;
}

/* ============= ANALYSIS ============= */
.analysis-progress {
  display: flex; gap: 6px; justify-content: center;
  margin-bottom: 28px;
}
.analysis-progress span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg-3);
  transition: background var(--t-mid), transform var(--t-mid);
}
.analysis-progress span.active { background: var(--icon); transform: scale(1.3); }
.analysis-progress span.done { background: var(--icon-deep); }

.confidence-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin: 12px 0 18px;
}
.confidence-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--icon-deep), var(--icon-glow));
  border-radius: 3px;
  transition: width 0.8s ease;
}
.result-type {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.result-confidence {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ============= WBTB CYCLE VIZ ============= */
.cycles-viz {
  width: 100%;
  margin: 8px 0 4px;
}
.cycles-viz-explainer {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}
.cycles-viz svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(139, 92, 246, 0.15));
}
.cycles-legend {
  display: flex; gap: 10px 16px; flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.cycles-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.cycles-legend .swatch {
  display: inline-block;
  width: 14px; height: 10px;
  border-radius: 2px;
  vertical-align: middle;
  border: 1px solid rgba(139, 92, 246, 0.20);
}

/* ============= TEXT PAGES ============= */
.text-page { padding-bottom: 48px; }
.text-page p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.text-page p.lead {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  color: var(--gold-light);
  letter-spacing: 0.03em;
  line-height: 1.5;
  margin-bottom: 20px;
}

.borvo-portrait {
  width: 160px; height: 160px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: radial-gradient(circle at 50% 35%, #1a1a26, #0a0a0f);
  border: 1px solid var(--border-hi);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow), inset 0 0 0 4px rgba(201,168,76,0.05);
  overflow: hidden;
  position: relative;
}
.borvo-portrait::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.6);
}
.borvo-portrait svg,
.borvo-portrait .borvo-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: sepia(0.45) saturate(1.25) hue-rotate(-25deg) brightness(0.95) contrast(1.05);
}

.link-list {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 24px;
}

/* ============= TUTORIAL OVERLAY ============= */
.tutorial-overlay {
  position: fixed; inset: 0;
  z-index: 9000;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  animation: tutFadeIn 0.35s ease;
}
.tutorial-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
}
.tutorial-card {
  position: relative;
  width: calc(100% - 24px);
  max-width: 440px;
  margin: 0 12px calc(20px + var(--safe-bot));
  padding: 22px 22px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(139, 92, 246, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  pointer-events: auto;
  animation: tutCardSlide 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.tutorial-skip {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-mid), border-color var(--t-mid);
}
.tutorial-skip:hover { color: var(--text); border-color: var(--border-hi); }

.tutorial-icon {
  font-size: 44px;
  text-align: center;
  margin: 6px 0 14px;
  line-height: 1;
  filter: drop-shadow(0 4px 14px rgba(139, 92, 246, 0.35));
}
.tutorial-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  text-align: center;
  margin-bottom: 10px;
  line-height: 1.3;
}
.tutorial-body {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  text-align: center;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.tutorial-progress {
  display: flex; justify-content: center; gap: 5px;
  margin-bottom: 8px;
}
.tutorial-progress span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--bg-3);
  transition: all 0.25s ease;
}
.tutorial-progress span.active { background: var(--icon); transform: scale(1.5); }
.tutorial-progress span.done   { background: var(--icon-deep); }

.tutorial-step-count {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.tutorial-controls {
  display: flex; gap: 10px;
}
.tutorial-controls .btn { flex: 1; }
.tutorial-controls .btn-primary { flex: 2; }

@keyframes tutFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes tutCardSlide {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Light mode tweaks */
body.light-mode .tutorial-card {
  background: var(--bg-2);
  box-shadow:
    0 24px 48px rgba(74, 50, 96, 0.20),
    0 0 0 1px rgba(123, 82, 175, 0.25);
}
body.light-mode .tutorial-backdrop {
  background: rgba(46, 33, 56, 0.40);
}

/* ============= FLOATING TIMER BADGE ============= */
.timer-badge {
  position: fixed;
  right: 14px;
  bottom: calc(78px + var(--safe-bot));
  z-index: 80;
  background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
  color: #fff;
  border: none;
  padding: 8px 14px 8px 11px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
  box-shadow:
    0 10px 24px rgba(109, 40, 217, 0.5),
    0 0 0 3px rgba(10, 10, 15, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: timerBadgePulse 2.4s ease-in-out infinite;
  transition: transform var(--t-fast), opacity var(--t-mid);
}
.timer-badge[hidden] { display: none !important; }
.timer-badge:hover { transform: scale(1.04); }
.timer-badge:active { transform: scale(0.96); }
.timer-badge-time { font-variant-numeric: tabular-nums; }

@keyframes timerBadgePulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(109, 40, 217, 0.50), 0 0 0 3px rgba(10, 10, 15, 0.8), inset 0 1px 0 rgba(255,255,255,0.20); }
  50%      { box-shadow: 0 10px 30px rgba(109, 40, 217, 0.78), 0 0 0 3px rgba(10, 10, 15, 0.8), inset 0 1px 0 rgba(255,255,255,0.20); }
}

/* ============= BOTTOM NAV (simple) ============= */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(64px + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: rgba(18, 18, 26, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
}
.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.75;
  transition: color var(--t-mid), opacity var(--t-mid), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.nav-btn svg { width: 26px; height: 26px; transition: filter var(--t-mid), transform var(--t-mid); }
.nav-btn:hover { opacity: 1; }
.nav-btn:active svg { transform: scale(0.92); }
.nav-btn.active {
  color: var(--icon-glow);
  opacity: 1;
}
.nav-btn.active svg { filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.55)); }

/* ============= ACCUEIL — Accès Actualités ============= */

/* Bouton icône cloche flottant en haut à droite du home */
.home-news-icon {
  position: absolute;
  top: calc(12px + var(--safe-top));
  /* à gauche du theme-toggle qui occupe right:14px */
  right: 64px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--icon-glow) 0%, var(--icon-deep) 100%);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 71;
  box-shadow:
    0 4px 14px rgba(109, 40, 217, 0.40),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform var(--t-fast), box-shadow var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.home-news-icon:hover {
  box-shadow:
    0 6px 20px rgba(109, 40, 217, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.10);
}
.home-news-icon:active { transform: scale(0.92); }
.home-news-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(232, 201, 109, 0.7);
  animation: newsDotPulse 2.4s ease-in-out infinite;
}
@keyframes newsDotPulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50%      { transform: scale(1.25); opacity: 1; }
}

/* La page home doit être en position: relative pour le bouton flottant */
#page-home { position: relative; }

/* Carte CTA Actualités sous le greeting */
.home-news-card {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  margin: 4px 0 18px;
  background: linear-gradient(135deg, rgba(155, 114, 207, 0.14) 0%, rgba(201, 168, 76, 0.10) 100%);
  border: 1px solid rgba(155, 114, 207, 0.35);
  border-radius: 16px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: transform var(--t-fast), border-color var(--t-mid), box-shadow var(--t-mid);
  box-shadow: 0 4px 18px rgba(109, 40, 217, 0.10);
  -webkit-tap-highlight-color: transparent;
}
.home-news-card:hover {
  border-color: rgba(155, 114, 207, 0.55);
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.22);
}
.home-news-card:active { transform: scale(0.98); }

.home-news-card-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(109, 40, 217, 0.40);
}
.home-news-card-text { flex: 1; min-width: 0; }
.home-news-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
}
.home-news-card-sub {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  margin-top: 2px;
}
.home-news-card-arrow {
  color: var(--icon-glow);
  flex-shrink: 0;
}

/* Mode clair : ajuster les fonds dégradés */
body.light-mode .home-news-card {
  background: linear-gradient(135deg, rgba(123, 82, 175, 0.10) 0%, rgba(184, 148, 60, 0.08) 100%);
  border-color: rgba(123, 82, 175, 0.30);
  box-shadow: 0 4px 18px rgba(74, 50, 96, 0.08);
}
body.light-mode .home-news-card:hover {
  border-color: rgba(123, 82, 175, 0.50);
  box-shadow: 0 8px 22px rgba(74, 50, 96, 0.18);
}

/* ============= HOME CAROUSEL ============= */
.tool-carousel {
  position: relative;
  margin: 8px -20px 18px;       /* extend to viewport edges */
  --slide-w: 78%;                /* width of each slide */
  --slide-gap: 4%;
}

.carousel-viewport {
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding: 16px 0 8px;
  scrollbar-width: none;
}
.carousel-viewport::-webkit-scrollbar { display: none; }

.carousel-track {
  display: flex;
  gap: var(--slide-gap);
  padding: 0 calc((100% - var(--slide-w)) / 2);
}

.cs-slide {
  flex: 0 0 var(--slide-w);
  scroll-snap-align: center;
  scroll-snap-stop: always;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px 22px 24px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  transition:
    transform 0.55s cubic-bezier(0.65, 0, 0.25, 1),
    opacity 0.55s ease,
    box-shadow 0.55s ease,
    border-color 0.55s ease;
  transform: scale(0.86);
  opacity: 0.55;
  -webkit-tap-highlight-color: transparent;
}
.cs-slide.active {
  transform: scale(1);
  opacity: 1;
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow:
    0 12px 32px rgba(10, 10, 15, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.15),
    0 0 40px rgba(139, 92, 246, 0.10);
}

.cs-slide-icon {
  width: 80px; height: 80px;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(139, 92, 246, 0.18), transparent 70%);
  color: var(--icon);
  filter: drop-shadow(0 0 18px rgba(139, 92, 246, 0.25));
}
.cs-slide-icon svg { width: 52px; height: 52px; }

.cs-slide-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 8px;
}
.cs-slide-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
  min-height: 36px;
}
.cs-slide-cta {
  min-width: 140px;
  height: 42px;
  font-size: 14px;
}

/* ============= CURVED SELECTOR ============= */
.carousel-selector {
  position: relative;
  height: 80px;
  margin: 14px 8px 0;
}
.cs-bar {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 46px;
  background: rgba(18, 18, 26, 0.85);
  border: 1px solid var(--border);
  border-radius: 24px;
  pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(139, 92, 246, 0.08),
    0 4px 18px rgba(0, 0, 0, 0.30);
}
.cs-mound {
  position: absolute;
  left: 12.5%;
  bottom: 36px;
  width: 64px; height: 30px;
  transform: translateX(-50%);
  background: rgba(18, 18, 26, 0.96);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 80% 80% 0 0 / 100% 100% 0 0;
  transition: left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
/* Hide the seam between mound and bar */
.cs-mound::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: rgba(18, 18, 26, 1);
}

.cs-tabs {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46px;
  display: flex;
  pointer-events: auto;
  padding: 0 4px;
}
.cs-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  height: 100%;
  transition: color 0.35s ease, opacity 0.35s ease, transform 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}
.cs-tab svg { width: 22px; height: 22px; }
.cs-tab:not(.active):hover { color: var(--icon-glow); }
.cs-tab.active {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.cs-bubble {
  position: absolute;
  left: 12.5%;
  bottom: 28px;
  transform: translateX(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
  box-shadow:
    0 6px 16px rgba(109, 40, 217, 0.55),
    0 0 0 3px var(--bg),
    inset 0 1px 0 rgba(255, 255, 255, 0.20);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  pointer-events: none;
  z-index: 2;
  transition: left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  opacity: 1;
}
.cs-bubble svg { width: 22px; height: 22px; }
.cs-bubble.pop { transform: translateX(-50%) scale(1.10); }

/* ============= ANIMATIONS ============= */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ============= FLUX ============= */
.flux-hint {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.flux-hint p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.6;
  letter-spacing: 0.02em;
}
.flux-hint p + p { margin-top: 6px; }
.flux-hint strong { color: var(--icon-glow); font-weight: 400; }

.flux-global {
  margin: 4px 0 22px;
}
.flux-global-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.flux-global-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--icon-deep), var(--icon-glow));
  border-radius: 4px;
  transition: width 0.5s linear;
}
.flux-global-meta {
  display: flex; justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.flux-stage {
  display: flex; flex-direction: column; align-items: center;
}
.flux-phase-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  text-align: center;
  margin: 4px 0 18px;
  min-height: 36px;
}

.flux-ring {
  position: relative;
  width: 260px; height: 260px;
  margin-bottom: 22px;
}
.flux-ring svg { width: 100%; height: 100%; }
.flux-ring-content {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.flux-time {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px;
  font-weight: 300;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.flux-message {
  position: relative;
  width: 100%;
  min-height: 140px;
  margin-bottom: 16px;
}
.flux-announce,
.flux-text {
  position: absolute;
  inset: 0;
  text-align: center;
  opacity: 0;
  transition: opacity 0.6s ease;
  padding: 4px 8px;
  pointer-events: none;
}
.flux-announce.visible,
.flux-text.visible { opacity: 1; }
.flux-announce {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-style: italic;
  color: var(--icon-glow);
  letter-spacing: 0.04em;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.4;
}
.flux-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  letter-spacing: 0.01em;
}

.flux-controls {
  display: flex; gap: 10px;
  width: 100%;
  margin-bottom: 18px;
}
.flux-controls .btn { flex: 1; }
.btn-ghost.confirming {
  border-color: rgba(215, 120, 120, 0.6);
  color: #d77878;
}

.flux-markers {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.flux-markers summary {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.flux-markers summary::-webkit-details-marker { display: none; }
.flux-markers summary::after {
  content: " ▾";
  color: var(--icon);
  font-size: 10px;
}
.flux-markers[open] summary::after { content: " ▴"; }
.flux-markers p {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
  letter-spacing: 0.02em;
  margin-top: 6px;
}
.flux-markers strong { color: var(--icon-glow); font-weight: 400; }
.flux-markers em { color: var(--gold-light); font-style: normal; }

.flux-end {
  text-align: center;
  padding: 36px 0 16px;
}
.flux-end-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 34px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: var(--icon-glow);
  margin-bottom: 18px;
  animation: pulseGlow 4s ease-in-out infinite;
}

/* ============= ANALYSIS — nouveaux types de questions ============= */
.analysis-radio-card .label {
  display: flex; align-items: center; gap: 6px;
}

.analysis-emoji-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.analysis-emoji-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.analysis-emoji-card:hover { border-color: var(--border-hi); background: var(--bg-3); }
.analysis-emoji-card:active { transform: scale(0.97); }
.analysis-emoji-icon { font-size: 32px; line-height: 1; }

.analysis-slider-block {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0;
}
.analysis-slider-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-weight: 300;
  color: var(--icon-glow);
  letter-spacing: 0.04em;
  text-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}
.analysis-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--icon-deep), var(--icon-glow));
  outline: none;
  margin-bottom: 8px;
}
.analysis-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 6px 16px rgba(109, 40, 217, 0.55);
  cursor: pointer;
}
.analysis-slider::-moz-range-thumb {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 6px 16px rgba(109, 40, 217, 0.55);
}
.analysis-slider-scale {
  width: 100%;
  display: flex; justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.analysis-slider-block .btn-primary { width: 100%; max-width: 280px; }

/* Spectrum (résultat — toutes catégories) */
.analysis-spectrum {
  display: flex; flex-direction: column; gap: 10px;
}
.analysis-spectrum-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
  font-size: 13px;
}
.analysis-spectrum-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.analysis-spectrum-pct {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}
.analysis-spectrum-bar {
  height: 8px;
  background: var(--bg-3);
  border-radius: 4px;
  overflow: hidden;
}
.analysis-spectrum-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Light-mode tweaks */
body.light-mode .analysis-emoji-card { background: var(--bg-2); color: var(--text); }
body.light-mode .analysis-slider-value { color: var(--icon-deep); text-shadow: 0 0 16px rgba(123, 82, 175, 0.25); }
body.light-mode .analysis-spectrum-bar { background: var(--bg-3); }

/* ============= NEWS (Actualités) ============= */
.news-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 8px 0 4px;
}

.news-loading {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 56px 0;
}
.news-loading-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--icon);
  opacity: 0.4;
  animation: newsDot 1.2s ease-in-out infinite;
}
.news-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.news-loading-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes newsDot {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50%      { transform: translateY(-6px); opacity: 1; }
}

.news-event-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  position: relative;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}
.news-event-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow);
}

.news-event-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.news-event-type {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.15);
  color: var(--icon-glow);
  border: 1px solid rgba(139, 92, 246, 0.30);
  font-weight: 400;
}
/* Type variants */
.news-event-card.type-stage   .news-event-type { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.40); }
.news-event-card.type-atelier .news-event-type { background: rgba(201, 168, 76, 0.15); color: var(--gold-light); border-color: rgba(201, 168, 76, 0.35); }
.news-event-card.type-retreat .news-event-type { background: rgba(192, 132, 252, 0.15); color: #d8b4fe; border-color: rgba(192, 132, 252, 0.40); }
.news-event-card.type-live    .news-event-type { background: rgba(96, 165, 250, 0.15); color: #93c5fd; border-color: rgba(96, 165, 250, 0.40); }
.news-event-card.type-autre   .news-event-type { background: rgba(124, 111, 155, 0.15); color: var(--text-dim); border-color: rgba(124, 111, 155, 0.30); }

.news-event-badge-complet {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(215, 120, 120, 0.15);
  color: #d77878;
  border: 1px solid rgba(215, 120, 120, 0.35);
  font-weight: 400;
  white-space: nowrap;
}

.news-event-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.news-event-meta {
  margin-bottom: 12px;
}
.news-event-row {
  display: flex; align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}
.news-event-row svg {
  color: var(--icon);
  flex-shrink: 0;
}

.news-event-desc {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-event-card.is-complet { opacity: 0.72; }
.news-event-card.is-complet .news-event-title { color: var(--text-dim); }

.news-event-cta {
  display: inline-flex;
  align-items: center;
  height: 38px;
  min-height: 0;
  padding: 0 16px;
  font-size: 13px;
  width: auto;
}
.news-event-cta[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  border-style: dashed;
}

.news-info {
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}
.news-info code {
  color: var(--gold-light);
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.news-videos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 520px) {
  .news-videos-grid { grid-template-columns: 1fr 1fr; }
}

.news-video-card {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  transition: transform var(--t-fast), border-color var(--t-mid), box-shadow var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.news-video-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--shadow);
}
.news-video-card:active { transform: scale(0.98); }

.news-video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background-color: var(--bg-3);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
}
.news-video-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(10, 10, 15, 0.55));
  pointer-events: none;
}
.news-video-play {
  position: relative;
  z-index: 1;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.news-video-play svg { width: 22px; height: 22px; margin-left: 2px; }

.news-video-body { padding: 12px 14px 14px; }
.news-video-title {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-video-date {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============= TECHNIQUES ============= */
/* Intro collapsible explaining the 3 categories */
.tq-intro {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 4px 0 14px;
}
.tq-intro summary {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.tq-intro summary::-webkit-details-marker { display: none; }
.tq-intro summary::after {
  content: "▾";
  color: var(--icon);
  font-size: 11px;
  transition: transform var(--t-mid);
}
.tq-intro[open] summary::after { transform: rotate(180deg); }
.tq-intro-body { padding-top: 10px; }
.tq-intro-body p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin-top: 8px;
  letter-spacing: 0.01em;
}
.tq-intro-body .muted { font-size: 12px; }
.tq-strong-induction { color: #c4b5fd; }
.tq-strong-decorp    { color: var(--gold-light); }
.tq-strong-mixte     {
  background: linear-gradient(90deg, #c4b5fd, var(--gold-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Search box */
.tq-search {
  position: relative;
  margin-bottom: 12px;
}
.tq-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
#tq-search {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 38px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
  -webkit-appearance: none;
}
#tq-search:focus {
  border-color: var(--border-hi);
  box-shadow: var(--shadow);
}
#tq-search::placeholder { color: rgba(124, 111, 155, 0.6); }

/* Filter pills (scrollable row) */
.tq-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 4px 14px;
  margin: 0 -4px 6px;
  scrollbar-width: none;
}
.tq-filters::-webkit-scrollbar { display: none; }
.tq-filter {
  flex: 0 0 auto;
  padding: 8px 14px;
  height: 34px;
  border-radius: 999px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color var(--t-mid), background var(--t-mid), border-color var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.tq-filter:hover { color: var(--text); border-color: var(--border-hi); }
.tq-filter.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.20), rgba(109, 40, 217, 0.20));
  color: var(--icon-glow);
  border-color: rgba(139, 92, 246, 0.45);
}

/* List of cards */
.tq-list {
  display: flex; flex-direction: column;
  gap: 12px;
}
.tq-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  text-align: left;
  transition: border-color var(--t-mid), box-shadow var(--t-mid), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.tq-card:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.tq-card:active { transform: scale(0.99); }

.tq-card-head {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.tq-card-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.tq-card-resume {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tq-card-foot {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.tq-card-duree {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* Badges */
.tq-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 400;
  white-space: nowrap;
}
.tq-cat.cat-induction {
  background: #8b5cf6;
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35);
}
.tq-cat.cat-decorp {
  background: var(--gold);
  color: #1a1410;
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.35);
}
.tq-cat.cat-mixte {
  background: linear-gradient(90deg, #8b5cf6 0%, var(--gold) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(155, 130, 175, 0.40);
}
.tq-level {
  background: rgba(18, 18, 26, 0.6);
  border: 1px solid var(--border);
}
.tq-level.level-beginner     { color: #86efac; border-color: rgba(134, 239, 172, 0.25); }
.tq-level.level-intermediate { color: #fbbf24; border-color: rgba(251, 191, 36, 0.25); }
.tq-level.level-advanced     { color: #fb7185; border-color: rgba(251, 113, 133, 0.25); }
.tq-canal {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: none;
  font-size: 11px;
  padding: 0 8px;
}
.tq-context {
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--icon-glow);
  letter-spacing: 0.08em;
  text-transform: none;
  font-size: 11px;
  padding: 0 8px;
}

/* Detail screen */
.tq-detail { padding-bottom: 24px; }
.tq-detail-head {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.tq-detail-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}
.tq-detail-contexts {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.tq-resume-box {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-left: 3px solid var(--icon);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 22px;
  letter-spacing: 0.01em;
  font-style: italic;
}
.tq-infos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 24px;
}
@media (min-width: 520px) {
  .tq-infos { grid-template-columns: 1fr 1fr 1fr; }
}
.tq-info {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.tq-info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  margin-bottom: 6px;
}
.tq-info-value {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: 0.01em;
}

.tq-section-h {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 22px 0 10px;
}

.tq-instructions {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin-bottom: 8px;
}
.tq-instructions li {
  counter-increment: step;
  position: relative;
  padding: 10px 0 10px 38px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border);
}
.tq-instructions li:last-child { border-bottom: none; }
.tq-instructions li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 10px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a78bfa, #6d28d9);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
  box-shadow: 0 3px 8px rgba(109, 40, 217, 0.45);
}

.tq-signs, .tq-errors {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.tq-signs li, .tq-errors li {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  letter-spacing: 0.01em;
}
.tq-sign-mark {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(134, 239, 172, 0.15);
  color: #86efac;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 500;
}
.tq-error-mark {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(251, 113, 133, 0.15);
  color: #fb7185;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
}

.tq-borvo {
  margin: 24px 0 16px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.08), rgba(109, 40, 217, 0.04));
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-left: 3px solid var(--icon);
  position: relative;
}
.tq-borvo::before {
  content: "“";
  position: absolute;
  top: -8px; left: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 44px;
  color: var(--icon-glow);
  line-height: 1;
}
.tq-borvo p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-style: italic;
  line-height: 1.55;
  color: var(--text);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}
.tq-borvo footer {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
}

/* ============= NAV BADGE ============= */
.nav-btn { position: relative; }
.nav-btn.needs-action::before {
  content: "";
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--icon-glow);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.8), 0 0 0 2px rgba(18, 18, 26, 0.95);
}

/* ============= PROFIL ============= */
#page-profile {
  --prof-color: var(--icon);
  --prof-color-alt: var(--icon-glow);
}

.prof-hero {
  position: relative;
  text-align: center;
  padding: 8px 0 18px;
}

/* Badge verdict du jour — flottant top-right */
.prof-verdict {
  position: absolute;
  top: 4px; right: 4px;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-fast), border-color var(--t-mid), box-shadow var(--t-mid);
}
.prof-verdict:hover { border-color: var(--border-hi); box-shadow: var(--shadow); }
.prof-verdict:active { transform: scale(0.95); }
.prof-verdict-emoji { font-size: 18px; line-height: 1; }
.prof-verdict-content {
  display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1;
}
.prof-verdict-label {
  font-size: 11px;
  color: var(--text);
  letter-spacing: 0.04em;
  font-weight: 500;
}
.prof-verdict-score {
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.prof-verdict-great { border-color: rgba(109, 184, 109, 0.40); }
.prof-verdict-great .prof-verdict-label { color: #6db86d; }
.prof-verdict-ok    { border-color: rgba(232, 161, 74, 0.40); }
.prof-verdict-ok    .prof-verdict-label { color: #e8a14a; }
.prof-verdict-low   { border-color: rgba(196, 116, 116, 0.40); }
.prof-verdict-low   .prof-verdict-label { color: #c47474; }
.prof-verdict-locked { opacity: 0.7; }
.prof-verdict-locked .prof-verdict-label { color: var(--text-dim); }
@media (max-width: 380px) {
  .prof-verdict-content { display: none; }
  .prof-verdict { padding: 8px; }
}
.prof-symbol {
  display: inline-block;
  margin-bottom: 12px;
  padding: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,0,0,0.4), transparent 65%);
  filter: drop-shadow(0 0 24px var(--prof-color));
}
.prof-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--prof-color-alt);
  margin-bottom: 4px;
}
.prof-subtitle {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.prof-reset {
  font-size: 12px;
  min-height: 36px;
  padding: 0 14px;
}
.prof-reset.confirming {
  border-color: rgba(215, 120, 120, 0.6);
  color: #d77878;
}

.prof-section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  margin: 24px 0 8px;
}

/* Stats — pixel-art style bars */
.prof-stats {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.prof-stat + .prof-stat { margin-top: 12px; }
.prof-stat-row {
  display: flex; justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.prof-stat-label { color: var(--text-dim); }
.prof-stat-value { color: var(--prof-color-alt); font-weight: 500; font-variant-numeric: tabular-nums; }
.prof-stat-bar {
  display: flex; gap: 3px;
}
.prof-stat-block {
  flex: 1;
  height: 10px;
  background: var(--bg-3);
  border-radius: 1px;
  transition: background var(--t-mid);
}

/* Favorites */
.prof-favs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.prof-fav {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}
.prof-fav-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  color: var(--prof-color);
}
.prof-fav-icon svg { width: 22px; height: 22px; }
.prof-fav-name { flex: 1; font-size: 14px; color: var(--text); }
.prof-fav-count {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  color: var(--prof-color-alt);
  letter-spacing: 0.03em;
}

/* Element description card */
.prof-desc-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 8px;
}
.prof-desc-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.prof-desc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
@media (min-width: 480px) {
  .prof-desc-grid { grid-template-columns: 1fr 1fr; }
}
.prof-desc-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--prof-color-alt);
  margin-bottom: 4px;
}
.prof-desc-value {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* Recommendations */
.prof-recos {
  display: flex; flex-direction: column;
  gap: 10px;
}
.prof-reco {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  transition: border-color var(--t-mid), background var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.prof-reco:hover { border-color: var(--border-hi); }
.prof-reco-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  color: var(--prof-color);
  flex-shrink: 0;
}
.prof-reco-icon svg { width: 22px; height: 22px; }
.prof-reco-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prof-reco-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.03em;
}
.prof-reco-resume {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prof-reco-arrow {
  color: var(--text-dim);
  flex-shrink: 0;
}

/* ============= TIE-BREAKER ============= */
.prof-tie {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.prof-tie-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  transition: border-color var(--t-mid), transform var(--t-mid);
}
.prof-tie-card:hover { border-color: var(--prof-color-alt); }
.prof-tie-card:active { transform: scale(0.97); }
.prof-tie-symbol { margin-bottom: 10px; }
.prof-tie-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: 0.03em;
}
.prof-tie-short {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ============= CALENDAR ============= */
.prof-calendar {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.cal-nav {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: color var(--t-mid), background var(--t-mid);
}
.cal-nav:hover { color: var(--prof-color-alt); background: var(--bg-3); }
.cal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
  text-transform: capitalize;
}
.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--text);
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  font-variant-numeric: tabular-nums;
  border: 1px solid transparent;
  transition: border-color var(--t-fast), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.cal-cell.empty {
  background: transparent;
  border: none;
  pointer-events: none;
}
.cal-cell.future {
  opacity: 0.35;
  cursor: not-allowed;
}
.cal-cell.today {
  border-color: var(--prof-color-alt);
}
.cal-cell:not(.empty):not(.future):not([disabled]):hover {
  border-color: var(--border-hi);
}
.cal-cell:not(.empty):not(.future):not([disabled]):active {
  transform: scale(0.94);
}
.cal-day-num { z-index: 1; }
.cal-shc-icon {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 12px; height: 12px;
  color: #ffd700;
  z-index: 2;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.8));
}
.cal-shc-icon svg { width: 100%; height: 100%; }
.cal-cell.has-shc .cal-day-num { color: #fff; font-weight: 500; }

.cal-legend {
  display: flex; gap: 16px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.cal-legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ============= BOTTOM SHEET (calendar day) ============= */
.prof-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn 0.25s ease;
}
.prof-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.prof-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
  animation: sheetUp 0.32s cubic-bezier(0.25, 1, 0.4, 1);
  overflow: hidden;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.prof-sheet-handle {
  width: 36px; height: 3px;
  background: var(--text-dim);
  border-radius: 3px;
  margin: 10px auto 0;
  opacity: 0.5;
}
.prof-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 8px;
}
.prof-sheet-header h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
}
.prof-sheet-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  color: var(--text-dim);
}
.prof-sheet-close:hover { color: var(--text); background: var(--bg-3); }
.prof-sheet-body {
  overflow-y: auto;
  padding: 8px 18px 24px;
}
.prof-sheet-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 4px 0 12px;
}
.prof-sheet-techs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.prof-tech-toggle {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  transition: border-color var(--t-mid), color var(--t-mid), background var(--t-mid);
}
.prof-tech-icon {
  display: flex; align-items: center; justify-content: center;
}
.prof-tech-icon svg { width: 24px; height: 24px; }
.prof-tech-toggle.selected {
  border-color: var(--icon);
  color: var(--icon-glow);
  background: rgba(139, 92, 246, 0.10);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.18);
}
.prof-tech-toggle.selected .prof-tech-icon { color: var(--icon-glow); filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4)); }

/* Lunar phase line in sheet header */
.prof-sheet-moon {
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* ============= WIZARD CALENDAR ============= */
.prof-wiz-progress {
  display: flex; justify-content: center; gap: 8px;
  margin: 14px 20px 12px;
}
.prof-wiz-progress span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--bg-3);
  transition: background 0.3s ease, transform 0.3s ease;
}
.prof-wiz-progress span.active { background: var(--icon); transform: scale(1.4); }
.prof-wiz-progress span.done   { background: var(--icon-deep); }

.prof-sheet-source {
  margin: 4px 20px 10px;
  padding: 8px 12px;
  background: rgba(155, 114, 207, 0.10);
  border: 1px solid rgba(155, 114, 207, 0.25);
  border-radius: 10px;
  font-size: 12px;
  color: var(--icon-glow);
  letter-spacing: 0.02em;
  text-align: center;
}

.prof-wiz-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  text-align: center;
  margin: 4px 0 18px;
}

.prof-wiz-hint {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
  line-height: 1.5;
  margin: 16px 0 0;
  padding: 10px 12px;
  background: rgba(155, 114, 207, 0.06);
  border-radius: 10px;
}

.prof-wiz-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px calc(16px + var(--safe-bot));
  border-top: 1px solid var(--border);
}
.prof-wiz-footer .btn { flex: 1; }
.prof-wiz-footer .prof-wiz-next { flex: 2; }

/* Time picker (sheet step 1) */
.prof-time-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.prof-time-block { display: flex; flex-direction: column; align-items: center; }
.prof-time-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.prof-time-picker {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 8px;
}
.prof-time-unit {
  display: flex; flex-direction: column; align-items: center;
}
.prof-time-arrow {
  color: var(--icon);
  width: 28px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.prof-time-arrow:hover { color: var(--icon-glow); }
.prof-time-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 300;
  color: var(--text);
  min-width: 42px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.prof-time-sep {
  font-size: 22px;
  color: var(--icon);
  font-weight: 300;
}

.prof-sleep-duration {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  letter-spacing: 0.04em;
  margin: 4px 0 18px;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 500;
}
.prof-sleep-duration.qual-bad  { color: #d77878; background: rgba(215, 120, 120, 0.10); }
.prof-sleep-duration.qual-mid  { color: #e8a14a; background: rgba(232, 161, 74, 0.10); }
.prof-sleep-duration.qual-good { color: #6db86d; background: rgba(109, 184, 109, 0.10); }
.prof-sleep-duration.qual-long { color: #5fa5d4; background: rgba(95, 165, 212, 0.10); }

.prof-natural-toggle { margin-bottom: 16px; }
.prof-natural-toggle .prof-shc-star { color: #f4a35a; }

.prof-quality-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.prof-quality-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 4px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.prof-quality-emoji { font-size: 22px; line-height: 1; }
.prof-quality-num {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.prof-quality-btn.selected {
  background: linear-gradient(135deg, rgba(155, 114, 207, 0.22), rgba(123, 82, 175, 0.10));
  border-color: var(--icon);
  transform: scale(1.05);
}
.prof-quality-btn.selected .prof-quality-num { color: var(--icon-glow); font-weight: 500; }

.prof-slider-row { margin: 0 0 4px; }
.prof-fatigue-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #d77878 0%, #e8a14a 35%, #b3c87a 60%, #6db86d 100%);
  outline: none;
}
.prof-fatigue-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(109, 40, 217, 0.5);
  cursor: pointer;
}
.prof-fatigue-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(109, 40, 217, 0.5);
}
.prof-slider-scale {
  display: flex; justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.prof-slider-scale [data-fatigue-display] { color: var(--icon-glow); font-weight: 500; }

/* Summary on step 3 */
.prof-summary {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
}
.prof-summary-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  color: var(--text);
  padding: 4px 0;
}
.prof-summary-row > span:first-child { font-size: 16px; }
.prof-summary-icons .prof-summary-icon { display: inline-flex; margin-right: 6px; color: var(--icon-glow); }
.prof-summary-icons .prof-summary-icon svg { width: 16px; height: 16px; }
.prof-summary-shc { color: var(--gold-light); }

/* Success animation after save */
.prof-sheet-success {
  padding: 60px 30px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  animation: profSuccessIn 0.4s ease;
}
.prof-success-circle {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 10px 30px rgba(109, 40, 217, 0.5);
  animation: profSuccessPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.prof-sheet-success p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  letter-spacing: 0.04em;
  color: var(--text);
}
@keyframes profSuccessIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes profSuccessPop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============= PREDICTION STARS ON CALENDAR ============= */
.cal-pred {
  position: absolute;
  bottom: 2px; right: 4px;
  font-size: 11px;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}
.cal-pred-high {
  color: var(--icon-glow);
  filter: drop-shadow(0 0 4px rgba(155, 114, 207, 0.85));
  animation: predHighPulse 2s ease-in-out infinite;
}
.cal-pred-mid {
  color: var(--gold-light);
  opacity: 0.85;
}
@keyframes predHighPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(155, 114, 207, 0.6)); }
  50%      { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(155, 114, 207, 1)); }
}

/* ============= INSIGHTS WIDGET ============= */
.prof-insights-progress {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 18px;
}
.prof-insights-progress strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--icon-glow);
}
.prof-insights-progress p {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.prof-insights-icon { font-size: 24px; flex-shrink: 0; }

.prof-insights-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 0 16px;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
  scrollbar-width: none;
}
.prof-insights-scroll::-webkit-scrollbar { display: none; }

.prof-insight-card {
  flex: 0 0 78%;
  scroll-snap-align: start;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow);
}
.prof-insight-icon {
  font-size: 24px;
  flex-shrink: 0;
}
.prof-insight-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: 0.01em;
}

/* Calendar cell : moon (top-left) + experience emoji (top-right) */
.cal-cell { position: relative; }
.cal-moon {
  position: absolute;
  top: 3px; left: 4px;
  font-size: 10px;
  opacity: 0.6;
  line-height: 1;
  pointer-events: none;
}
.cal-exp {
  position: absolute;
  top: 3px; right: 4px;
  font-size: 11px;
  opacity: 0.85;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.6));
}

/* Experience type grid (single-select) */
.prof-exp-types {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.prof-exp-toggle {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  text-align: left;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
}
.prof-exp-toggle .prof-exp-emoji { font-size: 18px; flex-shrink: 0; }
.prof-exp-toggle:hover { border-color: var(--border-hi); }
.prof-exp-toggle.selected {
  background: linear-gradient(135deg, rgba(155, 114, 207, 0.20), rgba(109, 40, 217, 0.10));
  border-color: var(--icon);
  color: var(--text);
  animation: profExpPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes profExpPop {
  0%   { transform: scale(0.94); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Lucidity slider */
.prof-lucidity {
  margin-bottom: 18px;
}
.prof-lucidity-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.prof-lucidity-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--icon-glow);
  letter-spacing: 0.04em;
}
.prof-lucidity-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--icon-deep), var(--icon-glow));
  outline: none;
  margin: 6px 0 4px;
}
.prof-lucidity-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(109, 40, 217, 0.5);
  cursor: pointer;
}
.prof-lucidity-range::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--icon-glow);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--icon), 0 4px 12px rgba(109, 40, 217, 0.5);
  cursor: pointer;
}
.prof-lucidity-scale {
  display: flex; justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Note textarea */
.prof-note-block {
  margin-bottom: 18px;
  position: relative;
}
.prof-note-area {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: 0.01em;
  transition: border-color var(--t-mid);
  -webkit-tap-highlight-color: transparent;
}
.prof-note-area::placeholder { color: var(--text-dim); }
.prof-note-area:focus { outline: none; border-color: var(--icon); box-shadow: var(--shadow); }
.prof-note-count {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  text-align: right;
  margin-top: 4px;
  padding-right: 4px;
}

.prof-shc-row {
  margin-bottom: 18px;
}
.prof-shc-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: all var(--t-mid);
}
.prof-shc-star { display: inline-flex; }
.prof-shc-star svg { width: 22px; height: 22px; color: var(--text-dim); transition: color var(--t-mid), filter var(--t-mid); }
.prof-shc-toggle.active {
  border-color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  color: #ffe566;
}
.prof-shc-toggle.active .prof-shc-star svg {
  color: #ffd700;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.7));
}

.prof-sheet-actions {
  display: flex; gap: 10px;
}
.prof-sheet-actions .btn { flex: 1; min-width: 0; }
.prof-sheet-actions .btn-ghost {
  border-color: rgba(215, 120, 120, 0.4);
  color: #d77878;
}

/* ============= HERO PROFIL — avatar + badge élément + actions ============= */
.prof-avatar-wrap {
  position: relative;
  display: inline-block;
  margin: 8px auto 14px;
}
.prof-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  border: 3px solid var(--icon);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  transition: box-shadow var(--t-mid), border-color var(--t-mid);
}
.prof-avatar img { width: 100%; height: 100%; object-fit: cover; }
.prof-avatar-initials {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}
.prof-avatar-badge {
  position: absolute;
  bottom: -4px; right: -4px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 4px;
  background: var(--icon);
  box-shadow: 0 0 0 3px var(--bg), 0 4px 10px rgba(0, 0, 0, 0.35);
}
.prof-avatar-badge svg {
  width: 100%; height: 100%;
  display: block;
}

.prof-hero-actions {
  display: flex; flex-wrap: wrap;
  justify-content: center; gap: 8px;
  margin-top: 10px;
}
.prof-hero-actions .btn { min-height: 38px; padding: 0 14px; font-size: 13px; flex: 0 1 auto; }

.prof-account-role {
  display: inline-block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  color: var(--icon-glow);
}

.prof-account-status {
  margin: 10px auto 0;
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  max-width: 320px;
  text-align: center;
}
.prof-account-status.pending { background: rgba(155, 114, 207, 0.10); color: var(--icon-glow); }
.prof-account-status.ok      { background: rgba(109, 184, 109, 0.10); color: #6db86d; }
.prof-account-status.error   { background: rgba(215, 120, 120, 0.10); color: #d77878; }

/* ============= MODAL VERDICT (remplace alert pour le score du jour) ============= */
.verdict-modal-wrap {
  position: fixed; inset: 0;
  z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: verdictFadeIn 0.25s ease;
}
.verdict-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.verdict-modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.20);
  animation: verdictSlideIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.verdict-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--t-mid), border-color var(--t-mid);
}
.verdict-modal-close:hover { color: var(--text); border-color: var(--border-hi); }
.verdict-modal-title {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--icon-glow);
  margin-bottom: 6px;
}
.verdict-modal-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.verdict-modal-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}
.verdict-modal-reasons {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.verdict-modal-reasons li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  padding: 8px 12px;
  background: rgba(155, 114, 207, 0.08);
  border-left: 2px solid var(--icon);
  border-radius: 6px;
  letter-spacing: 0.01em;
}
.verdict-modal-ok {
  width: 100%;
  min-height: 42px;
}

@keyframes verdictFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes verdictSlideIn {
  from { transform: translateY(12px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

body.light-mode .verdict-modal-backdrop { background: rgba(46, 33, 56, 0.45); }
body.light-mode .verdict-modal { background: var(--bg-2); }

/* ============= MODAL CONFIRM/ALERT générique (remplace confirm() / alert() natifs) ============= */
.vdc-confirm-wrap {
  position: fixed; inset: 0;
  z-index: 9700;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: verdictFadeIn 0.22s ease;
}
.vdc-confirm-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.vdc-confirm {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  padding: 22px 22px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.20);
  animation: verdictSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.vdc-confirm-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 10px;
}
.vdc-confirm-body {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}
.vdc-confirm-actions {
  display: flex; gap: 10px;
}
.vdc-confirm-actions .btn { flex: 1; min-height: 42px; }

/* Bouton confirm "danger" — rouge subtil */
.btn-confirm-danger {
  background: linear-gradient(135deg, #e85555 0%, #b43c3c 100%);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(232, 85, 85, 0.35);
}
.btn-confirm-danger:hover { box-shadow: 0 6px 20px rgba(232, 85, 85, 0.50); }

body.light-mode .vdc-confirm-backdrop { background: rgba(46, 33, 56, 0.45); }
body.light-mode .vdc-confirm { background: var(--bg-2); }

/* Bouton "Se déconnecter" persistant en bas de page profil */
.prof-signout-bottom {
  margin: 28px 0 12px;
  padding: 0 4px;
}
.btn-signout-red {
  width: 100%;
  background: transparent;
  border: 1px solid #e85555;
  color: #e85555;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--t-mid), color var(--t-mid), transform var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn-signout-red:hover {
  background: rgba(232, 85, 85, 0.10);
}
.btn-signout-red:active { transform: scale(0.98); }
body.light-mode .btn-signout-red { border-color: #c43d3d; color: #c43d3d; }
body.light-mode .btn-signout-red:hover { background: rgba(196, 61, 61, 0.08); }

/* ============= COMMUNITY INSIGHTS WIDGET ============= */
.community-insights {
  margin: 8px 14px 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(155, 114, 207, 0.10), rgba(201, 168, 76, 0.06));
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.community-insights-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--icon-glow);
  margin-bottom: 4px;
}

/* ============= AUTH GATE — UI complète masquée quand pas connecté ============= */
body.is-unauthenticated .bottom-nav,
body.is-unauthenticated .theme-toggle,
body.is-unauthenticated .timer-badge,
body.is-unauthenticated #page-auth .back-btn {
  display: none !important;
}

/* Quand l'app est verrouillée, l'app sans bottom-nav doit reprendre tout l'espace */
body.is-unauthenticated .app {
  padding-bottom: var(--safe-bot);
}

/* Et le titre de la page auth devient une bannière centrée premium */
body.is-unauthenticated #page-auth .page-header {
  justify-content: center;
  padding: 20px 0 8px;
}
body.is-unauthenticated #page-auth .page-title {
  font-size: 26px;
}

/* ============= AUTH PAGE ============= */
.auth-tabs {
  display: flex;
  gap: 8px;
  padding: 8px 4px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
}
.auth-tab.active {
  background: var(--bg-2);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow);
}
.auth-body { padding-bottom: 24px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.auth-field > span {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.auth-field input {
  height: 44px;
  padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color var(--t-mid), box-shadow var(--t-mid);
}
.auth-field input:focus { border-color: var(--icon); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15); }
.auth-help {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.auth-pseudo-hint {
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-top: 4px;
}
.auth-pseudo-hint.checking { color: var(--text-dim); font-style: italic; }
.auth-pseudo-hint.available { color: #6db86d; }
.auth-pseudo-hint.taken { color: #d77878; }

.auth-error {
  background: rgba(215, 120, 120, 0.10);
  border: 1px solid rgba(215, 120, 120, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
  color: #d77878;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 4px;
}
.auth-switch a {
  color: var(--icon-glow);
  text-decoration: none;
  margin-left: 4px;
}
.auth-switch a:hover { color: var(--icon); }

.auth-academy {
  background: rgba(155, 114, 207, 0.08);
  border-left: 3px solid var(--icon);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.auth-academy a { color: var(--icon-glow); }

.auth-notconfig {
  padding: 36px 8px;
  text-align: center;
}
.auth-notconfig-icon { font-size: 56px; margin-bottom: 12px; }
.auth-notconfig h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--text);
}
.auth-notconfig p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; }
.auth-notconfig ol { text-align: left; font-size: 13px; line-height: 1.7; padding-left: 22px; color: var(--text); }
.auth-notconfig ol code { background: var(--bg-3); padding: 1px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 12px; color: var(--gold-light); }
.auth-notconfig a { color: var(--icon-glow); }

.auth-success {
  padding: 48px 12px;
  text-align: center;
}
.auth-success-icon { font-size: 56px; margin-bottom: 14px; }
.auth-success h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  margin-bottom: 12px;
  color: var(--gold-light);
}
.auth-success p { font-size: 14px; color: var(--text); line-height: 1.6; }

/* ============= COMMUNITY PAGE ============= */
#page-community {
  display: flex; flex-direction: column;
  height: calc(100dvh - 64px - var(--safe-bot));
  padding: 0;
  margin: 0;
  max-width: none;
}
.community-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 8px;
}
.community-header .back-btn {
  width: 38px; height: 38px;
}
.community-header .page-title { font-size: 18px; flex: 1; }
.community-me {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.community-me-pseudo { letter-spacing: 0.03em; }
.community-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--icon);
  overflow: hidden;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
}
.community-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-avatar-initials {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.04em;
}

.community-channels {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 14px 12px;
  scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.community-channels::-webkit-scrollbar { display: none; }
.community-channel {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--text-dim);
  font-family: 'Outfit', sans-serif;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.community-channel:hover { color: var(--text); }
.community-channel.active {
  background: var(--ch-color, var(--icon));
  color: #0a0a0f;
  font-weight: 500;
  border-color: var(--ch-color);
}
.community-channel-emoji { font-size: 14px; line-height: 1; }

.community-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}
.community-loading, .community-empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px;
  letter-spacing: 0.02em;
}

.community-message {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: flex-start;
}
.community-msg-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 36px; height: 36px;
}
.community-msg-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--icon);
  overflow: hidden;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.community-msg-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-msg-elem-badge {
  position: absolute;
  bottom: -3px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 0 0 2px var(--bg);
  display: flex; align-items: center; justify-content: center;
}
.community-msg-elem-badge svg { width: 100%; height: 100%; display: block; }
.community-me-wrap { width: 28px; height: 28px; }
.community-me-badge { width: 14px; height: 14px; bottom: -2px; right: -2px; padding: 1.5px; }
.community-me-badge svg { width: 100%; height: 100%; }
.community-msg-body { min-width: 0; }
.community-msg-meta {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.community-msg-pseudo {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.community-msg-badge {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.18);
  color: var(--icon-glow);
}
.community-badge-admin { background: rgba(232, 161, 74, 0.22); color: #f4a35a; }
.community-msg-time {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
  margin-left: auto;
}
.community-msg-content {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  letter-spacing: 0.01em;
  word-wrap: break-word;
}
.community-msg-modbtn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-mid), background var(--t-mid);
  flex-shrink: 0;
}
.community-message:hover .community-msg-modbtn,
.community-msg-modbtn:focus { opacity: 1; background: var(--bg-3); }

/* Sur mobile/tactile, le bouton est toujours visible pour ses propres messages */
@media (hover: none) {
  .community-message.is-own .community-msg-modbtn,
  .community-message.is-modable .community-msg-modbtn { opacity: 0.7; }
}

/* Indicateur (modifié) discret */
.community-msg-edited {
  font-size: 10px;
  color: var(--text-dim);
  font-style: italic;
  letter-spacing: 0.02em;
  opacity: 0.7;
}

/* Mode édition inline d'un message */
.community-msg-editing {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border-hi);
}
.community-msg-edit-input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  outline: none;
}
.community-msg-edit-input:focus { border-color: var(--icon); }
.community-msg-edit-actions { display: flex; gap: 4px; flex-shrink: 0; }
.community-msg-edit-save,
.community-msg-edit-cancel {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.community-msg-edit-save {
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  color: #fff;
}
.community-msg-edit-save:hover { filter: brightness(1.1); }
.community-msg-edit-save:disabled { opacity: 0.6; cursor: not-allowed; }
.community-msg-edit-cancel {
  background: var(--bg);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.community-msg-edit-cancel:hover { color: var(--text); border-color: var(--border-hi); }

/* Tombstone d'un message supprimé */
.community-msg-tombstone {
  font-style: italic;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.community-message.is-deleted {
  opacity: 0.6;
}
.community-message.is-deleted .community-msg-tombstone {
  font-style: italic;
  font-size: 12px;
  color: var(--text-dim);
}

.community-modmenu {
  position: fixed;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 100;
  min-width: 200px;
}
.community-modmenu button {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.community-modmenu button:hover { background: var(--bg-3); }

.community-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.community-input input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-mid);
}
.community-input input:focus { border-color: var(--icon); }
.community-input-count {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 28px;
  text-align: right;
}
.community-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--icon-glow), var(--icon-deep));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast), opacity var(--t-mid);
}
.community-send:disabled { opacity: 0.6; cursor: not-allowed; }
.community-send:active { transform: scale(0.92); }

/* ============= UTIL ============= */
.text-center { text-align: center; }
.muted { color: var(--text-dim); }
.gold { color: var(--gold-light); }
.spacer-12 { height: 12px; }
.spacer-24 { height: 24px; }

@media (min-width: 600px) {
  .tools-grid { gap: 18px; }
  .timer-ring { width: 320px; height: 320px; }
}
