/* HorloBox — onglet L'Écrin. Palette et typographie : design/prompt-claude-design.md et maquette V1.4. */
@font-face { font-family: "Bodoni Moda"; font-weight: 400 600; font-display: swap; src: url(polices/bodoni-moda-latin.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400 600; font-display: swap; src: url(polices/inter-latin.woff2) format("woff2"); }

:root {
  --fond: #14171c; /* Noir encre (essai du 22/11, avant : #0b0b0c) */
  --carte: #1c2027;
  --carte-2: #252a32;
  --filet: rgb(var(--reflet) / 0.06);
  --texte: #f2ede4;
  --texte-2: #9a948c;
  --champagne: #ece5de; /* Nacre (essai du 22/11, avant : #c8a96a) */
  --accent: var(--champagne); /* nacre, sans couleur d'accent ; l'actif ressort par inversion et graisse (essais : or rose #c48b7a, laiton #bfa27a, bleu acier #7f9bb8, or ancien #b08d57, émeraude #2f8a68) : états actifs seulement (22/11) */
  --lueur: #ffd9a0;
  --alerte: #d9705f; /* 5,01:1 sur --carte, 5,50:1 sur --fond ; jamais sur --carte-2 (4,42:1) ni sur fond teinté */
  /* Canaux des couleurs translucides (rgb(var(--encre) / 0.18)) : chaque thème les redéfinit */
  --encre: 242 237 228; /* --texte */
  --reflet: 255 255 255;
  --nacre: 236 229 222; /* --champagne */
  --fond-rgb: 20 23 28;
  --carte-rgb: 28 32 39;
  --halo: 0 0 0; /* auréole des textes et traits posés sur la 3D */
  --piste: #6e6a65;
  --pouce: var(--texte); /* pastille des curseurs et interrupteurs */
  --voile: rgba(0, 0, 0, 0.6);
  --serif: "Bodoni Moda", Didot, Georgia, serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

/* Thème clair (Nahel, 04/12) : papier ivoire chaud, encre brune ; sans couleur d'accent, l'actif ressort par inversion (encre pleine,
   texte ivoire), comme le nacre en sombre. Posé par index.html (avant l'affichage) et app.mjs (Réglages › Affichage). Contrastes AA :
   --texte 14,81 / 16,15 / 13,30:1 sur --fond / --carte / --carte-2 ; --texte-2 5,43 / 5,92 / 4,88 ; --alerte 5,50 / 6,00 / 4,94 ;
   --texte-verre 6,36 / 6,93 / 5,71, et 5,02:1 sur le verre posé sur du noir ; actif (--fond sur --champagne) 13,14:1 */
:root[data-theme="clair"] {
  --fond: #f3eee5;
  --carte: #fbf8f2;
  --carte-2: #e9e2d6;
  --texte: #1f1b16;
  --texte-2: #675f55;
  --champagne: #2a251f;
  --alerte: #a63c2c;
  --texte-verre: #5c554c;
  --encre: 31 27 22;
  --reflet: 31 27 22;
  --nacre: 42 37 31;
  --fond-rgb: 243 238 229;
  --carte-rgb: 251 248 242;
  --halo: 243 238 229;
  --piste: #8c8377;
  --pouce: #fffdf9;
  --voile: rgba(42, 34, 24, 0.35);
  color-scheme: light;
}
/* Noms posés sur la 3D : l'auréole ivoire doit tenir sur l'écrin noir (couvercle ouvert) : couches serrées, plus opaques qu'en sombre */
:root[data-theme="clair"] .etiquette-rotor { text-shadow: 0 0 1px rgb(var(--halo)), 0 0 2px rgb(var(--halo)), 0 0 2px rgb(var(--halo)), 0 0 4px rgb(var(--halo)), 0 0 8px rgb(var(--halo)), 0 0 12px rgb(var(--halo) / 0.8); }
/* Ombre et sol de l'écran sans écrin : mêmes teintes que le sol 3D clair (ecrin3d.mjs, peindreSol) */
:root[data-theme="clair"] .premier-ecrin::after {
  background: radial-gradient(closest-side, rgba(40,32,22,0.4), rgba(40,32,22,0.22) 45%, transparent 80%) center / 70% 60% no-repeat,
    radial-gradient(closest-side, rgb(222,214,200), rgb(229,222,210) 25%, rgba(237,230,220,0.75) 50%, rgba(243,238,229,0.4) 70%, rgba(243,238,229,0.15) 85%, transparent); }

*, *::before, *::after { box-sizing: border-box; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
[hidden] { display: none !important; }
/* Barres de défilement : trait fin couleur du décor, sans flèches (Nahel, 02/12) ; sur iPhone, celle du système reste */
* { scrollbar-width: thin; scrollbar-color: rgb(var(--encre) / 0.18) transparent; }
/* Feuilles du rotor et du coussin : pas de barre (elle sortait de l'encadré) ; le fondu du bas dit qu'on peut défiler */
.feuille-rotor, .feuille.sur-coussin { scrollbar-width: none; }
.feuille-rotor::-webkit-scrollbar, .feuille.sur-coussin::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font: 15px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; }
button:disabled, button[aria-disabled="true"] { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sans-contour :focus-visible, .sans-contour #vit-rail:focus-visible { outline: none; } /* au doigt ou à la souris (app.mjs) ; le clavier le rend */

/* Colonne de téléphone, centrée sur un écran large */
.app { max-width: 430px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* En-tête */
.entete { padding: 40px 24px 0; }
.titre { font: 500 30px/1.1 var(--serif); }
.jauge-ligne { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.jauge { position: relative; width: 30px; height: 12px; border-radius: 4px; background: rgb(var(--encre) / 0.14); overflow: hidden; }
.jauge > span { position: absolute; inset: 0 auto 0 0; width: var(--niveau, 0%); background: var(--texte); opacity: 0.85; transition: width 600ms ease; }
.jauge-texte { font-weight: 500; font-variant-numeric: tabular-nums; }
.statut { margin-top: 4px; font-size: 13px; color: var(--texte-2); }
/* Titre-bouton (« Mes écrins ») et crayon (renommer) */
.titre-ligne { display: flex; align-items: center; gap: 2px; }
.titre-ligne .titre { min-width: 0; }
.titre-bouton { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; }
.titre-bouton svg { flex: none; margin-top: 4px; color: var(--texte-2); }
.crayon { flex: none; width: 44px; height: 44px; display: grid; place-items: center; color: var(--texte-2); }
/* Carrousel d'écrins sous l'état (Nahel, 02/12) : toute la bande se glisse ; au milieu, un point par écrin, seul celui de
   l'écrin courant est clair, entouré d'un anneau gris clair. Ni encadré ni éveil au toucher
   (Nahel) : pendant le glissement, l’anneau suit le doigt dans le même sens jusqu’au point voulu (--decal, app.mjs), puis s’y pose. Au clavier, le contour de focus
   commun (:focus-visible) suffit. Les points gardent leur contraste (≥ 3:1). */
.defilement { display: flex; align-items: center; justify-content: center; height: 64px; margin: 4px -12px 0 -24px; touch-action: none; cursor: grab; }
.points { --pos: 0; --decal: 0px; position: relative; display: flex; padding: 4px; opacity: 0.55; transition: opacity 200ms ease; }
/* Discrets au repos (Nahel, 03/12) ; nets sous la souris, au clavier ou sous le doigt. Au repos, le point d'un autre écrin
   descend sous 3:1 : choix de Nahel, il redevient lisible dès qu'on s'en sert. */
.defilement:has(:focus-visible) .points, .defilement.glisse .points { opacity: 1; }
@media (hover: hover) { .defilement:hover .points { opacity: 1; } } /* au téléphone, le survol resterait collé après un toucher (arbitre C2, 03/12) */
#points { display: flex; } /* shortcut: points de 44 px, 7 écrins au plus sur 375 px ; au-delà, réduire la largeur (variable --n, 28 px minimum) */
.point { position: relative; z-index: 1; width: 44px; height: 44px; display: grid; place-items: center; }
.point::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--encre) / 0.45); transition: background 200ms ease; }
.point[aria-current="true"]::before { background: var(--texte); }
.anneau-point { position: absolute; left: 15px; top: 15px; width: 22px; height: 22px; box-sizing: border-box; border-radius: 50%; border: 1.5px solid rgb(var(--encre) / 0.55); transform: translateX(calc(var(--pos) * 44px + var(--decal))); transition: transform 320ms cubic-bezier(0.3, 1.25, 0.5, 1); pointer-events: none; }
.defilement.glisse .anneau-point, .points.saut .anneau-point { transition: none; } /* sous le doigt : suit sans retard */
@media (prefers-reduced-motion: reduce) { .anneau-point { transition: none; } }

.zone { position: relative; z-index: 1; padding: 12px 16px 0; display: flex; flex-direction: column; gap: 12px; }

.bouton-principal {
  width: 100%; min-height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--champagne); color: var(--fond); font-weight: 500;
}

.carte { padding: 20px; border-radius: 20px; background: var(--carte); border: 1px solid var(--filet); }
.carte h2 { font: 500 19px/1.25 var(--serif); letter-spacing: 0.01em; }
.carte h2 .sous { font: 400 13px var(--sans); letter-spacing: 0; }
.carte .sous { font-weight: 400; color: var(--texte-2); }
.carte-titre-serif { font: 500 19px/1.25 var(--serif) !important; }
.note { margin-top: 6px; font-size: 13px; color: var(--texte-2); }
#vue-legal .carte p, #vue-legal .carte ul { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--texte-2); }
#vue-legal .carte ul { padding-left: 18px; list-style: disc; }
#vue-legal .carte li + li { margin-top: 4px; }
#vue-legal .carte a { color: inherit; text-decoration: underline; }
.carte-lumiere { box-shadow: inset 0 1px 0 rgb(var(--encre) / 0.08); }
.carte-video { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 16px; border-color: rgba(255, 177, 110, 0.4); }
.carte-video > div { flex: 1; min-width: 0; }

/* ---- Écran Écrin 1.1 : un seul écran sans défilement, la 3D plein écran derrière l'interface (contrôle M1-M10) ----
   --haut-entete : bas de l'en-tête, posé par app.mjs ; --bas-scene : haut de la navigation flottante (64 px + 12 px + 12 px d'écart) */
#vue-ecrin { --haut-entete: 120px; --bas-scene: calc(88px + env(safe-area-inset-bottom)); position: fixed; inset: 0; max-width: 430px; margin: 0 auto; overflow: hidden; }
body.sans-defilement { overflow: hidden; overscroll-behavior: none; }
/* Rideau ouvert (Nahel, 04/12) : la page derrière ne défile plus (doigt posé hors de la poignée, molette) ; place de la barre
   gardée, sinon tout glisse de quelques px à l'ouverture sur ordinateur */
html { scrollbar-gutter: stable; }
body:has(dialog:modal) { overflow: hidden; overscroll-behavior: none; }
.heros { position: absolute; inset: 0; margin: 0; }
.heros img { position: absolute; left: 0; top: var(--haut-entete); width: 100%; height: calc(100% - var(--haut-entete) - var(--bas-scene)); object-fit: contain; }
/* Canvas 3D : glisser pour tourner autour de l'écrin, pincer ou molette pour zoomer (la page ne défile plus) */
.heros canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.heros canvas:active { cursor: grabbing; }
/* M8 : fond derrière l'en-tête, pour que l'écrin zoomé ne passe pas sous le nom sans contraste */
.voile-haut { position: absolute; top: 0; left: 0; right: 0; height: calc(var(--haut-entete) + 24px); background: linear-gradient(var(--fond) 55%, rgb(var(--fond-rgb) / 0)); pointer-events: none; }
#entete-ecrin { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: calc(env(safe-area-inset-top) + 16px) 12px 8px 24px; }
#entete-ecrin .titre-ligne { gap: 0; }
#note-ecrin { margin-top: 8px; padding: 8px 12px; border-radius: 12px; }
.scene { position: absolute; left: 0; right: 0; top: var(--haut-entete); bottom: var(--bas-scene); z-index: 4; pointer-events: none; }
.scene > * { pointer-events: auto; }

/* Verre (M7) : opacité ≥ 0,85, texte secondaire #b9b3aa (≥ 4,5:1 même avec un fond blanc derrière) */
:root { --texte-verre: #b9b3aa; }
.verre { background: rgb(var(--carte-rgb) / 0.88); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgb(var(--encre) / 0.1); }
.verre .note, .verre .sous, .verre .curseur-tete label, .verre .curseur-bornes, .verre .info, .verre .fermer { color: var(--texte-verre); }

/* États par-dessus l'écrin : bandeau vidéo en haut, aide Bluetooth en panneau, « Connecter » au bas de l'écrin */
#bandeau-video { position: absolute; top: 0; left: 16px; right: 56px; z-index: 6; /* le soleil du rail reste visible */ border-color: rgba(255, 177, 110, 0.4); }
#aide-bluetooth { position: absolute; top: 0; left: 16px; right: 16px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; z-index: 6; }
.scene > .bas-ecrin { position: absolute; left: 60px; right: 60px; bottom: 8px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.bas-ecrin > * { pointer-events: auto; }
#hors-ligne { color: var(--texte-verre); text-shadow: 0 0 4px var(--fond), 0 0 2px var(--fond); }

/* Étiquettes des rotors (M9) : sous les panneaux, jamais sur l'en-tête, le rail ni la navigation (etiquettes.mjs) */
.scene > .etiquettes { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.traits { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 2px rgb(var(--halo) / 0.8)); }
.traits line { stroke: rgb(var(--encre) / 0.75); stroke-width: 1; }
.traits circle { fill: var(--texte); }
/* Texte seul, sans encadré (Nahel, 01/12) : halo sombre pour rester lisible sur l'écrin éclairé */
/* Comme l'écran de référence : texte serré contre le haut du trait, nom en gras, état fin et plus discret */
.etiquette-rotor { position: absolute; left: 0; top: 0; min-width: 44px; min-height: 44px; padding: 0 4px 0 0; background: none; border: 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left; line-height: 1.2; color: var(--texte); text-shadow: 0 0 3px rgb(var(--halo)), 0 0 6px rgb(var(--halo)), 0 0 10px rgb(var(--halo) / 0.8); pointer-events: auto; }
.etiquette-rotor, .traits g { transition: opacity 220ms ease, visibility 0s linear 0s; }
.etiquette-rotor.cachee, .traits g.cachee { opacity: 0; visibility: hidden; transition: opacity 220ms ease, visibility 0s linear 220ms; } /* fondu, puis hors du parcours au clavier */
/* Apparition après l'écran sans écrin (Nahel, 03/12 ; app.mjs afficherHeros) : l'écrin se dévoile en 0,45 s (ecrin3d.mjs),
   puis le point du rotor, son trait qui monte vers l'étiquette, et le texte balayé de gauche à droite */
@media (prefers-reduced-motion: no-preference) {
  /* --retard (app.mjs rejouerTraits) : 400 ms après l'écran sans écrin (fondu de l'écrin), 0 à l'arrivée d'un autre écrin */
  .apparition .traits circle { transform-box: fill-box; transform-origin: center; animation: point-nait 200ms ease-out var(--retard, 400ms) both; }
  .apparition .traits line { stroke-dasharray: 1; animation: trait-grandit 350ms cubic-bezier(0.3, 0, 0.2, 1) calc(var(--retard, 400ms) + 50ms) both; }
  .apparition .etiquette-rotor { animation: balaie 380ms ease-out calc(var(--retard, 400ms) + 400ms) both; }
  .passage .scene > .etiquettes { opacity: 0; } /* passage d'un écrin à l'autre : effacées, redessinées à l'arrivée */
}
@keyframes point-nait { from { scale: 0; } }
@keyframes trait-grandit { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes balaie { from { clip-path: inset(-12px 100% -12px -12px); } to { clip-path: inset(-12px -12px -12px -12px); } }
.etiquette-nom { font-size: 12px; font-weight: 600; white-space: nowrap; }
.etiquette-etat { font-size: 11px; font-weight: 400; letter-spacing: 0.06em; color: var(--texte-verre); }

/* Tiroir à gauche (Nahel, 01/12) : le panneau sort du bord gauche sur toute la hauteur de la scène et pousse les
   intercalaires, qui restent collés à son bord droit. --ouv (0 fermé, 1 ouvert) suit le doigt ; --tiroir = largeur en px (app.mjs).
   M10 : non modal, fermé = hors du parcours. */
.scene { --ouv: 0; --tiroir: 280px; }
.scene > .intercalaires { position: absolute; left: 0; top: 50%; transform: translate(calc(var(--ouv) * var(--tiroir)), -50%); z-index: 5; display: flex; flex-direction: column; gap: 10px; pointer-events: none; transition: transform 260ms ease; }
.intercalaire { width: 46px; height: 56px; display: grid; place-items: center; border-left: 0; border-radius: 0 14px 14px 0; color: var(--texte); pointer-events: auto; touch-action: none; transition: background 200ms ease, color 200ms ease, opacity 600ms ease; }
/* Discrets quand le tiroir est fermé, comme le rail (Nahel, 01/12) : pleins sous le doigt, au clavier ou tiroir ouvert */
.intercalaire { opacity: 0.3; }
.intercalaires.touche .intercalaire, .intercalaires:has(:focus-visible) .intercalaire, .scene:has(> .panneau.ouvert) .intercalaire { opacity: 1; transition: background 200ms ease, color 200ms ease, opacity 180ms ease; }
.intercalaire[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--fond); }
.scene > .fond-panneau { position: absolute; inset: 0; z-index: 2; }
.scene > .panneau { position: absolute; top: 0; bottom: 0; left: 0; z-index: 4; width: var(--tiroir); box-sizing: border-box; margin: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 12px 16px 16px; border-left: 0; border-radius: 0 18px 18px 0; visibility: hidden; transform: translateX(calc((var(--ouv) - 1) * 100%)); transition: transform 260ms ease, visibility 0s linear 260ms; }
.scene > .panneau.ouvert { visibility: visible; transition: transform 260ms ease; }
.scene.glisse > .panneau, .scene.glisse > .intercalaires, .scene > .panneau.efface { transition: none; } /* le tiroir suit le doigt sans retard ; un panneau remplacé disparaît tout de suite */
.panneau .carte-tete { align-items: center; gap: 0; }
.panneau .carte-tete h2 { flex: 1; min-width: 0; }
.panneau .carte-tete h2:focus { outline: none; }
.panneau .info { margin: -10px 0; }
.fermer { flex: none; width: 44px; height: 44px; margin: -10px -12px -10px 0; display: grid; place-items: center; }
.scene > .carte-rotors.panneau { padding: 10px 16px 6px; }
.carte-rotors .carte-tete + .ligne { min-height: 56px; }

/* Rail de lumière (M1) : sans fond ni texte ; halo sombre, car il passe sur le bord de l'écrin éclairé */
.scene > .rail { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 5; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 0 3px rgb(var(--halo) / 0.85)); }
/* Aucun écrin retenu ni connecté (Nahel, 03/12, app.mjs afficherHeros) : pas d'écrin (3D ou PNG : ni rotation ni zoom), ni rail,
   ni jauge (le bouton du bas reste, Nahel 03/12 ; l'engrenage reste depuis le thème clair, 04/12 : Réglages › Affichage) ; à la place, une ombre au sol (couleurs du sol et de l'ombre de contact de la 3D)
   et un « + » nacré au-dessus, immobile (une seule apparition en fondu, unslop U2 04/12) */
.sans-ecrin :is(.rail, .jauge-ligne, #couvercle-appli) { display: none; }
#vue-reglages.sans-ecrin .seulement-ecrin { display: none; } /* sans écrin, Réglages ne montre que l'Affichage */
.sans-ecrin #heros-cadre { pointer-events: none; } /* sol 3D gardé (même décor), ni rotation ni zoom */
.sans-ecrin #heros { visibility: hidden; }
.premier-ecrin { display: none; }
.sans-ecrin .scene > .premier-ecrin:not([hidden]) { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(240px, 64vw); height: 170px; display: flex; justify-content: center; padding-top: 16px; box-sizing: border-box; border-radius: 20px; color: var(--champagne); }
.premier-ecrin::after { content: ""; position: absolute; left: 0; right: 0; bottom: 14px; height: 48px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0,0,0,0.75), rgba(0,0,0,0.45) 45%, transparent 80%) center / 70% 60% no-repeat,
    radial-gradient(closest-side, rgba(37,42,50,1), rgba(31,36,43,1) 25%, rgba(25,29,35,0.75) 50%, rgba(20,23,28,0.4) 70%, rgba(20,23,28,0.15) 85%, transparent); }
#premier-ecrin[aria-disabled="true"] { cursor: default; }
.premier-ecrin svg { animation: fondu 400ms ease both; }
@media (prefers-reduced-motion: reduce) { .premier-ecrin svg { animation: none; } }
.rail { --rail-h: clamp(140px, calc(100vh - 470px), 280px); --rail-h: clamp(140px, calc(100dvh - 470px), 280px); }
.rail-icone { width: 44px; height: 44px; display: grid; place-items: center; color: var(--texte-verre); transition: color 300ms ease; }
.rail-icone svg { transition: fill 300ms ease; }
#qa-lumiere[aria-pressed="true"], #qa-mode[aria-pressed="false"] { color: var(--texte); }
#qa-lumiere[aria-pressed="true"] svg circle, #qa-mode[aria-pressed="false"] svg { fill: currentColor; }
/* Barre-jauge sans pouce : nacre en bas jusqu'au niveau, gris au-dessus (--piste : 4,3:1 face au nacre en sombre, 4,07:1 face à l'encre en clair). Le doigt agit sur toute la piste
   (44 px de large, app.mjs) ; vertical par rotate(-90deg), pas writing-mode (WebKit ancien, Bluefy : M2). */
.rail-piste { position: relative; width: 44px; height: var(--rail-h); margin: 6px 0; touch-action: none; cursor: pointer; }
#vit-rail { position: absolute; left: 50%; top: 50%; width: var(--rail-h); height: 44px; transform: translate(-50%, -50%) rotate(-90deg); pointer-events: none; }
#vit-rail::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--rempli), var(--piste) var(--rempli)); }
#vit-rail::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--rempli), var(--piste) var(--rempli)); }
#vit-rail::-webkit-slider-thumb { width: 2px; height: 4px; margin-top: 0; background: transparent; box-shadow: none; }
#vit-rail::-moz-range-thumb { width: 2px; height: 4px; background: transparent; box-shadow: none; }
#vit-rail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Rail discret au repos (soleil, barre, lune), plein quand le doigt le touche ou au clavier (Nahel, 01/12) ;
   apparition rapide, retour lent */
.rail > * { opacity: 0.3; transition: opacity 600ms ease, color 300ms ease; }
.rail.touche > *, .rail:has(:focus-visible) > * { opacity: 1; transition: opacity 180ms ease, color 300ms ease; }
@media (hover: hover) { .rail:hover > * { opacity: 1; transition: opacity 180ms ease, color 300ms ease; } } /* à la souris : plein au survol (Nahel, 04/12) ; jamais au doigt, le survol y resterait collé */
/* Passage en mode Nuit au rail (Nahel, 01/12) : anneau qui se remplit autour de la lune, qui grossit un peu, en 1 s */
#qa-mode { position: relative; }
#qa-mode .lune { transition: fill 300ms ease, transform 300ms ease; }
#qa-mode .anneau { position: absolute; inset: 0; width: 44px; height: 44px; transform: rotate(-90deg); opacity: 0; transition: opacity 150ms ease; }
#qa-mode .anneau circle { fill: none; stroke: var(--texte); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 113.1; stroke-dashoffset: 113.1; }
#qa-mode.charge .anneau { opacity: 1; }
#qa-mode.charge .anneau circle { animation: charge-nuit 1s linear forwards; }
#qa-mode.charge .lune { transform: scale(1.25); transition: transform 1s ease; }
@keyframes charge-nuit { to { stroke-dashoffset: 0; } }
/* Rotor sorti (Nahel, 01/12) : ses réglages montent du bas ; rail, intercalaires, étiquettes et bouton du bas s'effacent */
.feuille-rotor { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; max-width: 430px; max-height: 58dvh; margin: 0 auto; box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px calc(16px + env(safe-area-inset-bottom)); background: var(--carte); border-top: 1px solid rgb(var(--reflet) / 0.08); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform 450ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.feuille-rotor.ouverte { transform: none; }
/* Fondu en bas tant qu'il reste du contenu à faire défiler (classe .fin posée par app.mjs) */
.feuille-rotor::after { content: ""; position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom)); display: block; height: 48px; margin: -48px -8px calc(-16px - env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--carte)); pointer-events: none; transition: opacity 200ms ease; }
.feuille-rotor.fin::after { opacity: 0; }
.feuille-rotor.glisse { transition: none; }
.feuille-rotor-tete { position: relative; display: flex; align-items: center; min-height: 44px; touch-action: none; }
.feuille-rotor-tete .poignee { position: absolute; left: 50%; top: 6px; transform: translateX(-50%); }
.feuille-rotor .carte-rotor { margin: 0; border: 0; background: none; padding-top: 0; }
.feuille-rotor .rotor-t-montres, .feuille-rotor .rotor-montres { display: none; } /* les montres sont sur les coussins */
#vue-ecrin .scene > .rail, #vue-ecrin .scene > .intercalaires, #vue-ecrin .scene > .etiquettes, #vue-ecrin .scene > .bas-ecrin { transition: opacity 300ms ease; }
#vue-ecrin.rentre .scene > .etiquettes { visibility: hidden; } /* rotor qui rentre : traits redessinés une fois posé (app.mjs surRentre) */
#vue-ecrin.rotor-sorti .scene > .rail, #vue-ecrin.rotor-sorti .scene > .intercalaires, #vue-ecrin.rotor-sorti .scene > .etiquettes, #vue-ecrin.rotor-sorti .scene > .bas-ecrin { opacity: 0; pointer-events: none; visibility: hidden; }
body.rotor-sorti .onglets { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.coussins-boutons { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.coussin-bouton { position: absolute; left: 0; top: 0; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0 12px; border: 1px solid rgb(var(--encre) / 0.5); border-radius: 999px; background: rgb(var(--fond-rgb) / 0.75); color: var(--texte); font-size: 13px; pointer-events: auto; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fondu 250ms ease both; }
/* Coussin libre du rotor sorti et coussins du plateau (Nahel, 03/12) : bouton invisible pour le clavier et le lecteur d'écran,
   cerclé seulement au focus clavier ; le doigt passe au travers et touche le coussin en 3D (ecrin3d.mjs) */
.coussin-cache { position: absolute; left: 0; top: 0; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; pointer-events: none; }
.coussins-boutons .etiquette-rotor { max-width: var(--l-max, 160px); } /* --l-max : place à droite du trait (app.mjs placerCoussins) */
.coussins-boutons :is(.etiquette-nom, .etiquette-etat) { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* nom abrégé par « … » (Nahel, 03/12) */
.feuille.sur-coussin::backdrop { background: transparent; }
/* Tête de la feuille : flèche retour et glissement seulement sous un coussin sorti (ailleurs, la poignée seule, comme avant) */
#coussin-retour { display: none; }
.feuille.sur-coussin .feuille-tete { position: relative; display: flex; align-items: center; min-height: 44px; margin: -6px -8px 8px; touch-action: none; }
.feuille.sur-coussin .feuille-tete .poignee { position: absolute; left: 50%; top: 2px; margin: 0; transform: translateX(-50%); }
.feuille.sur-coussin #coussin-retour { display: flex; }
.feuille.sur-coussin { position: fixed; inset: auto 0 0; z-index: 20; max-height: var(--haut-feuille-rotor, 58dvh); overflow-y: auto; }
/* Téléphone (ou fenêtre basse) : rotor ou coussin sorti, la feuille se fait plus basse et serrée et l'en-tête ne garde que le
   nom et l'état, pour laisser à l'objet sorti la plus grande part de l'écran (Nahel, 02/12 : « prend toute la place » sur téléphone).
   La feuille défile si besoin ; les cibles restent de 44 px. */
@media (pointer: coarse), (max-height: 760px) {
  /* #statut reste : seul message visible d'échec de commande et de déconnexion (arbitre C1, 02/12) */
  #vue-ecrin.rotor-sorti #entete-ecrin > .jauge-ligne, #vue-ecrin.rotor-sorti #defilement { display: none; }
  .feuille-rotor { max-height: 44dvh; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .feuille-rotor .carte-rotor { padding: 0 12px 4px; }
  .feuille-rotor .rotor-sous-titre { margin-top: 10px; }
  .feuille-rotor .rotor-sous-titre + .segment { margin-top: 6px; }
  .feuille.sur-coussin .feuille-panneau { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .feuille.sur-coussin .grand-titre { font-size: 20px !important; }
  .feuille.sur-coussin #emplacement-choisir .surtitre { padding-top: 10px; }
  .feuille.sur-coussin .bouton-large { min-height: 48px; margin-top: 10px; }
}
/* Message bref au-dessus de l'écrin */
.scene > .toast { position: absolute; top: 12px; left: 50%; z-index: 6; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; font-size: 14px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 250ms ease; }
.scene > .toast.visible { opacity: 1; }

/* Segment Vitrine / Ouverture */
.segment { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 12px; padding: 4px; border-radius: 14px; background: var(--carte-2); }
.segment button { min-height: 44px; border-radius: 10px; text-align: center; font-size: 13px; font-weight: 500; color: var(--texte-2); transition: background 300ms ease, color 300ms ease; }
.segment button[aria-pressed="true"] { background: var(--accent); color: var(--fond); }
/* Réglage conseillé pour les montres du rotor (Nahel, 02/12) : « conseillé », ou la montre à qui il revient, sous la valeur */
.segment button[data-conseil]::after { content: attr(data-conseil); display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; font-size: 10px; font-weight: 400; letter-spacing: 0.02em; opacity: 0.8; }

/* Curseurs : remplissage champagne par --rempli (0 à 100 %) */
.curseur { margin-top: 16px; }
.curseur-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.curseur-tete label { font-size: 13px; color: var(--texte-2); }
.curseur-tete output { font-weight: 500; font-variant-numeric: tabular-nums; }
.curseur-bornes { display: flex; justify-content: space-between; font-size: 11px; color: var(--texte-2); }
input[type="range"] {
  --rempli: 50%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 44px; margin: 0; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--rempli), rgb(var(--encre) / 0.14) var(--rempli)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, var(--accent) var(--rempli), rgb(var(--encre) / 0.14) var(--rempli)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8.5px; border-radius: 50%; background: var(--pouce); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--pouce); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.55); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgb(var(--nacre) / 0.5); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgb(var(--nacre) / 0.5); }
input[type="range"]:disabled { cursor: default; opacity: 0.45; }

/* Interrupteur (role=switch) */
.ligne { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.ligne > div { flex: 1; min-width: 0; }
.ligne .sous { margin-top: 2px; font-size: 13px; color: var(--texte-2); }
.interrupteur { flex: none; width: 58px; height: 44px; display: flex; align-items: center; justify-content: flex-end; }
.interrupteur > span { position: relative; display: block; width: 50px; height: 30px; border-radius: 999px; background: rgb(var(--encre) / 0.18); transition: background 300ms ease; }
.interrupteur > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--pouce); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: left 300ms ease; }
.interrupteur[aria-checked="true"] > span { background: var(--accent); }
.interrupteur[aria-checked="true"] > span::after { left: 23px; }
.interrupteur:disabled { opacity: 0.45; }
.carte-rotors { padding: 4px 16px 4px 20px; }
.carte-rotors .ligne + .ligne { border-top: 1px solid var(--filet); min-height: 56px; }

/* Barre d'onglets (1.1) : encadré arrondi flottant, en verre (M7 : 0,86 d'opacité, texte #b9b3aa), au-dessus du bas de l'écran */
.onglets {
  position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 10;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 398px; height: 64px; margin: 0 auto; border-radius: 22px;
  background: rgb(var(--carte-rgb) / 0.86); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgb(var(--encre) / 0.1); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.onglet { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--texte-verre); font-size: 11px; font-weight: 500; }
.onglet[aria-current="page"] { color: var(--texte); }
/* Rectangle arrondi qui glisse sous le doigt (Nahel, 01/12, inspiré de la barre d'onglets de l'iPhone) : derrière
   l'onglet courant ; --pos = 0, 1 ou 2, continu pendant le geste (app.mjs) */
.onglets { --pos: 0; touch-action: none; }
.glissiere { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 3); border-radius: 17px; background: rgb(var(--encre) / 0.12); transform: translateX(calc(var(--pos) * 100%)); transition: transform 320ms cubic-bezier(0.3, 1.25, 0.5, 1), background 200ms ease; pointer-events: none; }
.onglets.glisse .glissiere { transition: background 200ms ease; background: rgb(var(--encre) / 0.18); }
.onglet { z-index: 1; }
.onglet > span { text-align: center; line-height: 1.2; }
.onglet small { display: block; font-size: 10px; font-weight: 400; }

/* Vue Réglages */
a { color: inherit; text-decoration: none; }
.titre:focus { outline: none; }
.entete-retour { display: flex; align-items: center; gap: 4px; padding-left: 8px; }
.retour { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.finitions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.finition { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 84px; padding: 10px 4px; border-radius: 14px; border: 1px solid var(--filet); font-size: 13px; font-weight: 500; color: var(--texte-2); transition: border-color 300ms ease, color 300ms ease; }
.finition[aria-pressed="true"] { border-color: var(--accent); color: var(--texte); }
.pastille { display: block; width: 32px; height: 32px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(var(--reflet) / 0.14); }
.pastille-noir { background: #1c1c1c; }
.pastille-marron { background: #4d2d24; }
.pastille-croco { background: repeating-linear-gradient(45deg, #070707 0 3px, #1b1b1b 3px 4px), #0d0d0d; }
.carte-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.carte-lumiere .carte-tete { align-items: center; }
.info { position: relative; flex: none; width: 44px; height: 44px; margin: -10px -12px -10px 0; display: grid; place-items: center; background: none; border: 0; color: var(--texte-2); cursor: pointer; }
.info[aria-expanded="true"] { color: var(--texte); }
.infos { margin: 8px 0 0; }
.infos > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--filet); font-size: 14px; }
.infos dt { color: var(--texte-2); }
.infos dd { margin: 0; font-variant-numeric: tabular-nums; }
.aide { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--carte-2); }
.etiquette { font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--champagne); }
.case { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 10px; font-size: 14px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.bouton-large { width: 100%; margin-top: 10px; }
.bouton-secondaire:disabled { opacity: 0.45; }

/* Alerte (oublier, erreurs) : texte et bordure, jamais de fond teinté (C5) */
.alerte, .bouton-alerte { color: var(--alerte); }
.bouton-alerte { border-color: var(--alerte); }
.bouton-plein { background: var(--champagne); border-color: var(--champagne); color: var(--fond); font-weight: 500; }

/* Dialogues (Mes écrins, nom, oubli) */
dialog { width: min(398px, calc(100% - 32px)); padding: 20px; border: 1px solid var(--filet); border-radius: 20px; background: var(--carte); color: var(--texte); }
dialog::backdrop { background: var(--voile); }
dialog h2 { font: 500 19px/1.25 var(--serif); }
/* Feuille « Mes écrins » (canevas l. 826-835) : collée en bas, montée 350 ms, voile en fondu 300 ms */
.feuille { width: 100%; max-width: 430px; max-height: 85dvh; margin: auto auto 0; padding: 0; border: 0; border-top: 1px solid rgb(var(--reflet) / 0.08); border-radius: 22px 22px 0 0; }
.feuille-panneau { padding: 10px 16px calc(40px + env(safe-area-inset-bottom)); }
/* Rideau (Nahel, 03/12) : toute la feuille monte du bas (avant : 24 px et fondu) et redescend à la fermeture (.ferme, posée par
   app.mjs 350 ms avant le vrai close), même durée, courbe à l'envers ; le voile s'éclaircit pendant la descente */
.feuille[open] { animation: monte 350ms ease-out both; }
.feuille[open]::backdrop { animation: fondu 300ms ease both; }
.feuille.ferme { animation: descend 350ms ease-in both; }
.feuille.ferme::backdrop { animation: efface 300ms ease both; }
@keyframes monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes descend { from { transform: none; } to { transform: translateY(100%); } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes efface { from { opacity: 1; } to { opacity: 0; } }
/* Petits dialogues (nom, oubli, suppression ; Nahel 04/12) : fondu à l'ouverture et à la fermeture (.ferme, 250 ms, app.mjs) */
dialog:not(.feuille)[open], dialog:not(.feuille)[open]::backdrop { animation: fondu 250ms ease both; }
dialog:not(.feuille).ferme, dialog:not(.feuille).ferme::backdrop { animation: efface 250ms ease both; }
/* Rien n'apparaît d'un coup (Nahel, 04/12) : écrans, onglets de l'Apparence, contenu de la feuille d'emplacement, rangées
   qui dépendent d'un choix, boutons des coussins, bandeaux : fondu à l'entrée (sans remplissage : pas de contexte d'empilement gardé) */
:is(#vue-ecrin, #vue-reglages, #vue-rotors, #vue-collection, #vue-journal, .panneau-apparence, #emplacement-actions, #emplacement-choisir,
  .apparence-rangee, .apparence-raison, #coussins-boutons, #coussins-plateau, #maj, #bandeau-video):not([hidden]) { animation: fondu 250ms ease; }
@media (prefers-reduced-motion: reduce) { .feuille[open], .feuille[open]::backdrop, .feuille.ferme, .feuille.ferme::backdrop, dialog[open], dialog[open]::backdrop, dialog.ferme, dialog.ferme::backdrop { animation: none; } }
.poignee { display: block; width: 36px; height: 4px; margin: 0 auto 16px; border-radius: 2px; background: rgb(var(--encre) / 0.2); }
/* Prises pour glisser une feuille vers le bas (app.mjs, glisserPourFermer) : poignée élargie à 44 px de haut, titre, tête */
.feuille .poignee, .feuille .grand-titre, .feuille .feuille-tete { touch-action: none; }
.feuille-panneau > .poignee, .feuille-tete > .poignee { position: relative; }
.feuille-panneau > .poignee::before, .feuille-tete > .poignee::before { content: ""; position: absolute; inset: -20px -80px; }
.feuille .feuille-titre { padding: 0 8px 8px; font: 500 11px var(--sans); letter-spacing: 0.02em; color: var(--texte-2); }
.ligne-ecrin { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 14px; padding: 10px 8px; border-radius: 14px; }
.ligne-ecrin svg { flex: none; }
.ligne-texte { flex: 1; min-width: 0; }
.ligne-nom { display: block; font: 500 18px var(--serif); overflow-wrap: anywhere; }
.ligne-ajout { display: block; font-size: 15px; font-weight: 500; }
.ligne-sous { display: block; margin-top: 1px; font-size: 13px; color: var(--texte-2); }
.coche { color: var(--accent); visibility: hidden; }
.ligne-ecrin[aria-current="true"] .coche { visibility: visible; }
.champ { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--texte-2); }
/* Rideau de suggestions (rideau.mjs) : sous le champ, 5 lignes visibles, le reste défile ; ligne choisie au clavier :
   fond --carte-2 et barre --texte à gauche (12,37:1), visible sans la couleur du fond */
.champ-rideau { position: relative; }
.rideau { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 2; max-height: 228px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 4px; list-style: none; border: 1px solid rgb(var(--encre) / 0.22); border-radius: 12px; background: var(--carte); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55); }
.rideau [role="option"] { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--texte); font-size: 16px; cursor: pointer; }
.rideau [aria-selected="true"] { background: var(--carte-2); box-shadow: inset 2px 0 0 var(--texte); }
@media (hover: hover) { .rideau [role="option"]:hover { background: var(--carte-2); } }
.champ input { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid rgb(var(--encre) / 0.22); background: var(--carte-2); color: var(--texte); font: 400 16px var(--sans); }
.dialogue-boutons { display: flex; gap: 8px; margin-top: 16px; }
.dialogue-boutons > * { flex: 1; }

/* Démonstration (?demo) */
.demo-boite { display: grid; gap: 6px; margin-top: 12px; font-size: 13px; color: var(--texte-2); }
.demo-boite select { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid rgb(var(--encre) / 0.22); background: var(--carte-2); color: var(--texte); font: 500 16px var(--sans); } /* 16 px : pas de zoom automatique au focus sur iPhone */
.demo-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.bouton-secondaire { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid rgb(var(--encre) / 0.22); font-size: 13px; font-weight: 500; text-align: center; }
.trame { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--carte-2); font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; color: var(--texte-2); }

/* États particuliers */
.visuellement-cache { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.visible-au-focus:not(:focus-visible) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.visible-au-focus:focus-visible { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; background: var(--carte); } /* K3 : fond opaque sur la 3D (14:1) */
.visuellement-cache:focus-visible { position: static; width: 100%; height: 44px; margin: 8px 0 0; overflow: visible; clip-path: none; white-space: normal; }
.centre { text-align: center; }
.aide-texte { margin-top: 10px; font-size: 14px; }
.bouton-principal:disabled { opacity: 0.6; }

/* Commandes grisées (déconnecté, vidéo) */
.inactif { opacity: 0.38; transition: opacity 300ms ease; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* Ma Collection (maquette du 23/11, couleurs de l'appli). Flou : contenu factice seulement (collection.mjs). */
.valeur { position: relative; display: block; width: 100%; overflow: hidden; text-align: left; }
.valeur-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; font: 400 13px var(--sans) !important; color: var(--texte-2); }
.pastille-premium { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; border: 1px solid rgb(var(--nacre) / 0.6); font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--champagne); }
.valeur-total { display: block; margin-top: 6px; font: 500 44px/1.05 var(--serif); font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; }
.courbe { display: block; width: 100%; height: 74px; margin-top: 16px; overflow: visible; }
.courbe path { fill: none; stroke: var(--champagne); stroke-width: 2; vector-effect: non-scaling-stroke; }
.flou { display: block; filter: blur(10px); opacity: 0.85; user-select: none; pointer-events: none; }
.verrou { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 16px; text-align: center; }
/* Total : la mention se centre sur le bloc flou (total, nombre, courbe), pas sur toute la carte avec sa tête (Nahel, 03/12) */
#valeur-gratuit { display: grid; }
#valeur-gratuit > .flou, #valeur-gratuit > .verrou { grid-area: 2 / 1; }
#valeur-gratuit > .verrou { position: static; }
.verrou > span { display: inline-block; padding: 10px 16px; border-radius: 22px; background: rgb(var(--fond-rgb) / 0.85); border: 1px solid rgb(var(--nacre) / 0.5); font-size: 14px; font-weight: 500; line-height: 1.35; }
.insecable { white-space: nowrap; }
.cadenas { display: inline-block; margin-left: 6px; vertical-align: -2px; stroke: var(--champagne); }

/* Catégories repliables (un écrin, ou « Hors écrin ») */
.categorie { margin-top: 8px; }
.categorie h2 { font: inherit; }
.categorie-bouton { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px; border-bottom: 1px solid rgb(var(--reflet) / 0.08); }
.categorie-nom { flex: 1; min-width: 0; font: 500 20px/1.2 var(--serif); overflow-wrap: anywhere; }
.categorie-sous { font: 400 13px var(--sans); color: var(--texte-2); white-space: nowrap; }
.categorie-compte { flex: none; font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.chevron { flex: none; color: var(--texte-2); transition: transform 250ms ease; }
.categorie-bouton[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.categorie-panneau { padding: 0 0 10px; }
.pastille-petite { flex: none; width: 24px; height: 24px; }
.pastille-hors { display: grid; place-items: center; border: 1px solid rgb(var(--encre) / 0.3); box-shadow: none; }
.pastille-hors svg { width: 14px; height: 14px; }
.zone-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 16px 8px 8px; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--texte-2); }
.zone-sous { font-weight: 400; }
.emplacements { display: flex; flex-direction: column; gap: 8px; }
.emplacement { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 12px 8px 10px; border-radius: 16px; background: var(--carte); border: 1px solid var(--filet); }
.badge { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid rgb(var(--encre) / 0.3); color: var(--texte-2); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.badge-plein { background: var(--champagne); border-color: var(--champagne); color: var(--fond); }
.vignette { flex: none; display: grid; place-items: center; width: 44px; height: 52px; border-radius: 10px; background: var(--carte-2); color: var(--texte-2); overflow: hidden; }
.emplacement-texte { flex: 1; min-width: 0; }
.emplacement-titre { display: block; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.emplacement-titre.libre { color: var(--texte-2); }
.emplacement-sous { display: block; margin-top: 2px; font-size: 13px; color: var(--texte-2); }
.chevron-droit { flex: none; color: var(--texte-2); }

/* « Hors écrin » : grille de 2 colonnes, la tuile « + » en premier */
.quota { margin: 12px 8px 0; }
.grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding-top: 12px; }
.grille > li { display: flex; }
.tuile { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 200px; border-radius: 18px; background: var(--carte); border: 1px solid var(--filet); overflow: hidden; text-align: left; }
.tuile-image { flex: 1; display: grid; place-items: center; min-height: 132px; background: radial-gradient(80% 70% at 50% 45%, var(--carte-2) 0%, var(--carte) 75%); color: var(--texte-2); }
.tuile-image svg { width: 66px; height: 66px; } /* Nahel 06/12 : 1,5 × et centrée dans tout l’espace au-dessus du nom */
.tuile-texte { display: block; padding: 10px 12px 12px; }
.tuile-modele { display: block; margin-top: 3px; font-size: 14px; font-weight: 500; line-height: 1.25; overflow-wrap: anywhere; }
.surtitre { display: block; margin: 0; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--texte-2); overflow-wrap: anywhere; }
.tuile-plus, .tuile-verrou .flou { align-items: center; justify-content: center; gap: 14px; text-align: center; font-size: 14px; font-weight: 500; }
.tuile-plus { padding: 12px; background: rgb(var(--carte-rgb) / 0.6); border: 1.5px dashed rgb(var(--encre) / 0.32); }
.tuile-verrou { border-color: rgb(var(--nacre) / 0.45); }
.tuile-verrou .flou { position: absolute; inset: 0; display: flex; flex-direction: column; filter: blur(7px); opacity: 0.7; }
.rond-plus { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; border: 1px solid rgb(var(--nacre) / 0.6); color: var(--champagne); }
.invite { align-items: center; padding: 0 6px; }

/* Feuilles de la collection (emplacement, fiche, Premium, saisie) */
.grand-titre { font: 500 22px/1.2 var(--serif) !important; overflow-wrap: anywhere; }
.grand-titre:focus { outline: none; }
.feuille-montre { display: flex; align-items: center; gap: 14px; padding: 0 8px 16px; }
.feuille-montre > div { min-width: 0; flex: 1; }
.feuille-montre > .crayon { align-self: flex-start; margin: -4px -10px 0 0; } /* ticket 4 : en haut à droite, sur la ligne du nom */
.liste-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ligne-action > svg { flex: none; color: var(--texte-2); } /* ticket 4 : icône fine à gauche du libellé */
.ligne-action { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; border-radius: 14px; background: var(--carte-2); font-size: 15px; font-weight: 500; }
.ligne-montre { min-height: 64px; padding-left: 10px; }
.ligne-montre .vignette { background: var(--carte); }
.placer { flex: none; font-size: 13px; font-weight: 500; color: var(--champagne); }
#emplacement-choisir .surtitre { padding: 18px 8px 2px; }
#emplacement-choisir > .grand-titre, #emplacement-choisir > .note { padding: 0 8px; }
.feuille .bouton-large { min-height: 52px; margin-top: 16px; font-size: 15px; }
.feuille .dialogue-boutons .bouton-large { margin-top: 0; }
.feuille .dialogue-boutons form { display: flex; }
.feuille .dialogue-boutons form button { flex: 1; }
.valeur-ligne { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 500; text-align: right; }
.valeur-ligne .flou { display: inline-block; filter: blur(6px); }
/* Mention et cadenas posés sur la valeur floutée, centrés sur sa ligne, calés à droite comme avant (Nahel, 03/12) */
#fiche-valeur-verrou { display: inline-grid; justify-items: end; align-items: center; }
#fiche-valeur-verrou > * { grid-area: 1 / 1; }
.infos dt { white-space: nowrap; }
#m-valeur-verrou { width: 100%; justify-content: flex-start; margin-top: 12px; padding: 0 12px; border-radius: 12px; border: 1px solid rgb(var(--encre) / 0.22); color: var(--texte-2); text-align: left; }
.champ input[type="file"] { padding: 10px 12px; min-height: 44px; font-size: 14px; }
.liste-premium { margin-top: 12px; padding-left: 20px; list-style: disc; display: grid; gap: 8px; font-size: 15px; }
/* Apparence de la montre générique (brief du 02/12) : aperçu, nom et crayon sur une ligne ; le crayon déplie les 4 silhouettes
   et les 8 pastilles. Choix : anneau --texte (14:1 sur --carte), visible sans la couleur ; chaque pastille porte son nom
   (aria-label) et le nom choisi est écrit. Pastilles : liseré clair, car les cadrans sombres se fondent dans --carte. */
.apparence { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.apparence-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 500; }
.apparence-legende { margin-top: 12px; font-size: 13px; color: var(--texte-2); }
.apparence-rangee { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); gap: 6px; margin-top: 6px; }
.rangee-forme { grid-template-columns: repeat(5, minmax(44px, 1fr)); } /* 5 choix au plus par ligne (Nahel, 02/12) ; cadrans : 2 lignes de 4 */
.apparence-detail { font-size: 13px; font-weight: 400; color: var(--texte-2); }
.apparence-bouton { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 12px; color: var(--texte-2); }
.bouton-forme { min-height: 52px; background: var(--carte-2); }
.bouton-bracelet { background: var(--carte-2); font-size: 15px; font-weight: 500; }
.bouton-forme[aria-pressed="true"], .bouton-bracelet[aria-pressed="true"], .bouton-battement[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--texte); color: var(--texte); }
/* Mouvement (étape 2) : libellés longs sur 2 colonnes ; sans Premium, choix flous (comme les TPD) et raison écrite dessous */
.rangee-battement { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bouton-battement { padding: 6px 10px; background: var(--carte-2); font-size: 13px; font-weight: 500; line-height: 1.3; text-align: center; }
.pastille-cadran { width: 28px; height: 28px; box-shadow: inset 0 0 0 1.5px rgb(var(--encre) / 0.45); }
.bouton-pastille[aria-pressed="true"] .pastille-cadran { outline: 2px solid var(--texte); outline-offset: 3px; }
/* Étape 3 (brief § 5, point 10) : styles en 1 clic en tête, puis 3 onglets dans le même panneau. Rangées de pastilles : autant
   que la largeur en tient (≥ 44 px chacune). Choix écrits : --texte-2 sur --carte-2 (4,80:1), choisi --texte (anneau).
   Indisponible avec la forme : estompé (contrôle inactif), raison écrite dessous en --texte-2. */
.rangee-cadran, .rangee-boitier, .rangee-texture, .rangee-couleurBracelet, .rangee-boitier2, .rangee-insertHaut, .rangee-insertBas { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.rangee-diametre { grid-template-columns: repeat(6, minmax(44px, 1fr)); }
.rangee-index, .rangee-surpiqure { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.rangee-bracelet { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.rangee-styles { display: flex; flex-wrap: wrap; }
.bouton-ecrit { padding: 6px 10px; background: var(--carte-2); font-size: 13px; font-weight: 500; line-height: 1.3; text-align: center; }
.bouton-ecrit[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--texte); color: var(--texte); }
.bouton-style { flex: 1 1 auto; padding: 6px 14px; }
/* Écran « Apparence » (Nahel, 03/12) : feuille plein écran qui monte comme les autres (rideau, mouvement réduit compris) ; la
   montre reste en vue en haut pendant que les choix défilent dessous. Tête : flèche retour (44 px) et titre, prise du glissement. */
.ecran-apparence { height: 100dvh; max-height: 100dvh; border-top: 0; border-radius: 0; }
.ecran-apparence[open] { display: flex; flex-direction: column; }
.ecran-apparence .feuille-tete { position: relative; display: flex; align-items: center; gap: 4px; min-height: 44px; padding: calc(8px + env(safe-area-inset-top)) 8px 0; }
.ecran-apparence .feuille-tete .poignee { position: absolute; left: 50%; top: calc(4px + env(safe-area-inset-top)); margin: 0; transform: translateX(-50%); }
.apercu-apparence { flex: none; height: min(38dvh, 340px); display: grid; place-items: center; touch-action: none; }
.apercu-apparence > * { grid-area: 1 / 1; } /* vignette et 3D superposées pendant le passage de l'une à l'autre */
.apercu-apparence canvas { display: block; width: 100%; height: 100%; animation: grandit 450ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes grandit { from { opacity: 0; transform: scale(0.5); } } /* la vignette grossit en 3D (Nahel, 04/12) */
@media (prefers-reduced-motion: reduce) { .apercu-apparence canvas { animation: none; } }
.apercu-texte { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 16px 4px; font-size: 15px; font-weight: 500; text-align: center; }
.ecran-apparence-choix { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(24px + env(safe-area-inset-bottom)); border-top: 1px solid var(--filet); }
/* Choix Premium de l'apparence : plus de flou (Nahel, 03/12 : sur iPhone il effaçait tout, et on doit voir ce que donne le Premium) ;
   seulement estompés, avec le cadenas net */
.apparence-bouton.verrouille > :not(.cadenas) { opacity: 0.7; }
/* Cadenas net (jamais flouté) dans le coin de chaque choix Premium flou (Nahel, 03/12) : pastille sombre, lisible sur tout fond */
.rotor-tpd > button { position: relative; } /* cadenas des tours par jour Premium (800, 950, TPD conseillé), même pastille */
.apparence-bouton > .cadenas, .rotor-tpd > button > .cadenas { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; margin: 0; padding: 2px; box-sizing: content-box; border-radius: 50%; background: rgb(var(--fond-rgb) / 0.85); }
.apparence-bouton.indisponible { opacity: 0.35; }
/* Cases « Bicolore » (06/12) : le libellé entier se touche (≥ 44 px de haut), cadenas Premium à côté du texte */
.apparence-bi { min-height: 52px; margin-top: 6px; font-size: 15px; color: var(--texte); }
.apparence-bi[hidden] { display: none; }
.apparence-bi .interrupteur { position: relative; }
.apparence-bi .interrupteur > .cadenas { position: absolute; top: 14px; right: 12px; margin: 0; }
.apparence-bi.verrouille p { opacity: 0.7; }
.apparence-raison { margin-top: 6px; font-size: 13px; color: var(--texte-2); }
.onglets-apparence { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-bottom: 1px solid var(--filet); }
.onglet-apparence { min-height: 44px; padding: 6px 4px; text-align: center; font-size: 13px; font-weight: 500; line-height: 1.25; color: var(--texte-2); border-bottom: 2px solid transparent; }
.onglet-apparence[aria-selected="true"] { color: var(--texte); border-bottom-color: var(--champagne); }

/* Nouvelle version disponible (hors-ligne.mjs) : discret, juste au-dessus de la barre flottante (12 + 64 px), sans cacher le nom de l’écrin (M8) */
.maj { position: fixed; z-index: 20; bottom: calc(12px + 64px + 12px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(100% - 32px, 420px); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px; border: 1px solid rgb(var(--encre) / 0.4); background: var(--carte); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); font-size: 14px; animation: fondu 200ms ease-out; }
.maj .bouton-secondaire { flex: none; }
body:has(#maj:not([hidden])) .app { padding-bottom: calc(170px + env(safe-area-inset-bottom)); } /* le bas de chaque vue reste visible sous le bandeau */

/* Remontoirs et réglages (#rotors, maquette « Rotors » du 30/11, couleurs de l'appli) et entrée depuis l'Écrin / les Réglages */
.lien-rotors { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.lien-rotors:not(:first-child) { border-top: 1px solid var(--filet); }
.lien-rotors > span { flex: 1; min-width: 0; }
.lien-rotors .sous { display: block; margin-top: 2px; font-size: 13px; }
.entete-retour .titre { flex: 1; min-width: 0; }
#info-rotors { margin: 0; }
.intro-rotors { display: flex; align-items: center; gap: 8px; margin: 0 8px; }
.cartes-rotors { display: flex; flex-direction: column; gap: 12px; }
.carte-rotor { padding: 4px 20px 20px; }
.rotor-sous-titre { margin: 14px 0 0; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; color: var(--texte-2); }
.rotor-sous-titre + .segment, .rotor-tete-tpd + .segment { margin-top: 8px; }
.rotor-tete-tpd { display: flex; align-items: center; justify-content: space-between; min-height: 0; }
.rotor-tete-tpd .info { margin: 2px -12px -12px 0; } /* « i » des réglages conseillés, au bout du titre */
.segment-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Sans Premium : 800 et 950 lisibles mais estompés, touchables (feuille Premium) ; l'étiquette, sous les boutons, ne capte pas le toucher */
.rotor-tpd .verrouille .seg-texte { filter: blur(0.8px); }
.rotor-tpd { grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); } /* --n : 4 avec un TPD conseillé hors des 3 (ecran-rotors.mjs) */
.rotor-herite { margin-top: 10px; }
.rotor-montres { margin-top: 8px; }
.ligne-libre { background: none; border: 1px dashed rgb(var(--encre) / 0.22); cursor: default; }

/* Fiche montre : remontage conseillé et « Appliquer au rotor » */
.conseil { margin-top: 20px; }
/* Carte d'un rotor : recommandation de chaque place (nom coupé par « … » + réglage), une action, pas un choix */
.rotor-recos { margin-top: 8px; }
.rotor-recos .rotor-reco { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 8px; min-width: 0; }
.reco-nom { display: block; max-width: 100%; text-align: center; overflow-wrap: anywhere; /* nom entier, sur deux lignes s'il le faut (Nahel, 02/12) */ font-size: 13px; font-weight: 500; color: var(--texte); }
.reco-reglage { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--texte-2); }
.rotor-recos .rotor-reco.fait { background: var(--accent); color: var(--fond); }
.rotor-reco.fait .reco-nom, .rotor-reco.fait .reco-reglage { color: inherit; }
.rotor-recos .rotor-reco:disabled { opacity: 0.45; }
.bouton-diametre { padding: 6px 2px; white-space: nowrap; }

/* Journal de port (maquette v2 du 04/12, design/maquettes/2026-12-04-journal-de-port/) */
.statut-journal { padding: 0 24px 0 60px; }
.port-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.port-tete .note { margin: 0; }
.port-rangee { display: flex; gap: 6px; margin: 12px -20px 0; padding: 4px 14px 2px; overflow-x: auto; scrollbar-width: none; }
.port-puce { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 104px; padding: 4px 2px; border-radius: 14px; text-align: center; }
.port-puce .vignette { position: relative; width: 56px; height: 64px; border-radius: 14px; overflow: visible; }
.port-puce .vignette svg { width: 34px; height: 34px; }
.port-puce[aria-pressed="true"] .vignette { box-shadow: inset 0 0 0 2px var(--texte); }
.port-puce .vignette .port-coche { position: absolute; right: -5px; top: -5px; display: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--champagne); color: var(--fond); box-shadow: 0 0 0 2px var(--carte); }
.port-puce .vignette .port-coche svg { width: 14px; height: 14px; }
.port-puce[aria-pressed="true"] .port-coche { display: grid; }
.port-nom { display: block; width: 100%; font-size: 12px; font-weight: 500; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.port-quand { display: block; font-size: 11px; color: var(--texte-2); white-space: nowrap; }
.port-puce[aria-pressed="true"] .port-quand { color: var(--texte); font-weight: 500; }
.port-puce:focus-visible, .calendrier button:focus-visible { outline: 2px solid var(--texte); outline-offset: 2px; }
.segment .verrouille { position: relative; }
.segment .verrouille > span { opacity: 0.7; }
.segment .verrouille > .cadenas { position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; margin: 0; padding: 2px; box-sizing: content-box; border-radius: 50%; background: rgb(var(--fond-rgb) / 0.85); }
.stats-periode { display: block; margin-top: 12px; }
.chiffres { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.chiffre { display: block; padding: 12px; border-radius: 14px; background: var(--carte-2); }
.chiffre b { display: block; font: 500 26px/1.1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.chiffre span { display: block; margin-top: 4px; font-size: 12px; color: var(--texte-2); }
.barres { display: grid; gap: 12px; margin-top: 16px; }
.barre-ligne { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.barre-ligne span:first-child { font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-ligne span:last-child { flex: none; color: var(--texte-2); font-variant-numeric: tabular-nums; }
.barre { display: block; height: 6px; margin-top: 5px; border-radius: 3px; background: rgb(var(--encre) / 0.12); overflow: hidden; }
.barre > i { display: block; height: 100%; width: var(--part); border-radius: 3px; background: var(--champagne); }
.pas-portees { margin-top: 12px; }
/* Bloc flou + mention centrée dessus (même montage que #valeur-gratuit) */
.bloc-verrou { display: grid; width: 100%; margin-top: 4px; text-align: left; }
.bloc-verrou > * { grid-area: 1 / 1; }
.bloc-verrou > .verrou { position: static; }
.conseil-ligne { align-items: flex-start; padding-top: 10px; padding-bottom: 10px; text-align: left; }
.conseil-ligne .emplacement-texte .note { display: block; margin-top: 3px; font-weight: 400; }
.conseil-ligne .chevron-droit { align-self: center; flex: none; }
.port-fiche { margin-top: 16px; }
.port-fiche .bouton-large { margin-top: 8px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.calendrier-tete { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; border-bottom: 1px solid rgb(var(--reflet) / 0.08); }
.calendrier-tete .surtitre { flex: 1; text-align: left; }
.calendrier-tete .note { margin: 0; }
.calendrier-tete[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.calendrier-tete:focus-visible { outline: 2px solid var(--texte); outline-offset: 2px; }
.calendrier { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.calendrier .jour-nom { display: grid; place-items: center; height: 22px; font-size: 11px; font-weight: 500; color: var(--texte-2); }
.calendrier button, .calendrier .hors { display: grid; place-items: center; height: 44px; border-radius: 12px; font-size: 13px; font-variant-numeric: tabular-nums; }
.calendrier button { color: var(--texte); background: rgb(var(--encre) / 0.05); }
.calendrier button[aria-pressed="true"] { background: var(--champagne); color: var(--fond); font-weight: 500; }
.calendrier button.aujourdhui { box-shadow: inset 0 0 0 2px var(--texte); }
.calendrier button.aujourdhui[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--champagne), inset 0 0 0 4px var(--fond); }
.calendrier .hors { color: rgb(var(--encre) / 0.25); }
.calendrier-mois { grid-column: 1 / -1; margin-top: 6px; font-size: 11px; color: var(--texte-2); }
#journal-conseils .valeur-tete .carte-titre-serif { color: var(--texte); }

/* Couleur libre du cadran (06/12) : carré saturation/luminosité + barre des teintes, sous la rangée Couleur.
   Repère : petit cercle fin sans remplissage (trait blanc 2 px, ombre très légère pour le fond clair) ; le carré et la barre
   entiers restent la zone de toucher (le repère ne capte rien). Les sous-cadrans réutilisent le même sélecteur. */
.selecteur-couleur { margin-top: 12px; }
.selecteur-couleur:not([hidden]) { animation: sel-ouvre 200ms ease-out; } /* rejouée à chaque ouverture (hidden retiré) */
@keyframes sel-ouvre { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .selecteur-couleur:not([hidden]) { animation: none; } }
.sel-zone { display: flex; gap: 16px; align-items: stretch; }
.sel-carre, .sel-teinte { position: relative; flex: none; height: 168px; border-radius: 12px; touch-action: none; cursor: crosshair; outline-offset: 3px; }
.sel-carre { flex: 1 1 auto; min-width: 120px; }
.sel-teinte { width: 44px; } /* zone de toucher de 44 px, invisible ; la piste fine de 6 px est le ::before */
.sel-teinte::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 6px; margin-left: -3px; border-radius: 3px; background: linear-gradient(to bottom, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }
.sel-carre:focus-visible, .sel-teinte:focus-visible { outline: 2px solid var(--texte); }
.sel-marque { position: absolute; box-sizing: border-box; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 2px rgba(0, 0, 0, .45), inset 0 0 2px rgba(0, 0, 0, .35); pointer-events: none; }
.sel-teinte .sel-marque { left: 50%; }
.sel-carre.glisse .sel-marque, .sel-teinte.glisse .sel-marque { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
