/* Le Chai — feuille de style
   Organisation : police → jetons du design system → base → structure → composants → pages → animations → fenêtres étroites.
   Tous les composants puisent dans les mêmes jetons (couleurs, espacements, rayons, ombres, durées). */

/* --- Police : Bricolage Grotesque, servie en local (licence libre OFL, voir polices/OFL.txt) --- */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/polices/bricolage-grotesque-latin.woff2) format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/polices/bricolage-grotesque-latin-ext.woff2) format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Jetons --- */
:root {
  color-scheme: light;
  /* Couleurs de fond et de texte */
  --fond: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --surface-3: #f1ede8;
  --bord: #ebe6df;
  --bord-fort: #dad3c9;
  --texte: #1d1916;
  --texte-2: #57504a;
  --texte-3: #7b736b;
  /* Couleur d'action : bordeaux */
  --accent: #7a1f3d;
  --accent-fonce: #5f1630;
  --accent-doux: #f7eaee;
  --accent-bord: #e6c4d0;
  --accent-texte: #7a1f3d;
  --accent-sur-doux: #5f1630;
  --anneau: 0 0 0 4px rgba(122, 31, 61, .14);
  --bord-survol: #c9c0b4;
  --placeholder: #a39a91;
  --entete-fond: rgba(247, 245, 242, .86);
  --voile: rgba(29, 25, 22, .32);
  --onglet-sel: #ffffff;
  --serie: #7a1f3d;
  --serie-neutre: #b9aea2;
  /* Couleurs d'état */
  --or: #b88a2e;
  --ok: #1f7a3a;
  --alerte: #b54708;
  --danger: #b42318;
  --sombre: #1d1916;
  --danger-doux: #fdeeec; --danger-bord: #f5c9c3; --danger-texte: #7a1c13;
  --avert-doux: #fdf5e7; --avert-bord: #f0dcb6; --avert-texte: #6e4510;
  --succes-doux: #f1f7f2; --succes-bord: #cfe4d5; --succes-texte: #24563a;
  --express-fond: linear-gradient(135deg, #fbf1f4, #fffaf3);
  /* Couleurs des vins */
  --rouge: #a83250; --blanc: #d9a400; --effervescent: #2a78d6; --rose: #e87ba4; --liquoreux: #b4621a;
  /* Espacements (grille de 4 px) */
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 20px; --e6: 24px; --e8: 32px; --e10: 40px;
  /* Rayons */
  --rayon: 14px;
  --rayon-moyen: 10px;
  --rayon-petit: 8px;
  --rayon-plein: 999px;
  /* Ombres */
  --ombre-xs: 0 1px 2px rgba(29, 25, 22, .05);
  --ombre: 0 1px 2px rgba(29, 25, 22, .04), 0 2px 10px rgba(29, 25, 22, .035);
  --ombre-survol: 0 2px 6px rgba(29, 25, 22, .05), 0 12px 32px rgba(29, 25, 22, .08);
  --ombre-forte: 0 4px 14px rgba(29, 25, 22, .08), 0 24px 64px rgba(29, 25, 22, .18);
  /* Mouvements : courts, pour accompagner une action sans la ralentir */
  --rapide: 120ms;
  --duree: 180ms;
  --lente: 280ms;
  --courbe: cubic-bezier(.2, .8, .2, 1);
  --courbe-sortie: cubic-bezier(.4, 0, 1, 1);
  /* Typographie : une seule famille, plusieurs graisses */
  --police: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: var(--police);
  --serif: var(--police);
  /* Dimensions de la structure */
  --largeur-barre: 248px;
  --h-entete: 68px;
}

/* --- Mode sombre : mêmes jetons, autres valeurs (attribut posé par le script en tête de index.html) --- */
:root[data-mode="sombre"] {
  color-scheme: dark;
  --fond: #141110;
  --surface: #1c1917;
  --surface-2: #211d1b;
  --surface-3: #2a2522;
  --bord: #322c29;
  --bord-fort: #443d39;
  --bord-survol: #5a514b;
  --texte: #f3ede7;
  --texte-2: #c6bcb3;
  --texte-3: #988d84;
  --placeholder: #7a7068;
  --accent: #a3304f;
  --accent-fonce: #b83a5c;
  --accent-doux: #3a1d27;
  --accent-bord: #6e2d42;
  --accent-texte: #f08faa;
  --accent-sur-doux: #f7bccb;
  --anneau: 0 0 0 4px rgba(240, 143, 170, .22);
  --or: #d8aa4c;
  --ok: #5bbd78;
  --alerte: #ec9a50;
  --danger: #f27b6b;
  --sombre: #36302d;
  --toast-bord: #4a423e;
  --danger-doux: #3a1e1b; --danger-bord: #6b2e27; --danger-texte: #f5b3a9;
  --avert-doux: #33261a; --avert-bord: #5e4424; --avert-texte: #f0c88e;
  --succes-doux: #1b2b20; --succes-bord: #2f5139; --succes-texte: #a6dcb5;
  --express-fond: linear-gradient(135deg, #2a1a20, #241e19);
  --entete-fond: rgba(20, 17, 16, .82);
  --voile: rgba(0, 0, 0, .55);
  --onglet-sel: #3a3431;
  --serie: #c9506f;
  --serie-neutre: #6b625c;
  --ombre-xs: 0 1px 2px rgba(0, 0, 0, .3);
  --ombre: 0 1px 2px rgba(0, 0, 0, .25), 0 2px 10px rgba(0, 0, 0, .2);
  --ombre-survol: 0 2px 6px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .35);
  --ombre-forte: 0 4px 14px rgba(0, 0, 0, .35), 0 24px 64px rgba(0, 0, 0, .55);
}
/* En sombre, la teinte garde la couleur d'origine mais l'éclaircit, sur un fond assombri */
[data-mode="sombre"] .teinte { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
[data-mode="sombre"] .btn.teinte:hover { filter: brightness(1.12); }
[data-mode="sombre"] .logo-marque { color: #fbe9ee; }
[data-mode="sombre"] img { filter: brightness(.92); }
/* Changement de thème : fondu des couleurs, uniquement pendant la bascule */
.bascule-theme, .bascule-theme * { transition: background-color var(--lente), border-color var(--lente), color var(--lente) !important; }

/* --- Base --- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--fond); color: var(--texte); font: 400 14.5px/1.55 var(--police); font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-family: var(--police); font-weight: 650; letter-spacing: -.015em; margin: 0; color: var(--texte); line-height: 1.25; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.028em; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 15.5px; }
a { color: var(--accent-texte); text-underline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-doux); color: var(--accent-sur-doux); }
[hidden] { display: none !important; }
svg.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.muet { color: var(--texte-3); }
.petit { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.chiffres { font-variant-numeric: tabular-nums; }
code { font-size: .92em; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

/* --- Structure --- */
.app { display: grid; grid-template-columns: var(--largeur-barre) minmax(0, 1fr); min-height: 100vh; }
.barre { background: var(--surface); border-right: 1px solid var(--bord); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--e5) var(--e3); z-index: 60; }
.logo { display: flex; align-items: center; gap: var(--e3); color: var(--texte); text-decoration: none; padding: 2px var(--e2) var(--e6); border-radius: var(--rayon-moyen); }
.logo-marque { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: #f7efe6; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 6px rgba(122, 31, 61, .25); transition: transform var(--duree) var(--courbe); }
.logo:hover .logo-marque { transform: rotate(-6deg) scale(1.04); }
.logo-marque svg { width: 22px; height: 22px; }
.logo-texte { display: flex; flex-direction: column; line-height: 1.1; }
.logo-texte b { font-size: 21px; font-weight: 750; letter-spacing: -.03em; }
.logo-texte small { font-size: 12px; color: var(--texte-3); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav a { display: flex; align-items: center; gap: var(--e3); padding: 9px var(--e3); border-radius: var(--rayon-moyen); color: var(--texte-2); text-decoration: none; font-size: 14.5px; font-weight: 500; transition: background var(--rapide), color var(--rapide); }
.nav a svg.ico { color: var(--texte-3); transition: color var(--rapide); }
.nav a:hover { background: var(--surface-3); color: var(--texte); }
.nav a:hover svg.ico { color: var(--texte-2); }
.nav a.actif { background: var(--accent-doux); color: var(--accent-sur-doux); font-weight: 650; }
.nav a.actif svg.ico { color: var(--accent); }
.nav a:focus-visible { outline: none; box-shadow: var(--anneau); }
.nav a span:not(.compteur) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav .compteur { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--texte-2); padding: 0 8px; border-radius: var(--rayon-plein); line-height: 20px; font-variant-numeric: tabular-nums; }
.nav a.actif .compteur { background: var(--surface); color: var(--accent-sur-doux); }
.nav .compteur.chaud { background: var(--accent); color: #fff; }
.nav-sep { height: 1px; background: var(--bord); margin: var(--e3) var(--e2); flex: none; }
.onglets.choix-theme { margin: auto var(--e2) var(--e2); display: grid; grid-template-columns: repeat(3, 1fr); }
.onglets.choix-theme button { display: grid; place-items: center; padding: 6px 0; }
.onglets button svg.ico { width: 16px; height: 16px; vertical-align: -3px; }
.barre-pied { font-size: 12.5px; color: var(--texte-3); padding: var(--e2) var(--e3); display: flex; gap: var(--e2); align-items: center; border-radius: var(--rayon-moyen); }
.barre-pied .voyant { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px rgba(31, 122, 58, .14); }
.barre-pied.attente .voyant { background: var(--or); box-shadow: 0 0 0 3px rgba(184, 138, 46, .18); animation: battement 1s ease-in-out infinite; }
.barre-pied.ok .voyant { animation: pop var(--lente) var(--courbe); }
.barre-pied.erreur { color: var(--danger); background: var(--danger-doux); }
.barre-pied.erreur .voyant { background: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.barre-pied.conflit, .barre-pied.deconnecte { color: var(--danger); background: var(--danger-doux); cursor: pointer; }
.barre-pied.conflit .voyant, .barre-pied.deconnecte .voyant { background: var(--danger); box-shadow: 0 0 0 3px rgba(180, 35, 24, .15); }
.compte-barre { display: flex; align-items: center; gap: var(--e2); margin: 0 var(--e2) var(--e1); padding-left: var(--e3); font-size: 13px; color: var(--texte-2); }
.compte-nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* ---------- Connexion et invitation (mode plusieurs caves) ---------- */
#connexion { display: none; }
.hors-connexion .app { display: none; }
.hors-connexion #connexion { display: block; }
.ecran-connexion { min-height: 100vh; display: grid; place-items: center; padding: var(--e6) var(--e4); }
.carte-connexion { width: min(420px, 100%); padding: var(--e8) var(--e6); display: flex; flex-direction: column; gap: var(--e3); }
.carte-connexion h1 { font-size: 24px; letter-spacing: -.02em; margin: var(--e3) 0 0; }
.carte-connexion > p { margin: 0; line-height: 1.55; }
.connexion-logo { padding: 0; }
.form-connexion { display: flex; flex-direction: column; gap: var(--e4); margin: var(--e3) 0; }
.form-connexion .btn-principal { justify-content: center; height: 44px; }
.erreur-form { margin: 0; padding: var(--e2) var(--e3); border-radius: var(--rayon-moyen); background: var(--danger-doux); color: var(--danger-texte); font-size: 13.5px; line-height: 1.45; }
@media (max-width: 560px) { .carte-connexion { padding: var(--e6) var(--e5); } }

/* ---------- Accueil d'un nouveau compte ---------- */
.bienvenue { max-width: 980px; display: flex; flex-direction: column; gap: var(--e4); }
.bienvenue .titre-page { margin-bottom: var(--e2); }
.etapes-accueil { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--e2); font-size: 13px; font-weight: 600; }
.etapes-accueil li { padding: 4px 12px; border-radius: var(--rayon-plein); background: var(--surface-2); color: var(--texte-3); }
.etapes-accueil li.actif { background: var(--accent-doux); color: var(--accent-sur-doux); }
.etapes-accueil li.fait { color: var(--texte-2); }
.carte-titre-accueil h2 { margin: 0; }
.carte-titre-accueil p { margin: 6px 0 0; line-height: 1.55; max-width: 70ch; }
.liste-rangements-accueil { display: flex; flex-direction: column; gap: var(--e4); }
.rangement-accueil { display: flex; flex-direction: column; gap: var(--e4); }
.modeles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e2); }
.modele { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: var(--e3) var(--e4); border: 1px solid var(--bord-fort); border-radius: var(--rayon-moyen); background: var(--surface); color: var(--texte); font: inherit; cursor: pointer; transition: border-color var(--rapide), box-shadow var(--duree), background var(--rapide); -webkit-tap-highlight-color: transparent; }
.modele b { font-weight: 650; font-size: 14px; }
.modele span { font-size: 12.5px; color: var(--texte-3); }
.modele:hover { border-color: var(--bord-survol); }
.modele:focus-visible { outline: none; box-shadow: var(--anneau); }
.modele.sel { border-color: var(--accent); background: var(--accent-doux); box-shadow: var(--anneau); }
.modele.sel b { color: var(--accent-sur-doux); }
.reglage-accueil { display: grid; grid-template-columns: 1.5fr 1fr auto auto; gap: var(--e4); align-items: end; }
.pied-rangement { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); flex-wrap: wrap; }
.pied-accueil { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); flex-wrap: wrap; padding-top: var(--e4); border-top: 1px solid var(--bord); }
.grille.choix-depart { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.choix-depart .carte-corps { display: flex; flex-direction: column; gap: var(--e2); align-items: flex-start; }
.choix-depart h3 { margin: var(--e2) 0 0; }
.choix-depart p { margin: 0 0 var(--e2); line-height: 1.5; flex: 1; }
.ico-depart { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-doux); color: var(--accent-sur-doux); }
.ico-depart .ico { width: 22px; height: 22px; }

/* ---------- Page « Amis » ---------- */
.form-invitation { display: flex; gap: var(--e3); align-items: end; }
.form-invitation .champ { flex: 1; }
.lien-invitation { margin-top: var(--e4); padding: var(--e4); border-radius: var(--rayon-moyen); background: var(--succes-doux); border: 1px solid var(--succes-bord); display: flex; flex-direction: column; gap: var(--e3); }
.lien-invitation p { margin: 0; line-height: 1.5; }
.ligne-lien { display: flex; gap: var(--e2); }
.ligne-lien .input { flex: 1; font-size: 13px; }
.ligne-ami { align-items: center !important; }
.ligne-ami .ami-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne-ami .badge { margin-left: 4px; }
.ligne-ami.inactif b { color: var(--texte-3); }

@media (max-width: 760px) {
  .reglage-accueil, .modeles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-invitation, .ligne-lien { flex-direction: column; align-items: stretch; }
  .ligne-ami { flex-direction: column; align-items: flex-start !important; }
}
.principal { min-width: 0; display: flex; flex-direction: column; }
.entete { position: sticky; top: 0; z-index: 30; display: flex; gap: var(--e3); align-items: center; height: var(--h-entete); padding: 0 var(--e8); background: var(--entete-fond); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--bord); }
.entete .btn-menu { display: none; }
.entete .espace { flex: 1; }
.vue { padding: var(--e8) var(--e8) 72px; max-width: 1400px; width: 100%; outline: none; }
.titre-page { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e4); margin-bottom: var(--e6); flex-wrap: wrap; }
.titre-page p { margin: 6px 0 0; color: var(--texte-2); font-size: 15px; }
.actions { display: flex; gap: var(--e2); flex-wrap: wrap; align-items: center; }
.barre-fond { display: none; }

/* --- Recherche globale --- */
.recherche-globale { position: relative; flex: 0 1 620px; min-width: 0; }
.recherche-globale input { width: 100%; height: 42px; padding: 0 76px 0 42px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: var(--surface); outline: none; box-shadow: var(--ombre-xs); transition: border-color var(--rapide), box-shadow var(--duree); text-overflow: ellipsis; }
.recherche-globale input:hover { border-color: var(--bord-fort); }
.recherche-globale input:focus { border-color: var(--accent); box-shadow: var(--anneau); }
.recherche-globale input::placeholder { color: var(--texte-3); }
.ico-recherche { position: absolute; left: 14px; top: 11px; color: var(--texte-3); pointer-events: none; }
.recherche-globale kbd { position: absolute; right: 10px; top: 10px; font: 500 11.5px var(--police); color: var(--texte-3); border: 1px solid var(--bord); border-bottom-width: 2px; border-radius: 6px; padding: 1px 7px; background: var(--surface-2); pointer-events: none; }
.resultats-globaux { position: absolute; top: 50px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-forte); max-height: 70vh; overflow: auto; padding: 6px; animation: deroule var(--duree) var(--courbe); transform-origin: top; }
.rg-groupe { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-3); padding: 10px 10px 4px; }
.rg-item { display: flex; gap: var(--e3); align-items: center; padding: 9px 10px; border-radius: var(--rayon-petit); cursor: pointer; transition: background var(--rapide); }
.rg-item:hover, .rg-item.sel { background: var(--surface-3); }
.rg-item .rg-titre { font-weight: 600; }
.rg-item .rg-sous { font-size: 12.5px; color: var(--texte-2); }
.rg-item .rg-lieu { margin-left: auto; font-size: 12px; color: var(--accent-texte); text-align: right; max-width: 45%; }
.rg-vide { padding: var(--e4); color: var(--texte-3); }

/* --- Boutons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); height: 38px; padding: 0 var(--e4); border-radius: var(--rayon-moyen); border: 1px solid var(--bord-fort); background: var(--surface); cursor: pointer; white-space: nowrap; font-weight: 550; font-size: 14px; text-decoration: none; color: var(--texte); box-shadow: var(--ombre-xs); transition: background var(--rapide), border-color var(--rapide), color var(--rapide), box-shadow var(--duree), transform var(--rapide) var(--courbe); -webkit-tap-highlight-color: transparent; }
.btn:hover { background: var(--surface-2); border-color: var(--bord-survol); }
.btn:active:not([disabled]) { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .lien:focus-visible, .onglets button:focus-visible, .qte button:focus-visible { outline: none; box-shadow: var(--anneau); }
.btn-principal { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(122, 31, 61, .3); }
.btn-principal:hover { background: var(--accent-fonce); border-color: var(--accent-sur-doux); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 4px 14px rgba(122, 31, 61, .28); }
.btn-principal:focus-visible { box-shadow: var(--anneau), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-discret { border-color: transparent; background: transparent; box-shadow: none; color: var(--texte-2); }
.btn-discret:hover { background: var(--surface-3); border-color: transparent; color: var(--texte); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-doux); border-color: var(--danger-bord); }
.btn-petit { height: 32px; padding: 0 var(--e3); font-size: 13px; border-radius: var(--rayon-petit); gap: 6px; }
.btn-petit svg.ico { width: 16px; height: 16px; }
.btn-icone { width: 38px; padding: 0; }
.btn-petit.btn-icone { width: 32px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-cloche { position: relative; }
.btn-cloche:hover svg.ico { animation: sonne .5s var(--courbe); transform-origin: 50% 10%; }
.pastille { position: absolute; top: -6px; right: -6px; background: var(--danger); color: #fff; font-size: 11px; min-width: 19px; height: 19px; border-radius: var(--rayon-plein); display: grid; place-items: center; padding: 0 5px; font-weight: 700; border: 2px solid var(--fond); animation: pop var(--lente) var(--courbe); }
.lien { background: none; border: 0; padding: 0; color: var(--accent-texte); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--accent-bord); transition: text-decoration-color var(--rapide); border-radius: 4px; }
.lien:hover { text-decoration-color: currentColor; }

/* --- Cartes et grilles --- */
.carte { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre); }
a.carte, .carte-vin { transition: box-shadow var(--duree), border-color var(--duree), transform var(--duree) var(--courbe); }
a.carte:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-survol); transform: translateY(-2px); }
.carte-corps { padding: var(--e5) var(--e6); }
.carte-titre { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); padding: var(--e5) var(--e6) 0; flex-wrap: wrap; }
.carte-titre h2, .carte-titre h3 { font-size: 16.5px; }
.carte-titre .sous { color: var(--texte-3); font-size: 13px; }
.carte-titre a.sous { color: var(--accent-texte); text-decoration: none; font-weight: 550; }
.carte-titre a.sous:hover { text-decoration: underline; }
.grille { display: grid; gap: var(--e5); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --- Tuiles chiffres --- */
.tuile { padding: var(--e5) var(--e6); }
.tuile .lib { color: var(--texte-2); font-size: 13px; font-weight: 500; }
.tuile .val { font-size: 28px; font-weight: 650; letter-spacing: -.025em; margin-top: 2px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tuile .det { font-size: 12.5px; color: var(--texte-3); margin-top: 2px; }
.tuile.heros .val { font-size: 56px; line-height: 1.02; font-weight: 700; letter-spacing: -.04em; margin-top: 6px; }

/* --- Pastilles, badges, étiquettes --- */
.puce { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: var(--rayon-plein); white-space: nowrap; line-height: 18px; }
.badge .point { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 10px; border-radius: var(--rayon-plein); background: var(--surface-3); color: var(--texte-2); border: 1px solid var(--bord); white-space: nowrap; }
.tag button { border: 0; background: none; padding: 0; cursor: pointer; color: var(--texte-3); font-size: 14px; line-height: 1; transition: color var(--rapide); }
.tag button:hover { color: var(--danger); }

/* Teinte : texte coloré sur fond pâle, calculée à partir d'une seule couleur (--c) et d'un fond clair (--f) */
.teinte { color: var(--c); background: var(--f); }
.btn.teinte { border-color: color-mix(in srgb, var(--c) 32%, var(--surface)); }
.btn.teinte:hover { background: var(--f); filter: brightness(.98); }

/* --- Formulaires --- */
.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.champ > label, .champ > .lab { font-size: 13px; font-weight: 600; color: var(--texte-2); }
.champ .aide { font-size: 12px; color: var(--texte-3); }
.input, .champ input[type=text], .champ input[type=number], .champ input[type=date], .champ input[type=search], .champ input[type=email], .champ input[type=tel], .champ input[type=url], .champ input[type=password], .champ select, .champ textarea, select.input {
  height: 40px; padding: 0 var(--e3); border: 1px solid var(--bord-fort); border-radius: var(--rayon-moyen); background: var(--surface); outline: none; width: 100%; min-width: 0;
  transition: border-color var(--rapide), box-shadow var(--duree);
}
.input:hover, .champ input:hover, .champ select:hover, .champ textarea:hover { border-color: var(--bord-survol); }
.champ textarea { height: auto; min-height: 80px; padding: 10px var(--e3); resize: vertical; line-height: 1.5; }
.input:focus, .champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--accent); box-shadow: var(--anneau); }
.champ input::placeholder, .champ textarea::placeholder, .input::placeholder { color: var(--placeholder); }
.champ.invalide input { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(180, 35, 24, .1); animation: secoue .32s var(--courbe); }
.ligne-champs { display: grid; gap: var(--e3) var(--e4); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chips { display: flex; gap: var(--e2); flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--rayon-plein); border: 1px solid var(--bord-fort); background: var(--surface); cursor: pointer; font-size: 13.5px; font-weight: 500; user-select: none; transition: background var(--rapide), border-color var(--rapide), color var(--rapide), transform var(--rapide) var(--courbe); -webkit-tap-highlight-color: transparent; }
.chip:hover { background: var(--surface-2); border-color: var(--bord-survol); }
.chip:active { transform: scale(.96); }
.chip.sel { background: var(--accent-doux); border-color: var(--accent); color: var(--accent-sur-doux); font-weight: 600; }
.chip input { display: none; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--bord-fort); border-radius: var(--rayon-moyen); overflow: hidden; background: var(--surface); height: 40px; }
.stepper button { width: 38px; height: 100%; border: 0; background: var(--surface-2); cursor: pointer; font-size: 18px; transition: background var(--rapide); }
.stepper button:hover { background: var(--surface-3); }
.stepper button:active { background: var(--bord); }
.stepper input { width: 52px; text-align: center; border: 0; height: 100%; outline: none; font-weight: 650; background: transparent; font-variant-numeric: tabular-nums; }
.case { display: inline-flex; gap: var(--e2); align-items: center; cursor: pointer; }
.case input { width: 16px; height: 16px; accent-color: var(--accent); }

/* Autocomplétion */
.ac-liste { position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon-moyen); box-shadow: var(--ombre-forte); max-height: 300px; overflow: auto; padding: 4px; animation: deroule var(--rapide) var(--courbe); transform-origin: top; }
.ac-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; display: flex; gap: var(--e2); align-items: center; }
.ac-item.sel, .ac-item:hover { background: var(--surface-3); }
.ac-item small { color: var(--texte-3); margin-left: auto; padding-left: 10px; text-align: right; }
.ac-item mark { background: none; color: var(--accent-texte); font-weight: 700; }

/* --- Inventaire --- */
.barre-filtres { display: flex; gap: var(--e2); flex-wrap: wrap; align-items: center; margin-bottom: var(--e4); }
.barre-filtres .input-filtre { flex: 1; min-width: 220px; max-width: 360px; }
.filtre-deroulant { position: relative; }
.filtre-deroulant > .btn.actif { border-color: var(--accent); background: var(--accent-doux); color: var(--accent-sur-doux); }
.panneau-filtre { position: absolute; top: 44px; left: 0; z-index: 40; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-forte); padding: var(--e2); min-width: 240px; max-height: 380px; overflow: auto; animation: deroule var(--duree) var(--courbe); transform-origin: top left; }
.panneau-filtre .case { display: flex; padding: 6px var(--e2); border-radius: var(--rayon-petit); transition: background var(--rapide); }
.panneau-filtre .case:hover { background: var(--surface-3); }
.panneau-filtre .case small { margin-left: auto; color: var(--texte-3); }
.panneau-filtre .plage { display: flex; gap: var(--e2); align-items: center; }
.panneau-filtre .plage input { width: 90px; }
.resume-liste { display: flex; gap: var(--e4); align-items: center; color: var(--texte-2); margin-bottom: var(--e3); font-size: 13.5px; flex-wrap: wrap; }
.resume-liste strong { color: var(--texte); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--texte-3); text-transform: uppercase; letter-spacing: .07em; padding: var(--e3) var(--e4); border-bottom: 1px solid var(--bord); background: var(--surface-2); position: sticky; top: var(--h-entete); z-index: 2; white-space: nowrap; }
.table th.tri { cursor: pointer; transition: color var(--rapide); }
.table th.tri:hover { color: var(--texte); }
.table td { padding: var(--e3) var(--e4); border-bottom: 1px solid var(--bord); vertical-align: middle; transition: background var(--rapide); }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.epuise td { color: var(--texte-3); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-carte { overflow: visible; }
.table-carte .table thead th:first-child { border-top-left-radius: var(--rayon); }
.table-carte .table thead th:last-child { border-top-right-radius: var(--rayon); }
.table-carte .table tbody tr:last-child td { border-bottom: 0; }
.table-carte .table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--rayon); }
.table-carte .table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--rayon); }
.table .emplacement { max-width: 230px; }
.vin-cel { display: flex; gap: var(--e3); align-items: center; min-width: 0; }
.vin-cel .t { font-weight: 600; line-height: 1.3; }
.vin-cel .s { font-size: 12.5px; color: var(--texte-2); }
.vin-cel .ico-fav { color: #c9506f; }
.qte { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: var(--surface); padding: 1px; }
.qte button { width: 28px; height: 28px; border: 0; background: none; cursor: pointer; border-radius: 8px; font-size: 16px; color: var(--texte-2); display: grid; place-items: center; transition: background var(--rapide), color var(--rapide), transform var(--rapide) var(--courbe); }
.qte button:hover { background: var(--surface-3); color: var(--texte); }
.qte button:active:not([disabled]) { transform: scale(.88); background: var(--accent-doux); color: var(--accent-sur-doux); }
.qte button[disabled] { opacity: .3; cursor: default; }
.qte span { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; display: inline-block; }
.qte span.bump { animation: bump var(--lente) var(--courbe); }
.emplacement { font-size: 12.5px; color: var(--texte-2); }
.emplacement.a-ranger { color: var(--alerte); }
.cartes-vins { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--e4); }
.carte-vin { cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.carte-vin:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-survol); transform: translateY(-2px); }
.carte-vin .visuel { height: 124px; background: var(--surface-3); display: grid; place-items: center; position: relative; }
.carte-vin .visuel img { width: 100%; height: 100%; object-fit: cover; }
.carte-vin .corps { padding: 14px var(--e4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.carte-vin .pied { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; }
.silhouette { width: 28px; height: 90px; }
.vide { text-align: center; padding: 56px var(--e5); color: var(--texte-2); }
.vide h3 { margin-bottom: 6px; }

/* --- Tiroir (fiche d'un vin) --- */
.tiroir-fond { position: fixed; inset: 0; background: var(--voile); z-index: 90; animation: fondu var(--duree) ease-out; }
.tiroir { position: fixed; top: 0; right: 0; bottom: 0; width: min(780px, 100vw); background: var(--fond); z-index: 100; box-shadow: var(--ombre-forte); overflow: auto; overscroll-behavior: contain; animation: glisse var(--lente) var(--courbe); outline: none; }
.tiroir.sortie { animation: glisse-sortie var(--duree) var(--courbe-sortie) forwards; }
.tiroir-fond.sortie { animation: fondu-sortie var(--duree) ease-in forwards; }
.fiche-entete { padding: var(--e6) var(--e8) var(--e5); background: var(--surface); border-bottom: 1px solid var(--bord); display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: var(--e6); position: relative; }
.fiche-photo { width: 108px; height: 150px; border-radius: var(--rayon-moyen); background: var(--surface-3); display: grid; place-items: center; overflow: hidden; border: 1px solid var(--bord); cursor: pointer; transition: transform var(--duree) var(--courbe), box-shadow var(--duree); }
.fiche-photo:hover { transform: scale(1.02); box-shadow: var(--ombre-survol); }
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; }
.fiche-entete h1 { font-size: 26px; padding-right: 48px; }
.fiche-entete .sous { color: var(--texte-2); margin-top: 4px; }
.fiche-entete .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: var(--e3); }
.fiche-fermer { position: absolute; top: var(--e4); right: var(--e4); }
.fiche-stock { display: flex; align-items: center; gap: var(--e3); margin-top: var(--e4); flex-wrap: wrap; }
.fiche-stock .qte span { min-width: 34px; font-size: 17px; }
.fiche-stock .qte button { width: 34px; height: 34px; }
.fiche-corps { padding: var(--e5) var(--e8) 48px; display: flex; flex-direction: column; gap: var(--e4); }
.infos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--e4) var(--e5); }
.info .k { font-size: 12px; color: var(--texte-3); }
.info .v { font-weight: 550; }
.frise { position: relative; height: 54px; margin: 6px 4px 0; }
.frise .piste { position: absolute; left: 0; right: 0; top: 20px; height: 10px; border-radius: 5px; background: var(--surface-3); }
.frise .seg { position: absolute; top: 20px; height: 10px; }
.frise .rep { position: absolute; top: 34px; font-size: 11.5px; color: var(--texte-2); transform: translateX(-50%); white-space: nowrap; }
.frise .auj { position: absolute; top: 12px; width: 2px; height: 26px; background: var(--texte); border-radius: 1px; }
.frise .auj span { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; white-space: nowrap; }
.liste-simple { list-style: none; margin: 0; padding: 0; }
.liste-simple li { padding: 10px 0; border-bottom: 1px solid var(--bord); display: flex; gap: var(--e3); align-items: baseline; }
.liste-simple li:last-child { border-bottom: 0; }
.etoiles { color: var(--or); letter-spacing: 1px; white-space: nowrap; }
.etoiles-saisie { display: inline-flex; gap: 2px; }
.etoiles-saisie button { border: 0; background: none; font-size: 24px; color: var(--bord-fort); cursor: pointer; padding: 0 1px; line-height: 1; transition: color var(--rapide), transform var(--rapide) var(--courbe); }
.etoiles-saisie button:hover { transform: scale(1.15); }
.etoiles-saisie button.on { color: var(--or); }

/* --- Modales --- */
.fige { overflow: hidden; }
.modale-fond { overscroll-behavior: contain; position: fixed; inset: 0; background: var(--voile); backdrop-filter: blur(2px); z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 6vh var(--e4); overflow: auto; animation: fondu var(--duree) ease-out; }
.modale { background: var(--fond); border-radius: 18px; box-shadow: var(--ombre-forte); width: min(860px, 100%); max-height: 88vh; display: flex; flex-direction: column; animation: apparait var(--lente) var(--courbe); }
.modale.etroite { width: min(480px, 100%); }
.modale.moyenne { width: min(640px, 100%); }
.modale-fond.sortie { animation: fondu-sortie 160ms ease-in forwards; }
.modale-fond.sortie .modale { animation: disparait 160ms var(--courbe-sortie) forwards; }
.modale-entete { flex: none; display: flex; justify-content: space-between; align-items: center; gap: var(--e3); padding: var(--e5) var(--e6); border-bottom: 1px solid var(--bord); background: var(--surface); border-radius: 18px 18px 0 0; }
.modale-entete h2 { font-size: 19px; }
.modale-corps { padding: var(--e5) var(--e6); display: flex; flex-direction: column; gap: var(--e4); overflow: auto; min-height: 0; overscroll-behavior: contain; }
.modale-pied { display: flex; justify-content: flex-end; gap: var(--e2); padding: var(--e4) var(--e6); border-top: 1px solid var(--bord); background: var(--surface); border-radius: 0 0 18px 18px; flex-wrap: wrap; flex: none; }
.modale-pied .gauche { margin-right: auto; display: flex; gap: var(--e2); align-items: center; }
.bloc { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: var(--e5); display: flex; flex-direction: column; gap: var(--e3); }
.bloc h3 { font-size: 15px; display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; }
.bloc h3 .muet { font-weight: 400; font-size: 12.5px; }
.saisie-express { background: var(--express-fond); border: 1px dashed var(--accent-bord); }
.saisie-express input { height: 46px !important; font-size: 15.5px; }
.express-apercu { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.express-apercu > * { animation: pop var(--duree) var(--courbe); }
.suggestion-garde { display: flex; gap: 10px; align-items: center; background: var(--succes-doux); border: 1px solid var(--succes-bord); color: var(--succes-texte); border-radius: var(--rayon-moyen); padding: 10px 14px; font-size: 13px; animation: entree var(--duree) var(--courbe); }
.photos-saisie { display: flex; gap: var(--e3); flex-wrap: wrap; }
.depot-photo { width: 120px; height: 150px; border: 1.5px dashed var(--bord-fort); border-radius: var(--rayon-moyen); display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; font-size: 12px; color: var(--texte-3); cursor: pointer; position: relative; overflow: hidden; background: var(--surface-2); transition: border-color var(--rapide), color var(--rapide), background var(--rapide); }
.depot-photo:hover, .depot-photo.survol { border-color: var(--accent); color: var(--accent-texte); background: var(--accent-doux); }
.depot-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fondu var(--lente) ease-out; }
.depot-photo .suppr { position: absolute; top: 4px; right: 4px; z-index: 2; background: var(--surface); border-radius: 50%; width: 26px; height: 26px; border: 0; cursor: pointer; box-shadow: var(--ombre-xs); }

/* --- Messages éphémères --- */
.toasts { position: fixed; bottom: var(--e6); left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: var(--e2); align-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--sombre); color: #fff; border: 1px solid var(--toast-bord, transparent); padding: 11px 14px 11px 18px; border-radius: 12px; box-shadow: var(--ombre-forte); display: flex; gap: var(--e4); align-items: center; font-size: 14px; animation: monte var(--lente) var(--courbe); }
.toast.sortie { animation: descend var(--duree) var(--courbe-sortie) forwards; }
.toast svg.ico { color: #f3b9c8; }
.toast button { background: none; border: 0; color: #f3b9c8; font-weight: 650; cursor: pointer; padding: 4px 8px; border-radius: 6px; transition: background var(--rapide), color var(--rapide); }
.toast button:hover { color: #fff; background: rgba(255,255,255,.1); }

/* --- Infobulle --- */
.infobulle { position: fixed; z-index: 600; pointer-events: none; background: var(--sombre); color: #fff; padding: 7px 11px; border-radius: var(--rayon-petit); font-size: 12.5px; box-shadow: var(--ombre-forte); max-width: 280px; line-height: 1.45; animation: fondu var(--rapide) ease-out; }
.infobulle b { font-weight: 650; }

/* --- Plan de la cave --- */
.plan-mise { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--e5); align-items: start; }
.plan-cote { position: sticky; top: calc(var(--h-entete) + var(--e5)); display: flex; flex-direction: column; gap: var(--e4); max-height: calc(100vh - var(--h-entete) - 40px); overflow: auto; }
.meuble { background: linear-gradient(180deg, #2f2a2b, #1f1b1c); border-radius: 18px; padding: var(--e4) var(--e4) 22px; box-shadow: var(--ombre-forte), inset 0 1px 0 rgba(255,255,255,.08); color: #e8e0d8; }
.meuble-entete { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); margin-bottom: var(--e3); padding: 0 4px; flex-wrap: wrap; }
.meuble-entete h3 { color: #f4ece4; font-size: 16px; }
.meuble-entete .petit { color: #b8ada3; }
.compartiments { display: grid; gap: var(--e3); }
.compartiment { background: linear-gradient(180deg, rgba(40, 70, 120, .18), rgba(10, 10, 14, .5)); border: 2px solid #4a4446; border-radius: 12px; padding: 10px 10px 12px; position: relative; }
.compartiment::after { content: ""; position: absolute; right: 8px; top: 40%; width: 4px; height: 56px; border-radius: 2px; background: linear-gradient(#c9c4be, #8f8984); opacity: .8; }
.compartiment-entete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e2); font-size: 12.5px; margin-bottom: var(--e2); color: #d9cfc6; padding-right: 14px; flex-wrap: wrap; }
.compartiment-entete strong { color: #fff; font-weight: 650; }
.temp { color: #9cc3f0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clayette { position: relative; padding: 6px 8px 9px; margin-bottom: 6px; }
.clayette::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; border-radius: 2px; background: linear-gradient(180deg, #b98b5c, #8a6239); box-shadow: 0 2px 0 #c7ccd1 inset, 0 2px 3px rgba(0,0,0,.4); }
.clayette-lib { font-size: 10.5px; color: #a89d93; margin-bottom: 3px; letter-spacing: .03em; }
.places { display: flex; gap: 6px; justify-content: center; position: relative; z-index: 1; }
.place { width: 46px; height: 46px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.18); display: grid; place-items: center; position: relative; transition: transform var(--rapide) var(--courbe), border-color var(--rapide), background var(--rapide); }
.place.survol { border-color: #f3b9c8; background: rgba(243, 185, 200, .15); transform: scale(1.1); }
.place.cible-deplacement { border-color: #9cc3f0; border-style: solid; cursor: pointer; animation: battement 1.4s ease-in-out infinite; }
.bouteille { width: 42px; height: 42px; border-radius: 50%; cursor: grab; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; position: relative; box-shadow: inset 0 -4px 8px rgba(0,0,0,.35), inset 0 3px 5px rgba(255,255,255,.25), 0 2px 4px rgba(0,0,0,.5); text-shadow: 0 1px 2px rgba(0,0,0,.6); user-select: none; transition: transform var(--rapide) var(--courbe), opacity var(--duree); }
.bouteille:hover { transform: scale(1.08); }
.bouteille::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: rgba(0,0,0,.45); box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.bouteille span { position: relative; }
.bouteille .fmt { position: absolute; top: -6px; right: -6px; background: #ece6f7; color: #4a3a86; font-size: 9px; font-style: normal; font-weight: 700; border-radius: 6px; padding: 0 4px; line-height: 14px; text-shadow: none; z-index: 2; }
.bouteille .anneau { position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid transparent; }
.bouteille.attenue { opacity: .18; }
.bouteille.surligne { outline: 3px solid #ffd76a; outline-offset: 3px; animation: pulse 1.2s ease-in-out 3; }
.bouteille.selection { outline: 3px solid #9cc3f0; outline-offset: 3px; }
.bouteille.posee { animation: pose var(--lente) var(--courbe); }
.bouteille:active { cursor: grabbing; }
.meuble.etagere { background: linear-gradient(180deg, #7a5a3c, #5d4229); }
.meuble.etagere .compartiment { background: rgba(0,0,0,.18); border-color: rgba(0,0,0,.25); }
.meuble.etagere .compartiment::after { display: none; }
.legende { display: flex; gap: var(--e2) var(--e4); flex-wrap: wrap; font-size: 12.5px; color: var(--texte-2); }
.legende span { display: inline-flex; gap: 6px; align-items: center; }
.a-ranger-liste { display: flex; flex-direction: column; gap: 6px; min-height: 60px; border-radius: var(--rayon-moyen); transition: background var(--duree); }
.a-ranger-liste.survol { background: var(--accent-doux); }
.a-ranger-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: var(--surface); cursor: grab; transition: border-color var(--rapide), box-shadow var(--duree), transform var(--rapide) var(--courbe); }
.a-ranger-item:hover { border-color: var(--bord-fort); box-shadow: var(--ombre-survol); transform: translateX(-2px); }
.a-ranger-item .mini { width: 26px; height: 26px; font-size: 9.5px; box-shadow: inset 0 -2px 4px rgba(0,0,0,.3); }
.a-ranger-item .mini::before { inset: 7px; }
.a-ranger-item .t { font-weight: 600; font-size: 13px; line-height: 1.2; }
.a-ranger-item .s { font-size: 12px; color: var(--texte-2); }
.a-ranger-item .n { margin-left: auto; font-weight: 700; color: var(--texte-2); }
.plan-bandeau { display: flex; gap: var(--e4); align-items: center; padding: 14px 18px; border-radius: var(--rayon); background: var(--avert-doux); border: 1px solid var(--avert-bord); color: var(--avert-texte); margin-bottom: var(--e5); flex-wrap: wrap; }
.plan-bandeau .actions { margin-left: auto; }
.plan-bandeau > span { flex: 1; min-width: 240px; }
.popover { position: fixed; z-index: 300; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre-forte); padding: var(--e4); width: 300px; max-width: calc(100vw - 24px); animation: apparait var(--duree) var(--courbe); }
.popover h4 { font-size: 15px; }
.popover .actions { margin-top: var(--e3); }

/* --- Graphiques --- */
.graph { width: 100%; display: block; overflow: visible; }
.graph text { font: 500 12px var(--police); fill: var(--texte-2); }
.graph .val { fill: var(--texte); font-weight: 650; font-variant-numeric: tabular-nums; }
.graph .grille-l { stroke: var(--bord); stroke-width: 1; }
.graph .zone-survol { fill: transparent; cursor: default; }
.graph .barre { transform-box: fill-box; transform-origin: 50% 100%; animation: grandir-y 520ms var(--courbe) both; transition: opacity var(--rapide); }
.graph g:hover .barre { opacity: .8; }
.graph .trait { stroke-dasharray: 1; animation: trace 900ms var(--courbe) both; }
.barres-h { display: flex; flex-direction: column; gap: var(--e2); }
.barre-h { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 54px; gap: var(--e3); align-items: center; font-size: 13px; }
.barre-h .lib { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--texte-2); display: flex; align-items: center; gap: 6px; }
.barre-h .piste { height: 14px; position: relative; background: var(--surface-2); border-radius: 0 4px 4px 0; }
.barre-h .rempli { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; min-width: 2px; transform-origin: left; animation: grandir-x 560ms var(--courbe) both; transition: filter var(--rapide); }
.barre-h:hover .rempli { filter: brightness(1.12); }
.barres-h .barre-h:nth-child(2) .rempli { animation-delay: 30ms; }
.barres-h .barre-h:nth-child(3) .rempli { animation-delay: 60ms; }
.barres-h .barre-h:nth-child(4) .rempli { animation-delay: 90ms; }
.barres-h .barre-h:nth-child(n+5) .rempli { animation-delay: 120ms; }
.barre-h .v { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.repartition { display: flex; height: 16px; gap: 2px; margin: 4px 0 var(--e3); animation: grandir-x 560ms var(--courbe) both; transform-origin: left; }
.repartition div { height: 100%; transition: filter var(--rapide); }
.repartition div:hover { filter: brightness(1.12); }
.repartition div:first-child { border-radius: 5px 0 0 5px; }
.repartition div:last-child { border-radius: 0 5px 5px 0; }
.onglets { display: inline-flex; background: var(--surface-3); border-radius: var(--rayon-moyen); padding: 3px; gap: 2px; }
.onglets button { border: 0; background: none; padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--texte-2); transition: background var(--rapide), color var(--rapide), box-shadow var(--duree); white-space: nowrap; }
.onglets button:hover { color: var(--texte); }
.onglets button.sel { background: var(--onglet-sel); color: var(--texte); font-weight: 650; box-shadow: 0 1px 2px rgba(29,25,22,.08), 0 1px 1px rgba(29,25,22,.04); }

/* --- Listes « à boire » --- */
.ligne-vin { display: flex; gap: var(--e3); align-items: center; padding: var(--e3) var(--e2); margin: 0 calc(var(--e2) * -1); border-bottom: 1px solid var(--bord); cursor: pointer; border-radius: var(--rayon-petit); transition: background var(--rapide); }
.ligne-vin:last-child { border-bottom: 0; }
.ligne-vin:hover { background: var(--surface-2); }
.ligne-vin:hover .t { color: var(--accent-texte); }
.ligne-vin .t { font-weight: 600; transition: color var(--rapide); }
.ligne-vin .s { font-size: 12.5px; color: var(--texte-2); }
.ligne-vin .droite { margin-left: auto; text-align: right; display: flex; gap: 10px; align-items: center; }
.colonnes-maturite { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--e5); align-items: start; }
.alerte-bandeau { display: flex; gap: var(--e3); align-items: center; padding: 14px 18px; border-radius: var(--rayon); background: var(--danger-doux); border: 1px solid var(--danger-bord); color: var(--danger-texte); flex-wrap: wrap; }
.alerte-bandeau > span { flex: 1; min-width: 220px; }

/* --- Carnet et envies --- */
.contact { padding: var(--e5); display: flex; flex-direction: column; gap: 6px; }
.contact .entete-c { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.contact .coord { font-size: 13px; color: var(--texte-2); display: flex; flex-direction: column; gap: 2px; }
.envie { display: grid; grid-template-columns: 1fr auto; gap: var(--e3); padding: var(--e4) var(--e5); border-bottom: 1px solid var(--bord); align-items: center; transition: opacity var(--duree), background var(--rapide); }
.envie:last-child { border-bottom: 0; }
.envie.faite { opacity: .55; }
.priorite-1 { color: var(--danger); }
.journal-item { display: grid; grid-template-columns: 96px 30px 1fr auto; gap: var(--e3); padding: 14px var(--e5); border-bottom: 1px solid var(--bord); align-items: center; transition: background var(--rapide); }
.journal-item:hover { background: var(--surface-2); }
.journal-item:last-child { border-bottom: 0; }
.journal-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.journal-ico svg.ico { width: 16px; height: 16px; }

/* --- Import --- */
.zone-depot { display: block; border: 2px dashed var(--bord-fort); border-radius: 16px; padding: 40px; text-align: center; background: var(--surface); cursor: pointer; transition: border-color var(--duree), background var(--duree), transform var(--duree) var(--courbe); }
.zone-depot:hover, .zone-depot.survol { border-color: var(--accent); background: var(--accent-doux); }
.zone-depot.survol { transform: scale(1.01); }
.correspondance { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--e3); }
.apercu-table { overflow: auto; max-height: 340px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); }
.apercu-table table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.apercu-table th, .apercu-table td { padding: 7px 10px; border-bottom: 1px solid var(--bord); text-align: left; white-space: nowrap; }
.apercu-table th { background: var(--surface-2); position: sticky; top: 0; }
.rapport li { margin-bottom: 4px; }

/* --- Réglages --- */
.rangee-edit { display: grid; grid-template-columns: 1fr 110px 38px; gap: var(--e2); align-items: center; margin-bottom: 6px; }
.section-edit { border: 1px solid var(--bord); border-radius: var(--rayon-moyen); padding: var(--e3); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }

/* --- Choix de l'emplacement à la sortie --- */
.choix-emplacements { display: flex; flex-direction: column; gap: var(--e2); }
.choix-emplacement { display: flex; align-items: center; gap: var(--e3); padding: 14px var(--e4); border: 1px solid var(--bord-fort); border-radius: var(--rayon-moyen); background: var(--surface); cursor: pointer; text-align: left; font-size: 14.5px; transition: border-color var(--rapide), background var(--rapide), transform var(--rapide) var(--courbe); }
.choix-emplacement:hover, .choix-emplacement:focus-visible { border-color: var(--accent); background: var(--accent-doux); outline: none; }
.choix-emplacement:active { transform: scale(.98); }
.choix-emplacement span { flex: 1; }

/* --- Service et profil gustatif --- */
.service { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e4) var(--e5); }
.service > p { grid-column: 1 / -1; }
.service-ligne { display: flex; gap: 10px; align-items: flex-start; }
.service-ligne > svg.ico { color: var(--accent-texte); margin-top: 2px; }
.service-ligne .k { font-size: 12px; color: var(--texte-3); }
.service-ligne .v { font-weight: 550; }
.profil { display: flex; flex-direction: column; gap: var(--e3); }
.profil-ligne { display: grid; grid-template-columns: 90px 1fr 100px; align-items: center; gap: var(--e3); font-size: 13px; }
.profil-g { text-align: right; color: var(--texte-2); }
.profil-d { color: var(--texte-2); }
.profil-echelle { display: flex; justify-content: space-between; align-items: center; position: relative; padding: 0 2px; }
.profil-echelle::before { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--bord); transform: translateY(-50%); }
.profil-pt { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--bord-fort); background: var(--surface); cursor: pointer; padding: 0; transition: transform var(--rapide) var(--courbe), background var(--duree), border-color var(--duree), width var(--duree) var(--courbe), height var(--duree) var(--courbe), box-shadow var(--duree); }
.profil-pt:hover { border-color: var(--accent); transform: scale(1.15); }
.profil-pt.avant { background: var(--accent-bord); border-color: var(--accent-bord); }
.profil-pt.on { background: var(--accent); border-color: var(--accent); width: 20px; height: 20px; box-shadow: 0 0 0 4px var(--accent-doux); }
.profil-pt.sugg { border-style: dashed; border-color: var(--accent); }

/* --- Chargement --- */
.chargement { display: flex; align-items: center; justify-content: center; gap: var(--e3); padding: 80px var(--e5); color: var(--texte-3); }
.rouage { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--bord-fort); border-top-color: var(--accent); animation: tourne .8s linear infinite; }

/* --- Animations --- */
/* Entrée d'une page : le contenu monte légèrement, bloc par bloc */
.vue.entree > * { animation: entree var(--lente) var(--courbe) both; }
.vue.entree > :nth-child(2) { animation-delay: 30ms; }
.vue.entree > :nth-child(3) { animation-delay: 60ms; }
.vue.entree > :nth-child(4) { animation-delay: 90ms; }
.vue.entree > :nth-child(n+5) { animation-delay: 120ms; }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes fondu-sortie { to { opacity: 0; } }
@keyframes apparait { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes disparait { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes glisse { from { transform: translateX(100%); } to { transform: none; } }
@keyframes glisse-sortie { to { transform: translateX(100%); } }
@keyframes deroule { from { opacity: 0; transform: translateY(-4px) scaleY(.97); } to { opacity: 1; transform: none; } }
@keyframes monte { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes descend { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--accent); } 100% { transform: scale(1); } }
@keyframes pose { 0% { transform: scale(.7); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes battement { 50% { opacity: .45; } }
@keyframes pulse { 50% { outline-color: rgba(255, 215, 106, .2); } }
@keyframes secoue { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes sonne { 25% { transform: rotate(12deg); } 50% { transform: rotate(-10deg); } 75% { transform: rotate(5deg); } }
@keyframes grandir-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes grandir-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes tourne { to { transform: rotate(360deg); } }

/* Respecte le réglage « réduire les animations » du système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

@media print {
  .barre, .entete, .barre-filtres, .actions, .qte button { display: none !important; }
  .app { display: block; }
  .vue { padding: 0; }
  .table th { position: static; }
}

/* --- Fenêtres moyennes (portable, petite fenêtre) --- */
@media (max-width: 1280px) {
  :root { --largeur-barre: 224px; }
  .vue { padding: 28px var(--e6) 64px; }
  .entete { padding: 0 var(--e6); }
  .table th, .table td { padding: 10px var(--e2); }
  .table .emplacement { max-width: 170px; }
  .badge { font-size: 11.5px; padding: 2px 8px; }
  .plan-mise { grid-template-columns: minmax(0, 1fr) 250px; }
  .place { width: 40px; height: 40px; }
  .bouteille { width: 37px; height: 37px; font-size: 10px; }
  .bouteille::before { inset: 8px; }
}
@media (max-width: 1180px) {
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Tablette et fenêtre étroite : le menu devient un volet --- */
@media (max-width: 1023px) {
  :root { --h-entete: 64px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .barre { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; transform: translateX(-102%); transition: transform var(--lente) var(--courbe), box-shadow var(--lente); z-index: 150; }
  .menu-ouvert .barre { transform: none; box-shadow: var(--ombre-forte); }
  .barre-fond { display: block; position: fixed; inset: 0; z-index: 140; background: var(--voile); opacity: 0; pointer-events: none; transition: opacity var(--lente); }
  .menu-ouvert .barre-fond { opacity: 1; pointer-events: auto; }
  .entete .btn-menu { display: inline-flex; }
  .entete { padding: 0 var(--e5); }
  .vue { padding: var(--e6) var(--e5) 56px; }
  .plan-mise { grid-template-columns: minmax(0, 1fr); }
  .plan-cote { position: static; max-height: none; }
  .table th:nth-child(5), .table td:nth-child(5) { display: none; }
}

/* --- Petite fenêtre --- */
@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 25px; }
  .entete { gap: var(--e2); padding: 0 var(--e3); }
  .vue { padding: var(--e5) var(--e4) 48px; }
  .recherche-globale input { padding-right: 12px; }
  .recherche-globale kbd { display: none; }
  #btn-ajouter { width: 42px; padding: 0; }
  #btn-ajouter .lib-btn { display: none; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .tuile.heros .val { font-size: 44px; }
  .titre-page { align-items: flex-start; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(6), .table td:nth-child(6) { display: none; }
  .tiroir { width: 100vw; }
  .fiche-entete { grid-template-columns: 76px minmax(0, 1fr); gap: var(--e4); padding: var(--e5) var(--e4) var(--e4); }
  .fiche-photo { width: 76px; height: 106px; }
  .fiche-entete h1 { font-size: 21px; }
  .fiche-corps { padding: var(--e4) var(--e4) 40px; }
  .infos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .service { grid-template-columns: minmax(0, 1fr); }
  .profil-ligne { grid-template-columns: 70px 1fr 74px; gap: var(--e2); font-size: 12.5px; }
  .modale-fond { padding: var(--e3) var(--e2); }
  .modale { max-height: calc(100vh - 24px); }
  .modale-entete, .modale-corps { padding-left: var(--e4); padding-right: var(--e4); }
  .modale-pied { padding: var(--e3) var(--e4); }
  .modale .ligne-champs { grid-template-columns: minmax(0, 1fr) !important; }
  .journal-item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--e3); padding: var(--e3) var(--e4); }
  .journal-item > :first-child { flex-basis: 100%; font-size: 12.5px; }
  .journal-item > div { flex: 1; min-width: 0; }
  .barre-h { grid-template-columns: minmax(70px, 110px) 1fr 44px; gap: var(--e2); }
  .carte-corps { padding: var(--e4); }
  .carte-titre { padding: var(--e4) var(--e4) 0; }
  .place { width: 36px; height: 36px; }
  .bouteille { width: 33px; height: 33px; font-size: 9.5px; }
  .bouteille::before { inset: 7px; }
  .places { gap: 4px; }
  .toasts { bottom: var(--e4); }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr); }
  .table th:nth-child(4), .table td:nth-child(4) { display: none; }
  .barre-filtres .input-filtre { min-width: 0; max-width: none; flex-basis: 100%; }
}
.modale-fond.sortie, .toast.sortie, .tiroir.sortie, .tiroir-fond.sortie { pointer-events: none; }

/* --- Que boire ce soir ? (plat, occasion, score) --- */
.qb { display: flex; flex-direction: column; gap: var(--e3); }
.qb-groupe, .qb-occasion { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--e3); align-items: start; }
.qb .lab { font-size: 12px; font-weight: 600; color: var(--texte-3); padding-top: 7px; }
.qb-occasion .onglets { flex-wrap: wrap; justify-self: start; }
.qb .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.qb .chip.grise { opacity: .45; }
.qb .chip.grise.sel { opacity: 1; }
.qb-resultats { margin-top: var(--e1); }
.qb-resultats.rafraichi > * { animation: entree var(--duree) var(--courbe) both; }
.qb-resultats.rafraichi > :nth-child(2) { animation-delay: 30ms; }
.qb-resultats.rafraichi > :nth-child(3) { animation-delay: 60ms; }
.qb-resultats.rafraichi > :nth-child(n+4) { animation-delay: 90ms; }
.ligne-vin .raisons { font-size: 12px; color: var(--texte-3); margin-top: 1px; }
.badge.score { font-variant-numeric: tabular-nums; min-width: 52px; justify-content: center; }
@media (max-width: 760px) {
  .qb-groupe, .qb-occasion { grid-template-columns: minmax(0, 1fr); gap: var(--e1); }
  .qb .lab { padding-top: 0; }
}

/* --- Dégustation complète --- */
.degust-complete { display: flex; flex-direction: column; gap: var(--e3); }
.degust-complete .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.photo-degust { width: 120px; height: 90px; object-fit: cover; border-radius: var(--rayon-petit); border: 1px solid var(--bord); margin-top: 4px; }

/* --- Listes et filtres enregistrés --- */
.vues { display: flex; flex-direction: column; gap: var(--e2); margin-bottom: var(--e4); }
.vues-ligne { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--e3); align-items: center; }
.vues-ligne .lab { font-size: 12.5px; font-weight: 600; color: var(--texte-3); display: inline-flex; align-items: center; gap: 6px; }
.vues-ligne .lab svg.ico { width: 15px; height: 15px; }
.vues .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.vues .chip small { color: var(--texte-3); font-weight: 600; }
.vues .chip.sel small { color: inherit; }
.chip.chip-ajout { border-style: dashed; color: var(--texte-2); background: transparent; }
.chip.chip-ajout svg.ico { width: 14px; height: 14px; }
.vues-gestion { color: var(--texte-2); padding: 8px 12px; background: var(--surface-2); border: 1px solid var(--bord); border-radius: var(--rayon-moyen); line-height: 1.7; }
@media (max-width: 760px) { .vues-ligne { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.listes-choix { display: flex; flex-direction: column; gap: 4px; }
.listes-choix .case { padding: 8px 10px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: var(--surface); transition: border-color var(--rapide), background var(--rapide); }
.listes-choix .case:hover { border-color: var(--bord-survol); }
.listes-choix .case small { margin-left: auto; }
.choix-carte { padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: var(--surface); }
.choix-carte small { margin-left: auto; }
.choix-carte:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); }
.modale.large { width: min(1000px, 100%); }
.apercu-carte { width: 100%; height: 66vh; border: 1px solid var(--bord); border-radius: var(--rayon-moyen); background: #f7f5f2; }

/* --- Qualité du millésime --- */
.millesime-info { margin-top: var(--e4); padding-top: var(--e3); border-top: 1px solid var(--bord); display: flex; flex-wrap: wrap; gap: 6px var(--e2); align-items: center; }
.millesime-info > p { flex-basis: 100%; }
p.millesime-info { color: var(--texte-3); }
.ajustements { max-height: 50vh; overflow-y: auto; overflow-x: hidden; padding: 0 var(--e2); }
