/* =====================================================
 * HYROX ARENA — Design system v2
 * Hi-fi : néon vert sur noir bleuté, game-menu vibe
 * Mobile-first PWA
 * ===================================================== */

:root {
  /* Surfaces (sombre par défaut, override par les thèmes) */
  --bg: #0A0E1A;
  --bg-deep: #050811;
  --surface: #141925;
  --surface-2: #1c2233;
  --surface-3: #232a3d;
  --border: rgba(120, 138, 178, 0.14);
  --border-strong: rgba(120, 138, 178, 0.24);

  /* Texte */
  --text: #F5F5F7;
  --text-muted: #8B92A8;
  --text-dim: #5C6275;

  /* Tints utilitaires (suivent le mode dark/light) */
  --tint-1: rgba(255,255,255,0.02);
  --tint-2: rgba(255,255,255,0.04);
  --tint-3: rgba(255,255,255,0.06);
  --tint-strong: rgba(255,255,255,0.08);
  --shimmer: rgba(255,255,255,0.4);
  --hatch: rgba(255,255,255,0.025);

  /* Surfaces translucides (topbar/bottomnav avec backdrop-blur) */
  --topbar-bg: rgba(10, 14, 26, 0.85);
  --bottomnav-bg: rgba(20, 25, 37, 0.85);
  --modal-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --modal-backdrop: rgba(0, 0, 0, 0.7);

  /* Accent primaire (Neon vert par défaut) */
  --hyrox: #00FF88;
  --hyrox-dim: #00cc6e;
  --hyrox-bright: #5cffae;
  --hyrox-deep: #062b1a;
  --hyrox-ink: #051a10;
  --cat-hyrox: #00FF88;
  --glow-hyrox: 0 0 24px color-mix(in oklab, var(--hyrox) 45%, transparent), 0 0 48px color-mix(in oklab, var(--hyrox) 22%, transparent);

  /* Spotlights radiaux du fond (suivent le thème) */
  --spot-top: color-mix(in oklab, var(--hyrox) 10%, transparent);
  --spot-bot: rgba(123,94,167,0.10);

  /* Catégories fixes (ne changent pas avec le thème, sauf hyrox) */
  --cat-cardio: #FF8A3D;
  --cat-strength: #3DA1FF;
  --cat-mobility: #B58CFF;

  /* États système (fixes) */
  --claude: #7B5EA7;
  --claude-bright: #A88BD9;
  --danger: #FF3B5C;
  --warning: #FFB534;
  --gold: #FFD24A;
  --success: #2BD67B;
  --glow-claude: 0 0 24px rgba(168, 139, 217, 0.35);

  /* Geometry */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --t: 200ms cubic-bezier(.2,.8,.2,1);

  /* ========== Typography (centralisé) ========== */
  --font-display: 'Montserrat', -apple-system, system-ui, sans-serif;
  --font-body:    'Poppins', -apple-system, system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
  background-image:
    radial-gradient(120% 60% at 50% -10%, var(--spot-top) 0%, transparent 60%),
    radial-gradient(80% 50% at 110% 110%, var(--spot-bot) 0%, transparent 60%);
  min-height: 100vh;
  padding-bottom: 100px;
  overscroll-behavior: none;
}
body.mode-immersive {
  background: var(--bg-deep);
  background-image: none;
  padding-bottom: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea, button { font: inherit; color: inherit; }
img, svg, object { display: block; max-width: 100%; }

.font-display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ==========================================================
 * ICÔNES (Lucide) — fallback robuste pour iOS Safari
 * Force les dimensions et l'affichage même si le SVG inline
 * a perdu ses attributs lors du remplacement.
 * ========================================================== */
[data-lucide], i[data-lucide] {
  display: inline-flex;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
}
svg.lucide, [data-lucide] svg {
  display: inline-block;
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Si l'élément a une largeur en inline-style, on la respecte */
i[data-lucide][style*="width"] svg { width: inherit; height: inherit; }

/* ========== TOPBAR ========== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  /* +safe-area pour la dynamic island / barre statut iPhone */
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 6px; }
.topbar-back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--text);
  transition: background var(--t);
}
.topbar-back:hover { background: var(--tint-strong); }
.topbar-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.06em;
}
.topbar-logo .arena {
  color: var(--hyrox);
  text-shadow: 0 0 12px color-mix(in oklab, var(--hyrox) 50%, transparent);
}
.topbar-right { display: flex; gap: 6px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tint-2);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.pill.streak { color: var(--warning); }
.pill.streak svg { stroke: var(--warning); }
.pill.level { color: var(--hyrox); border-color: color-mix(in oklab, var(--hyrox) 30%, transparent); background: color-mix(in oklab, var(--hyrox) 8%, transparent); }

/* ========== APP MAIN ========== */
.app-main { max-width: 480px; margin: 0 auto; padding: 0 16px 24px; position: relative; }
.scroll-pad { padding: 4px 0 110px; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.tiny { font-size: 11px; }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; }
.spacer { flex: 1; }

/* ========== BOTTOM NAV (floating glassy) ========== */
.bottom-nav {
  position: fixed;
  left: 12px; right: 12px;
  /* +safe-area-inset-bottom pour la barre home iPhone */
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  max-width: 456px; margin: 0 auto;
  background: var(--bottomnav-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  display: flex; justify-content: space-around;
  padding: 8px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 40;
  box-shadow: var(--modal-shadow);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--text-dim);
  font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 6px 4px;
  border-radius: 14px;
  transition: color var(--t);
  background: transparent;
}
.nav-item i, .nav-item svg { width: 20px; height: 20px; stroke: currentColor; }
.nav-item.active {
  color: var(--hyrox);
  text-shadow: 0 0 8px color-mix(in oklab, var(--hyrox) 50%, transparent);
}
.nav-item.active i, .nav-item.active svg { filter: drop-shadow(0 0 6px color-mix(in oklab, var(--hyrox) 60%, transparent)); }
.nav-item.center .nav-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 14px;
  background: var(--hyrox);
  color: var(--hyrox-ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--glow-hyrox);
  margin-bottom: 2px;
}
.nav-item.center .nav-icon-wrap i, .nav-item.center .nav-icon-wrap svg { stroke: var(--hyrox-ink); stroke-width: 2.5; }

/* ========== CARDS ========== */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  display: block;
}
.card-tight { padding: 12px; }
.card.empty-card { text-align: center; padding: 28px 16px; color: var(--text-muted); }

/* ========== BUTTONS ========== */
.btn {
  appearance: none; border: none;
  font-family: var(--font-display);
  font-weight: 600; font-size: 15px;
  border-radius: 12px;
  padding: 14px 18px; min-height: 48px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, background var(--t), box-shadow var(--t);
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: transparent;
  color: var(--text);
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--hyrox); color: var(--hyrox-ink);
  box-shadow: var(--glow-hyrox);
}
.btn-primary:hover { background: var(--hyrox-bright); }
.btn-claude {
  background: linear-gradient(135deg, #7B5EA7 0%, #5B3F87 100%);
  color: #fff;
  box-shadow: var(--glow-claude);
}
.btn-secondary {
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-danger-ghost {
  background: transparent; color: var(--danger);
  border: 1px solid rgba(255, 59, 92, 0.3);
}
.btn-block { width: 100%; }
.btn-big { padding: 18px 22px; font-size: 17px; min-height: 64px; }
.btn-sm { padding: 9px 12px; font-size: 13px; border-radius: 10px; min-height: 36px; }
.btn-square { width: 56px; height: 56px; padding: 0; border-radius: 16px; }

/* ========== HERO GREETING ========== */
.hero-greeting { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }
.hero-greeting-row { display: flex; align-items: center; gap: 14px; }
.hero-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -0.02em; line-height: 1.1;
}
.hero-meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.hero-meta .level-tag {
  color: var(--hyrox); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px;
}
.hero-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }

/* ========== AVATAR ========== */
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}

/* ========== XP BAR ========== */
.xp-bar {
  position: relative;
  height: 10px;
  background: var(--tint-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.xp-bar-fill {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--hyrox-dim) 0%, var(--hyrox) 100%);
  border-radius: 999px;
  box-shadow: 0 0 12px color-mix(in oklab, var(--hyrox) 40%, transparent);
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}
.xp-bar-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--shimmer) 50%, transparent 100%);
  animation: shimmer 2.4s linear infinite;
}
.xp-meta {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: 11px; color: var(--text-muted);
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ========== SECTION HEADING ========== */
.section-h {
  text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 11px; font-weight: 700;
  color: var(--text-dim);
  margin: 22px 4px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.section-h .acc { color: var(--hyrox); }
.section-h.cat-cardio { color: var(--cat-cardio); }
.section-h.cat-strength { color: var(--cat-strength); }
.section-h.cat-mobility { color: var(--cat-mobility); }
.section-h.cat-hyrox { color: var(--hyrox); }

/* ========== KPI HUD ========== */
.kpi-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 18px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.kpi-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-dim); font-weight: 600;
}
.kpi-value {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; letter-spacing: -0.02em;
  display: flex; align-items: baseline; gap: 6px;
}
.kpi-value.accent { color: var(--hyrox); }
.kpi-value.warn { color: var(--warning); }
.kpi-sub { font-size: 11px; color: var(--text-muted); }

/* ========== NEXT SESSION HERO ========== */
.next-hero {
  position: relative;
  border-radius: 20px;
  padding: 18px 18px 16px;
  overflow: hidden;
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in oklab, var(--hyrox) 18%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, #141a2a 0%, #0d1220 100%);
  border: 1px solid color-mix(in oklab, var(--hyrox) 25%, transparent);
  margin-top: 18px;
}
.next-hero::after {
  content: '';
  position: absolute; top: -40%; right: -20%;
  width: 70%; height: 180%;
  background: radial-gradient(circle, color-mix(in oklab, var(--hyrox) 12%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.next-hero-row { display: flex; justify-content: space-between; align-items: center; position: relative; z-index: 1; }
.next-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  background: color-mix(in oklab, var(--hyrox) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--hyrox) 30%, transparent);
  color: var(--hyrox);
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  border-radius: 999px;
}
.next-hero-tag .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--hyrox); box-shadow: 0 0 8px var(--hyrox);
}
.next-hero-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: 24px; line-height: 1.1;
  margin: 12px 0 4px;
  letter-spacing: -0.02em;
  position: relative; z-index: 1;
}
.next-hero-meta {
  font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.next-hero-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-dim); }
.cat-swatch-row {
  display: flex; gap: 4px; margin-bottom: 14px;
  position: relative; z-index: 1;
}
.cat-swatch { flex: 1; height: 4px; border-radius: 2px; opacity: 0.85; }
.next-hero-actions {
  display: flex; gap: 8px;
  position: relative; z-index: 1;
}

/* ========== MINI SESSION ========== */
.mini-session {
  display: flex; align-items: center; gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, border-color var(--t);
}
.mini-session:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.mini-session-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mini-session-name {
  font-weight: 600; font-size: 14px;
  font-family: var(--font-display); letter-spacing: -0.01em;
}
.mini-session-meta {
  font-size: 11px; color: var(--text-muted); margin-top: 2px;
  font-family: var(--font-mono);
}

.xp-pill {
  display: inline-flex; align-items: center;
  background: color-mix(in oklab, var(--hyrox) 12%, transparent);
  color: var(--hyrox);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid color-mix(in oklab, var(--hyrox) 25%, transparent);
}

/* ========== TOOL TILES ========== */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: border-color var(--t), transform 0.15s ease;
}
.tool-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tool-tile-icon {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--tint-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tool-tile-icon.accent { color: var(--hyrox); }
.tool-tile-label { font-size: 13px; font-weight: 600; font-family: var(--font-display); }
.tool-tile-value {
  font-size: 11px; color: var(--text-muted);
  font-family: var(--font-mono); margin-top: 2px;
}

/* ========== LIVE SESSION (immersive) ========== */
.immersive-screen, .live-shell {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  z-index: 50;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.immersive-screen::before, .live-shell::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(80% 50% at 50% 0%, var(--cat-tint, color-mix(in oklab, var(--hyrox) 18%, transparent)) 0%, transparent 60%),
    radial-gradient(60% 40% at 50% 100%, var(--cat-tint-2, color-mix(in oklab, var(--hyrox) 8%, transparent)) 0%, transparent 70%);
  pointer-events: none;
  transition: background-image 0.6s ease;
}

.live-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(20px + env(safe-area-inset-top)) 16px 8px;
  position: relative; z-index: 2;
}
.live-close, .exit-link {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--tint-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text); cursor: pointer;
}
.live-block-counter {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.2em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.live-block-counter span { color: var(--text-dim); }
.live-spacer { width: 36px; }

/* Temps total séance dans le header (mono, discret) */
.live-session-total {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--tint-2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}
.live-session-total svg { stroke: var(--text-muted); }

/* Badge mode timer (CHRONO / DÉCOMPTE) */
.timer-mode-badge {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.18em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--tint-2);
  border: 1px solid currentColor;
  margin-left: 6px;
}

/* Bloc suivant (hint) */
.next-block-hint {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 4px 16px;
  font-size: 12px;
  color: var(--text-muted);
  position: relative; z-index: 2;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.next-block-hint .hint-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--text-dim);
}
.next-block-hint .hint-text { color: var(--text); }
.next-block-hint.last { color: var(--warning); }
.next-block-hint.last .hint-label { color: var(--warning); }

/* Bouton "Terminer la séance" toujours visible */
.finish-session-row { padding: 12px 16px 6px; position: relative; z-index: 2; }
.finish-session-row .btn {
  font-size: 14px; padding: 12px 16px; min-height: 44px;
  opacity: 0.85;
  transition: opacity var(--t), transform var(--t), box-shadow var(--t);
}
.finish-session-row .btn:hover { opacity: 1; }
.finish-session-row .btn.pulse-attention {
  opacity: 1;
  animation: pulseAttention 1.4s ease-in-out infinite;
}
@keyframes pulseAttention {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--claude) 50%, transparent), var(--glow-claude); }
  50%      { box-shadow: 0 0 0 12px color-mix(in oklab, var(--claude) 0%, transparent), var(--glow-claude); }
}
.block-dot.skipped { opacity: 0.6; }

/* Overlay countdown 10s rouge */
.countdown-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(5, 8, 17, 0.96);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  cursor: pointer;
  animation: cdFadeIn 200ms ease;
}
@keyframes cdFadeIn { from { opacity: 0 } to { opacity: 1 } }
.countdown-prep {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.4em;
  color: var(--danger);
  text-transform: uppercase; font-weight: 700;
}
.countdown-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(160px, 36vw, 240px);
  line-height: 0.9;
  color: var(--danger);
  text-shadow: 0 0 40px rgba(255, 59, 92, 0.6), 0 0 80px rgba(255, 59, 92, 0.3);
  animation: cdPop 1s ease-in-out infinite;
}
@keyframes cdPop {
  0%, 100% { transform: scale(1); text-shadow: 0 0 40px rgba(255, 59, 92, 0.6), 0 0 80px rgba(255, 59, 92, 0.3); }
  50%      { transform: scale(1.06); text-shadow: 0 0 60px rgba(255, 59, 92, 0.9), 0 0 120px rgba(255, 59, 92, 0.5); }
}
.countdown-block {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 0 24px;
}

/* Block dots strip */
.block-dots-strip {
  display: flex; gap: 4px; padding: 8px 16px 0;
  position: relative; z-index: 2;
}
.block-dot {
  flex: 1; height: 4px; border-radius: 2px;
  background: var(--tint-strong);
  transition: all 0.3s ease;
}
.block-dot.done { opacity: 0.4; }
.block-dot.active { box-shadow: 0 0 8px currentColor; }

/* Timer zone with ring */
.timer-zone {
  flex-shrink: 0;
  text-align: center;
  padding: 20px 16px 8px;
  position: relative; z-index: 2;
}
.timer-ring-wrap {
  position: relative;
  width: 280px; height: 280px;
  margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.progress-ring {
  position: absolute; top: 0; left: 0;
  pointer-events: none;
}
.timer-content { position: relative; z-index: 2; }
.timer-cat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 6px;
  justify-content: center;
}
.cat-dot { width: 6px; height: 6px; border-radius: 50%; }
.timer-block-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}
.timer-display {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(64px, 18vw, 88px);
  line-height: 0.95;
  color: var(--hyrox);
  text-shadow: 0 0 28px color-mix(in oklab, var(--hyrox) 55%, transparent), 0 0 60px color-mix(in oklab, var(--hyrox) 25%, transparent);
  letter-spacing: -0.02em;
  margin: 0;
}
.timer-display.paused { opacity: 0.5; text-shadow: none; }
.timer-target {
  font-size: 12px; color: var(--text-muted);
  margin-top: 6px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.timer-pulse { animation: timerPulse 1.6s ease-in-out infinite; }
@keyframes timerPulse {
  0%, 100% { text-shadow: 0 0 28px color-mix(in oklab, var(--hyrox) 55%, transparent), 0 0 60px color-mix(in oklab, var(--hyrox) 25%, transparent); }
  50%      { text-shadow: 0 0 36px color-mix(in oklab, var(--hyrox) 75%, transparent), 0 0 80px color-mix(in oklab, var(--hyrox) 35%, transparent); }
}

/* Live inputs (steppers) */
.live-inputs-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px;
  padding: 4px 16px;
  position: relative; z-index: 2;
}
.live-input {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 8px;
  text-align: center;
}
.live-input-label {
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 700;
}
.live-input-value {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 22px;
  margin-top: 2px;
  color: var(--text);
}
.live-input-value .unit { font-size: 11px; color: var(--text-muted); margin-left: 2px; }
.live-input-stepper { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.live-input-stepper button {
  appearance: none;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 24px; height: 22px;
  font-weight: 700; cursor: pointer;
  font-size: 14px; line-height: 1;
}
.live-input-stepper button:active { transform: scale(0.93); }

/* RPE row */
.rpe-row {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 8px 16px;
  position: relative; z-index: 2;
}
.rpe-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.rpe-label { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); font-weight: 700; }
.rpe-value { font-family: var(--font-mono); font-weight: 700; font-size: 20px; }
.rpe-track {
  position: relative; height: 8px;
  background: var(--tint-strong);
  border-radius: 999px;
  cursor: pointer;
}
.rpe-fill {
  position: absolute; inset: 0 auto 0 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--hyrox) 0%, var(--warning) 70%, var(--danger) 100%);
}
.rpe-thumb {
  position: absolute; top: 50%;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.rpe-scale {
  display: flex; justify-content: space-between;
  margin-top: 4px;
  font-size: 9px; color: var(--text-dim);
  font-family: var(--font-mono);
}

/* Live controls */
.live-controls {
  padding: 12px 16px;
  position: relative; z-index: 2;
}
.live-controls-row {
  display: grid; grid-template-columns: 56px 1fr 56px;
  gap: 10px;
}
.live-controls-row .play {
  font-size: 17px; height: 64px;
  font-family: var(--font-display);
}
.live-block-actions {
  display: flex; gap: 8px; margin-top: 10px;
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  position: relative; z-index: 2;
}

/* Notes textarea in live */
.live-notes { padding: 0 16px; position: relative; z-index: 2; }
.live-notes textarea {
  width: 100%; min-height: 56px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; color: var(--text);
  font-family: inherit; font-size: 13px;
  resize: vertical;
}

/* Finalize zone (mode live) */
.finalize-zone {
  background: var(--surface); padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 18px 16px;
  position: relative; z-index: 2;
}
.finalize-zone textarea {
  width: 100%; padding: 12px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); min-height: 80px;
  font-family: inherit;
}
.upload-zone { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.upload-zone input { display: none; }
.hidden { display: none !important; }

/* XP popup */
.xp-popup {
  position: fixed;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 700; font-size: 44px;
  color: var(--hyrox);
  text-shadow: 0 0 20px color-mix(in oklab, var(--hyrox) 70%, transparent);
  pointer-events: none;
  z-index: 100;
  animation: xpFloat 1.6s ease-out forwards;
}
@keyframes xpFloat {
  0% { transform: translate(-50%, -20%); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(-50%, -160%); opacity: 0; }
}

/* Badge unlock overlay */
.badge-pop {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  animation: fadeIn 200ms ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.badge-pop-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 2px solid var(--hyrox);
  box-shadow: 0 0 60px color-mix(in oklab, var(--hyrox) 50%, transparent);
  text-align: center;
  max-width: 320px;
}
.badge-pop-icon { width: 80px; height: 80px; color: var(--hyrox); margin: 0 auto 12px; }

/* ========== REVIEW SCREEN ========== */
.review-hero {
  border-radius: 20px;
  padding: 20px;
  background:
    radial-gradient(80% 80% at 100% 0%, color-mix(in oklab, var(--hyrox) 18%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #131825 0%, #0c1120 100%);
  border: 1px solid var(--border-strong);
  position: relative; overflow: hidden;
  margin-top: 12px;
}
.review-hero h1 {
  font-family: var(--font-display);
  font-size: 24px; font-weight: 700;
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
}
.review-hero-row { display: flex; justify-content: space-between; align-items: center; }
.review-hero-meta { font-size: 12px; color: var(--text-muted); }
.review-stat-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.review-stat-grid > div { padding: 0 4px; border-right: 1px solid var(--border); }
.review-stat-grid > div:last-child { border-right: none; }
.review-stat-value {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700; margin-top: 2px;
}
.review-stat-value.warn { color: var(--warning); }
.review-stat-value.accent { color: var(--hyrox); }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
}
.status-pill.done { background: color-mix(in oklab, var(--hyrox) 12%, transparent); color: var(--hyrox); border: 1px solid color-mix(in oklab, var(--hyrox) 30%, transparent); }
.status-pill.archived { background: rgba(123, 94, 167, 0.18); color: var(--claude-bright); border: 1px solid rgba(168, 139, 217, 0.3); }
.status-pill.skipped { background: rgba(255,59,92,0.15); color: var(--danger); border: 1px solid rgba(255,59,92,0.3); }
.status-pill.in_progress { background: rgba(255,181,52,0.15); color: var(--warning); border: 1px solid rgba(255,181,52,0.3); }

/* Block review */
.block-review {
  display: flex; gap: 12px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  position: relative; overflow: hidden;
}
.block-review-bar {
  width: 3px; border-radius: 2px;
  flex-shrink: 0; align-self: stretch;
}
.block-review h3 {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  margin: 0 0 2px;
}
.block-review-head {
  display: flex; align-items: center; justify-content: space-between;
}
.block-review-head-left { display: flex; align-items: center; gap: 8px; }
.block-num-mono {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-dim);
}
.block-pr-badge {
  font-size: 9px; font-weight: 700;
  color: var(--hyrox);
  background: color-mix(in oklab, var(--hyrox) 12%, transparent);
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.1em;
  border: 1px solid color-mix(in oklab, var(--hyrox) 30%, transparent);
}
.block-skipped-badge {
  font-size: 9px; font-weight: 700;
  color: var(--danger);
  background: rgba(255,59,92,0.15);
  padding: 2px 6px; border-radius: 4px;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255,59,92,0.3);
}
.block-rpe {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 6px;
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.block-rpe.high { color: var(--danger); border-color: rgba(255,59,92,0.3); }
.block-rpe.med  { color: var(--warning); border-color: rgba(255,181,52,0.3); }
.block-metrics {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-muted);
}
.block-metrics b { color: var(--text); font-weight: 700; }
.block-notes {
  font-size: 12px; color: var(--text-muted);
  font-style: italic; margin-top: 6px; line-height: 1.4;
}

/* Edit mode in review */
.block-review.editing { padding-bottom: 12px; }
.block-edit-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-top: 8px;
}
.block-edit-grid label { font-size: 10px; color: var(--text-dim); display: flex; flex-direction: column; gap: 2px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.block-edit-grid input, .block-review textarea {
  padding: 8px 10px; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-family: inherit;
}
.block-review textarea { width: 100%; margin-top: 6px; resize: vertical; min-height: 50px; }

/* Claude analysis card */
.claude-card {
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(100% 80% at 0% 0%, rgba(168, 139, 217, 0.18) 0%, transparent 60%),
    linear-gradient(160deg, #1a1428 0%, #0e0a18 100%);
  border: 1px solid rgba(168, 139, 217, 0.28);
  position: relative; overflow: hidden;
}
.claude-card .verdict {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700;
  color: var(--hyrox);
  letter-spacing: -0.02em;
  margin: 8px 0 2px;
}
.claude-card .verdict.warn { color: var(--warning); }
.claude-card .verdict.danger { color: var(--danger); }
.claude-card .summary {
  font-size: 13px;
  color: rgba(245,245,247,0.85);
  line-height: 1.5;
  margin: 4px 0 0;
}
.claude-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--claude-bright);
  padding: 4px 10px;
  background: rgba(168, 139, 217, 0.12);
  border-radius: 999px;
  border: 1px solid rgba(168, 139, 217, 0.3);
}
.claude-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--claude-bright);
  margin: 10px 0 6px;
  display: flex; align-items: center; gap: 6px;
}
.claude-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(168, 139, 217, 0.18); }

.machine-data {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.machine-data > div { padding: 4px 0; }
.machine-data .lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em;
  color: rgba(168, 139, 217, 0.7); font-weight: 700;
}
.machine-data .val {
  font-family: var(--font-mono);
  font-weight: 700; font-size: 16px; color: var(--text);
  margin-top: 2px;
}

.tip-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.tip-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(168, 139, 217, 0.18);
  color: var(--claude-bright);
  font-family: var(--font-mono);
  font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tip-text {
  font-size: 13px; color: rgba(245,245,247,0.85);
  line-height: 1.4;
}

/* Photos grid */
.photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-top: 10px;
}
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  display: block;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.7); color: #fff;
  border: 0; border-radius: 50%;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.photo-thumb .photo-del:hover { background: var(--danger); }

/* Review actions */
.review-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 18px;
}

/* ========== FINALIZE (full-screen celebration) ========== */
.finalize-screen {
  position: fixed; inset: 0;
  background: var(--bg-deep);
  z-index: 60;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.finalize-screen::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(80% 50% at 50% 0%, color-mix(in oklab, var(--hyrox) 22%, transparent) 0%, transparent 60%),
    radial-gradient(60% 40% at 50% 100%, color-mix(in oklab, var(--hyrox) 10%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.confetti-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.confetti {
  position: absolute; top: -20px;
  width: 6px; height: 12px;
  border-radius: 1px;
  opacity: 0.85;
  animation: confettiFall ease-in forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(120vh) rotate(720deg); opacity: 0.6; }
}
.finalize-content {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  padding: 0 24px;
  text-align: center;
  position: relative; z-index: 2;
}
.finalize-tag {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--hyrox);
  margin-bottom: 14px;
  animation: finaleIn 0.5s ease-out;
}
.finalize-title {
  font-family: var(--font-display);
  font-size: 56px; font-weight: 800;
  line-height: 0.95;
  margin: 0 0 6px;
  letter-spacing: -0.04em;
  animation: finaleIn 0.6s ease-out 0.1s backwards;
}
.finalize-subtitle {
  font-size: 13px; color: var(--text-muted); margin-top: 8px;
  animation: finaleIn 0.6s ease-out 0.2s backwards;
}
.finalize-xp-block {
  margin-top: 32px;
  padding: 16px 24px;
  background: color-mix(in oklab, var(--hyrox) 8%, transparent);
  border: 1px solid color-mix(in oklab, var(--hyrox) 30%, transparent);
  border-radius: 16px;
  animation: finaleIn 0.6s ease-out 0.3s backwards;
}
.finalize-xp-value {
  font-family: var(--font-mono);
  font-size: 48px; font-weight: 700;
  color: var(--hyrox); line-height: 1; margin-top: 4px;
  animation: shimmerXp 2s ease-in-out infinite;
}
.finalize-xp-detail {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
}
.finalize-pr {
  margin-top: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: rgba(255,210,74,0.08);
  border: 1px solid rgba(255,210,74,0.25);
  border-radius: 12px;
  animation: finaleIn 0.6s ease-out 0.4s backwards;
}
.finalize-pr-label {
  font-size: 11px; color: var(--gold);
  font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase;
}
.finalize-pr-value { font-size: 13px; font-weight: 600; }
.finalize-actions {
  padding: 0 16px calc(28px + env(safe-area-inset-bottom));
  position: relative; z-index: 2;
}
@keyframes finaleIn {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shimmerXp {
  0%, 100% { text-shadow: 0 0 20px color-mix(in oklab, var(--hyrox) 60%, transparent); }
  50%      { text-shadow: 0 0 40px color-mix(in oklab, var(--hyrox) 100%, transparent), 0 0 80px color-mix(in oklab, var(--hyrox) 40%, transparent); }
}

/* ========== HISTORY ========== */
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 12px; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer;
  font-size: 13px; white-space: nowrap;
  text-decoration: none;
}
.chip.active { background: var(--hyrox); color: var(--hyrox-ink); border-color: var(--hyrox); font-weight: 600; }

.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; }
.status-dot.ok { background: var(--hyrox); }
.status-dot.warn { background: var(--warning); }
.status-dot.danger { background: var(--danger); }
.status-dot.muted { background: var(--text-muted); }

/* ========== AUTH ========== */
.auth-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), var(--glow-hyrox);
  text-align: center;
}
.auth-card .display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 36px;
  letter-spacing: 0.06em;
  margin: 0 0 4px;
}
.auth-card .display .arena { color: var(--hyrox); text-shadow: 0 0 16px color-mix(in oklab, var(--hyrox) 50%, transparent); }
.form-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.form-stack input, .form-stack textarea, .form-stack select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}
.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus {
  outline: 2px solid var(--hyrox); border-color: var(--hyrox);
}
.form-stack label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em;
  font-weight: 600;
  text-align: left;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14px; }
.auth-alt a { color: var(--hyrox); }

/* ========== BUILDER / LIBRARY ========== */
.search-input {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 8px 0;
  color: var(--text);
  font-family: inherit;
}
.toggle {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.toggle span { color: var(--text); font-size: 14px; text-transform: none; letter-spacing: 0; }

.exo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.exo-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 8px;
  cursor: pointer;
  transition: all var(--t);
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  font-size: 11px; text-align: center; line-height: 1.2;
  color: var(--text);
}
.exo-tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.exo-tile.cat-hyrox i, .exo-tile.cat-hyrox svg { color: var(--cat-hyrox); }
.exo-tile.cat-cardio i, .exo-tile.cat-cardio svg { color: var(--cat-cardio); }
.exo-tile.cat-strength i, .exo-tile.cat-strength svg { color: var(--cat-strength); }
.exo-tile.cat-mobility i, .exo-tile.cat-mobility svg { color: var(--cat-mobility); }

.cat-hyrox { color: var(--cat-hyrox); }
.cat-cardio { color: var(--cat-cardio); }
.cat-strength { color: var(--cat-strength); }
.cat-mobility { color: var(--cat-mobility); }

.exo-list { display: flex; flex-direction: column; gap: 6px; }
.exo-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.exo-row-left { display: flex; gap: 12px; align-items: center; }
.exo-row-actions { display: flex; gap: 4px; }
.icon-btn {
  background: transparent; border: 0;
  color: var(--text-muted); cursor: pointer;
  padding: 6px; border-radius: 8px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.danger:hover { color: var(--danger); }

/* Mode toggle (Programmer / Enregistrer) */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin: 12px 0;
}
.mode-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--t);
  white-space: nowrap;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active {
  background: var(--hyrox);
  color: var(--hyrox-ink);
  box-shadow: 0 2px 8px color-mix(in oklab, var(--hyrox) 30%, transparent);
}
.mode-tab.active i, .mode-tab.active svg { stroke: var(--hyrox-ink); }

.builder-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.builder-form label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.builder-form input, .builder-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
}

.blocks-list { display: flex; flex-direction: column; gap: 8px; }
.block-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.block-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.block-pos {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--hyrox); color: var(--hyrox-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  font-family: var(--font-mono);
}
.block-name { font-weight: 600; flex: 1; }
.block-card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.block-card-grid label {
  display: flex; flex-direction: column;
  font-size: 10px; color: var(--text-dim); gap: 2px;
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700;
}
.block-card-grid input { padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: inherit; }

.builder-actions { display: flex; gap: 8px; margin-top: 16px; }
.builder-actions .btn { flex: 1; }

/* Indicateur de durée */
.duration-indicator {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-muted);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0 12px;
  flex-wrap: wrap;
  transition: all var(--t);
}
.duration-indicator.ok { border-left-color: var(--hyrox); box-shadow: 0 0 14px color-mix(in oklab, var(--hyrox) 15%, transparent); }
.duration-indicator.warn { border-left-color: var(--warning); }
.duration-indicator.danger { border-left-color: var(--danger); }
.duration-value {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
}
.duration-indicator.ok .duration-value { color: var(--hyrox); }
.duration-indicator.warn .duration-value { color: var(--warning); }
.duration-indicator.danger .duration-value { color: var(--danger); }
.duration-target { margin-left: auto; }

/* ========== HEATMAP ========== */
.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  overflow-x: auto;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  scrollbar-width: none;
}
.heatmap::-webkit-scrollbar { display: none; }
.heat-cell { width: 12px; height: 12px; border-radius: 2px; background: var(--surface-2); }
.heat-cell.lvl1 { background: color-mix(in oklab, var(--hyrox) 25%, transparent); }
.heat-cell.lvl2 { background: color-mix(in oklab, var(--hyrox) 50%, transparent); }
.heat-cell.lvl3 { background: color-mix(in oklab, var(--hyrox) 75%, transparent); }
.heat-cell.lvl4 { background: var(--hyrox); box-shadow: 0 0 6px color-mix(in oklab, var(--hyrox) 60%, transparent); }

.chart-wrap {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px;
}

.pr-list { display: flex; flex-direction: column; gap: 6px; }
.pr-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--border);
}
.pr-info { flex: 1; }
.pr-name { font-weight: 600; margin: 0; }
.pr-value {
  font-family: var(--font-mono);
  font-weight: 700; color: var(--hyrox); font-size: 18px;
}

/* ========== BADGES ========== */
.badges-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.badge-card {
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  text-align: center;
  transition: all var(--t);
}
.badge-card.unlocked { border-color: var(--hyrox); box-shadow: var(--glow-hyrox); }
.badge-card.locked { opacity: 0.4; filter: grayscale(0.7); }
.badge-icon { font-size: 32px; color: var(--hyrox); margin-bottom: 8px; display: flex; justify-content: center; }
.badge-icon i, .badge-icon svg { width: 32px; height: 32px; }
.badge-name { font-weight: 700; margin: 4px 0; font-size: 14px; font-family: var(--font-display); }
.badge-desc { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; min-height: 32px; }
.badge-date {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--hyrox); margin: 6px 0 0;
}

/* ========== COACH CHAT ========== */
.coach-screen { padding-bottom: 160px; }
.chat-list { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-msg.assistant { flex-direction: column; align-items: flex-start; }
.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px; line-height: 1.5;
  word-wrap: break-word;
}
.chat-bubble ul { margin: 6px 0; padding-left: 20px; }
.chat-bubble li { margin: 2px 0; }
.chat-bubble strong { color: var(--hyrox); }
.chat-bubble code {
  background: rgba(0,0,0,0.3);
  padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 12px;
}
.chat-msg.user .chat-bubble {
  background: var(--hyrox); color: var(--hyrox-ink);
  border-color: var(--hyrox);
}
.chat-msg.user .chat-bubble strong { color: var(--hyrox-ink); }
.chat-msg.assistant .chat-bubble {
  background: linear-gradient(180deg, var(--claude), #5d4583);
  border-color: var(--claude); color: #fff;
}
.chat-msg.assistant .chat-bubble strong { color: var(--claude-bright); }

.chat-form {
  position: fixed; bottom: 90px; left: 12px; right: 12px;
  max-width: 456px; margin: 0 auto;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  display: flex; gap: 8px;
  background: rgba(20,25,37,0.92);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  z-index: 30;
}
.chat-form input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 16px; color: var(--text);
  min-width: 0; font-family: inherit;
}
.chat-form button { flex-shrink: 0; }

.proposal-card {
  width: 100%; max-width: 90%;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--claude);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 4px;
  box-shadow: 0 0 18px rgba(123,94,167,0.2);
  position: relative;
}
.proposal-dismiss {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px;
  border: 1px solid var(--border);
  background: var(--tint-2);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t);
}
.proposal-dismiss:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.proposal-card h4 { margin: 0 0 4px; color: var(--text); }
.proposal-card .btn { width: 100%; margin-top: 12px; }
.proposal-card .btn.done { background: color-mix(in oklab, var(--hyrox) 20%, transparent); color: var(--hyrox); cursor: default; }
.proposal-list { padding-left: 18px; margin: 12px 0; }
.proposal-list li { margin: 4px 0; }
.claude-msg {
  margin: 12px 0; padding: 12px;
  background: rgba(123,94,167,0.15);
  border-left: 3px solid var(--claude);
  border-radius: 0 8px 8px 0;
  font-style: italic; font-size: 14px;
}
.focus-list { padding-left: 18px; }

/* ========== COACH — Layout simplifié ========== */
.coach-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
}
.icon-btn {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--t);
}
.icon-btn:hover { background: var(--tint-1); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.icon-btn.claude {
  background: color-mix(in oklab, var(--claude) 16%, transparent);
  color: var(--claude-bright);
  border-color: color-mix(in oklab, var(--claude) 40%, var(--border));
}
.icon-btn.claude:hover {
  background: color-mix(in oklab, var(--claude) 28%, transparent);
  color: #fff;
}

.chat-form-top {
  position: sticky;
  top: 60px;
  z-index: 5;
  margin: 12px 0 10px;
  background: var(--bg);
  padding: 4px 0;
}

.quick-prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.quick-prompts::-webkit-scrollbar { display: none; }
.quick-prompt {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 11px;
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t);
}
.quick-prompt:hover {
  background: color-mix(in oklab, var(--claude) 12%, var(--tint-1));
  color: var(--text);
  border-color: color-mix(in oklab, var(--claude) 30%, var(--border));
}

.chat-section { margin-top: 6px; }
.chat-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--tint-1);
  border: 1px dashed var(--border);
  border-radius: 14px;
}

/* ========== COACH — Analyse post-séance (card) ========== */
.analysis-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 4px;
  margin-bottom: 12px;
  position: relative;
  max-width: 100%;
}
.chat-msg.assistant .analysis-card { max-width: 92%; }
.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.analysis-summary {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0.3px;
  text-transform: capitalize;
}
.verdict-pill.v-excellent {
  background: color-mix(in oklab, var(--hyrox) 18%, transparent);
  color: var(--hyrox);
  border: 1px solid color-mix(in oklab, var(--hyrox) 40%, transparent);
}
.verdict-pill.v-bien {
  background: color-mix(in oklab, var(--claude) 18%, transparent);
  color: var(--claude-bright);
  border: 1px solid color-mix(in oklab, var(--claude) 40%, transparent);
}
.verdict-pill.v-toimprove {
  background: color-mix(in oklab, var(--danger) 14%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
}

/* Données machine extraites */
.md-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 6px;
  margin: 10px 0;
  padding: 10px;
  background: var(--tint-1);
  border-radius: 10px;
  border: 1px dashed var(--border);
}
.md-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.md-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.md-value {
  font-family: var(--font-mono, var(--font-display));
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.md-notes {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* Conseils */
.advice-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.advice-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  background: color-mix(in oklab, var(--hyrox) 6%, var(--tint-1));
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.45;
}
.advice-list li i { flex-shrink: 0; margin-top: 2px; }

/* ========== COACH — Bilan stratégique ========== */
.bilan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg,
    color-mix(in oklab, var(--claude) 14%, var(--surface)),
    var(--surface));
  border: 1px solid color-mix(in oklab, var(--claude) 30%, var(--border));
  border-radius: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.bilan-bar-text { display: flex; flex-direction: column; gap: 2px; }
.bilan-bar-text strong { font-family: var(--font-display); font-size: 15px; }
.bilan-bar-actions { display: flex; gap: 8px; align-items: center; }
.select-pill {
  background: var(--tint-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}

.bilan-loading {
  text-align: center;
  padding: 40px 20px;
  background: var(--tint-1);
  border-radius: 14px;
  margin-bottom: 14px;
}
.bilan-loading .spinner {
  width: 32px; height: 32px;
  border: 3px solid color-mix(in oklab, var(--claude) 30%, transparent);
  border-top-color: var(--claude-bright);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.bilan-card {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--claude) 40%, var(--border));
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 0 24px color-mix(in oklab, var(--claude) 15%, transparent);
}
.bilan-card.empty { padding: 16px; text-align: center; }
.bilan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.bilan-vibe {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.bilan-vibe.vibe-up {
  background: color-mix(in oklab, var(--hyrox) 18%, transparent);
  color: var(--hyrox);
  border: 1px solid color-mix(in oklab, var(--hyrox) 40%, transparent);
}
.bilan-vibe.vibe-flat {
  background: var(--tint-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.bilan-vibe.vibe-down,
.bilan-vibe.vibe-warn {
  background: color-mix(in oklab, var(--danger) 14%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent);
}
.bilan-headline {
  margin: 6px 0 14px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
}

.bilan-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 12px;
  background: var(--tint-1);
  border-radius: 12px;
  margin-bottom: 16px;
}
.bilan-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}
.bilan-stat-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.bilan-stat-lab {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bilan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
@media (max-width: 480px) {
  .bilan-grid { grid-template-columns: 1fr; }
  .bilan-stats { grid-template-columns: repeat(3, 1fr); }
  .bilan-stat:nth-child(4),
  .bilan-stat:nth-child(5) { display: none; }
}
.bilan-col h4 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.bilan-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bilan-list li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.4;
}
.bilan-list li i { flex-shrink: 0; margin-top: 2px; }
.bilan-list.pos li {
  background: color-mix(in oklab, var(--hyrox) 8%, var(--tint-1));
  color: var(--text);
}
.bilan-list.pos li i { color: var(--hyrox); }
.bilan-list.neg li {
  background: color-mix(in oklab, var(--danger) 8%, var(--tint-1));
  color: var(--text);
}
.bilan-list.neg li i { color: var(--danger); }
.bilan-list.neutral li {
  background: var(--tint-1);
  color: var(--text);
}
.bilan-list.neutral li i { color: var(--text-muted); }

.bilan-plan {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: planNum;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bilan-plan li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  background: var(--tint-1);
  border-radius: 10px;
  border-left: 3px solid var(--claude);
}
.bilan-plan-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--claude);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  border-radius: 50%;
  font-size: 14px;
}
.bilan-plan li strong { display: block; margin-bottom: 4px; font-size: 14.5px; }
.bilan-plan li p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.bilan-next {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 12px 14px;
  background: color-mix(in oklab, var(--hyrox) 10%, var(--tint-1));
  border-left: 3px solid var(--hyrox);
  border-radius: 0 10px 10px 0;
  font-size: 13.5px;
  line-height: 1.45;
}
.bilan-next i { flex-shrink: 0; margin-top: 3px; }

/* ========== PAGE RAPPORT (/report?id=X) ========== */
.report-head { padding: 8px 0 12px; }
.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 6px;
  padding: 12px;
  background: var(--tint-1);
  border-radius: 12px;
  margin-bottom: 14px;
}
.report-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.report-stat-num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.report-stat-lab {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.report-analysis { margin-bottom: 18px; }
.report-no-analysis {
  text-align: center;
  padding: 22px 18px;
  margin-bottom: 18px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px dashed color-mix(in oklab, var(--claude) 40%, var(--border));
  border-radius: 14px;
}

.report-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin: 24px 0 8px;
}

.report-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}
.report-photo {
  display: block;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--tint-1);
}
.report-photo img { width: 100%; height: 100%; object-fit: cover; }

.report-notes {
  background: var(--tint-1);
  border-left: 3px solid var(--claude);
  padding: 10px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}

.report-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.report-block {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--tint-1);
  border-radius: 10px;
  border-left: 3px solid var(--border);
}
.report-block.done { border-left-color: var(--hyrox); }
.report-block.skipped { border-left-color: var(--danger); opacity: 0.7; }
.report-block-num {
  flex-shrink: 0;
  font-family: var(--font-mono, var(--font-display));
  font-size: 11px;
  color: var(--text-muted);
  width: 22px;
  text-align: center;
  padding-top: 2px;
  letter-spacing: 0.5px;
}
.report-block-body { flex: 1; min-width: 0; }
.report-block-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.report-block-meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-family: var(--font-mono, var(--font-display));
}
.report-block-notes {
  margin-top: 6px;
  padding: 6px 8px;
  background: var(--surface);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.report-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.report-actions .btn { width: 100%; }

/* ========== MODAL ========== */
.modal {
  background: transparent; border: 0; padding: 0;
  max-width: 480px; width: 100%;
}
.modal::backdrop { background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 20px;
}
.modal-content h3 { margin: 0 0 12px; font-family: var(--font-display); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ========== TOAST ========== */
#toast-host {
  position: fixed; top: 80px; left: 50%;
  transform: translateX(-50%); z-index: 999;
  pointer-events: none;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--hyrox);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), var(--glow-hyrox);
  animation: toastIn 200ms ease, toastOut 200ms ease 2.5s forwards;
  font-size: 14px;
}
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateY(-20px); opacity: 0; } }

/* ========== THÈMES — sélecteur compact (rangée de pastilles) ========== */
.theme-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 4px;
  flex-wrap: wrap;
}
.theme-dot {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--swatch);
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow var(--t);
  position: relative;
  flex-shrink: 0;
}
/* Anneau d'inactivité subtil */
.theme-dot::after {
  content: '';
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
  transition: border-color var(--t), inset var(--t);
}
.theme-dot:hover { transform: scale(1.18); }
.theme-dot:hover::after { border-color: var(--border-strong); }
/* Anneau d'activité plus marqué */
.theme-dot.active::after {
  inset: -5px;
  border: 2px solid var(--text);
}
.theme-dot.active {
  box-shadow: 0 0 14px var(--swatch);
}
.theme-dot:focus-visible { outline: none; }
.theme-dot:focus-visible::after { border-color: var(--hyrox); }
.theme-dot:active { transform: scale(0.95); }

/* Mode light : ajustements pour les composants critiques */
[data-theme-mode="light"] .topbar { box-shadow: 0 1px 0 var(--border); }
[data-theme-mode="light"] .bottom-nav { box-shadow: var(--modal-shadow); }
[data-theme-mode="light"] .timer-display { text-shadow: 0 0 12px color-mix(in oklab, var(--hyrox) 30%, transparent); }

/* ========== SETTINGS ========== */
.settings-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 24px; }
.settings-actions .btn { justify-content: flex-start; }

.center-stack { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 18px; text-align: center; }

/* ========== DESKTOP ========== */
@media (min-width: 768px) {
  .app-main { max-width: 480px; }
  .bottom-nav { max-width: 456px; }
  .chat-form { max-width: 456px; }
  .badges-grid { grid-template-columns: repeat(4, 1fr); }
  .exo-grid { grid-template-columns: repeat(5, 1fr); }
  .photo-grid { grid-template-columns: repeat(4, 1fr); }
}
