/* Téléphone d'abord : tout ce qui n'est pas dans une règle « min-width » est pensé pour un pouce et 360 px.
   Couleurs : orange = ce qui arrive, bleu = ce que l'on prend, vert = les soins. */
:root {
  color-scheme: light dark;
  --haut: env(safe-area-inset-top);
  --nuit: #12284a; --nuit-2: #1d3a66; --sur-nuit: #fff; --sur-nuit-d: #b9c9e2;
  --fond: #edf1f7; --surface: #fff; --creux: #eff3f8; --actif: #dfe7f2;
  --bord: #dde4ee; --regle: #e9eef5; --controle: #bcc7d6;
  --texte: #101a2b; --doux: #52607a;
  --primaire: #12284a; --sur-primaire: #fff; --lien: #1757ac;
  --prise: #257de0; --mal: #f47230; --soin: #00a884; --grille: #e1e7f0;
  --prise-b: #1f6bcb; --soin-b: #007a5f;
  --prise-f: #e3eefc; --mal-f: #fdebe1; --soin-f: #dcf5ee; --prise-t: #1453a3; --mal-t: #a23c08; --soin-t: #00634c;
  --bon-f: #dcfae5; --bon-t: #04250e; --mauvais-f: #ffe7e3; --mauvais-t: #831c1e; --avis-f: #fff2cf; --avis-t: #6f3806; --danger: #b3261e;
  --sur-mal: #2b1003;
  --r: 18px; --rc: 12px; --hc: 46px;
  --chiffre: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  font: 16px/1.45 "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --nuit: #14294b; --nuit-2: #21406f;
    --fond: #0c1422; --surface: #151f31; --creux: #1d2940; --actif: #273654; --bord: #24314a; --regle: #202c43; --controle: #43536f;
    --texte: #f1f5fb; --doux: #a9b6cb; --primaire: #e9f0fb; --sur-primaire: #12284a; --lien: #8fc0f8;
    --prise: #3f97f5; --mal: #f07a3c; --soin: #1fbf9a; --grille: #263349;
    --prise-f: #17304f; --mal-f: #3b2419; --soin-f: #123a34; --prise-t: #a5cffb; --mal-t: #ffb48c; --soin-t: #7fe3cb;
    --bon-f: #14352a; --bon-t: #7fe0b0; --mauvais-f: #3a1f24; --mauvais-t: #ffa8a3; --avis-f: #372c14; --avis-t: #f5cf78; --danger: #ff9790; --sur-mal: #fff;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--fond); color: var(--texte); overflow-wrap: anywhere; }
h1, h2, h3, p, dl, dd, ul, ol, figure, fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
ul { list-style: none; }
h1 { font-size: 27px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; outline: 0; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 650; letter-spacing: -.005em; }
h3 { font-size: 15px; font-weight: 600; }
a { color: var(--lien); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--prise); outline-offset: 2px; }
time, dd, td, .intens, .graphe, .note, .anneau { font-variant-numeric: tabular-nums; }
.note { color: var(--doux); font-size: 14px; }
.saut { position: absolute; left: -999px; }
.saut:focus { left: 8px; top: 8px; z-index: 9; background: var(--surface); padding: 8px; }

/* Icônes et dessins */
.ico { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico .ton { fill: currentColor; stroke: none; opacity: .2; }
.med-d { flex: none; filter: drop-shadow(0 1px 1px rgb(10 25 50 / .28)); }
.m-c { fill: var(--pc); } .m-f { fill: color-mix(in srgb, var(--pc) 76%, #24304a); } .m-p { fill: color-mix(in srgb, var(--pc) 28%, #fff); }
.m-t { fill: none; stroke: color-mix(in srgb, var(--pc) 62%, #24304a); stroke-width: 2.4; stroke-linecap: round; }
.m-v { fill: none; stroke: #fff; stroke-opacity: .75; stroke-width: 2.6; stroke-linecap: round; }
.soin-d { color: var(--soin-t); margin: 0 6px; }
.ic-rang { flex: none; width: 44px; display: grid; place-items: center; color: var(--prise-t); }
.visage { flex: none; }
.visage .peau { fill: color-mix(in srgb, var(--mal) var(--p, 0%), #ffdf8c); }
.visage .trait { fill: none; stroke: #35210f; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.visage[data-n=""] .peau { fill: var(--actif); } .visage[data-n=""] .trait { stroke: var(--doux); }
.logo { flex: none; } .lg-m { fill: var(--mal); } .lg-p { fill: var(--prise); }
[data-n="1"] { --p: 12%; } [data-n="2"] { --p: 20%; } [data-n="3"] { --p: 28%; } [data-n="4"] { --p: 37%; } [data-n="5"] { --p: 46%; }
[data-n="6"] { --p: 55%; } [data-n="7"] { --p: 66%; } [data-n="8"] { --p: 77%; } [data-n="9"] { --p: 88%; } [data-n="10"] { --p: 100%; }

/* Lancement : la ligne du temps passe, ce qui arrive (orange) jaillit, ce que l'on prend (bleu) répond, puis le nom sort du logo.
   Les tailles sont en em, aux proportions de l'en-tête de connexion, où le logo vient se poser. */
#lancement { display: none; }
.lancement #lancement { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; background: #12284a; --mal: #ff8646; --prise: #56a7ff; -webkit-user-select: none; user-select: none; }
.lancement body { overflow: hidden; }
#lancement .marque { gap: .357em; font-size: min(16.5vw, 76px); color: #fff; white-space: nowrap; animation: l-place .7s .95s cubic-bezier(.7, 0, .15, 1) both; }
#lancement .logo { width: 1.0714em; height: 1.0714em; overflow: visible; }
#lancement .logo g { transform-origin: 14px 14px; animation: l-bat .62s 1.5s ease-in-out; }
#lancement.attente .logo g { animation: l-bat 1.1s .2s ease-in-out infinite; }
/* Chaque barre se dessine d'un trait (son tour fait moins de 30), puis se remplit et le trait s'efface. */
#lancement rect { stroke-width: .9; stroke-dasharray: 30; animation: l-trace .62s cubic-bezier(.5, 0, .3, 1) both, l-remplit .32s ease-out both; }
#lancement .lg-m { stroke: var(--mal); } #lancement .lg-p { stroke: var(--prise); }
#lancement rect:nth-child(1) { animation-delay: .2s, .72s; } #lancement rect:nth-child(2) { animation-delay: .3s, .82s; } #lancement rect:nth-child(3) { animation-delay: .4s, .9s; }
#lancement rect:nth-child(4) { animation-delay: .36s, .88s; } #lancement rect:nth-child(5) { animation-delay: .46s, .98s; } #lancement rect:nth-child(6) { animation-delay: .56s, 1.06s; }
#lancement path { fill: none; stroke: #fff; stroke-width: .9; stroke-dasharray: .45 2; animation: l-ligne .75s .1s linear both; }
#lancement .lettres { display: block; clip-path: inset(-.1em -.1em -.06em); }
#lancement i { display: inline-block; font-style: normal; animation: l-lettre .6s cubic-bezier(.2, .9, .25, 1) both; }
#lancement i:nth-child(1) { animation-delay: 1.12s; } #lancement i:nth-child(2) { animation-delay: 1.165s; } #lancement i:nth-child(3) { animation-delay: 1.21s; }
#lancement i:nth-child(4) { animation-delay: 1.255s; } #lancement i:nth-child(5) { animation-delay: 1.3s; } #lancement i:nth-child(6) { animation-delay: 1.345s; }
#lancement small { margin-top: .333em; font-size: .4286em; animation: l-nom .5s 1.55s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes l-place { from { transform: translateX(calc(50% - .5357em)); } }
@keyframes l-trace { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes l-remplit { from { fill-opacity: 0; stroke-opacity: 1; } to { fill-opacity: 1; stroke-opacity: 0; } }
@keyframes l-ligne { from { stroke-dashoffset: .45; } to { stroke-dashoffset: -1; } }
@keyframes l-lettre { from { transform: translateY(115%); } }
@keyframes l-nom { from { opacity: 0; transform: translateX(-.8em); } }
@keyframes l-bat { 0%, 60%, 100% { transform: none; } 14% { transform: scale(1.04, 1.2); } 28% { transform: none; } 42% { transform: scale(1.02, 1.11); } }

/* Coquille */
#principal { width: 100%; padding: calc(18px + var(--haut)) 16px calc(104px + env(safe-area-inset-bottom)); }
.cote { display: none; }
.marque { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 750; letter-spacing: -.03em; color: var(--texte); text-decoration: none; }
.nom-app { display: grid; line-height: 1; }
.nom-app small { margin-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: .01em; opacity: .72; }
.bas { position: fixed; z-index: 5; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--bord); padding-bottom: env(safe-area-inset-bottom); }
.bas > * { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 62px; padding: 0 2px; border: 0; background: none; color: var(--doux); font-size: 12px; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.bas .ico { width: 25px; height: 25px; }
.bas [aria-current] { color: var(--prise-t); font-weight: 650; }
.bas .plus { color: var(--texte); align-content: end; padding-bottom: 9px; }
.bas .plus i { display: grid; place-items: center; width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--mal); color: #1c0d04; border: 4px solid var(--surface); }
.bas .plus .ico { stroke-width: 2.4; width: 27px; height: 27px; }

#reseau { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 8px; padding: calc(7px + env(safe-area-inset-top)) 16px 7px; background: var(--avis-f); color: var(--avis-t); font-size: 14px; font-weight: 600; }
#reseau:not([hidden]) + main { --haut: 0px; }
.corps-page { min-width: 0; }
.bas, .cote { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.invite { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 14px; background: var(--prise-f); }
.invite > * + * { margin: 0; }
.invite > .ico { color: var(--prise-t); }
.invite .actions { grid-column: 1 / -1; justify-content: flex-end; }
.etapes { display: grid; gap: 14px; }
.etapes li { display: flex; align-items: center; gap: 14px; }
.etapes .ico { color: var(--prise-t); }

/* Titre de page */
.tete { margin-bottom: 16px; }
.tete-l { display: grid; gap: 14px; }
.tete-t { display: flex; align-items: center; gap: 14px; }
.tete .sous { color: var(--doux); margin-top: 2px; }
.retour { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin: -6px 0 6px -4px; color: var(--doux); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tete .actions > .btn { flex: 1 1 auto; }
.filtres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.filtres .segs, .filtres .segs + input, .filtres select[hidden] + input { grid-column: 1 / -1; }
.titre-l { margin: 24px 0 10px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: var(--hc); padding: 0 15px; border: 1px solid var(--controle); border-radius: var(--rc); background: var(--surface); color: var(--texte); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primaire { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire); }
.btn.bleu { background: var(--prise-b); border-color: var(--prise-b); color: #fff; }
.btn.vert { background: var(--soin-b); border-color: var(--soin-b); color: #fff; }
.btn.texte { border-color: transparent; background: none; color: var(--lien); padding: 0 8px; }
.btn.danger { color: var(--danger); }
.btn.carre { width: var(--hc); padding: 0; }
.rang .btn { padding: 0 13px; }
.rang .btn.carre { padding: 0; }
.rang .btn.carre:not(.bleu) { border-color: transparent; background: var(--creux); color: var(--doux); }
.segs { display: flex; gap: 3px; padding: 3px; border-radius: var(--rc); background: var(--actif); }
.segs button { flex: 1 1 auto; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--doux); font-weight: 550; }
.segs button[aria-pressed=true] { background: var(--surface); color: var(--texte); font-weight: 650; box-shadow: 0 1px 2px rgb(10 25 50 / .16); }

/* Blocs */
.bloc { background: var(--surface); border-radius: var(--r); padding: 16px; margin-bottom: 14px; }
.bloc > * + * { margin-top: 12px; }
.bloc-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.bloc-tete + .note { margin-top: 2px; }
.vide { color: var(--doux); }
.vide .btn { margin: 4px 0 0 -8px; }
.vide.grand { display: grid; justify-items: center; gap: 12px; padding: 36px 16px; text-align: center; }
.vide.grand .ico { stroke-width: 1.1; color: var(--prise); }
.vide.grand .btn { margin: 0; }
.alerte { background: var(--avis-f); color: var(--avis-t); border-radius: var(--rc); padding: 11px 14px; }
.alerte.grave { background: var(--mauvais-f); color: var(--mauvais-t); }
.puce { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: var(--creux); color: var(--doux); font-size: 14px; white-space: nowrap; }
.puce.bon { background: var(--bon-f); color: var(--bon-t); }
.puce.mauvais { background: var(--mauvais-f); color: var(--mauvais-t); }
.puces-l { display: flex; flex-wrap: wrap; gap: 6px; }
.puces-l .puce { white-space: normal; border-radius: 14px; }

/* Lignes */
.rangs > * + * { border-top: 1px solid var(--regle); }
.rang { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; min-height: 64px; border: 0; background: none; color: inherit; text-align: left; text-decoration: none; }
.rangs > .rang:last-child { padding-bottom: 0; }
.rang-c { flex: 1; min-width: 0; display: block; }
.rang-t { display: block; font-weight: 600; line-height: 1.3; }
.rang-t a { color: inherit; text-decoration: none; }
.rang-s { display: block; color: var(--doux); font-size: 14px; }
.rang > .ico:not(.soin-d) { color: var(--doux); }
.bloc-texte { display: block; white-space: pre-line; }
.fin { display: flex; align-items: center; gap: 6px; flex: none; }
.retard { color: var(--danger); font-weight: 650; }
.dose time { font-weight: 650; }
.fait .med-d, .fait .soin-d { opacity: .45; }
.fait .rang-t { color: var(--doux); }
.moment h3 { display: flex; align-items: center; gap: 8px; color: var(--doux); }
.moment + .moment { margin-top: 18px; }
.moment h3 .ico { color: var(--mal); }
.besoin { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.besoin .btn { padding: 0 14px 0 8px; white-space: normal; text-align: left; }
.jour h2 { margin: 20px 4px 8px; font-size: 16px; }
.rang select { width: auto !important; flex: none; }
.intens { flex: none; position: relative; width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font: 700 18px var(--chiffre); background: color-mix(in srgb, var(--mal) var(--p, 0%), var(--mal-f)); color: var(--mal-t); }
.intens[data-n]:not([data-n=""], [data-n="0"], [data-n="1"], [data-n="2"], [data-n="3"]) { color: var(--sur-mal); }
.intens.avec b { position: absolute; right: -6px; bottom: -6px; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 99px; display: grid; place-items: center; background: var(--surface); color: var(--texte); border: 1px solid var(--bord); font-size: 13px; }
.tete .intens { width: 60px; height: 60px; border-radius: 17px; }
.tete .intens .ico { width: 36px; height: 36px; }
.feuille { flex: none; width: 46px; border-radius: 12px; overflow: hidden; text-align: center; background: var(--creux); }
.feuille span { display: block; padding: 2px 0; background: var(--nuit); color: #fff; font-size: 12px; }
.feuille b { display: block; padding: 2px 0 4px; font: 700 20px/1.2 var(--chiffre); }

/* Anneau de progression */
.anneau { position: relative; flex: none; display: grid; place-items: center; font: 650 13px var(--chiffre); }
.anneau svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke-width: 4; stroke-linecap: round; }
.an-f { stroke: var(--actif); } .an-v { stroke: var(--prise); } .anneau.soin .an-v { stroke: var(--soin); }
.anneau > span { position: relative; }

/* Aujourd'hui : panneau de nuit avec la semaine et le cadran */
.heros { margin: calc(-18px - var(--haut)) -16px 14px; padding: calc(18px + var(--haut)) 16px 18px; background: var(--nuit); color: var(--sur-nuit); border-radius: 0 0 28px 28px; --texte: #fff; --doux: #b9c9e2; --prise: #56a7ff; --mal: #ff8646; --soin: #2fd3ad; }
.heros .sous a { color: var(--sur-nuit-d); }
.page-jour .tete-l { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.page-jour .tete .actions { flex: none; margin-top: -5px; }
.choix-date { position: relative; flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--sur-nuit); background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); transition: background .15s; }
.choix-date:hover { background: rgba(255, 255, 255, .18); }
.choix-date:focus-within { outline: 2px solid var(--sur-nuit); outline-offset: 2px; }
.choix-date .ton { opacity: .35; }
.heros .tete .choix-date input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; color-scheme: dark; }
.choix-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.heros .legende { justify-content: center; margin: 0; }
.semaine { display: grid; grid-template-columns: 20px repeat(7, minmax(0, 1fr)) 20px; align-items: center; margin: 0 -8px; }
.semaine a { color: inherit; text-decoration: none; }
.semaine .fl { display: grid; place-items: center; height: 74px; color: var(--sur-nuit-d); }
.sj { display: grid; justify-items: center; gap: 4px; padding: 6px 0; border-radius: 14px; font-size: 13px; color: var(--sur-nuit-d) !important; }
.sj .anneau { color: #fff; font-size: 14px; }
.sj .an-f { stroke: rgb(255 255 255 / .17); }
.sj > i { width: 6px; height: 6px; border-radius: 50%; }
.sj > i.mal { background: var(--mal); }
.sj[aria-current] { background: var(--nuit-2); color: #fff !important; }
.cadran { position: relative; width: min(100%, 296px); margin: 8px auto 2px; }
.cadran svg { display: block; width: 100%; }
.cd-piste, .cd-nuit, .cd-passe { fill: none; stroke-width: 24; }
.cd-piste { stroke: #24467a; } .cd-nuit { stroke: #1a3560; } .cd-passe { stroke: #6f9edb; stroke-opacity: .34; }
.cd-tic { stroke: #6c86ad; stroke-width: 1.3; }
.cd-h { fill: #b9c9e2; font-size: 12px; }
.cd-alea { fill: none; stroke: #ff8646; stroke-width: 8; stroke-linecap: round; }
.cd-aiguille { stroke: #fff; stroke-width: 3.5; stroke-linecap: round; }
.cd-libre { fill: #56a7ff; stroke: #12284a; stroke-width: 2; } .cd-libre.soin { fill: #2fd3ad; }
.cd-marque circle { stroke-width: 3; }
.cd-marque text { font: 700 14px var(--chiffre); }
.cd-marque path { fill: none; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.cd-marque.attente circle { fill: #12284a; stroke: #56a7ff; } .cd-marque.attente text { fill: #fff; }
.cd-marque.fait circle { fill: #56a7ff; stroke: #12284a; } .cd-marque.fait path { stroke: #0b1c36; }
.cd-marque.retard circle { fill: #fff; stroke: #56a7ff; } .cd-marque.retard text { fill: #12284a; }
.cd-marque.saute circle { fill: #3a5580; stroke: #12284a; } .cd-marque.saute path { stroke: #dbe6f7; }
.cd-centre { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; pointer-events: none; text-align: center; }
.cd-centre b { font: 700 46px/1 var(--chiffre); letter-spacing: -.03em; }
.cd-centre span { max-width: 112px; margin-top: 4px; color: var(--sur-nuit-d); font-size: 14px; line-height: 1.25; }

/* Tuiles illustrées */
.tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tuiles button { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 82px; padding: 9px 3px 8px; border: 2px solid transparent; border-radius: 15px; background: var(--creux); font-size: 13.5px; line-height: 1.2; font-weight: 550; overflow-wrap: normal; hyphens: auto; }
.tuiles button:active { transform: scale(.96); }
.tuiles.mal button, .tuiles button.mal { background: var(--mal-f); color: var(--mal-t); }
.tuiles button.prise { background: var(--prise-f); color: var(--prise-t); }
.tuiles button.soin { background: var(--soin-f); color: var(--soin-t); }
.tuiles button[aria-pressed=true] { border-color: var(--prise); background: var(--prise-f); color: var(--prise-t); font-weight: 700; }
.tuiles.mal button[aria-pressed=true] { border-color: var(--mal); background: var(--mal-f); color: var(--mal-t); }
.tuiles.trois, .tuiles.formes { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.tuiles.meds { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 8px; }
.tuiles.meds button { grid-template-columns: 40px minmax(0, 1fr); justify-items: start; align-items: center; text-align: left; min-height: 62px; padding: 6px 8px; }
.tuiles.couleurs { display: flex; flex-wrap: wrap; gap: 6px; }
.tuiles.couleurs button { min-height: 44px; width: 44px; padding: 0; background: none; border-radius: 50%; }
.tuiles.couleurs i { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(10 25 50 / .25); }
.tuiles.couleurs span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tuiles.mesures { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.tuiles.mesures button { flex: 0 0 140px; justify-items: start; align-content: space-between; padding: 12px; background: var(--surface); min-height: 108px; text-align: left; }
.tuiles.mesures .ico { color: var(--prise-t); }
.tuiles.mesures b { font: 700 18px/1.15 var(--chiffre); color: var(--texte); }
.tuiles.mesures button[aria-pressed=true] { background: var(--prise-f); }

/* Médicaments */
.meds-g { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.med { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 10px 12px; align-items: center; padding: 14px; border-radius: var(--r); background: var(--surface); color: inherit; text-decoration: none; }
.med b { display: block; line-height: 1.25; }
.med small { color: var(--doux); font-size: 14px; }
.med-n { text-align: right; }
.med-n b { font: 700 26px/1 var(--chiffre); }
.bande { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; height: 20px; }
.bande i { border-radius: 3px; background: var(--actif); }
.bande i.oui { background: var(--prise); }
.med-p { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; }
.med-p span { display: inline-flex; align-items: center; gap: 5px; }
.bas-stock { color: var(--danger); font-weight: 650; }

/* Calendrier du journal */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-j { text-align: center; font-size: 13px; color: var(--doux); }
.cal-c { position: relative; display: grid; place-items: center; aspect-ratio: 1; max-height: 52px; width: 100%; border-radius: 12px; background: var(--creux); color: inherit; text-decoration: none; font: 600 15px var(--chiffre); }
.cal-c.mal { background: color-mix(in srgb, var(--mal) var(--p, 0%), var(--mal-f)); }
.cal-c.mal[data-n] { color: var(--sur-mal); }
@media (prefers-color-scheme: dark) { .intens:is([data-n="8"], [data-n="9"], [data-n="10"]), .cal-c.mal:is([data-n="8"], [data-n="9"], [data-n="10"]) { color: #1f0b02 !important; } }
.cal-c.futur { background: none; color: var(--doux); font-weight: 400; }
.cal-c.auj { outline: 2px solid var(--texte); outline-offset: -2px; }
.cal-c i { position: absolute; bottom: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--prise-b); box-shadow: 0 0 0 1.5px #fff; }

/* Chiffres, détails, tableaux */
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
.chiffres > div { display: flex; flex-direction: column; }
.chiffres dt, .infos dt { color: var(--doux); font-size: 14px; line-height: 1.3; }
.chiffres dd { font: 700 23px/1.3 var(--chiffre); letter-spacing: -.01em; }
.part { display: block; height: 8px; margin-top: 5px; border-radius: 99px; background: var(--actif); overflow: hidden; }
.part i { display: block; height: 100%; border-radius: 99px; background: var(--prise); } .part.mal i { background: var(--mal); }
.infos > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 6px 0; }
.infos dd { white-space: pre-line; }
.table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 400; }
thead th { color: var(--doux); font-size: 13.5px; padding: 4px 12px 8px 0; vertical-align: bottom; }
tbody th, td { padding: 10px 12px 10px 0; border-top: 1px solid var(--regle); vertical-align: middle; }
tbody th { font-weight: 600; }
tr > :last-child { padding-right: 0; }
.num + :not(.num) { padding-left: 12px; }
.num { text-align: right; white-space: nowrap; }
th small { display: block; color: var(--doux); font-weight: 400; font-size: 13.5px; }
tbody a { color: inherit; }
.avec-d { display: flex; align-items: center; gap: 10px; }
.avec-d.mal .ico { color: var(--mal-t); }

/* Formulaires */
input:not([type=checkbox]):not([type=file]), select, textarea { width: 100%; min-height: var(--hc); padding: 8px 12px; border: 1px solid var(--controle); border-radius: var(--rc); background: var(--surface); font-size: 16px; }
input[type=file] { width: 100%; }
textarea { resize: vertical; display: block; }
::placeholder { color: var(--doux); opacity: .9; }
.form, .grille-form { display: grid; gap: 18px; }
.grille-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px 10px; }
.grille-form > * { grid-column: 1 / -1; }
.grille-form > .demi { grid-column: auto; }
.grille-form > .demi:has([type=datetime-local]) { grid-column: 1 / -1; }
.grille-form > h3 { margin-top: 4px; font-size: 17px; }
.lab, legend { display: block; font-weight: 600; font-size: 15px; margin-bottom: 7px; padding: 0; }
.champ > .note { margin-top: 6px; }
.avec-unite { display: flex; align-items: center; gap: 8px; }
.avec-unite span { color: var(--doux); white-space: nowrap; }
.coche { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.coche input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--prise-b); }
.coche small { display: block; color: var(--doux); font-size: 14px; }
.puces { display: flex; flex-wrap: wrap; gap: 7px; }
.puces button { display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 13px; border: 1px solid var(--controle); border-radius: 99px; background: var(--surface); }
.puces button[aria-pressed=true] { background: var(--primaire); border-color: var(--primaire); color: var(--sur-primaire); }
.puces input { width: 170px !important; flex: 1 1 150px; min-height: 42px !important; border-radius: 99px !important; }
.echelle-v { display: grid; grid-template-columns: 56px auto 1fr; align-items: center; gap: 12px; margin-bottom: 8px; color: var(--doux); }
.echelle-v b { min-width: 34px; font: 700 40px/1 var(--chiffre); color: var(--texte); }
.echelle { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 3px; }
.echelle button { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 88px; padding: 0; border: 0; background: none; font: 600 15px var(--chiffre); color: var(--doux); touch-action: manipulation; }
.echelle i { width: 100%; height: calc(10px + var(--p, 0%) * .5); border-radius: 6px; background: color-mix(in srgb, var(--mal) var(--p, 0%), var(--mal-f)); }
.echelle button[aria-pressed=true] { color: var(--texte); }
.echelle button[aria-pressed=true] i { outline: 3px solid var(--texte); outline-offset: -1px; }
.heures { display: flex; flex-wrap: wrap; gap: 8px; }
.heure { display: inline-flex; }
.heure input { width: 122px !important; }
.heure button { border: 0; background: none; min-width: 36px; padding: 0 6px; color: var(--doux); }
.rappels { display: grid; gap: 6px; }
.corps { display: grid; grid-template-columns: repeat(2, minmax(0, 190px)); justify-content: center; gap: 4px 12px; text-align: center; }
.corps > p { grid-column: 1 / -1; }
.corps figcaption { color: var(--doux); font-size: 14px; }
.corps.mini { grid-template-columns: repeat(2, 112px); justify-content: start; }
.silhouette { width: 100%; }
/* Modèle 3D : la toile prend la largeur, les zones choisies sont orange, comme les aléas */
.c3 { --c3-base: color-mix(in srgb, var(--prise) 22%, var(--actif)); --c3-survol: color-mix(in srgb, var(--mal) 40%, var(--actif)); --c3-neutre: color-mix(in srgb, var(--prise) 15%, var(--actif)); display: grid; gap: 8px; }
.c3-scene { position: relative; height: min(430px, 58vh); border-radius: var(--rc); background: radial-gradient(ellipse at 50% 42%, var(--surface), var(--creux) 75%); overflow: hidden; }
.c3-attente { height: min(430px, 58vh); }
.c3-toile { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.c3-toile:active { cursor: grabbing; }
.c3-nom { position: absolute; top: 10px; left: 0; right: 0; text-align: center; font-weight: 650; font-size: 15px; pointer-events: none; min-height: 1.4em; }
.c3-cote { position: absolute; bottom: 10px; padding: 2px 9px; border-radius: 99px; background: var(--surface); color: var(--doux); font-size: 13px; pointer-events: none; }
.c3-cote.g { left: 10px; } .c3-cote.d { right: 10px; }
.c3-outils { display: flex; gap: 8px; } .c3-espace { flex: 1; }
.c3-outils .btn { min-width: var(--hc); }
.c3-liste summary { cursor: pointer; color: var(--lien); padding: 6px 0; font-size: 15px; }
.c3-liste .puces { margin-top: 6px; }
.zone { fill: color-mix(in srgb, var(--prise) 22%, var(--actif)); stroke: var(--surface); stroke-width: 1.4; }
.chair { fill: color-mix(in srgb, var(--prise) 22%, var(--actif)); }
.zone[role] { cursor: pointer; }
.zone[aria-pressed=true] { fill: var(--mal); }
.zone:focus-visible { outline: none; stroke: var(--texte); stroke-width: 3; }
.recherche { margin-bottom: 18px; padding: 14px; border-radius: 15px; background: var(--prise-f); }
.recherche > .note { margin-top: 6px; }
.recherche > .btn { width: 100%; margin-bottom: 12px; }
.reconnue { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; padding: 12px 14px; border-radius: var(--rc); background: var(--bon-f); color: var(--bon-t); }
.visee { position: relative; aspect-ratio: 1; max-height: 52vh; margin-inline: auto; overflow: hidden; border-radius: var(--r); background: #0b1526; }
.visee video { display: block; width: 100%; height: 100%; object-fit: cover; }
.visee > i { position: absolute; inset: 17%; border-radius: 16px; box-shadow: 0 0 0 999px rgb(8 18 36 / .5); outline: 3px solid #fff; }
.visee .torche { position: absolute; right: 10px; bottom: 10px; }
.visee .torche[aria-pressed="true"] { background: #ffdf8c; color: #35210f; }
.visee + .note { text-align: center; min-height: 42px; }
.code-main > div { display: flex; gap: 8px; }
.code-main input { flex: 1; min-width: 0; }
.resultats { max-height: 290px; overflow: auto; }
.resultats:not(:empty) { margin-top: 8px; border-radius: var(--rc); background: var(--surface); }
.resultats button { display: block; width: 100%; min-height: 48px; text-align: left; border: 0; background: none; padding: 8px 12px; }
.resultats button + button { border-top: 1px solid var(--regle); }
.resultats button:focus-visible { background: var(--creux); outline-offset: -2px; }
.resultats small { display: block; color: var(--doux); }
.resultats .note { padding: 10px 12px; }

/* Dialogues : feuille qui monte du bas sur téléphone */
dialog { position: fixed; inset: auto 0 0; margin: 0; width: 100%; max-width: none; max-height: 93vh; max-height: 93dvh; border: 0; border-radius: 24px 24px 0 0; padding: 0; background: var(--surface); color: var(--texte); overflow: auto; overscroll-behavior: contain; }
@keyframes monte { from { transform: translateY(48px); opacity: .4; } }
dialog::backdrop { background: rgb(6 14 28 / .55); }
dialog.bloque .croix { display: none; }
.dlg-tete { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 10px 10px 18px; background: var(--surface); }
.dlg-tete h2 { font-size: 20px; }
.croix { border: 0; background: var(--creux); width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--doux); flex: none; }
.dlg-corps { padding: 4px 18px 0; }
.dlg-corps > * + * { margin-top: 16px; }
.dlg-pied { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); background: var(--surface); }
.dlg-pied .primaire { flex: 1 1 auto; }
.ressort { display: none; }
.menu-l { display: grid; gap: 8px; padding: 4px 14px calc(18px + env(safe-area-inset-bottom)); }
.menu-l button { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 16px; border: 0; border-radius: 16px; background: var(--creux); text-align: left; font-weight: 650; }
.menu-l .ico { color: var(--prise-t); }
.menu-l .mal { background: var(--mal-f); } .menu-l .mal .ico { color: var(--mal-t); }
.menu-l .prise { background: var(--prise-f); }
.menu-l .soin { background: var(--soin-f); } .menu-l .soin .ico { color: var(--soin-t); }
.menu-l small { display: block; color: var(--doux); font-weight: 400; font-size: 14px; }
.en-tuiles .menu-l { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.en-tuiles .menu-l button { flex-direction: column; justify-content: center; gap: 6px; min-height: 92px; text-align: center; }
.en-tuiles .menu-l button:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 66px; }
.apercu { display: block; max-width: 100%; max-height: 70vh; margin: auto; }
#toasts { position: fixed; z-index: 50; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 24px); }
.toast { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 15px; background: var(--primaire); color: var(--sur-primaire); box-shadow: 0 8px 24px rgb(6 14 28 / .3); }
.toast button { border: 0; background: none; font-weight: 700; text-decoration: underline; padding: 6px; white-space: nowrap; }
.toast.ko { background: var(--mauvais-f); color: var(--mauvais-t); }

/* Graphiques */
.graphe { width: 100%; overflow: hidden; }
.graphe svg { display: block; }
.graphe text { fill: var(--doux); font-size: 12px; }
.graphe .grille { stroke: var(--grille); }
.graphe .mal { fill: var(--mal); } .graphe .prise { fill: var(--prise); } .graphe .soin { fill: var(--soin); }
.graphe .pale { opacity: .4; }
.graphe .cible { fill: transparent; }
.graphe rect.cible:hover { fill: var(--texte); fill-opacity: .06; }
.graphe path.trace { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.graphe .trace.mal { stroke: var(--mal); } .graphe .trace.prise { stroke: var(--prise); }
.graphe .point { stroke: var(--surface); stroke-width: 2; }
.legende { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--doux); font-size: 14px; margin-bottom: 8px; }
.legende span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 4px; margin-right: 7px; }
.legende .rond::before { width: 8px; height: 8px; border-radius: 50%; }
.legende .l-mal::before { background: var(--mal); } .legende .l-prise::before { background: var(--prise); }
.cal-b .legende { margin-bottom: 0; }
.bulle { position: fixed; z-index: 60; pointer-events: none; padding: 8px 12px; border-radius: var(--rc); background: var(--primaire); color: var(--sur-primaire); font-size: 14px; max-width: 260px; }
.bulle b, .bulle span { display: block; }
.barres li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 6px 0; }
.barres b { font-weight: 600; font-variant-numeric: tabular-nums; }
.barres i { grid-column: 1 / -1; height: 12px; border-radius: 4px 99px 99px 4px; min-width: 4px; }
.barres i.prise { background: var(--prise); } .barres i.mal { background: var(--mal); }
.barres li.note { display: block; }
.grille-h { display: grid; grid-template-columns: 36px repeat(8, minmax(0, 1fr)); gap: 3px; font-size: 13px; color: var(--doux); }
.grille-h .case { height: 30px; border-radius: 7px; background: color-mix(in srgb, var(--prise) calc(var(--f) * 100%), var(--creux)); }
.grille-h .case.mal { background: color-mix(in srgb, var(--mal) calc(var(--f) * 100%), var(--creux)); }
.grille-h .gj { align-self: center; }
.creneaux > div { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; padding: 3px 0; }
.creneaux > div > span { color: var(--doux); font-size: 14px; }
.creneaux > div > div { display: flex; flex-wrap: wrap; gap: 6px; }
.creneaux button { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-width: 76px; min-height: 42px; border-radius: 12px; border: 1px solid transparent; font-variant-numeric: tabular-nums; }
.creneaux .oui { background: var(--prise-f); color: var(--prise-t); }
.creneaux .non { background: var(--mauvais-f); color: var(--mauvais-t); }
.creneaux .trou { background: none; border: 1.5px dashed var(--controle); }
.creneaux .futur { background: var(--creux); color: var(--doux); }

/* Connexion */
.porte { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.porte-boite { width: min(400px, 100%); display: grid; gap: 16px; }
.porte .btn.primaire { min-height: 52px; }
.porte.accueil { place-items: start center; align-content: start; padding: 0 0 32px; background: var(--surface); }
.porte-fond { position: relative; width: 100%; height: 190px; overflow: hidden; background: var(--nuit); border-radius: 0 0 28px 28px; padding: calc(22px + env(safe-area-inset-top)) 20px; --mal: #ff8646; --prise: #56a7ff; }
.porte-fond .marque { color: #fff; font-size: 28px; }
.decor { position: absolute; width: 330px; right: -70px; top: 18px; pointer-events: none; }
.decor .cadran { width: 100%; margin: 0; }
.accueil .porte-boite { padding: 26px 20px 0; width: min(440px, 100%); }
.liens { display: flex; justify-content: space-between; flex-wrap: wrap; margin: 0 -8px; }
.pages-pub { display: flex; flex-wrap: wrap; gap: 0 18px; margin-top: 8px; font-size: 14px; }
.pages-pub a { padding: 8px 0; color: var(--doux); }
.code-secret { padding: 16px; border-radius: var(--rc); background: var(--creux); font-size: 17px; font-weight: 650; text-align: center; letter-spacing: .03em; user-select: all; overflow-wrap: normal; }
.qr { display: block; width: 208px; margin: 0 auto; border-radius: var(--rc); }
.secret { user-select: all; color: var(--texte); }

/* Bilan */
.papier { background: var(--surface); border-radius: var(--r); padding: 20px 16px; }
.papier .bloc { padding: 0; margin: 24px 0 0; border-radius: 0; }
.papier-tete { display: grid; gap: 12px; }
.papier-tete h2 { font-size: 20px; }
.papier > .note { margin-top: 24px; }
.texte-long { white-space: pre-line; }

/* Tableaux en fiches sur téléphone : chaque valeur garde son intitulé */
@media screen and (max-width: 760px) {
  .table thead { position: absolute; left: -9999px; }
  .table table, .table tbody { display: block; }
  .table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--regle); }
  .table tr:first-child { border-top: 0; padding-top: 0; }
  .table tbody th, .table td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; }
  .table tbody th { grid-column: 1 / -1; padding-bottom: 2px; }
  .table td::before { content: attr(data-c); display: block; color: var(--doux); font-size: 13.5px; }
}
@media (max-width: 599px) {
  .rang.empile { flex-wrap: wrap; }
  .empile .fin { width: 100%; }
  .empile .fin .btn { flex: 1; }
}
@media (max-width: 350px) {
  .tuiles button { font-size: 12.5px; }
  .echelle button { font-size: 13px; }
}

/* Tablette et grand téléphone couché */
@media (min-width: 600px) {
  .filtres { display: flex; flex-wrap: wrap; }
  .filtres input[type=search] { flex: 1 1 180px; }
  .filtres select { width: auto; }
  .chiffres { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .meds-g { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .grille-form > .demi:has([type=datetime-local]) { grid-column: auto; }
  .tuiles.rapide { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); }
  dialog { inset: 0; margin: auto; width: min(600px, calc(100vw - 32px)); max-height: min(92vh, 900px); height: fit-content; border-radius: 22px; }
  dialog.petit { width: min(440px, calc(100vw - 32px)); }
  dialog.large { width: min(960px, calc(100vw - 32px)); }
  .dlg-pied .primaire { flex: none; }
  .ressort { display: block; flex: 1; }
}

/* Ordinateur */
@media (min-width: 761px) {
  :root { --hc: 40px; font-size: 15px; }
  html { scrollbar-gutter: stable; }
  #app:has(> .cote) { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
  #principal { max-width: 1240px; padding: 28px 32px 56px; }
  .bas { display: none; }
  .cote { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 24px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); }
  .cote .marque { padding: 0 10px 18px; }
  .cote .noter { margin: 0 0 14px; min-height: 46px; }
  .cote a:not(.marque) { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--rc); color: var(--doux); text-decoration: none; font-weight: 550; }
  .cote a:not(.marque):hover { color: var(--texte); background: var(--creux); }
  .cote a[aria-current] { color: var(--prise-t) !important; background: var(--prise-f) !important; font-weight: 650; }
  .cote hr { width: 100%; border: 0; border-top: 1px solid var(--bord); margin: 8px 0; }
  .tete { margin-bottom: 20px; }
  .tete-l { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; }
  .tete .actions > .btn { flex: none; }
  .bloc { padding: 18px 20px; margin-bottom: 16px; }
  .btn:hover:not(:disabled) { background: var(--creux); }
  .btn.primaire:hover:not(:disabled), .btn.bleu:hover, .btn.vert:hover { opacity: .88; background: var(--primaire); }
  .btn.bleu:hover { background: var(--prise-b); } .btn.vert:hover { background: var(--soin-b); }
  .segs button { min-height: 34px; padding: 0 13px; }
  .rang-t a:hover, a.rang:hover .rang-t { text-decoration: underline; }
  .tuiles button:hover, .menu-l button:hover, .med:hover { box-shadow: inset 0 0 0 2px var(--controle); }
  .cal-c:not(.futur):hover { box-shadow: inset 0 0 0 2px var(--doux); }
  .zone[role]:not([aria-pressed=true]):hover { fill: var(--controle); }
  .resultats button:hover { background: var(--creux); }
  .tuiles.mesures { flex-wrap: wrap; margin: 0 0 16px; padding: 0; }
  .puces button, .puces input { min-height: 36px !important; }
  .creneaux button { min-height: 34px; }
  .infos > div { grid-template-columns: 128px minmax(0, 1fr); }
  .papier { padding: 28px 32px; }
  .papier table { font-size: 14px; }
  #toasts { bottom: 24px; }
  .heros { margin: 0 0 16px; border-radius: 24px; padding: 22px 20px 20px; }
  .porte.accueil { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); place-items: center; align-content: stretch; padding: 0; }
  .porte-fond { height: 100vh; border-radius: 0; padding: 36px 40px; }
  .decor { width: min(78%, 560px); right: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); }
  .accueil .porte-boite { padding: 32px 24px; }
}
@media (min-width: 1000px) {
  .deux { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 0 16px; align-items: start; }
  .deux.egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deux.egal > :only-child { grid-column: 1 / -1; }
  .deux.inverse { grid-template-columns: 372px minmax(0, 1fr); gap: 0 20px; }
  .deux.inverse .cal-b, .page-jour .heros { position: sticky; top: 28px; }
  .page-jour { display: grid; grid-template-columns: 372px minmax(0, 1fr); gap: 0 20px; align-items: start; }
}
@media (display-mode: standalone) { body { overscroll-behavior-y: none; } }
.texte-long { display: grid; gap: 8px; max-width: 68ch; overflow-wrap: anywhere; }
.texte-long p { margin: 0; }
.texte-long .puce-l { position: relative; padding-left: 18px; }
.texte-long .puce-l::before { content: ''; position: absolute; left: 4px; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .55; }
.texte-long details > p { margin-top: 8px; }
.texte-long summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.texte-long + .note { margin-top: 12px; }

.sous-titre { margin: 22px 0 12px; }

/* Mouvement. « entre » : on arrive sur la page. « trace-g » : les graphiques se dessinent. « neuf » et « saut » : ce qui vient de changer.
   Tout part d'un état décalé et finit dans l'état normal : sans animation, la page est simplement complète. */
:root { --ressort: cubic-bezier(.3, 1.55, .5, 1); --doucement: cubic-bezier(.2, .8, .2, 1); }
.btn, .tuiles button, .menu-l button, .puces button, .segs button, .med, .croix, .cal-c, .sj { transition: transform .22s var(--ressort), background-color .18s, color .18s, border-color .18s, box-shadow .18s, opacity .18s; }
.btn:active, .tuiles button:active, .menu-l button:active, .puces button:active, .cal-c:not(.futur):active, .med:active, .croix:active { transform: scale(.95); transition-duration: .06s; }
.zone { transition: fill .2s; }
.bas a, .bas button { transition: color .2s; }
.bas .ico { transition: transform .3s var(--ressort); }
.bas > :active .ico { transform: scale(.86); }
.bas .plus i { transition: transform .3s var(--ressort); }
.bas .plus:active i { transform: scale(.9) rotate(90deg); }
.bas::before { content: ""; position: absolute; top: -1px; left: 0; width: 20%; height: 3px; background: linear-gradient(var(--prise), var(--prise)) center / 34px 3px no-repeat; transform: translateX(calc(var(--n, 0) * 100%)); transition: transform .38s cubic-bezier(.5, 1.25, .5, 1); }
.bas [aria-current] .ico, .cote [aria-current] .ico { animation: m-pop .45s var(--ressort); }

.entre .tete, .entre .bloc, .entre .papier, .entre .med, .entre .filtres, .entre .jour > h2 { animation: m-monte .46s calc(var(--i, 0) * 45ms) var(--doucement) backwards; }
.entre .med { animation-delay: calc(var(--j, 0) * 45ms); }
.entre .heros .tete { animation-name: m-fond; }
.entre .rangs > *, .entre .tuiles > *, .entre .besoin > *, .entre .barres > li, .porte.entre .porte-boite > * { animation: m-monte .4s calc(var(--i, 0) * 45ms + var(--j, 0) * 30ms + 70ms) var(--doucement) backwards; }
.entre .rang .med-d, .entre .rang .intens, .entre .rang .ic-rang, .entre .rang .feuille, .entre .tuiles > * > .ico, .entre .med .med-d, .entre .vide.grand .ico { animation: m-pop .5s calc(var(--i, 0) * 45ms + var(--j, 0) * 30ms + 170ms) var(--ressort) backwards; }
.entre .cal-c { animation: m-pop .34s calc(var(--j, 0) * 22ms + 80ms) var(--doucement) backwards; }
.entre .sj { animation: m-monte .4s calc(var(--j, 0) * 35ms) var(--doucement) backwards; }
.entre .an-v { animation: m-anneau .8s calc(var(--j, 0) * 40ms + 150ms) var(--doucement) backwards; }

.entre .cd-piste, .entre .cd-nuit, .entre .cd-tic, .entre .cd-h { animation: m-fond .4s backwards; }
.entre .cd-passe { animation: m-trait .9s .1s cubic-bezier(.4, 0, .2, 1) backwards; }
.entre .cd-aiguille { transform-origin: 150px 150px; animation: m-tour .9s .1s cubic-bezier(.4, 0, .2, 1) backwards; }
.entre .cd-alea { animation: m-trait .6s .6s var(--doucement) backwards; }
.cd-marque, .cd-libre { transform-box: fill-box; transform-origin: center; }
.entre .cd-marque, .entre .cd-libre { animation: m-pop .5s calc(var(--h, 0) * 32ms + 180ms) var(--ressort) backwards; }
.entre .cd-centre { animation: m-pop .5s .15s var(--ressort) backwards; }

.trace-g .graphe path:not(.trace) { transform-box: fill-box; transform-origin: 50% 100%; animation: m-barre .5s calc(var(--k, 0) * 420ms + 120ms) var(--doucement) backwards; }
.trace-g .graphe path.vers-bas { transform-origin: 50% 0; }
.trace-g .graphe .trace { animation: m-trait 1s .15s cubic-bezier(.4, 0, .2, 1) backwards; }
.trace-g .graphe .point { transform-box: fill-box; transform-origin: center; animation: m-pop .4s calc(var(--k, 0) * 850ms + 180ms) var(--ressort) backwards; }
.trace-g .part i, .trace-g .barres i { transform-origin: 0 50%; animation: m-large .65s calc(var(--j, 0) * 40ms + 160ms) var(--doucement) backwards; }
.trace-g .bande { animation: m-volet .7s calc(var(--j, 0) * 45ms + 150ms) var(--doucement) backwards; }
.trace-g .grille-h { animation: m-volet .7s .12s var(--doucement) backwards; }

.neuf { border-radius: 12px; animation: m-neuf 1.1s var(--doucement); }
.neuf .med-d, .neuf .soin-d, .neuf .intens, .neuf .puce { animation: m-pop .5s .06s var(--ressort) backwards; }
.neuf .puce .ico { stroke-dasharray: 26; animation: m-coche .45s .2s var(--doucement) backwards; }
.saut { animation: m-saut .55s var(--ressort); }
.cd-centre b.saut { display: inline-block; }

dialog { opacity: 0; transform: translateY(60%); pointer-events: none; transition: opacity .2s, transform .24s cubic-bezier(.5, 0, .8, .4), overlay .24s allow-discrete, display .24s allow-discrete; }
dialog[open] { opacity: 1; transform: none; pointer-events: auto; animation: monte .36s cubic-bezier(.2, 1.1, .3, 1); }
dialog::backdrop { opacity: 0; transition: opacity .24s, overlay .24s allow-discrete, display .24s allow-discrete; }
dialog[open]::backdrop { opacity: 1; animation: m-fond .24s; }
dialog .grille-form > *, .menu-l button { animation: m-monte .34s .06s var(--doucement) backwards; }
:is(dialog .grille-form, .menu-l) > :nth-child(2) { animation-delay: .09s; } :is(dialog .grille-form, .menu-l) > :nth-child(3) { animation-delay: .12s; }
:is(dialog .grille-form, .menu-l) > :nth-child(4) { animation-delay: .15s; } :is(dialog .grille-form, .menu-l) > :nth-child(n+5) { animation-delay: .18s; }
.tuiles button[aria-pressed=true] > :first-child { animation: m-saut .45s var(--ressort); }
.puces button[aria-pressed=true], .segs button[aria-pressed=true] { animation: m-choix .28s var(--ressort); }
.echelle i { transform-origin: 50% 100%; animation: m-barre .45s calc(var(--j, 0) * 28ms + 160ms) var(--ressort) backwards; }
.echelle button[aria-pressed=true] i { animation: m-rebond .4s var(--ressort); }
.echelle-v .visage { animation: m-saut .4s var(--ressort); }
.echelle-v .visage:is([data-n="8"], [data-n="9"], [data-n="10"]) { animation: m-secoue .5s; }
.toast { animation: m-toast .42s var(--ressort); transition: opacity .2s, transform .2s; }
.toast.part { opacity: 0; transform: translateY(14px) scale(.96); }
#reseau { animation: m-descend .3s var(--doucement); }
.lancement:not(.revele) #app * { animation-play-state: paused !important; }
@keyframes m-fond { from { opacity: 0; } }
@keyframes m-monte { from { opacity: 0; transform: translate(var(--dx, 0), 14px); } }
@keyframes m-pop { from { opacity: 0; transform: scale(.55); } }
@keyframes m-saut { 35% { transform: scale(1.2); } }
@keyframes m-choix { 0% { transform: scale(.93); } }
@keyframes m-rebond { 35% { transform: scaleY(1.22); } }
@keyframes m-secoue { 20%, 60% { transform: rotate(-9deg); } 40%, 80% { transform: rotate(9deg); } }
@keyframes m-barre { from { transform: scaleY(0); } }
@keyframes m-large { from { transform: scaleX(0); } }
@keyframes m-volet { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }
@keyframes m-trait { from { stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: 0; } 1% { opacity: 1; } to { stroke-dasharray: 1 1; stroke-dashoffset: 0; } }
@keyframes m-anneau { from { stroke-dasharray: 0 120; opacity: 0; } 5% { opacity: 1; } }
@keyframes m-tour { from { transform: rotate(var(--tour)); } }
@keyframes m-coche { from { stroke-dashoffset: 26; } }
@keyframes m-neuf { 0% { opacity: 0; transform: translateY(10px); } 30% { opacity: 1; transform: none; background: var(--prise-f); } 60% { background: var(--prise-f); } }
@keyframes m-toast { from { opacity: 0; transform: translateY(28px) scale(.9); } }
@keyframes m-descend { from { transform: translateY(-100%); } }
@media (min-width: 600px) { dialog { transform: translateY(16px) scale(.97); } @keyframes monte { from { transform: translateY(26px) scale(.96); opacity: 0; } } }
@media (min-width: 761px) { .med:hover, .tuiles button:hover { transform: translateY(-2px); } .cote a:not(.marque) { transition: background-color .18s, color .18s; } .cote a:not(.marque) .ico { transition: transform .25s var(--ressort); } .cote a:not(.marque):hover .ico { transform: scale(1.12); } }
@media print { dialog, .entre *, .trace-g * { animation: none !important; } }

@media (prefers-reduced-motion: reduce) { *, ::before, ::backdrop, dialog[open] { transition: none !important; animation: none !important; } }

@media print {
  :root { color-scheme: light; --fond: #fff; --surface: #fff; --texte: #000; --doux: #444; --bord: #ccc; --regle: #ddd; --creux: #f1f2f2; --actif: #e5e8ec; --mal: #f47230; --prise: #257de0; --grille: #ddd; font-size: 12px; }
  * { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .intens, .cal-c { color: #2b1003 !important; }
  #reseau, .cote, .bas, .tete .actions, .tete .sous, .reglages, #toasts, .bulle { display: none !important; }
  #app:has(> .cote) { display: block; }
  #principal { padding: 0; max-width: none; }
  .papier { padding: 0; }
  .papier table { font-size: 11px; }
  .bloc, tr { break-inside: avoid; }
  .bloc:has(table) { break-inside: auto; }
  .tete:has(+ .reglages) { display: none; }
  a { color: inherit; text-decoration: none; }
  .graphe { height: auto !important; }
  .graphe svg { width: 100%; height: auto; }
}
