/* Élan : feuille de style unique.
   Sombre par défaut (comme une page produit), clair si l'appareil le demande ou si on le choisit.
   Couleurs des tâches : palette catégorielle validée (8 emplacements, ordre fixe). */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../polices/inter-regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../polices/inter-medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../polices/inter-semibold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../polices/inter-bold.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --page: #000;
  --surface: #161618;
  --surface-2: #1e1e21;
  --surface-3: #2a2a2e;
  --verre: rgba(22, 22, 24, .72);
  --ligne: rgba(255, 255, 255, .08);
  --ligne-forte: rgba(255, 255, 255, .16);
  --texte: #f5f5f7;
  --texte-2: #a1a1a6;
  --texte-3: #6e6e73;
  --grille: #2a2a2d;
  --axe: #47474b;
  --bouton: #f5f5f7;
  --bouton-texte: #000;
  --succes: #53c556;
  --bon: #0aac23;
  --alerte: #fbb315;
  --critique: #dc3c3d;
  /* Tâches : palette catégorielle (sombre) */
  --c1: #338ced; --c2: #e76624; --c3: #00a888; --c4: #d28e05;
  --c5: #e24d8b; --c6: #0aac23; --c7: #9887ef; --c8: #eb6263;
  /* Anneaux : jour, semaine, mois (3 premiers emplacements validés deux à deux) */
  --r-jour: #e76624; --r-jour-2: #ffb36b;
  --r-semaine: #00a888; --r-semaine-2: #5cf2c8;
  --r-mois: #338ced; --r-mois-2: #8fd0ff;
  /* Rampe séquentielle (bleu) pour le calendrier */
  --s0: #1f1f22; --s1: #0e3d7e; --s2: #1757ac; --s3: #2370cd; --s4: #338ced; --s5: #84b9f3;
  --rayon: 28px;
  --rayon-m: 20px;
  --rayon-s: 14px;
  --ressort: cubic-bezier(.32, .72, 0, 1);
  --doux: cubic-bezier(.2, .8, .2, 1);
  --rebond: cubic-bezier(.34, 1.56, .64, 1);
  --ombre: 0 30px 80px -20px rgba(0, 0, 0, .7);
  --largeur: 1180px;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="sombre"])) {
    color-scheme: light;
    --page: #f5f5f7; --surface: #fff; --surface-2: #f2f2f5; --surface-3: #e8e8ed;
    --verre: rgba(255, 255, 255, .72); --ligne: rgba(0, 0, 0, .07); --ligne-forte: rgba(0, 0, 0, .14);
    --texte: #1d1d1f; --texte-2: #6e6e73; --texte-3: #a1a1a6; --grille: #e7e7e7; --axe: #c2c2c2;
    --bouton: #1d1d1f; --bouton-texte: #fff; --succes: #006c10;
    --c1: #257de0; --c2: #f47230; --c3: #00b894; --c4: #f2a600;
    --c5: #ee7fac; --c6: #008a17; --c7: #6a4ce2; --c8: #ec4647;
    --r-jour: #f47230; --r-jour-2: #ffb36b; --r-semaine: #00b894; --r-semaine-2: #4fe0bb;
    --r-mois: #257de0; --r-mois-2: #6aabf1;
    --s0: #ececf0; --s1: #cce3fd; --s2: #9dc8f7; --s3: #6aabf1; --s4: #338ced; --s5: #1757ac;
    --ombre: 0 30px 80px -30px rgba(0, 0, 0, .25);
  }
}
:root[data-theme="clair"] {
  color-scheme: light;
  --page: #f5f5f7; --surface: #fff; --surface-2: #f2f2f5; --surface-3: #e8e8ed;
  --verre: rgba(255, 255, 255, .72); --ligne: rgba(0, 0, 0, .07); --ligne-forte: rgba(0, 0, 0, .14);
  --texte: #1d1d1f; --texte-2: #6e6e73; --texte-3: #a1a1a6; --grille: #e7e7e7; --axe: #c2c2c2;
  --bouton: #1d1d1f; --bouton-texte: #fff; --succes: #006c10;
  --c1: #257de0; --c2: #f47230; --c3: #00b894; --c4: #f2a600;
  --c5: #ee7fac; --c6: #008a17; --c7: #6a4ce2; --c8: #ec4647;
  --r-jour: #f47230; --r-jour-2: #ffb36b; --r-semaine: #00b894; --r-semaine-2: #4fe0bb;
  --r-mois: #257de0; --r-mois-2: #6aabf1;
  --s0: #ececf0; --s1: #cce3fd; --s2: #9dc8f7; --s3: #6aabf1; --s4: #338ced; --s5: #1757ac;
  --ombre: 0 30px 80px -30px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--page);
  color: var(--texte);
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--c1); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }
.masque-visuel { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- fond animé */
.aurore { position: fixed; inset: -20vh -20vw; z-index: -1; pointer-events: none; opacity: .55; filter: blur(80px); }
.aurore i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: derive 28s ease-in-out infinite alternate; }
.aurore i:nth-child(1) { width: 46vw; height: 46vw; left: 8vw; top: 2vh; background: radial-gradient(circle, rgba(231, 102, 36, .55), transparent 65%); }
.aurore i:nth-child(2) { width: 52vw; height: 52vw; right: 4vw; top: -6vh; background: radial-gradient(circle, rgba(51, 140, 237, .5), transparent 65%); animation-delay: -9s; }
.aurore i:nth-child(3) { width: 40vw; height: 40vw; left: 34vw; top: 26vh; background: radial-gradient(circle, rgba(0, 168, 136, .4), transparent 65%); animation-delay: -18s; }
:root[data-theme="clair"] .aurore { opacity: .35; }
@media (prefers-color-scheme: light) { :root:where(:not([data-theme="sombre"])) .aurore { opacity: .35; } }
@keyframes derive {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-4vw, 8vh, 0) scale(.95); }
}

/* ---------------------------------------------------------------- barre de navigation */
.nav {
  position: fixed; z-index: 40; top: calc(14px + var(--haut-sur)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--verre); border: 1px solid var(--ligne); border-radius: 999px;
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 40px -12px rgba(0, 0, 0, .5);
}
.marque { display: flex; align-items: center; gap: 8px; padding: 0 12px 0 8px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; }
.marque svg { width: 22px; height: 22px; }
.onglets { display: flex; gap: 2px; position: relative; }
.onglet {
  position: relative; z-index: 1; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--texte-2); transition: color .3s var(--doux);
}
.onglet:hover { color: var(--texte); }
.onglet[aria-current="page"] { color: var(--bouton-texte); }
.onglet .ico { display: none; }
.curseur-onglet {
  position: absolute; z-index: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--bouton);
  transition: left .5s var(--ressort), width .5s var(--ressort);
}
.btn-installer {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: linear-gradient(135deg, var(--r-jour), var(--c5) 50%, var(--r-mois)); color: #fff;
}

@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) {
  .nav {
    top: auto; bottom: calc(10px + var(--bas-sur)); width: calc(100% - 24px); max-width: 460px; justify-content: center;
    padding: 6px;
  }
  .marque, .btn-installer { display: none; }
  .onglets { width: 100%; }
  .onglet { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; font-size: 10.5px; white-space: nowrap; min-width: 0; }
  .onglet .ico { display: block; width: 22px; height: 22px; }
}

/* ---------------------------------------------------------------- mise en page */
main { width: min(100% - 40px, var(--largeur)); margin: 0 auto; padding: calc(110px + var(--haut-sur)) 0 120px; }
@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) {
  main { width: calc(100% - 28px); padding: calc(28px + var(--haut-sur)) 0 calc(120px + var(--bas-sur)); }
}
.vue { animation: entree .7s var(--ressort) both; }
@keyframes entree { from { opacity: 0; transform: translateY(18px) scale(.99); } to { opacity: 1; transform: none; } }

.surtitre { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); margin: 0 0 10px; }
.titre-section { font-size: clamp(30px, 4.4vw, 52px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; margin: 0; }
.titre-section .doux { color: var(--texte-3); }
.entete-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin: 96px 0 28px; }
.entete-section.serre { margin-top: 56px; }

.sous { color: var(--texte-2); font-size: 14px; }
.carte {
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon);
  padding: 24px; position: relative; overflow: hidden;
}
.carte h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.carte .sous { margin: 0 0 18px; color: var(--texte-2); font-size: 14px; }

.apparition { opacity: 0; transform: translateY(32px); transition: opacity .9s var(--doux), transform .9s var(--ressort); }
.apparition.vue-ok { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- héros */
.heros { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; min-height: min(64vh, 620px); }
.heros-texte .date { font-size: 15px; font-weight: 600; color: var(--texte-2); letter-spacing: .02em; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pastille-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(231, 102, 36, .14); color: var(--r-jour-2); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pastille-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--r-jour); animation: pouls 1.6s infinite; }
@keyframes pouls { 0% { box-shadow: 0 0 0 0 rgba(231, 102, 36, .7); } 70% { box-shadow: 0 0 0 8px rgba(231, 102, 36, 0); } 100% { box-shadow: 0 0 0 0 rgba(231, 102, 36, 0); } }
.chiffre-heros {
  margin: 0; font-size: clamp(76px, 12.5vw, 168px); line-height: .92; font-weight: 700; letter-spacing: -.055em;
  background: linear-gradient(180deg, var(--texte) 30%, color-mix(in srgb, var(--texte) 45%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  white-space: nowrap;
}
.chiffre-heros .unite { font-size: .42em; letter-spacing: -.03em; margin: 0 .08em 0 .04em; }
.phrase-heros { font-size: clamp(19px, 2.1vw, 26px); line-height: 1.3; letter-spacing: -.02em; font-weight: 600; color: var(--texte-2); margin: 22px 0 0; max-width: 30ch; }
.phrase-heros strong { color: var(--texte); font-weight: 600; }
.degrade {
  background: linear-gradient(90deg, var(--r-jour-2), var(--c5), var(--r-mois-2), var(--r-semaine-2), var(--r-jour-2));
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: miroir 8s linear infinite;
}
@keyframes miroir { to { background-position: 300% 0; } }
.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.puce {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--ligne); font-size: 14px; font-weight: 500; color: var(--texte-2);
}
.puce b { color: var(--texte); font-weight: 600; }
.puce svg { width: 16px; height: 16px; }

.anneaux-bloc { display: flex; flex-direction: column; align-items: center; gap: 26px; }
.anneaux { width: min(100%, 360px); aspect-ratio: 1; filter: drop-shadow(0 20px 60px rgba(0, 0, 0, .35)); }
.anneaux .piste { opacity: .2; }
.anneaux .arc { transition: stroke-dashoffset 1.6s var(--ressort); }
.anneaux .tour2 { transition: stroke-dashoffset 1.6s var(--ressort), opacity .4s; }
.legende-anneaux { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; width: 100%; max-width: 440px; }
.legende-anneaux div { text-align: center; }
.legende-anneaux .nom { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; color: var(--texte-2); font-weight: 500; }
.legende-anneaux .nom i { width: 12px; height: 4px; border-radius: 2px; }
.legende-anneaux .val { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-top: 2px; }
.legende-anneaux .sur { font-size: 13px; color: var(--texte-3); }

@media (max-width: 900px) {
  .heros { grid-template-columns: 1fr; gap: 28px; min-height: 0; }
  .anneaux { width: min(62vw, 250px); }
  .heros-texte { text-align: left; }
}

/* ---------------------------------------------------------------- défi (objectif qui monte) */
.defi {
  margin-top: 36px; display: flex; align-items: center; gap: 18px; padding: 18px 20px 18px 18px;
  border-radius: var(--rayon-m); position: relative; overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--ligne);
}
.defi::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22;
  background: linear-gradient(110deg, var(--r-jour), var(--c5) 40%, var(--r-mois) 80%);
}
.defi .fusee { font-size: 30px; }
.defi p { margin: 0; flex: 1; font-size: 15px; color: var(--texte-2); }
.defi p strong { display: block; color: var(--texte); font-size: 17px; letter-spacing: -.01em; }
.defi .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- en cours (activité en direct) */
.en-cours {
  margin-top: 40px; position: relative; border-radius: var(--rayon); padding: 2px; isolation: isolate; overflow: hidden;
}
.en-cours::before {
  content: ""; position: absolute; z-index: -2; width: 2400px; height: 2400px; left: calc(50% - 1200px); top: calc(50% - 1200px);
  background: conic-gradient(from 0deg, var(--r-jour), var(--c5), var(--r-mois), var(--r-semaine), var(--r-jour));
  animation: tourne 6s linear infinite;
}
.en-cours::after { content: ""; position: absolute; inset: 2px; border-radius: calc(var(--rayon) - 2px); background: var(--surface); z-index: -1; }
@keyframes tourne { to { transform: rotate(1turn); } }
.en-cours-int { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 22px 26px; }
.en-cours .icone-tache { width: 64px; height: 64px; font-size: 30px; border-radius: 20px; }
.en-cours .libelle { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.en-cours .nom { font-size: 24px; font-weight: 700; letter-spacing: -.025em; margin: 2px 0 8px; }
.chrono { font-size: clamp(40px, 5.5vw, 64px); font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.en-cours .progression { display: flex; align-items: center; gap: 10px; color: var(--texte-2); font-size: 13px; }
.en-cours .progression .barre { width: 180px; }
.en-cours .actions { display: flex; gap: 10px; }
@media (max-width: 760px) {
  .en-cours-int { grid-template-columns: auto 1fr; padding: 20px; gap: 14px 16px; }
  .en-cours .actions { grid-column: 1 / -1; }
  .en-cours .actions .btn { flex: 1; }
  .en-cours .icone-tache { width: 52px; height: 52px; font-size: 24px; border-radius: 16px; }
  .en-cours .progression .barre { width: 120px; }
}

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; white-space: nowrap;
  background: var(--surface-3); color: var(--texte);
  transition: transform .25s var(--rebond), background .2s, opacity .2s;
}
.btn:hover { background: color-mix(in srgb, var(--surface-3) 80%, var(--texte) 20%); }
.btn:active { transform: scale(.95); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.principal { background: var(--bouton); color: var(--bouton-texte); }
.btn.principal:hover { background: color-mix(in srgb, var(--bouton) 86%, var(--c1)); }
.btn.vif { background: linear-gradient(135deg, var(--r-jour), var(--c5)); color: #fff; }
.btn.succes { background: var(--bon); color: #fff; }
.btn.danger { background: color-mix(in srgb, var(--critique) 18%, transparent); color: #ff6b6b; }
:root[data-theme="clair"] .btn.danger { color: var(--critique); }
.btn.fantome { background: transparent; color: var(--texte-2); }
.btn.fantome:hover { background: var(--surface-2); color: var(--texte); }
.btn.petit { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.rond { width: 44px; padding: 0; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn .touche { opacity: .55; font-weight: 500; }

/* ---------------------------------------------------------------- segments de choix (Jour / Semaine / Mois) */
.choix {
  display: inline-flex; position: relative; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne);
}
.choix button { position: relative; z-index: 1; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--texte-2); transition: color .3s; display: inline-flex; align-items: center; gap: 8px; }
.choix button[aria-pressed="true"] { color: var(--texte); }
.choix button .compte { font-size: 12px; font-weight: 600; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.choix .curseur { position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 999px; background: var(--surface-3); transition: left .45s var(--ressort), width .45s var(--ressort); }
@media (max-width: 560px) { .choix { width: 100%; } .choix button { flex: 1; justify-content: center; padding: 8px 6px; } }

/* ---------------------------------------------------------------- cartes de tâches */
.grille-taches { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.tache {
  --couleur: var(--c1);
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; min-height: 196px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-m); text-align: left;
  transition: transform .5s var(--ressort), border-color .3s, background .3s, opacity .4s;
  cursor: pointer; isolation: isolate; overflow: hidden;
}
.tache:hover { transform: translateY(-4px); border-color: var(--ligne-forte); }
.tache::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .5s;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--couleur) 26%, transparent), transparent 60%);
}
.tache.etat-en_cours::after { opacity: 1; }
.tache.etat-en_cours { border-color: color-mix(in srgb, var(--couleur) 60%, transparent); }
.tache.etat-faite { opacity: .62; }
.tache.etat-faite:hover { opacity: 1; }
.tache .haut { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.icone-tache {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; font-size: 22px; flex: none;
  background: color-mix(in srgb, var(--couleur) 22%, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--couleur) 35%, transparent);
}
.tache .nom { font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.25; margin: 0; }
.tache .details { font-size: 13px; color: var(--texte-2); margin-top: 3px; }
.tache .bas { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; }
.tache .bas > div:first-child { flex: 1 1 110px; }
.tache .temps { white-space: nowrap; font-size: 22px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.tache .temps small { font-size: 13px; font-weight: 500; color: var(--texte-2); letter-spacing: 0; margin-left: 4px; }
.tache .boutons { display: flex; gap: 8px; }
.tache .btn-rond {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-3); color: var(--texte); transition: transform .3s var(--rebond), background .2s;
}
.tache .btn-rond:hover { transform: scale(1.08); }
.tache .btn-rond:active { transform: scale(.9); }
.tache .btn-rond.principal { background: var(--bouton); color: var(--bouton-texte); }
.tache .btn-rond.couleur { background: var(--couleur); color: #fff; }
.tache .btn-rond svg { width: 20px; height: 20px; }
.etiquette {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--texte-2); white-space: nowrap;
}
.etiquette::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.etiquette.en_cours { color: var(--couleur); background: color-mix(in srgb, var(--couleur) 15%, transparent); }
.etiquette.en_cours::before { animation: pouls-c 1.6s infinite; }
@keyframes pouls-c { 50% { opacity: .2; } }
.etiquette.en_pause { color: var(--alerte); background: color-mix(in srgb, var(--alerte) 14%, transparent); }
.etiquette.interrompue { color: #ff8a65; background: rgba(255, 138, 101, .14); }
.etiquette.terminee { color: var(--succes); background: color-mix(in srgb, var(--bon) 14%, transparent); }
.etiquette.terminee::before { display: none; }
.etiquette.repos::before { display: none; }

.barre { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; width: 100%; }
.barre i { display: block; height: 100%; border-radius: inherit; background: var(--couleur, var(--c1)); width: 0; transition: width 1.2s var(--ressort); }
.barre i.depasse { background: linear-gradient(90deg, var(--couleur, var(--c1)), color-mix(in srgb, var(--couleur, var(--c1)) 40%, #fff)); }

.vide {
  border: 1.5px dashed var(--ligne-forte); border-radius: var(--rayon-m); padding: 36px; text-align: center; color: var(--texte-2);
}
.vide strong { display: block; color: var(--texte); font-size: 18px; margin-bottom: 6px; }
.repos-liste { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--texte-3); font-size: 13px; }

/* ---------------------------------------------------------------- ruban de la journée */
.ruban-carte { margin-top: 16px; }

/* ---------------------------------------------------------------- graphiques */
.graphique { position: relative; width: 100%; }
.graphique svg { display: block; width: 100%; overflow: visible; }
.graphique text { font-family: inherit; }
.graphique .tick { fill: var(--texte-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphique .grille { stroke: var(--grille); stroke-width: 1; shape-rendering: crispEdges; }
.graphique .axe { stroke: var(--axe); stroke-width: 1; shape-rendering: crispEdges; }
.graphique .etiq { fill: var(--texte); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.graphique .etiq-douce { fill: var(--texte-2); font-size: 11px; font-weight: 500; }
.graphique .marque-donnee { transition: opacity .2s, filter .2s; outline: none; }
.graphique .marque-donnee:hover, .graphique .marque-donnee:focus-visible { filter: brightness(1.25); }
.graphique.survol .marque-donnee:not(.actif) { opacity: .35; }
.graphique .objectif-ligne { stroke: var(--texte); stroke-width: 1; opacity: .55; shape-rendering: crispEdges; }
.graphique .maintenant { stroke: var(--texte); stroke-width: 1.5; }
.graphique .pousse { transform-box: fill-box; transform-origin: bottom; animation: pousse 1s var(--ressort) both; }
@keyframes pousse { from { transform: scaleY(0); } }
.graphique .glisse { transform-box: fill-box; transform-origin: left; animation: glisse 1s var(--ressort) both; }
@keyframes glisse { from { transform: scaleX(0); } }

.calme .pousse, .calme .glisse, .calme .case { animation: none !important; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 14px; font-size: 13px; color: var(--texte-2); }
.legende span { display: inline-flex; align-items: center; gap: 7px; }
.legende i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.infobulle {
  position: fixed; z-index: 100; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 10px 12px; border-radius: 14px; background: var(--verre); border: 1px solid var(--ligne-forte);
  backdrop-filter: blur(20px) saturate(180%); -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .5); font-size: 13px; opacity: 0; transform: translateY(4px) scale(.98);
  transition: opacity .15s, transform .2s var(--doux);
}
.infobulle.visible { opacity: 1; transform: none; }
.infobulle .titre { color: var(--texte-2); font-size: 12px; margin-bottom: 6px; }
.infobulle .ligne { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.infobulle .ligne i { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.infobulle .ligne .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.infobulle .ligne .n { color: var(--texte-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.infobulle .ligne.actif .n { color: var(--texte); }
.infobulle .total { border-top: 1px solid var(--ligne); margin-top: 6px; padding-top: 6px; font-weight: 600; }

.tableau-donnees { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.tableau-donnees th, .tableau-donnees td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--ligne); }
.tableau-donnees th { color: var(--texte-2); font-weight: 500; }
.tableau-donnees td.n { text-align: right; font-variant-numeric: tabular-nums; }
.basculer-tableau { margin-top: 12px; font-size: 13px; color: var(--texte-2); text-decoration: underline; text-underline-offset: 3px; }
.basculer-tableau:hover { color: var(--texte); }

/* ---------------------------------------------------------------- analyses */
.barre-filtres {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; position: sticky;
  top: calc(78px + var(--haut-sur)); z-index: 20; padding: 6px; margin: 28px 0 0; border-radius: 999px;
  background: var(--verre); border: 1px solid var(--ligne); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.barre-filtres .choix { border: 0; background: transparent; }
@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) { .barre-filtres { top: calc(8px + var(--haut-sur)); border-radius: 24px; } }
.navigation-periode { display: flex; align-items: center; gap: 6px; }
.navigation-periode .libelle { min-width: 190px; text-align: center; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
@media (max-width: 560px) { .navigation-periode { width: 100%; justify-content: space-between; } .navigation-periode .libelle { min-width: 0; } }
.chargement { opacity: .45; transition: opacity .3s; }

.histoire { margin: 56px 0 36px; }
.histoire .grand { font-size: clamp(40px, 7.5vw, 96px); font-weight: 700; letter-spacing: -.05em; line-height: .95; margin: 0; }
.histoire .grand .unite { font-size: .45em; letter-spacing: -.03em; }
.histoire .phrase { font-size: clamp(18px, 2vw, 24px); color: var(--texte-2); letter-spacing: -.015em; font-weight: 600; margin: 16px 0 0; max-width: 40ch; line-height: 1.35; }
.histoire .phrase strong { color: var(--texte); font-weight: 600; }
.delta-haut, .histoire .phrase strong.delta-haut { color: var(--succes); }
.delta-bas, .histoire .phrase strong.delta-bas { color: #e8603c; }

.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.tuile { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-m); padding: 18px 18px 16px; }
.tuile .l { font-size: 13px; color: var(--texte-2); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.tuile .v { font-size: 30px; font-weight: 700; letter-spacing: -.035em; margin-top: 6px; line-height: 1.1; }
.tuile .v small { font-size: 15px; font-weight: 600; color: var(--texte-2); letter-spacing: -.01em; margin-left: 2px; }
.tuile .d { font-size: 13px; color: var(--texte-2); margin-top: 4px; }

.grille-graphiques { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; margin-top: 16px; }
.g-12 { grid-column: span 12; } .g-7 { grid-column: span 7; } .g-5 { grid-column: span 5; } .g-6 { grid-column: span 6; }
@media (max-width: 900px) { .g-7, .g-5, .g-6 { grid-column: span 12; } }

.calendrier { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendrier .jsem { font-size: 11px; color: var(--texte-2); text-align: center; padding-bottom: 2px; font-weight: 500; }
.calendrier .case {
  aspect-ratio: 1; border-radius: 10px; background: var(--s0); position: relative; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--texte-2); transition: transform .3s var(--rebond); outline: none;
  font-variant-numeric: tabular-nums;
}
.calendrier .case:hover, .calendrier .case:focus-visible { transform: scale(1.08); z-index: 1; box-shadow: 0 0 0 2px var(--texte); }
.calendrier .case.n1 { background: var(--s1); color: #fff; } .calendrier .case.n2 { background: var(--s2); color: #fff; }
.calendrier .case.n3 { background: var(--s3); color: #fff; } .calendrier .case.n4 { background: var(--s4); color: #fff; }
.calendrier .case.n5 { background: var(--s5); color: #fff; }
:root[data-theme="clair"] .calendrier .case.n1, :root[data-theme="clair"] .calendrier .case.n2 { color: #0e3d7e; }
@media (prefers-color-scheme: light) { :root:where(:not([data-theme="sombre"])) .calendrier .case.n1, :root:where(:not([data-theme="sombre"])) .calendrier .case.n2 { color: #0e3d7e; } }
.calendrier .case.atteint::after { content: ""; position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--s4); }
.calendrier .case.aujourdhui { box-shadow: 0 0 0 2px var(--texte); }
.calendrier .case.futur { opacity: .35; }
.echelle { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--texte-2); margin-top: 14px; flex-wrap: wrap; }
.echelle i { width: 18px; height: 12px; border-radius: 4px; }
.echelle span { margin: 0 4px; }

/* ---------------------------------------------------------------- gestion des tâches */
.liste-gestion { display: flex; flex-direction: column; gap: 10px; }
.ligne-gestion {
  --couleur: var(--c1);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-s);
  transition: transform .45s var(--ressort), opacity .3s;
}
.ligne-gestion .nom { font-weight: 600; letter-spacing: -.01em; }
.ligne-gestion .details { font-size: 13px; color: var(--texte-2); }
.ligne-gestion .outils { display: flex; gap: 4px; }
.ligne-gestion .outils .btn { width: 38px; min-height: 38px; padding: 0; }
.groupe-gestion h3 { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-2); margin: 34px 0 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.suggestion { padding: 9px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--ligne); font-size: 14px; font-weight: 500; transition: transform .25s var(--rebond), border-color .2s; }
.suggestion:hover { border-color: var(--ligne-forte); transform: translateY(-2px); }
.suggestion:active { transform: scale(.95); }

.fab {
  position: fixed; z-index: 35; right: max(20px, calc((100vw - var(--largeur)) / 2)); bottom: calc(28px + var(--bas-sur));
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bouton); color: var(--bouton-texte); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .6);
  transition: transform .35s var(--rebond);
}
.fab:hover { transform: scale(1.06) rotate(90deg); }
.fab:active { transform: scale(.92); }
.fab svg { width: 26px; height: 26px; }
@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) { .fab { bottom: calc(96px + var(--bas-sur)); right: 18px; } }

/* ---------------------------------------------------------------- réglages */
.reglage { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--ligne); }
.reglage:last-child { border-bottom: 0; padding-bottom: 0; }
.reglage:first-of-type { padding-top: 0; }
.reglage .t { font-weight: 600; letter-spacing: -.01em; }
.reglage .d { font-size: 13px; color: var(--texte-2); margin-top: 2px; }
.pas-a-pas { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.pas-a-pas button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 500; color: var(--texte); transition: background .2s, transform .2s var(--rebond); }
.pas-a-pas button:hover { background: var(--surface-3); }
.pas-a-pas button:active { transform: scale(.88); }
.pas-a-pas output { min-width: 78px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.interrupteur { position: relative; width: 52px; height: 32px; border-radius: 999px; background: var(--surface-3); transition: background .3s; flex: none; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .4s var(--rebond); }
.interrupteur[aria-checked="true"] { background: var(--bon); }
.interrupteur[aria-checked="true"]::after { transform: translateX(20px); }
.jours { display: flex; gap: 6px; flex-wrap: wrap; }
.jours button { width: 40px; height: 40px; border-radius: 50%; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--texte-2); transition: background .2s, color .2s, transform .25s var(--rebond); }
.jours button[aria-pressed="true"] { background: var(--bouton); color: var(--bouton-texte); }
.jours button:active { transform: scale(.9); }
.grille-reglages { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .grille-reglages { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- feuilles (modales) */
.voile {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .35s;
}
.voile.ouvert { opacity: 1; }
.feuille {
  position: fixed; z-index: 61; left: 50%; bottom: 0; width: min(100%, 560px); max-height: min(92dvh, 860px);
  transform: translate(-50%, 105%); transition: transform .55s var(--ressort);
  background: var(--surface); border: 1px solid var(--ligne); border-bottom: 0; border-radius: 30px 30px 0 0;
  box-shadow: var(--ombre); display: flex; flex-direction: column; overscroll-behavior: contain;
}
.feuille.ouvert { transform: translate(-50%, 0); }
@media (min-width: 761px) {
  .feuille { bottom: auto; top: 50%; border-radius: 30px; border-bottom: 1px solid var(--ligne); transform: translate(-50%, -46%) scale(.96); opacity: 0; transition: transform .5s var(--ressort), opacity .3s; }
  .feuille.ouvert { transform: translate(-50%, -50%); opacity: 1; }
}
.feuille .poignee { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 10px auto 0; flex: none; }
@media (min-width: 761px) { .feuille .poignee { display: none; } }
.feuille .tete { display: flex; align-items: center; gap: 14px; padding: 18px 22px 10px; }
.feuille .tete h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.025em; flex: 1; line-height: 1.2; }
.feuille .tete .sous { margin: 2px 0 0; font-size: 13px; color: var(--texte-2); font-weight: 500; letter-spacing: 0; }
.feuille .corps { padding: 8px 22px 24px; overflow-y: auto; }
.feuille .pied { padding: 14px 22px calc(18px + var(--bas-sur)); border-top: 1px solid var(--ligne); display: flex; gap: 10px; flex-wrap: wrap; }
.feuille .pied .btn { flex: 1; }
.fermer { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--texte-2); flex: none; }
.fermer svg { width: 16px; height: 16px; }

.champ { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.champ > label, .champ > .lbl { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.champ input[type="text"], .champ input[type="password"], .champ input[type="time"], .champ input[type="date"], .champ textarea {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--ligne); background: var(--surface-2);
  font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s;
}
.champ input:focus, .champ textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 25%, transparent); }
.deux-colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.icones { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.icones button { aspect-ratio: 1; border-radius: 12px; font-size: 22px; background: var(--surface-2); transition: transform .25s var(--rebond), box-shadow .2s; }
.icones button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--texte); background: var(--surface-3); }
.icones button:active { transform: scale(.88); }
.couleurs { display: flex; gap: 10px; flex-wrap: wrap; }
.couleurs button { width: 36px; height: 36px; border-radius: 50%; transition: transform .25s var(--rebond); position: relative; }
.couleurs button[aria-pressed="true"] { transform: scale(1.12); box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--texte); }
.couleurs button:active { transform: scale(.9); }
.puces-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.puces-choix button { padding: 9px 14px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 500; transition: background .2s, color .2s, transform .25s var(--rebond); }
.puces-choix button[aria-pressed="true"] { background: var(--bouton); color: var(--bouton-texte); }
.puces-choix button:active { transform: scale(.94); }

.gros-chrono { text-align: center; padding: 10px 0 18px; }
.gros-chrono .chrono { font-size: 56px; }
.gros-chrono .d { color: var(--texte-2); font-size: 14px; margin-top: 4px; }
.actions-feuille { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.actions-feuille .btn { min-height: 52px; border-radius: 16px; }
.heure-action { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--texte-2); flex-wrap: wrap; }
.heure-action input { padding: 6px 10px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--surface-2); font-size: 14px; }
.seances { display: flex; flex-direction: column; margin-top: 8px; }
.seance { display: grid; grid-template-columns: 4px 1fr auto auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne); font-size: 14px; }
.seance:last-child { border-bottom: 0; }
.seance > i { align-self: stretch; border-radius: 2px; background: var(--couleur); }
.seance .h { font-weight: 600; font-variant-numeric: tabular-nums; }
.seance .r { font-size: 12px; color: var(--texte-2); }
.seance .duree { font-weight: 600; font-variant-numeric: tabular-nums; }
.seance .outils { display: flex; gap: 2px; }
.seance .outils button { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--texte-2); }
.seance .outils button:hover { background: var(--surface-2); color: var(--texte); }
.seance .outils svg { width: 15px; height: 15px; }
.seance-edition { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px 0 14px; border-bottom: 1px solid var(--ligne); }
.seance-edition label { font-size: 12px; color: var(--texte-2); display: flex; flex-direction: column; gap: 4px; }
.seance-edition input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--ligne); background: var(--surface-2); }
.sous-titre-feuille { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); margin: 26px 0 6px; }

/* ---------------------------------------------------------------- notifications et fête */
.toasts { position: fixed; z-index: 120; left: 50%; top: calc(80px + var(--haut-sur)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
@media (max-width: 760px) { .toasts { top: calc(14px + var(--haut-sur)); } }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: var(--verre); border: 1px solid var(--ligne-forte); box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .5);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  animation: toast-entre .5s var(--rebond) both; pointer-events: auto;
}
.toast.sort { animation: toast-sort .35s var(--doux) both; }
.toast.erreur { color: #ff8a8a; }
.toast button { color: var(--c1); font-weight: 700; margin-left: 4px; }
@keyframes toast-entre { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes toast-sort { to { opacity: 0; transform: translateY(-10px) scale(.95); } }
.confettis { position: fixed; inset: 0; z-index: 110; pointer-events: none; }

.celebration {
  position: fixed; inset: 0; z-index: 105; display: grid; place-items: center; pointer-events: none;
  animation: celeb 3.2s var(--doux) both;
}
.celebration div { text-align: center; }
.celebration .grand { font-size: clamp(44px, 9vw, 110px); font-weight: 700; letter-spacing: -.05em; line-height: 1; }
.celebration .petit { font-size: 18px; color: var(--texte-2); margin-top: 10px; font-weight: 600; }
@keyframes celeb { 0% { opacity: 0; transform: scale(.85); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(1.04); } }

.connexion { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.connexion > div { width: min(100%, 380px); text-align: center; }
.connexion form { width: 100%; text-align: center; }
.connexion pre { background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: 14px; margin: 0 0 18px; }
.connexion .logo { width: 72px; height: 72px; margin: 0 auto 20px; }
.connexion h1 { font-size: 40px; letter-spacing: -.04em; margin: 0 0 6px; }
.connexion p { color: var(--texte-2); margin: 0 0 26px; }
.connexion .btn { width: 100%; min-height: 52px; }

.bandeau-hors-ligne { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--bas-sur)); padding: 8px 16px; border-radius: 999px; background: var(--critique); color: #fff; font-size: 13px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .apparition { opacity: 1; transform: none; }
}

/* ================================================================ AGENDA */
main.large { width: min(100% - 40px, 1640px); padding-bottom: 20px; }
main.accueil { padding: 0; }
@media (max-width: 760px), (display-mode: standalone) and (max-width: 1024px) { main.large { width: calc(100% - 16px); padding-top: calc(14px + var(--haut-sur)); padding-bottom: calc(96px + var(--bas-sur)); } }
.agenda { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 26px; align-items: start; }
@media (max-width: 1099px) { .agenda { grid-template-columns: minmax(0, 1fr); } .agenda-cote { display: none !important; } }
.agenda-cote { position: sticky; top: calc(92px + var(--haut-sur)); display: flex; flex-direction: column; gap: 24px; }
.ag-creer {
  display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; padding: 14px 24px 14px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--ligne); box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .7);
  font-weight: 600; font-size: 15px; transition: transform .35s var(--rebond), box-shadow .3s, border-color .3s;
}
.ag-creer svg { width: 26px; height: 26px; color: var(--r-jour); stroke-width: 2.6; }
.ag-creer:hover { transform: translateY(-2px); border-color: var(--ligne-forte); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .8); }
.ag-creer:active { transform: scale(.96); }
.ag-mini-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; padding-left: 6px; }
.ag-mini-tete > div { display: flex; }
.ag-mini-tete .btn { width: 32px; min-height: 32px; }
.ag-mini-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.ag-mini-grille .js { font-size: 11px; color: var(--texte-3); padding: 4px 0; font-weight: 600; }
.ag-mini-grille button { aspect-ratio: 1; border-radius: 50%; font-size: 12px; font-weight: 500; position: relative; transition: background .2s; font-variant-numeric: tabular-nums; }
.ag-mini-grille button:hover { background: var(--surface-3); }
.ag-mini-grille button.autre { color: var(--texte-3); }
.ag-mini-grille button.visible { background: var(--surface-2); border-radius: 9px; }
.ag-mini-grille button.aujourdhui { background: var(--r-jour); color: #fff; border-radius: 50%; font-weight: 700; }
.ag-mini-grille button.travaille::after { content: ""; position: absolute; bottom: 2px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--r-semaine); }
.ag-mini-grille button.aujourdhui::after { background: #fff; }
.ag-calques { display: flex; flex-direction: column; gap: 2px; }
.ag-calque { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 8px; border-radius: 12px; width: 100%; transition: background .2s; }
.ag-calque:hover { background: var(--surface); }
.ag-calque i { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; margin-top: 1px; border: 2px solid var(--texte-3); transition: background .2s, border-color .2s; }
.ag-calque i svg { width: 14px; height: 14px; opacity: 0; color: #fff; stroke-width: 3; }
.ag-calque[aria-checked="true"] i svg { opacity: 1; }
.ag-calque.cal-prevus[aria-checked="true"] i { background: var(--c1); border-color: var(--c1); }
.ag-calque.cal-seances[aria-checked="true"] i { background: var(--r-jour); border-color: var(--r-jour); }
.ag-calque b { display: block; font-size: 14px; font-weight: 600; }
.ag-calque small { color: var(--texte-2); font-size: 12px; }
.ag-resume { background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon-m); padding: 16px; }
.ag-resume-ligne { display: flex; justify-content: space-between; font-size: 14px; color: var(--texte-2); padding: 3px 0; }
.ag-resume-ligne b { color: var(--texte); font-variant-numeric: tabular-nums; }

.agenda-barre { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-bottom: 16px; }
.ag-fleches { display: flex; }
.ag-titre-zone { position: relative; flex: 1; min-width: 140px; }
.ag-titre { font-size: 24px; font-weight: 700; letter-spacing: -.025em; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ag-titre-fleche svg { width: 18px; height: 18px; color: var(--texte-2); }
@media (min-width: 1100px) { .ag-titre-fleche { display: none; } .ag-titre { cursor: default; } }
@media (max-width: 760px) { .ag-titre { font-size: 19px; } }
.ag-deroulant { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 14px; background: var(--surface); border: 1px solid var(--ligne-forte); border-radius: 22px; box-shadow: var(--ombre); animation: pop .3s var(--rebond); }
.ag-resume-barre { display: flex; gap: 14px; font-size: 13px; color: var(--texte-2); flex-wrap: wrap; }
.ag-resume-barre b { color: var(--texte); font-variant-numeric: tabular-nums; margin-left: 3px; }
.ag-resume-barre .delta-haut b { color: var(--succes); }
@media (max-width: 760px) { .ag-resume-barre { order: 10; width: 100%; } .agenda-barre .choix { order: 11; } }
.ag-pastille { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ag-pastille.prevu { background: color-mix(in srgb, var(--c1) 30%, transparent); box-shadow: inset 3px 0 0 var(--c1); }
.ag-pastille.fait { background: var(--r-jour); }

.ag-grille { --ag-gouttiere: 58px; background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
@media (max-width: 760px) { .ag-grille { --ag-gouttiere: 38px; border-radius: 20px; } }
.ag-entetes { display: grid; border-bottom: 1px solid var(--ligne); }
.ag-entete { text-align: center; padding: 10px 0 8px; min-width: 0; }
.ag-entete .js { display: block; font-size: 11px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .07em; }
.ag-entete .num { width: 42px; height: 42px; border-radius: 50%; font-size: 22px; font-weight: 600; margin-top: 2px; letter-spacing: -.02em; transition: background .2s, transform .25s var(--rebond); }
.ag-entete .num:hover { background: var(--surface-2); }
.ag-entete .num:active { transform: scale(.9); }
.ag-entete.passe .num { color: var(--texte-2); }
.ag-entete.aujourdhui .js { color: var(--r-jour-2); }
.ag-entete.aujourdhui .num { background: var(--r-jour); color: #fff; }
@media (max-width: 760px) { .ag-entete .num { width: 34px; height: 34px; font-size: 17px; } }
.ag-journee { display: grid; border-bottom: 1px solid var(--ligne); max-height: 132px; overflow-y: auto; }
.ag-coin-l { font-size: 10px; color: var(--texte-3); text-align: right; padding: 9px 8px 0 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
@media (max-width: 760px) { .ag-coin-l { font-size: 0; } }
.ag-jcell { display: flex; flex-direction: column; gap: 3px; padding: 5px 4px; border-left: 1px solid var(--ligne); min-width: 0; }
.ag-puce {
  --couleur: var(--c1); display: flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600;
  text-align: left; min-width: 0; border: 1px solid color-mix(in srgb, var(--couleur) 60%, transparent); transition: transform .2s var(--rebond);
}
.ag-puce:active { transform: scale(.95); }
.ag-puce span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-puce svg { width: 12px; height: 12px; flex: none; stroke-width: 3; }
.ag-puce.faite { background: var(--couleur); border-color: transparent; color: #fff; }
.ag-puce.encours { background: color-mix(in srgb, var(--couleur) 28%, transparent); animation: pouls-c 2s infinite; }
.ag-puce.manquee { opacity: .5; border-style: dashed; }
.ag-puce.manquee span { text-decoration: line-through; }

.ag-defile { overflow-y: auto; overscroll-behavior: contain; position: relative; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
.ag-corps { display: grid; position: relative; }
.ag-heures { position: relative; }
.ag-heures span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--texte-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 760px) { .ag-heures span { right: 5px; font-size: 10px; } }
.ag-col {
  position: relative; border-left: 1px solid var(--ligne); min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--grille) 0 1px, transparent 1px var(--h));
}
.ag-col.passe { background-color: color-mix(in srgb, var(--page) 30%, transparent); }
.ag-col.aujourdhui { background-color: color-mix(in srgb, var(--r-jour) 4%, transparent); }
.ag-maintenant { position: absolute; left: -1px; right: 0; height: 2px; margin-top: -1px; background: var(--r-jour); z-index: 5; pointer-events: none; }
.ag-maintenant::before { content: ""; position: absolute; left: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--r-jour); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r-jour) 30%, transparent); }

.ag-evt {
  --couleur: var(--c1);
  position: absolute; z-index: 2; border-radius: 9px; padding: 4px 8px; overflow: hidden; font-size: 12px; line-height: 1.3;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  transition: box-shadow .2s, transform .25s var(--rebond), opacity .2s;
  animation: evt-entre .45s var(--ressort) both;
}
@keyframes evt-entre { from { opacity: 0; transform: scale(.96); } }
.ag-evt .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-evt .h { opacity: .78; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ag-evt.court { padding: 0 8px; display: flex; align-items: center; }
.ag-evt.court .t { font-size: 11px; }
.ag-evt.ev-prevu {
  background: color-mix(in srgb, var(--couleur) 16%, var(--surface)); color: var(--texte);
  box-shadow: inset 3px 0 0 var(--couleur); border: 1px solid color-mix(in srgb, var(--couleur) 38%, transparent);
}
.ag-evt.ev-seance { background: var(--couleur); color: #fff; box-shadow: 0 0 0 2px var(--surface); z-index: 3; }
.ag-evt.ev-interrompue::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #ff8a65; }
.ag-evt.ev-seance.ev-en-cours { background: linear-gradient(180deg, var(--couleur), color-mix(in srgb, var(--couleur) 60%, transparent)); animation: evt-entre .45s var(--ressort) both, respire 2.4s ease-in-out infinite; }
@keyframes respire { 50% { filter: brightness(1.18); } }
.ag-evt.ev-brouillon { background: var(--c1); color: #fff; z-index: 4; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, .7); animation: none; }
.ag-evt:hover, .ag-evt:focus-visible { z-index: 4; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .7); }
.ag-evt.ev-prevu:hover { box-shadow: inset 3px 0 0 var(--couleur), 0 8px 24px -8px rgba(0, 0, 0, .7); }
.ag-evt.glisse { z-index: 6; opacity: .94; cursor: grabbing; transform: scale(1.02); box-shadow: 0 18px 44px -10px rgba(0, 0, 0, .8); transition: box-shadow .2s, transform .25s var(--rebond); }
.ag-etirer { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.ag-etirer::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .2s; }
.ag-evt:hover .ag-etirer::after { opacity: .5; }
.agenda-zone { transition: opacity .3s; }

.ag-mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--ligne); border-radius: var(--rayon); overflow: hidden; }
.ag-mois-js { text-align: center; padding: 10px 0; font-size: 11px; font-weight: 600; color: var(--texte-2); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--ligne); }
.ag-mcase { min-height: 120px; padding: 6px; border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne); display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; transition: background .2s; animation: entree .5s var(--ressort) both; }
.ag-mcase:nth-child(7n) { border-right: 0; }
.ag-mcase:hover { background: var(--surface-2); }
.ag-mcase.autre { opacity: .42; }
.ag-mcase-tete { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 2px; }
.ag-mcase .num { width: 28px; height: 28px; border-radius: 50%; font-size: 13px; font-weight: 600; transition: background .2s; flex: none; }
.ag-mcase .num:hover { background: var(--surface-3); }
.ag-mcase.aujourdhui .num { background: var(--r-jour); color: #fff; }
.ag-fait { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--r-semaine) 18%, transparent); white-space: nowrap; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.ag-mitem { --couleur: var(--c1); display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 4px; border-radius: 6px; min-width: 0; text-align: left; transition: background .2s; }
.ag-mitem:hover { background: var(--surface-3); }
.ag-mitem i { width: 8px; height: 8px; border-radius: 50%; background: var(--couleur); flex: none; }
.ag-mitem .h { color: var(--texte-2); font-variant-numeric: tabular-nums; flex: none; }
.ag-mitem .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ag-plus { font-size: 12px; color: var(--texte-2); text-align: left; padding: 0 4px; font-weight: 600; }
.ag-plus:hover { color: var(--texte); }
@media (max-width: 760px) {
  .ag-mcase { min-height: 78px; padding: 3px; }
  .ag-mcase .num { width: 24px; height: 24px; font-size: 12px; }
  .ag-mitem .h { display: none; }
  .ag-mitem { font-size: 10px; padding: 1px 2px; gap: 3px; }
  .ag-fait { font-size: 9px; padding: 1px 4px; }
  .ag-mcase-tete { flex-direction: column; align-items: flex-start; }
}

.ag-pop {
  --couleur: var(--c1); position: fixed; z-index: 70; width: 348px; background: var(--surface); border: 1px solid var(--ligne-forte);
  border-radius: 22px; box-shadow: var(--ombre); padding: 16px; animation: pop .32s var(--rebond) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(4px); } }
.ag-pop-tete { display: flex; gap: 12px; align-items: flex-start; }
.ag-pop-tete > div { flex: 1; min-width: 0; }
.ag-pop-tete h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; line-height: 1.25; }
.ag-pop-tete p { margin: 3px 0 0; font-size: 13px; color: var(--texte-2); }
.ag-pop-carre { width: 14px; height: 14px; border-radius: 4px; background: var(--couleur); margin-top: 5px; flex: none; }
.ag-pop-carre.prevu { background: color-mix(in srgb, var(--couleur) 35%, transparent); box-shadow: inset 3px 0 0 var(--couleur); }
.ag-pop-corps { margin: 14px 0 16px; display: flex; flex-direction: column; gap: 9px; }
.ag-pop-ligne { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--texte-2); }
.ag-pop-ligne svg { width: 16px; height: 16px; flex: none; }
.ag-pop-ligne.note { white-space: pre-wrap; color: var(--texte); }
.ag-pop-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ag-portee { display: flex; flex-direction: column; gap: 8px; }
.ag-portee button { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 14px; background: var(--surface-2); font-weight: 500; text-align: left; transition: background .2s; }
.ag-portee i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--texte-3); flex: none; position: relative; transition: border-color .2s; }
.ag-portee [aria-checked="true"] { background: var(--surface-3); }
.ag-portee [aria-checked="true"] i { border-color: var(--c1); }
.ag-portee [aria-checked="true"] i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--c1); }
.ag-taches-choix button[aria-pressed="true"] { background: var(--couleur, var(--bouton)); color: #fff; }

.fab.ag-fab { display: none; }
@media (max-width: 1099px) { .fab.ag-fab { display: grid; } }

/* ------------------------------------------------------------------ v2 : agendas connectés et comptes */
.ag-calque.cal-agenda[aria-checked="true"] i { background: var(--couleur); border-color: var(--couleur); }
.ag-puce.evt-journee { background: var(--couleur); border-color: transparent; color: #fff; font-weight: 600; }
.ag-mitem.journee { background: var(--couleur); color: #fff; padding: 2px 6px; }
.ag-mitem.journee:hover { background: color-mix(in srgb, var(--couleur) 85%, #fff); }
/* Créneau importé : rayures légères = « vient d'ailleurs », il ne se déplace pas ici. */
.ag-evt.ev-prevu.ev-importe {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--couleur) 18%, var(--surface)) 0 10px,
    color-mix(in srgb, var(--couleur) 12%, var(--surface)) 10px 20px);
  cursor: pointer;
}
.ag-pop-carre.journee { border-radius: 4px; background: var(--couleur); }
.etiquette.importee { color: var(--texte-2); background: var(--surface-3); }
.etiquette.importee::before { display: none; }
.etiquette.erreur { color: #ff8a8a; background: rgba(255, 138, 138, .12); }
.ligne-compte { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ligne); }
.ligne-compte:last-child { border-bottom: 0; }
.ligne-compte .pastille { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700;
  background: color-mix(in srgb, var(--couleur, var(--c1)) 22%, var(--surface)); color: var(--couleur, var(--c1)); text-transform: uppercase; }
.ligne-compte .infos { flex: 1; min-width: 0; }
.ligne-compte .infos b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne-compte .infos small { display: block; color: var(--texte-2); font-size: 13px; margin-top: 2px; }
.ligne-compte .outils { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pin-revele { font: 700 34px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .28em; text-align: center; padding: 18px 10px;
  border-radius: 16px; background: var(--surface-2); margin: 6px 0 12px; user-select: all; }
.aide-etapes { margin: 0; padding-left: 20px; color: var(--texte-2); font-size: 14px; line-height: 1.55; }
.aide-etapes li + li { margin-top: 4px; }
.aide-etapes b { color: var(--texte); }
.bilan-synchro { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin: 10px 0; }
.bilan-synchro div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.bilan-synchro b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.bilan-synchro small { color: var(--texte-2); font-size: 12px; }

/* ------------------------------------------------------------------ v2 : téléphone (essai à 360 px) */
/* Le menu du titre de l'agenda passe au-dessus du bouton « + ». */
.ag-deroulant { z-index: 36; }
/* Une colonne étroite (vue Semaine sur téléphone) : la pastille ne garde que l'emoji ; le fond plein dit « fait ». */
.ag-jcell { container-type: inline-size; }
@container (max-width: 72px) {
  .ag-puce { justify-content: center; padding: 2px 3px; }
  .ag-puce svg, .ag-puce .nom-puce { display: none; }
  .ag-puce span { text-overflow: clip; }
}
@media (max-width: 560px) {
  /* Tâches et comptes : les boutons passent sous le texte au lieu de l'écraser. */
  .ligne-gestion { grid-template-columns: auto 1fr; gap: 4px 12px; padding: 12px 10px 8px 14px; }
  .ligne-gestion .outils { grid-column: 1 / -1; justify-content: flex-end; }
  .ligne-compte { flex-wrap: wrap; row-gap: 8px; }
  .ligne-compte .infos { flex-basis: calc(100% - 50px); }
  .ligne-compte .outils { margin-left: 50px; justify-content: flex-start; }
  /* Vue Mois : début du titre plutôt que « … », et « +4 » plutôt que « + 4 autres ». */
  .ag-mitem .t { text-overflow: clip; }
  .ag-plus .mot { display: none; }
}
@media (max-width: 400px) { .jours { gap: 4px; } .jours button { width: 36px; height: 36px; } }
/* Le titre de l'agenda (« Vendredi 4 décembre ») ne passe jamais à la ligne : sa zone ne rétrécit pas en dessous
   de lui (la barre passe à la ligne à la place), et sur téléphone il a sa propre rangée. Sinon, à 412 px, il
   dépassait de l'écran et le téléphone dézoomait toute la page. */
.ag-titre-zone { min-width: max-content; }
@media (max-width: 760px) { .ag-titre-zone { flex-basis: 100%; min-width: 0; } .ag-titre { max-width: 100%; } }
