:root {
  --fond: #faf6ef;
  --carte: #ffffff;
  --texte: #2a2420;
  --doux: #6f655c;
  --ligne: #ece4d8;
  --accent: #0f6e56;
  --accent-clair: #e1f5ee;
  --or: #d0861a;
  --or-clair: #fcefd9;
  --vert: #1d9e75;
  --vert-clair: #e1f5ee;
  --rouge: #b42a2a;
  --rouge-clair: #fbe7e7;
  --orange: #a35a00;
  --orange-clair: #fdf0dc;
  --ombre: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .05);
  --rayon: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1a1714;
    --carte: #24201c;
    --texte: #f2ece4;
    --doux: #b3a89c;
    --ligne: #3a332c;
    --accent: #5dcaa5;
    --accent-clair: #12352b;
    --or: #efa83a;
    --or-clair: #3d2c12;
    --vert: #5dcaa5;
    --vert-clair: #12352b;
    --rouge: #f08484;
    --rouge-clair: #3a1d1f;
    --orange: #f0a64d;
    --orange-clair: #3a2a14;
    --ombre: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
main { max-width: 680px; margin: 0 auto; padding: 16px 16px 24px; outline: none; }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 6px; }
p { margin: 0 0 8px; }
small, .doux { color: var(--doux); }
button, input, select { font: inherit; color: inherit; }

/* En-tête */
.entete { margin: 4px 0 14px; }
.sur-titre { color: var(--doux); font-size: .9rem; margin: 0; }
.comptes { display: flex; gap: 8px; margin-top: 10px; }
.compte {
  flex: 1; background: var(--carte); border-radius: var(--rayon); padding: 10px 12px;
  box-shadow: var(--ombre); border: 1px solid var(--ligne);
}
.compte b { display: block; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.compte span { font-size: .8rem; color: var(--doux); }
.compte.principal b { color: var(--or); }

/* Cartes */
.carte {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 14px; margin-bottom: 12px;
}
.carte.phase { border-left: 4px solid var(--accent); }
.etiquette {
  display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent); background: var(--accent-clair);
  border-radius: 999px; padding: 2px 8px; margin-bottom: 6px;
}
.alerte { border-radius: var(--rayon); padding: 12px 14px; margin-bottom: 12px; font-size: .95rem; }
.alerte.attention { background: var(--orange-clair); color: var(--orange); }
.alerte.danger { background: var(--rouge-clair); color: var(--rouge); }
.alerte.info { background: var(--accent-clair); color: var(--texte); }
.alerte b { display: block; margin-bottom: 2px; }

/* Minuteur */
.minuteur { text-align: center; padding: 18px 14px; }
.minuteur .quoi { font-size: 1.15rem; font-weight: 650; margin: 2px 0 4px; }
.minuteur .ou { color: var(--doux); font-size: .92rem; margin-bottom: 12px; }
.compteur {
  font-size: 3.4rem; font-weight: 700; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 10px;
}
.minuteur.pause .compteur { color: var(--vert); }
.barre { height: 6px; background: var(--ligne); border-radius: 99px; overflow: hidden; margin: 0 0 14px; }
.barre i { display: block; height: 100%; background: var(--or); width: 0; transition: width .5s linear; }
.minuteur.pause .barre i { background: var(--vert); }
.boutons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.bouton {
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 600; cursor: pointer;
  background: var(--accent); color: #fff; min-height: 44px;
}
@media (prefers-color-scheme: dark) { .bouton { color: #0f1620; } }
.bouton.second { background: var(--accent-clair); color: var(--texte); }
.bouton.petit { padding: 8px 12px; min-height: 36px; font-size: .9rem; }
.bouton.danger { background: var(--rouge-clair); color: var(--rouge); }
.bouton:focus-visible, .rond:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible {
  outline: 3px solid var(--or); outline-offset: 2px;
}

/* Liste des séances */
.seances { list-style: none; margin: 0; padding: 0; }
.seance {
  display: grid; grid-template-columns: 58px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--ligne);
}
.seance:first-child { border-top: 0; }
.seance .heure { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .92rem; }
.seance .heure small { display: block; font-weight: 400; font-size: .75rem; }
.seance .corps strong { display: block; font-size: .95rem; }
.seance .corps span { display: block; color: var(--doux); font-size: .82rem; }
.seance.faite .corps strong { text-decoration: line-through; text-decoration-color: var(--vert); }
.seance.faite .heure { color: var(--vert); }
.seance.ratee .heure, .seance.ratee .corps strong { color: var(--rouge); }
.seance.courante { background: var(--accent-clair); margin: 0 -14px; padding: 10px 14px; border-radius: 10px; }
.seance.rattrapage .corps strong { color: var(--orange); }
.actions { display: flex; gap: 6px; }
.rond {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ligne);
  background: transparent; cursor: pointer; display: grid; place-items: center; padding: 0;
}
.rond svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; }
.rond.ok { color: var(--vert); }
.rond.ko { color: var(--rouge); }
.rond.ok.actif { background: var(--vert); border-color: var(--vert); color: #fff; }
.rond.ko.actif { background: var(--rouge); border-color: var(--rouge); color: #fff; }

.resume { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; color: var(--doux); }
.resume b { color: var(--texte); }

/* Planning */
.nav-semaine { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.nav-semaine h1 { font-size: 1.25rem; text-align: center; flex: 1; }
.jour { padding: 0; overflow: hidden; }
.jour > summary {
  list-style: none; cursor: pointer; padding: 12px 14px; display: grid;
  grid-template-columns: 1fr auto; gap: 2px 10px;
}
.jour > summary::-webkit-details-marker { display: none; }
.jour > summary .titre { font-weight: 650; }
.jour > summary .compte-jour { font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--doux); }
.jour > summary .detail { grid-column: 1 / -1; font-size: .85rem; color: var(--doux); }
.jour.aujourdhui { border-color: var(--accent); }
.jour .contenu { padding: 0 14px 10px; }
.jauge { height: 4px; background: var(--ligne); border-radius: 99px; overflow: hidden; grid-column: 1 / -1; margin-top: 6px; }
.jauge i { display: block; height: 100%; background: var(--vert); }

.calendrier { list-style: none; margin: 0; padding: 0; }
.calendrier li {
  display: grid; grid-template-columns: 92px 1fr auto; gap: 8px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--ligne); font-size: .9rem;
}
.calendrier li:first-child { border-top: 0; }
.calendrier .dates { color: var(--doux); font-variant-numeric: tabular-nums; font-size: .82rem; }
.calendrier .courante { font-weight: 650; }
.calendrier .courante .dates { color: var(--accent); }
.calendrier .ev { display: block; font-size: .8rem; color: var(--or); }
.calendrier .ev.reel { color: var(--rouge); font-weight: 600; }
.ajust { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--doux); white-space: nowrap; }
.ajust button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--ligne);
  background: var(--carte); cursor: pointer;
}

/* Réglages */
.champ { display: grid; gap: 4px; margin-bottom: 12px; }
.champ label, .etiq { font-size: .85rem; color: var(--doux); }
input[type="date"], input[type="time"], input[type="number"], select {
  border: 1px solid var(--ligne); border-radius: 10px; padding: 8px 10px; background: var(--fond);
  min-height: 40px; width: 100%;
}
.grille-creneaux { display: grid; grid-template-columns: 92px 1fr 1fr; gap: 8px; align-items: center; }
.grille-creneaux .entete-col { font-size: .8rem; color: var(--doux); }
.jour-dec { border-top: 1px solid var(--ligne); padding: 12px 0; }
.jour-dec:first-of-type { border-top: 0; }
.ligne-dec { display: grid; grid-template-columns: 1fr 86px 38px; gap: 6px; margin-bottom: 6px; }
.apercu { font-size: .8rem; color: var(--doux); margin-top: 2px; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.champ, .grille-creneaux > *, .ligne-dec > * { min-width: 0; }
input, select { min-width: 0; max-width: 100%; }
.vide { text-align: center; color: var(--doux); padding: 24px 8px; }

/* Onglets */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--carte); border-top: 1px solid var(--ligne);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 10;
}
.onglets a {
  flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--doux); text-decoration: none; font-size: .72rem; padding: 4px 0; border-radius: 10px;
}
.onglets svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onglets a.actif { color: var(--accent); font-weight: 650; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Écran Aujourd'hui : mission du jour */
.haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 2px 0 8px; }
.haut .date { color: var(--doux); font-size: .92rem; }
.serie {
  display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; font-weight: 600;
  color: var(--doux); background: var(--carte); border: 1px solid var(--ligne); border-radius: 999px; padding: 4px 10px 4px 6px;
}
.serie svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.serie.active { color: var(--or); background: var(--or-clair); border-color: transparent; }
.serie.active svg { fill: var(--or); stroke: var(--or); }
.pastilles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.pastille { font-size: .8rem; color: var(--doux); border: 1px solid var(--ligne); border-radius: 999px; padding: 3px 10px; font-variant-numeric: tabular-nums; }
.pastille.forte { color: var(--texte); font-weight: 600; }

.mission {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 22px; box-shadow: var(--ombre);
  padding: 22px 18px 18px; text-align: center; margin-bottom: 14px;
}
.sur-mission { font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin: 0 0 6px; }
.mission .quoi { font-size: 1.55rem; line-height: 1.2; margin: 0 0 6px; }
.mission .ou { color: var(--doux); font-size: .92rem; margin: 0 auto 4px; max-width: 34ch; }
.mission .encourage { color: var(--doux); font-size: .95rem; margin: 0 auto 16px; max-width: 32ch; }
.anneau { position: relative; width: min(220px, 62vw); aspect-ratio: 1; margin: 14px auto 12px; }
.anneau svg { width: 100%; height: 100%; display: block; }
.anneau circle { fill: none; stroke-width: 14; }
.anneau .piste { stroke: var(--ligne); }
.anneau .plein { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.anneau.or .plein { stroke: var(--or); }
.anneau.vert .plein { stroke: var(--vert); }
.anneau .centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.anneau .centre b { font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.anneau .centre b svg { width: 56px; height: 56px; stroke: var(--vert); fill: none; stroke-width: 2.6; stroke-linecap: round; }
.anneau .centre span { color: var(--doux); font-size: .85rem; margin-top: 4px; }
.en-cours .anneau .centre b, .en-pause .anneau .centre b { font-size: 2.9rem; }
.bouton.grand { width: 100%; min-height: 56px; font-size: 1.08rem; border-radius: 16px; }
.lien {
  background: none; border: 0; color: var(--doux); font-size: .88rem; text-decoration: underline;
  text-underline-offset: 3px; padding: 12px 8px 2px; cursor: pointer;
}
.gagnee .sur-mission { color: var(--vert); }
.citation {
  font-style: italic; color: var(--doux); text-align: center; font-size: .92rem;
  margin: 4px 12px 16px; line-height: 1.5;
}
.soiree { padding: 0; }
.soiree > summary {
  cursor: pointer; padding: 14px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; list-style: none;
}
.soiree > summary::-webkit-details-marker { display: none; }
.soiree > summary span { color: var(--doux); font-weight: 400; font-size: .9rem; }
.soiree .seances { padding: 0 14px 8px; }
.semaine-jauge { padding: 4px 2px 8px; }
.semaine-jauge > div:first-child { display: flex; justify-content: space-between; font-size: .88rem; color: var(--doux); margin-bottom: 6px; }
.semaine-jauge b { color: var(--texte); font-weight: 600; }
.semaine-jauge .jauge { height: 8px; }
.semaine-jauge .jauge i { background: var(--accent); border-radius: 99px; }
@media (prefers-color-scheme: dark) { .bouton { color: #10201b; } }
