/* Ma cave : polices système, aucune image d'interface. Les animations disent ce qui vient de se passer (docs/charte-ux.md). */

:root {
  --craie: #eceee9;
  --craie-2: #e2e5de;
  --verre: #1f2b24;
  --verre-doux: #4c5a50;
  --filet: rgb(31 43 36 / 0.12);
  --lie: #6b2438;
  --lie-texte: #6b2438;
  --paille: #c9a94b;
  --mousse: #8fa37a;
  --rose: #d98f7e;
  --orange: #c9803c;
  --fond: var(--craie);
  --surface: #f6f7f3;
  --texte: var(--verre);
  --texte-doux: var(--verre-doux);
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --rayon: 14px;
  --onglets: calc(64px + env(safe-area-inset-bottom));
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #141b17;
    --surface: #1c2520;
    --craie-2: #24302a;
    --texte: #e4e8e1;
    --texte-doux: #a3ada4;
    --filet: rgb(228 232 225 / 0.12);
    --lie: #a33c58;
    --lie-texte: #e08aa0;
    --bascule-actif: #34433b;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--fond);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  padding-bottom: var(--onglets);
}

::selection { background: var(--lie); color: #fff; }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(28px, 7vw, 34px); letter-spacing: -0.01em; }
h2 { font-size: 20px; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--lie); outline-offset: 2px; border-radius: 6px; }

.visuellement-cache {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.evitement { position: absolute; left: 16px; top: -48px; padding: 8px 12px; background: var(--surface); z-index: 10; }
.evitement:focus { top: 8px; }

/* En-tête */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left));
}

main { padding: 0 max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left)); max-width: 720px; margin: 0 auto; outline: none; }
.entete { max-width: 720px; margin: 0 auto; }

.entete-actions { display: flex; gap: 2px; margin-right: -10px; }
.bouton-icone {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: none; cursor: pointer;
  border-radius: 50%; color: var(--texte-doux); text-decoration: none;
}
.panneau-entete .boutons-entete { display: flex; gap: 8px; margin: -6px -6px 0 0; }
.panneau-entete .boutons-entete .fermer { margin: 0; }

/* Cockpit : ce que contient la cave et ce qu'elle demande */
.cockpit { margin: 4px 0 28px; }
.cockpit-cave {
  display: grid; gap: 10px; padding: 4px 0 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--filet);
}
.cockpit-total { font-family: var(--serif); font-size: 22px; line-height: 1.25; color: var(--texte-doux); }
.cockpit-total span { font-size: 44px; font-weight: 600; color: var(--texte); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin-right: 4px; }
.composition { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.composition span { background: var(--teinte); min-width: 3px; }
.cockpit-legende { font-size: 14px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.tuiles { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--filet); }
.tuile {
  display: grid; align-content: start; gap: 2px; padding: 14px 10px 14px 0; min-height: 84px;
  color: inherit; text-decoration: none; transition: transform 120ms ease-out;
}
.tuile + .tuile { border-left: 1px solid var(--filet); padding-left: 12px; }
.tuile-chiffre { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile-nom { font-size: 14px; line-height: 1.3; color: var(--texte-doux); }
.tuile[href$="a-ouvrir"] .tuile-chiffre { color: var(--lie-texte); }
.tuile[aria-current] .tuile-nom, .cockpit-cave[aria-current] .cockpit-legende { color: var(--texte); font-weight: 600; }
.tuile:active, .cockpit-cave:active, .niveau:active, .pastille:active, .vin button:active { transform: scale(0.98); }
.bouge { color: var(--lie-texte); }
.cockpit-phrase { font-family: var(--serif); font-size: 17px; line-height: 1.45; margin: 14px 0 0; color: var(--texte-doux); text-wrap: pretty; }
.cockpit-phrase button {
  border: 0; background: none; padding: 0; font: inherit; color: var(--texte); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--filet); text-underline-offset: 4px;
}

/* Le plan : chaque tiroir vu de face, un cul de bouteille par bouteille */
.plan { margin-bottom: 28px; }
.plan > h2 { font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--filet); }
.plan-aide { margin-top: 0; }
.meubles { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 10px; }
.meuble { min-width: 0; }
.meuble h3 { font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--texte-doux); margin: 0 0 4px; }
.niveaux { list-style: none; margin: 0; padding: 0; }
.niveau {
  display: grid; grid-template-columns: 2.1em 1fr auto; align-items: center; gap: 8px;
  min-height: 34px; padding: 4px 6px 4px 4px; margin: 0 -6px 0 -4px; border-radius: 8px;
  color: inherit; text-decoration: none; transition: transform 120ms ease-out;
}
.niveau + .niveau, li + li > .niveau { border-top: 1px solid var(--filet); border-radius: 0; }
.niveau.actif { background: var(--craie-2); border-radius: 8px; }
.niveau.touche { animation: touche 1200ms ease-out; }
@keyframes touche { 0%, 30% { background: color-mix(in srgb, var(--lie) 16%, transparent); } }
.niveau-code { font-size: 13px; font-weight: 600; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.culs { display: flex; flex-wrap: wrap; gap: 3px; min-width: 0; }
.cul {
  width: 10px; height: 10px; border-radius: 50%; flex: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--teinte) 55%, #000) 0 28%, var(--teinte) 34%);
}
.cul.a-boire { outline: 1.5px solid var(--texte); outline-offset: 1px; }
.cul.arrive { animation: arrive 360ms cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: calc(var(--i, 0) * 60ms + 150ms); }
@keyframes arrive { from { transform: scale(0); opacity: 0; } }
.niveau-vide { font-size: 12px; color: var(--texte-doux); opacity: 0.7; }
.niveau-nb { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.drapeau { width: 13px; height: 13px; color: var(--lie-texte); stroke-width: 2; }
.plan-legende { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--texte-doux); margin: 12px 0 0; }
.plan-legende li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* La liste, derrière la recherche */
.zone-liste { scroll-margin-top: 12px; }
.filtre-actif {
  display: inline-flex; align-items: center; gap: 4px; justify-self: start;
  padding: 0 4px 0 14px; min-height: 36px; border-radius: 18px; background: var(--texte); color: var(--fond); font-size: 14px; font-weight: 600;
}
.filtre-actif a { display: grid; place-items: center; width: 32px; height: 32px; color: inherit; }
.filtre-actif svg { width: 16px; height: 16px; }
.voir-tout {
  display: flex; align-items: center; min-height: 48px; margin-top: 4px;
  color: var(--texte-doux); text-underline-offset: 3px; font-size: 15px;
}
#liste > .groupe { animation: apparait 200ms ease-out; }
@keyframes apparait { from { opacity: 0; transform: translateY(6px); } }

/* Couleurs du vin, toujours doublées d'un libellé texte */
[data-couleur="rouge"] { --teinte: var(--lie); }
[data-couleur="blanc"] { --teinte: var(--paille); }
[data-couleur="rosé"] { --teinte: var(--rose); }
[data-couleur="effervescent"] { --teinte: var(--mousse); }
[data-couleur="liquoreux"] { --teinte: #b8862f; }
[data-couleur="orange"] { --teinte: var(--orange); }

/* Filtres */
.filtres { display: grid; gap: 12px; margin-bottom: 8px; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--texte);
  background: var(--surface); border: 1px solid var(--filet); border-radius: 10px;
  padding: 11px 12px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--lie); outline-offset: 0; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
textarea { resize: vertical; min-height: 64px; }

.pastilles { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.pastilles::-webkit-scrollbar { display: none; }
.pastille {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border-radius: 18px; border: 1px solid var(--filet); background: transparent; color: var(--texte);
  font: inherit; font-size: 14px; cursor: pointer; user-select: none;
}
.pastille[aria-pressed="true"] { background: var(--texte); color: var(--fond); border-color: var(--texte); }
.pastille .goutte { width: 8px; height: 8px; border-radius: 50%; background: var(--teinte); }

/* Liste des vins, en lignes */
.groupe { margin-top: 24px; }
.groupe h2 { font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 6px; border-bottom: 1px solid var(--filet); }
.groupe h2 .compte { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
.groupe.urgent h2 { color: var(--lie-texte); }
ul.vins { list-style: none; margin: 0; padding: 0; }
.vin {
  content-visibility: auto; contain-intrinsic-size: auto 68px;
  border-bottom: 1px solid var(--filet);
}
.vin button {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 0 14px; align-items: center; width: 100%;
  padding: 12px 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.vin .liseré { grid-row: span 2; align-self: stretch; border-radius: 2px; background: var(--teinte); }
.vin .domaine { font-family: var(--serif); font-size: 17px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vin .details { grid-column: 2; font-size: 14px; color: var(--texte-doux); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vin .millesime { font-variant-numeric: tabular-nums; font-size: 15px; text-align: right; }
.vin .quantite { grid-column: 3; text-align: right; font-size: 14px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .vin button:hover .domaine { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; } }

/* États vides */
.vide { padding: 40px 0; text-align: left; }
.vide h2 { margin-bottom: 8px; }
.vide p { color: var(--texte-doux); margin: 0 0 20px; max-width: 34ch; }

/* Boutons */
.bouton-principal, .bouton-secondaire {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 24px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; user-select: none;
  transition: transform 120ms ease-out;
}
.bouton-principal { background: var(--lie); color: #fff; border: 0; width: 100%; }
.bouton-secondaire { background: transparent; color: var(--texte); border: 1px solid var(--filet); }
.bouton-secondaire.danger { color: var(--lie-texte); }
.bouton-principal:active, .bouton-secondaire:active { transform: scale(0.97); }
.bouton-principal[aria-busy="true"] { opacity: 0.75; cursor: progress; }
.lien { background: none; border: 0; padding: 12px 0; font: inherit; color: var(--texte-doux); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rangee-boutons { display: flex; flex-wrap: wrap; gap: 10px; }

/* Ajouter */
.photo {
  display: grid; justify-items: start; gap: 6px; padding: 28px 22px; margin: 12px 0 8px;
  border: 1.5px dashed color-mix(in srgb, var(--texte) 28%, transparent); border-radius: var(--rayon);
  cursor: pointer;
}
.photo svg { width: 34px; height: 34px; color: var(--lie-texte); }
.photo-titre { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.photo-aide { color: var(--texte-doux); font-size: 15px; max-width: 36ch; }
/* Lecture d'étiquette : la photo balayée, les étapes en mots */
.lecture-en-cours { display: grid; justify-items: start; gap: 14px; padding: 20px 0; }
.lecture-photo { position: relative; width: 120px; height: 160px; border-radius: 10px; overflow: hidden; background: var(--craie-2); }
.lecture-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lecture-photo img:not([src]) { visibility: hidden; }
.balayage {
  position: absolute; inset: 0 0 auto; height: 2px; background: var(--paille);
  box-shadow: 0 0 12px 3px color-mix(in srgb, var(--paille) 60%, transparent);
  animation: balaye 1.6s ease-in-out infinite alternate;
}
@keyframes balaye { to { transform: translateY(158px); } }
#lecture-etape { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--texte-doux); }
.formulaire .rempli { animation: rempli 260ms ease-out both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rempli { from { opacity: 0; transform: translateY(4px); } }

/* Pendant que l'IA réfléchit : la forme du résultat */
.fantomes { display: grid; gap: 18px; padding: 8px 0; }
.fantome { display: grid; gap: 8px; }
.fantome span { display: block; height: 12px; border-radius: 6px; background: var(--craie-2); animation: respire 1.2s ease-in-out infinite alternate; }
.fantome span:first-child { height: 18px; width: 60%; }
.fantome span:last-child { width: 80%; }
@keyframes respire { to { opacity: 0.45; } }

/* Formulaires */
.formulaire { display: grid; gap: 8px; margin-top: 12px; }
.formulaire label, .champ > span { font-size: 14px; font-weight: 600; }
.formulaire .bouton-principal { margin-top: 12px; }
.aide { font-size: 14px; color: var(--texte-doux); margin: 0; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.champ { display: grid; gap: 6px; }
.entete-lecture { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 8px; }
.entete-lecture img { width: 72px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--craie-2); }
.remarque { font-size: 14px; color: var(--texte-doux); font-style: italic; margin: 0; }
.quantite-pas { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; border: 1px solid var(--filet); border-radius: 10px; background: var(--surface); }
.quantite-pas button { height: 46px; border: 0; background: none; font-size: 22px; color: var(--texte); cursor: pointer; }
.quantite-pas input { border: 0; text-align: center; background: none; font-variant-numeric: tabular-nums; padding: 0; }
.groupe-reglages { margin-top: 32px; display: grid; gap: 10px; }
.erreur-champ { color: var(--lie-texte); font-size: 14px; margin: 0; }

/* Accords */
.accord { padding: 16px 0; border-bottom: 1px solid var(--filet); display: grid; gap: 4px; }
.accord button { all: unset; cursor: pointer; font-family: var(--serif); font-size: 18px; font-weight: 600; }
.accord button:focus-visible { outline: 2px solid var(--lie); outline-offset: 2px; }
.accord p { margin: 0; color: var(--texte-doux); }
.accord .etat { font-size: 13px; }
.hors-cave { margin-top: 16px; color: var(--texte-doux); font-style: italic; }

/* Fiche d'un vin : panneau du bas */
.panneau {
  border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88dvh;
  background: var(--surface); color: var(--texte);
  border-radius: 20px 20px 0 0; overscroll-behavior: contain;
}
@media (min-width: 720px) { .panneau { margin: auto; max-width: 560px; border-radius: 20px; } }
.panneau::backdrop { background: rgb(20 27 23 / 0.45); }
.panneau[open] { animation: monte 180ms ease-out; }
@keyframes monte { from { transform: translateY(24px); opacity: 0.6; } }
.panneau-contenu { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 16px; }
.panneau-entete { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.panneau-entete h2 { font-size: 24px; }
.panneau-entete p { margin: 4px 0 0; color: var(--texte-doux); }
.fermer { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--craie-2); color: var(--texte); cursor: pointer; display: grid; place-items: center; margin: -6px -6px 0 0; }
.faits { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.faits dt { color: var(--texte-doux); }
.faits dd { margin: 0; font-variant-numeric: tabular-nums; }
.faits dd::first-letter { text-transform: uppercase; }
.actions { display: grid; gap: 10px; }
.recettes { display: grid; gap: 14px; }
.recette h3 { font-size: 17px; }
.recette p { margin: 2px 0 0; font-size: 15px; }
.recette .pourquoi { color: var(--texte-doux); }
.ouverture-form { display: grid; gap: 10px; }
.notes-etoiles { display: flex; gap: 6px; }
.notes-etoiles label { flex: 1; }
.notes-etoiles input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.notes-etoiles span {
  display: grid; place-items: center; height: 44px; border: 1px solid var(--filet); border-radius: 10px;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.notes-etoiles input:checked + span { background: var(--texte); color: var(--fond); }
.notes-etoiles input:focus-visible + span { outline: 2px solid var(--lie); outline-offset: 2px; }

/* Onglets du bas */
.onglets {
  position: fixed; inset: auto 0 0 0; z-index: 5; height: var(--onglets);
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: start;
  padding: 6px max(12px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
  background: var(--fond);
  border-top: 1px solid var(--filet);
}
.onglets a {
  display: grid; justify-items: center; gap: 2px; padding: 6px 0; min-height: 50px;
  font-size: 12px; color: var(--texte-doux); text-decoration: none; user-select: none;
}
.onglets a[aria-current="page"] { color: var(--texte); font-weight: 600; }
.onglets svg { height: 26px; }
.onglets .onglet-ajouter svg { width: 26px; height: 26px; padding: 3px; border-radius: 50%; background: var(--lie); color: #fff; stroke-width: 2.2; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--onglets) + 12px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: 12px; background: var(--texte); color: var(--fond);
  font-size: 15px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 8px 24px rgb(0 0 0 / 0.16);
  visibility: hidden; opacity: 0; transform: translate(-50%, 8px);
  transition: opacity 180ms ease-out, transform 180ms ease-out, visibility 180ms;
  z-index: 20;
}
.toast.visible { visibility: visible; opacity: 1; transform: translate(-50%, 0); }
.toast button { background: none; border: 0; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .balayage { display: none; }
}

/* Ce soir : deux entrées en miroir */
.bascule {
  display: grid; grid-template-columns: 1fr 1fr; padding: 3px; margin: 4px 0 20px;
  border-radius: 12px; background: var(--craie-2);
}
.bascule a {
  display: grid; place-items: center; min-height: 40px; border-radius: 9px;
  font-size: 15px; color: var(--texte-doux); text-decoration: none; user-select: none;
}
.bascule a[aria-current="page"] {
  background: var(--bascule-actif, var(--surface)); color: var(--texte); font-weight: 600;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08), 0 1px 1px rgb(0 0 0 / 0.04);
}
.titre-mode { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.2; margin-bottom: 4px; }
.formulaire label.titre-mode { font-size: 21px; }
.priorites { margin-top: 20px; }
.priorites h3 { font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--texte-doux); padding-bottom: 6px; border-bottom: 1px solid var(--filet); }
.priorites input { margin: 10px 0 4px; }
.vin-choisi { display: grid; gap: 14px; padding: 4px 0 8px; }
.vin-choisi .entete-choix { display: grid; grid-template-columns: 4px 1fr; gap: 14px; }
.vin-choisi .liseré { border-radius: 2px; background: var(--teinte); }
.vin-choisi h2 { font-size: 22px; }
.vin-choisi p { margin: 2px 0 0; color: var(--texte-doux); }
.vin-choisi .rangee-boutons .bouton-principal { width: auto; flex: 1; }

/* Qualité des données */
.lien-qualite {
  display: inline-flex; align-items: center; gap: 8px; margin: -12px 0 24px; min-height: 44px;
  font-size: 14px; color: var(--texte-doux); text-decoration: none;
}
.lien-qualite .jauge-mini { width: 48px; height: 4px; border-radius: 2px; background: var(--craie-2); overflow: hidden; }
.lien-qualite .jauge-mini span { display: block; height: 100%; background: var(--texte-doux); border-radius: 2px; }
.lien-qualite strong { color: var(--texte); font-weight: 600; font-variant-numeric: tabular-nums; }
.lien-qualite .alerte-compte { color: var(--lie-texte); }

.qualite-tete { margin: 4px 0 28px; }
.qualite-chiffre { font-family: var(--serif); font-size: 56px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.qualite-tete p { margin: 8px 0 0; color: var(--texte-doux); max-width: 34ch; }

.qualite-bloc { margin-top: 28px; }
.qualite-bloc h2 { font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--filet); }
.jauges { list-style: none; margin: 0; padding: 0; }
.jauge { border-bottom: 1px solid var(--filet); }
.jauge button {
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; width: 100%; padding: 14px 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.jauge button[disabled] { cursor: default; }
.jauge .nom { font-size: 15px; }
.jauge .valeur { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--texte-doux); }
.jauge .piste { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: var(--craie-2); overflow: hidden; }
.jauge .rempli { height: 100%; border-radius: 4px; background: var(--texte-doux); }
.jauge[aria-expanded="true"] .nom { font-weight: 600; }
.manquants { list-style: none; margin: 0 0 12px; padding: 0 0 0 12px; border-left: 2px solid var(--filet); }
.manquants button { padding: 8px 0; font-size: 15px; }
.alertes { list-style: none; margin: 0; padding: 0; }
.alertes li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--filet); }
.alertes svg { width: 20px; height: 20px; color: var(--lie-texte); margin-top: 2px; }
.alertes p { margin: 0; }
.alertes .vins-concernes { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; }
.alertes .vins-concernes button, .manquants button {
  border: 0; background: none; color: var(--texte-doux); font: inherit; font-size: 14px; padding: 6px 0; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-align: left;
}
.ok { color: var(--texte-doux); margin: 12px 0 0; }
.cle-enregistree { margin-top: 12px; }

/* Le pourquoi d'un accord, en critères */
.criteres { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.criteres li { display: grid; grid-template-columns: 6.2em 1fr; gap: 10px; font-size: 15px; line-height: 1.35; }
.criteres strong { font-weight: 600; color: var(--texte); }
.criteres span { color: var(--texte-doux); }

/* Souvenirs : un journal de moments, jamais un compteur */
.un-an {
  font-family: var(--serif); font-size: 19px; line-height: 1.4; margin: 4px 0 20px; color: var(--texte-doux); text-wrap: pretty;
}
.un-an button {
  border: 0; background: none; padding: 0; font: inherit; color: var(--texte); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--filet); text-underline-offset: 4px;
}
.mois { margin-top: 20px; }
.mois > h2 { font-size: 17px; padding-bottom: 6px; border-bottom: 1px solid var(--filet); }
.souvenir { padding: 18px 0; border-bottom: 1px solid var(--filet); display: grid; gap: 12px; }
.souvenir-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: var(--craie-2); }
.souvenir-corps { display: grid; gap: 4px; border-left: 3px solid var(--teinte, var(--filet)); padding-left: 14px; }
.souvenir-date { margin: 0; font-size: 13px; color: var(--texte-doux); }
.souvenir h3 { font-size: 19px; }
.souvenir-texte { margin: 4px 0 0; font-family: var(--serif); font-size: 17px; font-style: italic; line-height: 1.45; text-wrap: pretty; }
.souvenir-meta { margin: 2px 0 0; font-size: 14px; color: var(--texte-doux); }
.souvenir-actions { display: flex; flex-wrap: wrap; gap: 0 18px; }
.souvenir-actions .lien { padding: 10px 0; font-size: 14px; }
.champ-photo { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.champ-photo .bouton-secondaire { font-weight: 600; }
.champ-photo svg { width: 20px; height: 20px; }
.apercu-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.arrive-photo { animation: arrive 320ms cubic-bezier(.2, 1.4, .4, 1); }
.onglets a.recoit svg { animation: recoit 520ms cubic-bezier(.2, 1.4, .4, 1); transform-origin: 50% 100%; }
@keyframes recoit { 30% { transform: translateY(-5px) scale(1.15); } }

/* Revue des fiches et rangement direct */
.faits dd.a-verifier { color: var(--lie-texte); }
.panneau-contenu.suivante { animation: suivante 240ms ease-out; }
@keyframes suivante { from { opacity: 0; transform: translateX(16px); } }
#liste > .ranger { margin: 4px 0 8px; }
