/* Style repris de la maquette : mobile d'abord, une colonne centrée sur grand écran. */
:root {
  --fond: #F4F5FA;
  --encre: #14172B;
  --doux: #5B6178;
  --carte: #FFFFFF;
  --accent: #4F46E5;
  --accent-encre: #4338CA;
  --accent-clair: #E8E7FF;
  --trait: #E6E8F0;
  --bord: #D5D8E6;
  --alerte-fond: #FFEBD1;
  --alerte-encre: #5E3300;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: 'Space Grotesk', 'Inter', system-ui, sans-serif; }

.app { max-width: 430px; margin: 0 auto; min-height: 100vh; position: relative; }
main { padding: 28px 20px 110px; display: flex; flex-direction: column; gap: 20px; }
main.sans-onglets { padding-bottom: 32px; }

/* En-tête */
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.head h1 { font-size: 32px; line-height: 1.1; font-weight: 700; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--doux); margin-bottom: 2px; }
.icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 999px; display: flex; align-items: center; justify-content: center;
  color: var(--doux); background: transparent; border: 0; cursor: pointer; font-size: 26px; line-height: 1;
}
.icon-btn:hover { background: var(--accent-clair); }
.head-actions { display: flex; gap: 2px; }

/* Barre d'onglets */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; height: 80px;
  background: var(--carte); border-top: 1px solid var(--trait); display: flex; padding: 8px 4px 10px; z-index: 10;
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px;
  font-size: 11px; font-weight: 600; color: var(--doux);
}
.tab .pastille { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 999px; }
.tab[aria-current="page"] { color: var(--accent-encre); }
.tab[aria-current="page"] .pastille { background: var(--accent-clair); }

/* Cartes et lignes */
.carte { background: var(--carte); border-radius: 20px; padding: 18px; }
.ligne { display: flex; align-items: center; gap: 8px; background: var(--carte); border-radius: 16px; padding: 14px 8px 14px 16px; }
.ligne .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ligne .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ligne .titre { font-size: 15px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.ligne .detail { font-size: 13px; line-height: 1.45; color: var(--doux); white-space: pre-line; overflow-wrap: anywhere; }
.ligne.fait .titre { text-decoration: line-through; color: var(--doux); }
.quand { font-size: 13px; font-weight: 500; color: var(--doux); }
h2.section { font-size: 16px; font-weight: 600; font-family: 'Inter', system-ui, sans-serif; }
.section-bloc { display: flex; flex-direction: column; gap: 10px; }

.pastille-matiere, .badge {
  font-size: 12px; font-weight: 600; border-radius: 999px; padding: 3px 10px; display: inline-block; white-space: nowrap;
}
.badge-alerte { background: var(--alerte-fond); color: var(--alerte-encre); }
.badge-gris { background: #EDEEF5; color: #3B4258; }

/* Case à cocher */
.coche-form { margin: 0; flex: none; }
.coche { width: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.coche-off { width: 26px; height: 26px; border-radius: 999px; border: 2px solid #8A8FA8; display: block; }
.coche-on { width: 26px; height: 26px; border-radius: 999px; background: var(--accent); display: flex; align-items: center; justify-content: center; color: #fff; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; border: 0; width: 100%;
  font-family: inherit; font-size: 16px; font-weight: 600; cursor: pointer; padding: 0 16px; text-align: center;
}
.btn-accent { background: var(--accent); color: #fff; }
.btn-blanc { background: #fff; color: #3730A3; }
.btn-contour { background: var(--carte); color: var(--encre); border: 2px solid var(--bord); }
.btn[disabled], .btn.inactif { background: #C9CCDC; color: #3B4258; cursor: not-allowed; }

/* Carte principale (séance) */
.hero { background: var(--accent); color: #fff; border-radius: 24px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.hero-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: #E6E5FD; }
.hero .puce { background: #fff; color: #3730A3; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.hero h2 { font-size: 26px; line-height: 1.15; font-weight: 700; }
.hero p { font-size: 15px; line-height: 1.45; color: #E6E5FD; overflow-wrap: anywhere; }

/* Encadrés */
.encadre { display: flex; align-items: flex-start; gap: 12px; border-radius: 16px; padding: 14px 16px; font-size: 14px; line-height: 1.4; }
.encadre svg { flex: none; margin-top: 1px; }
.encadre-alerte { background: var(--alerte-fond); color: var(--alerte-encre); }
.encadre-info { background: var(--accent-clair); color: #26206F; }
.encadre-erreur { background: #FFE4EC; color: #6E0D28; }

/* Filtres et jours */
.filtres { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.filtre {
  flex: none; min-height: 44px; display: flex; align-items: center; padding: 0 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--carte); color: var(--encre); border: 1px solid var(--bord); white-space: nowrap;
}
.filtre[aria-current="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.jours { display: flex; gap: 6px; }
.jour {
  flex: 1; min-width: 0; min-height: 64px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--carte); border: 1px solid var(--bord); color: var(--encre);
}
.jour .j { font-size: 12px; font-weight: 600; }
.jour .n { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 18px; font-weight: 700; line-height: 1; }
.jour .point { width: 6px; height: 6px; border-radius: 999px; background: transparent; }
.jour .point.plein { background: var(--accent); }
.jour[aria-current="date"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.jour[aria-current="date"] .point.plein { background: #fff; }
.semaine-nav { display: flex; align-items: center; justify-content: space-between; }

/* Frise horaire */
.creneau { display: flex; gap: 12px; align-items: stretch; }
.creneau .heures { flex: none; width: 48px; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 0; }
.creneau .heures b { font-size: 14px; font-weight: 600; }
.creneau .heures span { font-size: 13px; font-weight: 500; color: var(--doux); }
.creneau .cadre { flex: 1; min-width: 0; background: var(--carte); border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.creneau .cadre .haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.creneau .cadre p { font-size: 15px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.creneau .cadre .petit { font-size: 13px; font-weight: 400; color: var(--doux); }
.creneau.annule .cadre p, .creneau.annule .cadre .nom { text-decoration: line-through; color: var(--doux); }
.creneau .cadre.pause { background: transparent; border: 1px dashed #AEB2C6; min-height: 52px; justify-content: center; color: var(--doux); font-size: 14px; font-weight: 500; }
.creneau .cadre.activite { background: #EDEEF5; }
.titre-jour { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.titre-jour span { font-size: 14px; font-weight: 500; color: var(--doux); text-align: right; }

/* Notes */
.synthese { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--carte); border-radius: 24px; padding: 20px; }
.synthese .libelle { font-size: 14px; font-weight: 500; color: var(--doux); }
.synthese .valeur { display: flex; align-items: baseline; gap: 6px; }
.synthese .valeur b { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 44px; line-height: 1; font-weight: 700; }
.synthese .valeur span { font-size: 16px; font-weight: 500; color: var(--doux); }
.puce-info { font-size: 14px; font-weight: 600; color: #3730A3; background: var(--accent-clair); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.carte-radar { background: var(--carte); border-radius: 24px; padding: 14px 0 18px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.carte-radar .legende { padding: 0 20px; font-size: 13px; line-height: 1.45; color: var(--doux); }
.radar { position: relative; width: 100%; max-width: 350px; aspect-ratio: 350 / 330; margin: 0 auto; }
.radar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.radar .anneau { fill: none; stroke: #E3E5EF; stroke-width: 1; }
.radar .anneau.pointille { stroke: #7C8199; stroke-dasharray: 4 4; }
.radar .anneau.bord { stroke: #C9CCDC; stroke-width: 1.5; }
.radar .rayon { fill: none; stroke: #E3E5EF; stroke-width: 1; }
.rlabel { position: absolute; width: 64px; transform: translate(-50%, -50%); text-align: center; display: flex; flex-direction: column; gap: 1px; }
.rlabel .rnom { font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--doux); }
.rlabel .rval { font-size: 14px; font-weight: 700; line-height: 1.2; }
.detail-tete { padding: 0 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-tete .moy { display: flex; align-items: baseline; gap: 6px; }
.detail-tete .moy b { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 24px; font-weight: 700; }
.detail-tete .moy span { font-size: 13px; font-weight: 500; color: var(--doux); }
.liste-notes { padding: 0 20px; display: flex; flex-direction: column; }
.liste-notes h3 { font-size: 14px; font-weight: 600; padding: 12px 0 4px; border-top: 1px solid #EDEEF5; }
.note-ligne { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid #EDEEF5; }
.note-ligne .d { flex: none; width: 48px; font-size: 13px; font-weight: 500; color: var(--doux); }
.note-ligne .t { flex: 1; min-width: 0; font-size: 15px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.note-ligne .t small { display: block; font-size: 12px; font-weight: 400; color: var(--doux); }
.note-ligne .v { flex: none; font-size: 16px; font-weight: 700; }

/* Séance */
.minuteur { font-family: 'Space Grotesk', 'Inter', sans-serif; font-size: 64px; font-weight: 700; text-align: center; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.consigne { white-space: pre-line; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.vide { text-align: center; color: var(--doux); font-size: 15px; padding: 24px 12px; }
.reglage-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.reglage-table th { text-align: left; font-weight: 500; color: var(--doux); padding: 8px 12px 8px 0; vertical-align: top; width: 52%; }
.reglage-table td { padding: 8px 0; font-weight: 600; }
.reglage-table tr + tr { border-top: 1px solid #EDEEF5; }
code { background: #EDEEF5; border-radius: 6px; padding: 1px 6px; font-size: 13px; }

/* Formulaires */
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--doux); }
.formulaire select, .formulaire input[type="date"], .formulaire textarea {
  font-family: inherit; font-size: 16px; color: var(--encre); background: #fff; border: 1px solid var(--bord);
  border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%;
}
.formulaire textarea { resize: vertical; line-height: 1.4; }
.formulaire label.case { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--encre); font-size: 14px; line-height: 1.4; }
.formulaire label.case input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.lien-danger { background: none; border: 0; padding: 10px 0; min-height: 44px; font-family: inherit; font-size: 13px; font-weight: 600; color: #A3153F; text-decoration: underline; cursor: pointer; text-align: left; }

/* Explication des horaires */
.pourquoi { background: var(--carte); border-radius: 16px; padding: 4px 16px; }
.pourquoi summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-encre); }
.pourquoi ul { margin: 0 0 12px; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--doux); }
.pourquoi li + li { margin-top: 4px; }

/* Notes : évolution, nouvelles notes, moyenne de la classe */
.radar .classe { fill: none; stroke: #EA580C; stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.rlabel .rval2 { display: block; font-size: 11px; font-weight: 600; line-height: 1.2; color: #C2410C; }
.note-ligne { padding: 10px 0; align-items: flex-start; }
.note-ligne.nouvelle { background: #F3F2FF; margin: 0 -20px; padding: 10px 20px; }
.note-ligne .ligne-matiere { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; flex-wrap: wrap; }
.note-ligne .evo { font-weight: 600; }
.note-ligne .evo.haut { color: #15803D; }
.note-ligne .evo.bas { color: #B91C1C; }
.note-ligne .evo.egal { color: var(--doux); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.version { text-align: center; font-size: 11px; color: var(--doux); padding: 16px 0 4px; }
.classe-synthese { text-align: right; }
.classe-synthese .valeur { justify-content: flex-end; }
.classe-synthese .valeur b { font-size: 32px; color: #C2410C; }
.synthese .libelle { white-space: nowrap; }
