/* =====================================================================
   app.css — Identité visuelle « Nuit indigo »
   Toutes les couleurs et tailles sont dans les variables ci-dessous :
   modifier une valeur ici change toute l'appli.
   ===================================================================== */

@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('../fonts/Inter-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }

:root {
  /* Fonds */
  --fond: #0E1117;
  --surface: #171B26;
  --surface-2: #1E2331;
  --surface-3: #262C3D;
  --bordure: #232838;
  --bordure-forte: #2F3650;

  /* Textes */
  --texte: #E6E8F0;
  --texte-2: #B4BAD0;
  --texte-3: #8B93AD;
  --texte-4: #5A6280;

  /* Accent et états */
  --accent: #8C9BFF;
  --accent-fort: #A7B2FF;
  --accent-fond: #232A4A;
  --sur-accent: #0E1117;
  --succes: #5CC8C2;
  --succes-fond: #163330;
  --alerte: #E9B872;
  --alerte-fond: #3A2E1C;
  --danger: #F2A3B3;
  --danger-fond: #3A1F28;

  /* Formes */
  --rayon: 12px;
  --rayon-petit: 8px;
  --rayon-pilule: 999px;

  /* Typo */
  --police: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Dimensions */
  --largeur-contenu: 760px;
  --hauteur-nav: 64px;
  --largeur-barre: 248px;
  --duree: 180ms;
}

@media (prefers-reduced-motion: reduce) {
  :root { --duree: 0ms; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 600; }
h1 { font-size: 24px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icone { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Mise en page ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.barre-laterale { display: none; }
.principal { flex: 1; min-width: 0; padding: 20px 16px calc(var(--hauteur-nav) + 28px + env(safe-area-inset-bottom)); }
.page { max-width: var(--largeur-contenu); margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page.large { max-width: 980px; }

.nav-bas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--hauteur-nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14, 17, 23, 0.96);
  border-top: 1px solid var(--bordure);
}
.nav-bas a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--texte-3); font-size: 11px; font-weight: 500;
}
.nav-bas a[aria-current="page"] { color: var(--accent); }

@media (min-width: 980px) {
  .nav-bas { display: none; }
  .barre-laterale {
    display: flex; flex-direction: column; gap: 4px;
    width: var(--largeur-barre); flex: none;
    position: sticky; top: 0; height: 100vh;
    padding: 24px 14px; border-right: 1px solid var(--bordure); overflow-y: auto;
  }
  .principal { padding: 36px 40px 60px; }
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 20px; font-weight: 600; font-size: 17px; }
.marque img { width: 28px; height: 28px; border-radius: 8px; }
.lien-barre {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--rayon-petit);
  color: var(--texte-2); font-size: 14px; font-weight: 500;
}
.lien-barre:hover { background: var(--surface); color: var(--texte); }
.lien-barre[aria-current="page"] { background: var(--accent-fond); color: var(--accent-fort); }
.titre-barre { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--texte-4); padding: 18px 10px 6px; }

/* ---------- En-têtes de page ---------- */
.entete { display: flex; flex-direction: column; gap: 4px; }
.entete .sur-titre { font-size: 13px; color: var(--texte-3); }
.entete .sous-titre { font-size: 14px; color: var(--texte-3); }
.retour { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--texte-3); background: none; border: 0; padding: 4px 0; cursor: pointer; align-self: flex-start; }
.retour:hover { color: var(--texte); }
.retour svg.icone { width: 16px; height: 16px; }
.ligne-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ligne-titre a, .ligne-titre button.lien { font-size: 13px; }

/* ---------- Surfaces ---------- */
.carte-surface { background: var(--surface); border-radius: var(--rayon); padding: 16px; }
.carte-surface.bordee { border: 1px solid var(--bordure-forte); }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grille-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pile { display: flex; flex-direction: column; gap: 10px; }
.rangee { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.muet { color: var(--texte-3); font-size: 14px; }
.petit { font-size: 13px; }

/* Compte à rebours d'examen */
.examen .nom { font-size: 13px; color: var(--texte-3); }
.examen .jours { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }
.examen .jours.accent { color: var(--accent); }
.examen .jours.sans { font-size: 15px; font-weight: 500; color: var(--texte-2); padding: 10px 0 6px; }
.examen .legende { font-size: 12px; color: var(--texte-3); margin-top: 6px; }

/* Barre de progression */
.progression { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progression > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width var(--duree); }

/* Listes */
.liste { background: var(--surface); border-radius: var(--rayon); overflow: hidden; }
.liste > * + * { border-top: 1px solid var(--bordure); }
.element {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; width: 100%;
  background: none; border: 0; text-align: left; color: var(--texte); cursor: pointer;
}
a.element:hover, button.element:hover { background: var(--surface-2); }
.element .corps { flex: 1; min-width: 0; }
.element .titre { font-size: 15px; font-weight: 500; }
.element .detail { font-size: 12px; color: var(--texte-3); margin-top: 1px; }
.element .valeur { font-size: 13px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.element .chevron { color: var(--texte-4); }
.element .numero {
  width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; color: var(--texte-2);
}
.element .mini-prog { width: 64px; }

.pastille { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--rayon-petit);
  border: 1px solid var(--bordure-forte); background: var(--surface); color: var(--texte);
  font-size: 15px; font-weight: 500; cursor: pointer; text-align: center;
  transition: background var(--duree), transform var(--duree);
}
.bouton:hover { background: var(--surface-2); }
.bouton:active { transform: scale(0.98); }
.bouton.principal-btn { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); font-weight: 600; }
.bouton.principal-btn:hover { background: var(--accent-fort); }
.bouton.danger { border-color: #5A2E3A; color: var(--danger); }
.bouton.plein { width: 100%; }
.bouton.discret { background: none; border-color: transparent; color: var(--texte-2); }
.bouton[disabled] { opacity: 0.5; cursor: not-allowed; }

/* Puces / filtres / onglets */
.onglets { display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.onglets::-webkit-scrollbar { display: none; }
.puce {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: var(--rayon-pilule); border: 0; background: var(--surface); color: var(--texte-2);
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.puce:hover { background: var(--surface-2); }
.puce[aria-selected="true"], .puce[aria-pressed="true"] { background: var(--accent); color: var(--sur-accent); font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--rayon-pilule); background: var(--surface-3); color: var(--texte-2); }
.badge.accent { background: var(--accent-fond); color: var(--accent-fort); }
.badge.succes { background: var(--succes-fond); color: var(--succes); }
.badge.alerte { background: var(--alerte-fond); color: var(--alerte); }

/* Chiffres clés */
.chiffre { background: var(--surface); border-radius: var(--rayon); padding: 12px 14px; }
.chiffre .val { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chiffre .lib { font-size: 12px; color: var(--texte-3); }

/* Formulaires */
.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label, .champ .label { font-size: 13px; font-weight: 500; color: var(--texte-2); }
.saisie {
  min-height: 44px; padding: 10px 12px; border-radius: var(--rayon-petit);
  background: var(--surface-2); border: 1px solid var(--bordure-forte); color: var(--texte); width: 100%;
}
.saisie:focus { outline: none; border-color: var(--accent); }
.recherche { position: relative; }
.recherche svg.icone { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--texte-3); }
.recherche .saisie { padding-left: 40px; }
.case { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; font-size: 15px; }
.case input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- Aide-mémoire (texte mis en forme) ---------- */
.texte-riche { font-size: 15px; line-height: 1.65; color: var(--texte); }
.texte-riche h3 { font-size: 16px; margin: 20px 0 8px; color: var(--accent-fort); }
.texte-riche h3:first-child { margin-top: 0; }
.texte-riche p { margin: 8px 0; }
.texte-riche ul, .texte-riche ol { margin: 8px 0; padding-left: 20px; }
.texte-riche li { margin: 4px 0; }
.texte-riche li::marker { color: var(--accent); }
.texte-riche strong { color: #fff; font-weight: 600; }
.texte-riche .encadre { border-left: 3px solid var(--accent); background: var(--accent-fond); padding: 10px 14px; border-radius: 0 var(--rayon-petit) var(--rayon-petit) 0; margin: 12px 0; }
.texte-riche table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 10px 0; display: block; overflow-x: auto; }
.texte-riche th, .texte-riche td { border-bottom: 1px solid var(--bordure-forte); padding: 7px 10px 7px 0; text-align: left; vertical-align: top; }
.texte-riche th { color: var(--texte-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- Lexique ---------- */
.terme { padding: 13px 14px; }
.terme .mot { font-weight: 600; font-size: 15px; }
.terme .def { font-size: 14px; color: var(--texte-2); margin-top: 3px; }
.terme .origine { font-size: 12px; color: var(--texte-4); margin-top: 5px; display: flex; align-items: center; gap: 6px; }

/* ---------- Cartes (flashcards) ---------- */
.zone-carte { display: flex; flex-direction: column; gap: 16px; }
.compteur { display: flex; justify-content: space-between; font-size: 13px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.carte-flash {
  min-height: 260px; background: var(--surface); border: 1px solid var(--bordure-forte); border-radius: 16px;
  padding: 26px 22px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 14px; text-align: center;
}
.carte-flash .contexte { font-size: 12px; color: var(--texte-3); }
.carte-flash .recto { font-size: 20px; font-weight: 600; line-height: 1.35; }
.carte-flash .separateur { width: 40px; height: 2px; background: var(--bordure-forte); border-radius: 1px; }
.carte-flash .verso { font-size: 16px; color: var(--texte-2); line-height: 1.6; white-space: pre-line; }
.actions-carte { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bouton.revoir { border-color: #5A2E3A; color: var(--danger); background: var(--danger-fond); }
.bouton.sais { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); font-weight: 600; }
.raccourcis { font-size: 12px; color: var(--texte-4); text-align: center; }

/* ---------- Quiz ---------- */
.question { font-size: 18px; font-weight: 600; line-height: 1.4; }
.choix { display: flex; flex-direction: column; gap: 8px; }
.choix button {
  text-align: left; padding: 13px 14px; border-radius: var(--rayon-petit); border: 1px solid var(--bordure-forte);
  background: var(--surface); color: var(--texte); cursor: pointer; font-size: 15px; line-height: 1.45;
  display: flex; gap: 10px; align-items: flex-start;
}
.choix button:hover:not([disabled]) { background: var(--surface-2); }
.choix button .lettre { flex: none; width: 24px; height: 24px; border-radius: 6px; background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--texte-2); }
.choix button.juste { border-color: var(--succes); background: var(--succes-fond); }
.choix button.faux { border-color: var(--danger); background: var(--danger-fond); }
.choix button[disabled] { cursor: default; }
.explication { font-size: 14px; color: var(--texte-2); background: var(--surface-2); border-radius: var(--rayon-petit); padding: 12px 14px; }
.verdict { font-weight: 600; font-size: 15px; }
.verdict.ok { color: var(--succes); }
.verdict.ko { color: var(--danger); }
.verdict.presque { color: var(--alerte); }

.paires { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.paires .col { display: flex; flex-direction: column; gap: 8px; }
.paires button {
  min-height: 64px; padding: 10px 12px; border-radius: var(--rayon-petit); border: 1px solid var(--bordure-forte);
  background: var(--surface); color: var(--texte); cursor: pointer; font-size: 13px; line-height: 1.4; text-align: left;
}
.paires button.choisi { border-color: var(--accent); background: var(--accent-fond); }
.paires button.trouve { border-color: var(--succes); background: var(--succes-fond); color: var(--succes); cursor: default; }
.paires button.erreur { border-color: var(--danger); background: var(--danger-fond); }

.resultat { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.resultat .grand { font-size: 44px; font-weight: 600; color: var(--accent); letter-spacing: -0.02em; }

/* ---------- Statistiques ---------- */
.barres { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.barres .b { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barres .b span.v { width: 100%; max-width: 28px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.barres .b span.j { font-size: 11px; color: var(--texte-3); }

/* ---------- Planning ---------- */
.jour-plan { display: flex; gap: 14px; padding: 12px 14px; }
.jour-plan .date { width: 86px; flex: none; font-size: 13px; color: var(--texte-3); }
.jour-plan .date strong { display: block; color: var(--texte); font-size: 15px; }
.jour-plan.aujourdhui { background: var(--accent-fond); }

/* ---------- Vidéo ---------- */
.video { width: 100%; border-radius: var(--rayon); background: #000; aspect-ratio: 16 / 9; }

/* ---------- Vide / chargement ---------- */
.vide { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; color: var(--texte-3); }
.vide svg.icone { width: 32px; height: 32px; color: var(--texte-4); }
.vide .titre { color: var(--texte); font-weight: 600; font-size: 16px; }

/* ---------- Panneaux (confirmation, fenêtres) ---------- */
.voile {
  position: fixed; inset: 0; z-index: 50; background: rgba(5, 7, 12, 0.7);
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  animation: apparition var(--duree) ease-out;
}
@media (min-width: 640px) { .voile { align-items: center; } }
.panneau {
  width: 100%; max-width: 440px; background: var(--surface-2); border: 1px solid var(--bordure-forte);
  border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  max-height: 85vh; overflow-y: auto;
}
.panneau .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@keyframes apparition { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Messages éphémères ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--hauteur-nav) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 980px) { .toasts { bottom: 24px; } }
.toast { background: var(--surface-3); border: 1px solid var(--bordure-forte); color: var(--texte); padding: 10px 16px; border-radius: var(--rayon-pilule); font-size: 14px; animation: apparition var(--duree) ease-out; }

/* ---------- Bienvenue ---------- */
.bienvenue { max-width: 460px; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 22px; }
.bienvenue .logo { width: 56px; height: 56px; border-radius: 14px; }

/* Onglets du chapitre : sur téléphone, ils se partagent toute la largeur */
@media (max-width: 520px) {
  .onglets.chapitre { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .onglets.chapitre .puce { justify-content: center; padding: 7px 4px; font-size: 12px; }
}
.consigne { font-size: 13px; color: var(--texte-3); margin-bottom: -8px; }

/* ---------- Calendrier ---------- */
.calendrier { padding: 12px; }
.cal-grille { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-entete { text-align: center; font-size: 11px; font-weight: 600; color: var(--texte-4); padding: 4px 0; }
.cal-jour {
  aspect-ratio: 1 / 1; min-height: 40px; border-radius: 10px; border: 1px solid transparent; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; color: var(--texte); padding: 0;
}
.cal-jour:hover { background: var(--surface-3); }
.cal-jour .num { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cal-jour .points { display: flex; gap: 2px; min-height: 5px; }
.point { display: inline-block; width: 5px; height: 5px; border-radius: 50%; }
.cal-jour.hors { background: none; color: var(--texte-4); }
.cal-jour.aujourdhui { border-color: var(--accent); }
.cal-jour.aujourdhui .num { color: var(--accent-fort); font-weight: 700; }
.cal-jour.choisi { background: var(--accent); color: var(--sur-accent); }
.cal-jour.choisi .num { color: var(--sur-accent); }
.cal-jour.examen { box-shadow: inset 0 0 0 2px var(--alerte); }
.cal-legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--texte-3); margin-top: 10px; }
.cal-legende > span { display: inline-flex; align-items: center; gap: 6px; }
.carre-examen { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 2px var(--alerte); display: inline-block; }
.element.moment { cursor: default; }
.element.moment .bouton { min-height: 36px; padding: 6px 8px; }
input[type="date"], input[type="time"] { color-scheme: dark; }
@media (min-width: 980px) { .cal-jour { aspect-ratio: auto; height: 58px; } }

/* ---------- Organisation des pages : sections titrées ---------- */
.page { gap: 26px; }
.bloc { display: flex; flex-direction: column; gap: 10px; }
.bloc-tete { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.bloc-titre { font-size: 12px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--texte-3); }
.bloc-sous-titre { font-size: 13px; color: var(--texte-3); margin-top: 2px; }
.bloc-action { font-size: 13px; font-weight: 500; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.bloc-action svg.icone { width: 16px; height: 16px; }

/* Sous-onglets (Planning) */
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--surface); padding: 4px; border-radius: var(--rayon); }
.segment { text-align: center; padding: 9px 6px; border-radius: var(--rayon-petit); font-size: 14px; font-weight: 500; color: var(--texte-2); }
.segment:hover { color: var(--texte); background: var(--surface-2); }
.segment[aria-current="page"] { background: var(--accent); color: var(--sur-accent); font-weight: 600; }

/* Carte examen enrichie */
.examen .ligne-rythme { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bordure); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--texte-2); }

/* Tuile d'action du jour */
.tuile { display: flex; flex-direction: column; gap: 4px; }
.tuile .tete { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tuile .grand-chiffre { font-size: 26px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }

/* Repli (chapitres à venir) */
details.repli { background: var(--surface); border-radius: var(--rayon); }
details.repli > summary { list-style: none; cursor: pointer; padding: 13px 14px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--texte-2); }
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary .chevron { margin-left: auto; transition: transform var(--duree); color: var(--texte-4); }
details.repli[open] > summary .chevron { transform: rotate(90deg); }
details.repli > .liste { border-radius: 0 0 var(--rayon) var(--rayon); border-top: 1px solid var(--bordure); }
@media (max-width: 520px) { .element .mini-prog { display: none; } }

/* ---------- Mode concentration ---------- */
body.concentration .barre-laterale, body.concentration .nav-bas, body.concentration .retour { display: none !important; }
body.concentration .principal { padding-top: 28px; }
.petit-bouton { min-height: 36px; padding: 6px 10px; font-size: 13px; gap: 6px; }
.petit-bouton svg.icone { width: 18px; height: 18px; }
.petit-bouton[aria-pressed="true"] { color: var(--accent); }

/* ---------- Entraînement ---------- */
.grand-chrono { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.courbe { width: 100%; height: auto; display: block; }
.courbe-ligne { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.courbe-point { fill: var(--accent); }
.courbe-point.bas { fill: var(--danger); }
.courbe-seuil { stroke: var(--texte-4); stroke-dasharray: 4 4; stroke-width: 1; }
textarea.saisie { min-height: 96px; resize: vertical; font: inherit; }

/* Anneau de l'objectif du jour */
.anneau { position: relative; width: 64px; height: 64px; flex: none; }
.anneau svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.anneau circle { fill: none; stroke-width: 7; }
.anneau .fond { stroke: var(--surface-3); }
.anneau .plein { stroke: var(--succes); stroke-linecap: round; transition: stroke-dashoffset var(--duree); }
.anneau .val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }

/* Carte de chaleur */
.chaleur { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.chaleur .c { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-3); }
.chaleur .c.n1 { background: #2C3566; }
.chaleur .c.n2 { background: #4855A3; }
.chaleur .c.n3 { background: #6B7BE0; }
.chaleur .c.n4 { background: #A7B2FF; }
.chaleur .c.futur { background: none; }
.chaleur-legende { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--texte-3); justify-content: flex-end; margin-top: 8px; }
.chaleur-legende .c { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* Badges */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.badge-carte { background: var(--surface); border-radius: var(--rayon); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.badge-carte .ico { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--texte-4); }
.badge-carte.obtenu .ico { background: var(--alerte-fond); color: var(--alerte); }
.badge-carte .nom { font-size: 13px; font-weight: 600; }
.badge-carte:not(.obtenu) .nom { color: var(--texte-3); }
.badge-carte .desc { font-size: 11px; color: var(--texte-3); line-height: 1.4; }

/* Alerte matière en retard */
.alerte-retard { display: flex; gap: 10px; align-items: flex-start; background: var(--alerte-fond); color: var(--alerte); border-radius: var(--rayon); padding: 12px 14px; font-size: 14px; }
.alerte-retard p { color: var(--texte); }
.alerte-retard svg.icone { margin-top: 1px; }

/* Recherche : résultats */
.resultat-recherche .type { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--texte-3); }
.resultat-recherche .extrait { font-size: 13px; color: var(--texte-2); margin-top: 2px; }

.ligne-dispo { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 6px; align-items: center; font-size: 14px; }
.ligne-dispo .saisie { min-height: 38px; padding: 6px 8px; }
.tuile .anneau, .tuile .anneau svg { width: 54px; height: 54px; }
