/* ============================================================
   NOTRE CAVE — Feuille de style (v2, direction Vivino)
   Fond near-black · typo Inter (contenu) + Fraunces (signatures)
   Accents : orange (notes) · bordeaux (actions/nav) · bois (cave)
   ============================================================ */

/* ---------- 0. VARIABLES ---------- */
:root {
    --fond:        #100f0e;
    --fond-2:      #171513;
    --surface:     #1c1a18;
    --surface-h:   #242120;
    --carte:       #1a1817;

    --bord:        rgba(255, 255, 255, 0.08);
    --bord-fort:   rgba(255, 255, 255, 0.16);

    --texte:       #f5f3f0;
    --texte-2:     #a9a29b;
    --texte-3:     #7c736b;

    /* Accents */
    --orange:      #ff6a3d;   /* notes / étoiles / onglet actif */
    --orange-2:    #ff855e;
    --vin:         #a52836;   /* boutons primaires / nav */
    --vin-2:       #c23346;
    --vin-fonce:   #7c1c28;

    --barre:       #855f32;   /* jauges de données (couleur fournie) */
    --barre-2:     #9c7440;

    /* Couleurs des vins (pastilles + points de cave) */
    --c-rouge:     #b23a48;
    --c-blanc:     #d9b95c;
    --c-rose:      #de9aa1;
    --dot-rouge:   #9d2734;
    --dot-blanc:   #e0aa3c;
    --dot-rose:    #e3a3ab;

    /* Bois des clayettes */
    --bois:        #7d5f38;
    --bois-h:      #8d6c40;

    /* Phases de garde */
    --p-jeunesse:  #6fa84f;
    --p-maturite:  #d99a3a;
    --p-apogee:    #e6b84d;
    --p-declin:    #b06a54;

    --r-s: 10px;
    --r-m: 16px;
    --r-l: 22px;
    --r-pill: 999px;

    --f-titre: 'Fraunces', Georgia, serif;
    --f-ui: 'Inter', system-ui, -apple-system, sans-serif;

    --ombre: 0 16px 40px -22px rgba(0, 0, 0, 0.8);
}

/* ---------- 1. BASE ---------- */
* { box-sizing: border-box; }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible), input:focus:not(:focus-visible), select:focus:not(:focus-visible) { outline: none; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0; padding: 0;
    min-height: 100vh;
    font-family: var(--f-ui);
    font-size: 15px; line-height: 1.5;
    color: var(--texte);
    background: var(--fond);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-weight: 700; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }
::selection { background: rgba(255, 106, 61, 0.3); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

/* ---------- 2. EN-TÊTE ---------- */
.entete {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    background: rgba(16, 15, 14, 0.82);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--bord);
}
.marque { display: flex; align-items: center; gap: 12px; }
.marque-logo {
    width: 30px; height: 30px; flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.marque-nom {
    font-family: var(--f-titre); font-size: 22px; font-weight: 500;
    letter-spacing: 0.2px; color: var(--texte);
}

/* ---------- 3. VUES ---------- */
#app { max-width: 1080px; margin: 0 auto; padding: 22px 18px 120px; }
.vue { display: none; }
.vue.est-active { display: block; animation: apparait .3s ease both; }
@keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .vue.est-active { animation: none; } * { transition: none !important; } }

/* ---------- 4. NAVIGATION BASSE ---------- */
.nav-bas {
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    display: flex; justify-content: space-around; align-items: stretch;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(20, 18, 17, 0.9);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-top: 1px solid var(--bord);
}
.nav-item {
    flex: 1; max-width: 96px;
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 6px 2px; border-radius: 12px;
    color: var(--texte-3); font-size: 10.5px; font-weight: 600;
    transition: color .2s ease;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-label { white-space: nowrap; }
.nav-item:hover { color: var(--texte-2); }
.nav-item.est-actif { color: var(--orange); }

.nav-plus {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--vin); color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 16px -6px var(--vin);
    transition: background .2s ease, transform .15s ease;
}
.nav-item--accent { color: var(--texte-2); }
.nav-item--accent:hover .nav-plus { background: var(--vin-2); transform: translateY(-2px); }
.nav-item--accent svg { width: 20px; height: 20px; }

/* ---------- 5. CARTES ---------- */
.carte {
    background: var(--carte);
    border: 1px solid var(--bord);
    border-radius: var(--r-m);
    padding: 20px;
}
.carte-titre { font-size: 15px; font-weight: 700; color: var(--texte); margin-bottom: 2px; }
.carte-soustitre { font-size: 12.5px; color: var(--texte-3); margin-bottom: 18px; }

/* ---------- 6. HÉRO ---------- */
.hero {
    position: relative; overflow: hidden; text-align: center;
    padding: 38px 24px 32px; margin-bottom: 16px;
    border-radius: var(--r-l); border: 1px solid var(--bord);
    background:
        radial-gradient(560px 280px at 50% -20%, rgba(165, 40, 54, 0.28), transparent 70%),
        linear-gradient(180deg, #241413, #17110f);
}
.hero-eyebrow { font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--orange); margin-bottom: 12px; }
.hero-chiffre { font-family: var(--f-titre); font-weight: 500; font-size: clamp(3.4rem, 14vw, 5.2rem); line-height: 0.92; color: var(--texte); letter-spacing: -1px; }
.hero-chiffre-unite { display: block; font-family: var(--f-ui); font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--texte-2); margin-top: 10px; }
.hero-rule { width: 52px; height: 2px; background: var(--vin); margin: 20px auto; border-radius: 2px; }
.hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px 32px; }
.hero-stat { text-align: center; }
.hero-stat-val { font-family: var(--f-titre); font-size: 25px; color: var(--orange); line-height: 1; }
.hero-stat-lbl { font-size: 10.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--texte-3); margin-top: 6px; }

/* ---------- 7. PHASES (cliquables) ---------- */
.phases { margin-bottom: 16px; padding: 20px; border-radius: var(--r-m); border: 1px solid var(--bord); background: var(--carte); }
.phases-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.phases-indice { font-size: 12px; color: var(--texte-3); margin-bottom: 14px; }
.phases-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.phase {
    text-align: center; padding: 14px 6px; border-radius: var(--r-s);
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--bord);
    cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease;
    font-family: inherit;
}
.phase:hover { transform: translateY(-3px); border-color: var(--bord-fort); background: var(--surface-h); }
.phase-pt { width: 9px; height: 9px; border-radius: 50%; margin: 0 auto 9px; }
.phase-val { font-family: var(--f-titre); font-size: 26px; line-height: 1; color: var(--texte); }
.phase-nom { font-size: 11px; color: var(--texte-2); margin-top: 6px; }
.pt-jeunesse { background: var(--p-jeunesse); box-shadow: 0 0 10px -1px var(--p-jeunesse); }
.pt-maturite { background: var(--p-maturite); box-shadow: 0 0 10px -1px var(--p-maturite); }
.pt-apogee   { background: var(--p-apogee);   box-shadow: 0 0 12px -1px var(--p-apogee); }
.pt-declin   { background: var(--p-declin);   box-shadow: 0 0 10px -1px var(--p-declin); }

/* ---------- 8. GRILLE DASHBOARD ---------- */
.dash-grille { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .dash-grille { grid-template-columns: 1fr 1fr; } .col-pleine { grid-column: 1 / -1; } }
@media (min-width: 960px) { .dash-grille { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 9. DONUT ---------- */
.donut-bloc { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { flex-shrink: 0; }
.donut svg { display: block; }
.donut-centre-val { font-family: var(--f-titre); font-size: 30px; fill: var(--texte); }
.donut-centre-lbl { font-family: var(--f-ui); font-size: 9px; letter-spacing: 1.4px; fill: var(--texte-3); text-transform: uppercase; }
.donut-legende { display: flex; flex-direction: column; gap: 11px; flex: 1; min-width: 130px; }
.legende-item { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.legende-pt { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }
.legende-nom { color: var(--texte-2); flex: 1; }
.legende-val { color: var(--texte); font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---------- 10. BARRES ---------- */
.barres { display: flex; flex-direction: column; gap: 13px; }
.barre-ligne { display: flex; flex-direction: column; gap: 6px; }
.barre-etiquette { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.barre-nom { font-size: 13.5px; color: var(--texte); }
.barre-val { font-size: 12.5px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.barre-piste { height: 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.barre-remplie { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--barre), var(--barre-2)); transition: width .5s cubic-bezier(.2,.7,.2,1); }

.mini-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mini-table th { text-align: left; font-weight: 600; color: var(--texte-3); font-size: 11px; letter-spacing: .4px; text-transform: uppercase; padding: 0 0 10px; border-bottom: 1px solid var(--bord); }
.mini-table td { padding: 10px 0; border-bottom: 1px solid var(--bord); color: var(--texte); vertical-align: middle; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; color: var(--texte-2); }
.mini-piste { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; min-width: 50px; }
.mini-remplie { height: 100%; background: linear-gradient(90deg, var(--barre), var(--barre-2)); border-radius: 999px; }

/* ---------- 11. MINI-VIN (dashboard) ---------- */
.mini-vin {
    display: flex; align-items: center; gap: 13px; padding: 12px; border-radius: var(--r-s);
    border: 1px solid var(--bord); background: rgba(255,255,255,0.015);
    cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .15s ease;
    text-align: left; width: 100%;
}
.mini-vin + .mini-vin { margin-top: 10px; }
.mini-vin:hover { border-color: var(--bord-fort); background: var(--surface-h); transform: translateX(2px); }
.mini-vin-corps { flex: 1; min-width: 0; }
.mini-vin-nom { font-size: 15px; font-weight: 700; color: var(--texte); }
.mini-vin-meta { font-size: 12.5px; color: var(--texte-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-vin-prix { font-size: 13px; color: var(--orange); white-space: nowrap; font-weight: 600; }
.vide { text-align: center; padding: 26px 12px; color: var(--texte-3); font-size: 13.5px; }

/* ---------- 12. PASTILLES ---------- */
.pastille { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; display: inline-block; border: 1px solid rgba(0,0,0,0.3); }
.pastille-Rouge { background: var(--c-rouge); }
.pastille-Blanc { background: var(--c-blanc); }
.pastille-Rosé  { background: var(--c-rose); }
.pastille-Rose  { background: var(--c-rose); }

/* ---------- 13. CARTE SVG ---------- */
.carte-map { padding: 0; overflow: hidden; }
.carte-map .carte-titre, .carte-map .carte-soustitre { padding: 20px 20px 0; }
.carte-svg {
    display: block; width: 100%; height: auto; margin-top: 12px; overflow: hidden;
    padding: 8px 14px 16px;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(133,95,50,.08), transparent 60%),
        #120f0e;
}
.carte-pays { fill: #211b18; stroke: #362b26; stroke-width: 0.6; stroke-linejoin: round; }
.carte-france { fill: #2c211c; stroke: var(--barre-2); stroke-width: 0.9; stroke-linejoin: round; }
.carte-pin-halo { fill: var(--orange); opacity: .16; }
.carte-pin-pt {
    fill: var(--barre-2); stroke: #f0d9a8; stroke-width: 1;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,.5));
}
.carte-pin-num { fill: #1c130a; font-family: var(--f-ui); font-size: 10px; font-weight: 800; }
.carte-pin { transition: transform .15s ease; }

/* ---------- 14. LISTE : EN-TÊTE & FILTRES ---------- */
.liste-tete { display: flex; flex-direction: column; gap: 14px; margin-bottom: 18px; }
.liste-titre-rang { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.liste-h { font-size: 27px; font-weight: 800; color: var(--texte); letter-spacing: -0.5px; }
.liste-compteur { font-size: 13px; color: var(--texte-3); }

.recherche { position: relative; }
.recherche svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--texte-3); pointer-events: none; }
.recherche input { width: 100%; padding: 13px 16px 13px 44px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-pill); color: var(--texte); font-size: 14.5px; outline: none; transition: border-color .2s ease; }
.recherche input:focus { border-color: var(--bord-fort); }
.recherche input::placeholder { color: var(--texte-3); }

.filtres { display: flex; gap: 8px; flex-wrap: wrap; }
.puce, .puce-phase {
    padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--bord);
    background: transparent; color: var(--texte-2); font-size: 13px; font-weight: 600;
    transition: all .2s ease; display: inline-flex; align-items: center; gap: 7px;
}
.puce:hover, .puce-phase:hover { border-color: var(--bord-fort); color: var(--texte); }
.puce.est-actif { background: var(--texte); color: #14100f; border-color: var(--texte); }
.puce .pastille { border: none; }
.puce-phase.est-actif { background: var(--surface-h); border-color: var(--bord-fort); color: var(--texte); }
.chip-pt { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.tri { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--texte-3); }
.tri select { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-s); padding: 8px 12px; color: var(--texte); font-size: 13px; outline: none; cursor: pointer; }

/* ---------- 15. CARTE VIN (style Vivino) ---------- */
.vin-ligne {
    background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-m);
    overflow: hidden; transition: border-color .2s ease, transform .15s ease;
}
.vin-ligne + .vin-ligne { margin-top: 12px; }
.vin-ligne:hover { border-color: var(--bord-fort); transform: translateY(-2px); }

.vin-clic { display: flex; gap: 16px; padding: 16px; text-align: left; width: 100%; align-items: flex-start; }

.vin-photo {
    width: 58px; height: 82px; flex-shrink: 0; border-radius: 8px;
    background: linear-gradient(160deg, #24211f, #14110f); border: 1px solid var(--bord);
    position: relative; overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
}
.vin-photo-bouteille { width: 24px; height: 66px; border-radius: 9px 9px 3px 3px; position: relative; }
.vin-photo-bouteille::before { content: ""; position: absolute; top: -7px; left: 50%; transform: translateX(-50%); width: 8px; height: 9px; background: inherit; border-radius: 2px; }
.vin-photo-bouteille::after { content: ""; position: absolute; bottom: 12px; left: 2px; right: 2px; height: 22px; background: rgba(245, 243, 240, 0.92); border-radius: 2px; }
.couleur-Rouge { background: #7a1e2a; }
.couleur-Blanc { background: #c6a53d; }
.couleur-Rosé  { background: #cf858c; }
.couleur-Rose  { background: #cf858c; }

.vin-info { flex: 1; min-width: 0; }
.vin-domaine { display: block; font-size: 12.5px; color: var(--texte-3); font-weight: 500; margin-bottom: 1px; }
.vin-titre { display: block; font-size: 16.5px; font-weight: 700; color: var(--texte); line-height: 1.25; }
.vin-region { display: block; font-size: 12.5px; color: var(--texte-2); margin-top: 5px; }
.vin-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.rating {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 8px;
    background: rgba(255, 255, 255, 0.06); font-size: 13px; font-weight: 700; color: var(--texte);
    font-variant-numeric: tabular-nums;
}
.rating-star { color: var(--orange); font-size: 13px; }
.rating--vide { color: var(--texte-3); font-weight: 500; background: transparent; border: 1px solid var(--bord); }

.vin-tag { font-size: 10.5px; letter-spacing: .3px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--bord); color: var(--texte-2); }
.vin-tag--phase { color: #1c1310; border: none; font-weight: 700; }

.vin-bas {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 16px; border-top: 1px solid var(--bord); background: rgba(255,255,255,0.012);
}
.stock-ctrl { display: flex; align-items: center; gap: 9px; }
.stock-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--bord); color: var(--texte);
    display: inline-flex; align-items: center; justify-content: center;
    transition: background .2s ease, border-color .2s ease, transform .1s ease;
}
.stock-btn:hover { background: var(--surface-h); border-color: var(--bord-fort); }
.stock-btn:active { transform: scale(.9); }
.stock-btn svg { width: 15px; height: 15px; }
.stock-btn[disabled] { opacity: .3; cursor: not-allowed; }
.stock-val { font-size: 17px; font-weight: 700; color: var(--texte); min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.stock-mot { font-size: 12px; color: var(--texte-3); margin-left: 2px; }
.stock-lbl { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--texte-3); text-align: center; }

.vin-fiche-lien { font-size: 12.5px; color: var(--texte-2); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; transition: color .2s ease; }
.vin-fiche-lien:hover { color: var(--orange); }
.vin-fiche-lien svg { width: 15px; height: 15px; }

/* ---------- 16. FICHE VIN ---------- */
.fiche-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.btn-retour { display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: var(--r-pill); border: 1px solid var(--bord); color: var(--texte-2); font-size: 13.5px; font-weight: 600; transition: all .2s ease; }
.btn-retour:hover { border-color: var(--bord-fort); color: var(--texte); }
.btn-retour svg { width: 16px; height: 16px; }
.fiche-actions-h { display: flex; gap: 8px; }
.btn-ico { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--bord); color: var(--texte-2); display: inline-flex; align-items: center; justify-content: center; transition: all .2s ease; }
.btn-ico:hover { border-color: var(--bord-fort); color: var(--texte); background: var(--surface-h); }
.btn-ico--danger:hover { color: var(--vin-2); border-color: rgba(194,51,70,0.5); background: rgba(194,51,70,0.1); }
.btn-ico svg { width: 18px; height: 18px; }

.fiche-entete {
    padding: 30px 24px; border-radius: var(--r-l); border: 1px solid var(--bord);
    background: radial-gradient(500px 240px at 15% -20%, rgba(165,40,54,0.28), transparent 65%), linear-gradient(180deg, #241413, #17110f);
    margin-bottom: 16px;
}
.fiche-drapeau { font-size: 12.5px; letter-spacing: .6px; color: var(--orange); text-transform: uppercase; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; }
.fiche-nom { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; line-height: 1.08; color: var(--texte); letter-spacing: -0.5px; }
.fiche-cuvee { font-family: var(--f-titre); font-style: italic; font-weight: 400; font-size: clamp(1.2rem, 4vw, 1.5rem); color: var(--orange-2); margin-top: 5px; }
.fiche-lieu { font-size: 14px; color: var(--texte-2); margin-top: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fiche-note { margin-top: 14px; font-size: 18px; letter-spacing: 2px; color: var(--orange); }

.jauge { margin-bottom: 16px; padding: 20px; border: 1px solid var(--bord); border-radius: var(--r-m); background: var(--carte); }
.jauge-tete { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.jauge-phase { font-size: 19px; font-weight: 800; }
.jauge-conseil { font-size: 12.5px; color: var(--texte-3); }
.jauge-piste { position: relative; height: 10px; border-radius: 999px; margin: 18px 0 10px; background: linear-gradient(90deg, var(--p-jeunesse), var(--p-maturite) 38%, var(--p-apogee) 62%, var(--p-declin)); opacity: .6; }
.jauge-curseur { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 18px; height: 18px; border-radius: 50%; background: var(--texte); border: 3px solid #14100f; box-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.jauge-echelle { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--texte-3); }

.fiche-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
@media (min-width: 620px) { .fiche-grille { grid-template-columns: repeat(3, 1fr); } }
.detail { padding: 15px; border-radius: var(--r-s); border: 1px solid var(--bord); background: var(--carte); }
.detail-lbl { font-size: 10.5px; letter-spacing: .8px; text-transform: uppercase; color: var(--texte-3); margin-bottom: 6px; }
.detail-val { font-size: 15px; color: var(--texte); }
.detail-val .accent { color: var(--orange); font-family: var(--f-titre); font-size: 20px; }

.cepages-carte { margin-bottom: 16px; }
.cepage-ligne { display: flex; flex-direction: column; gap: 6px; }
.cepage-ligne + .cepage-ligne { margin-top: 13px; }
.cepage-tete { display: flex; justify-content: space-between; font-size: 14px; }
.cepage-nom { color: var(--texte); }
.cepage-pct { color: var(--orange); font-variant-numeric: tabular-nums; font-weight: 600; }

.fiche-stock { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; padding: 20px; border: 1px solid var(--bord); border-radius: var(--r-m); background: var(--carte); }
.fiche-stock-info { display: flex; align-items: baseline; gap: 12px; }
.fiche-stock-nb { font-family: var(--f-titre); font-size: 40px; color: var(--orange); line-height: 1; }
.fiche-stock-txt { font-size: 13px; color: var(--texte-2); }
.fiche-stock-actions { display: flex; align-items: center; gap: 10px; }
.btn-boire { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: var(--r-pill); background: var(--vin); color: #fff; font-weight: 600; font-size: 13.5px; transition: background .2s ease, transform .15s ease, opacity .2s ease; }
.btn-boire:hover { background: var(--vin-2); transform: translateY(-1px); }
.btn-boire[disabled] { opacity: .35; cursor: not-allowed; transform: none; }
.btn-boire svg { width: 16px; height: 16px; }

.annot-carte { margin-bottom: 16px; }
.annot-texte { font-size: 14.5px; line-height: 1.7; color: var(--texte); }
.annot-vide { color: var(--texte-3); font-style: italic; }

/* ---------- 17. FORMULAIRE ---------- */
.form-barre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.form-h { font-size: 25px; font-weight: 800; color: var(--texte); letter-spacing: -0.5px; }
.form-carte { margin-bottom: 14px; }
.form-section-titre { font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--orange); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--bord); font-weight: 700; }
.form-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 560px) { .form-grille { grid-template-columns: 1fr; } }
.champ { display: flex; flex-direction: column; gap: 7px; }
.champ--large { grid-column: 1 / -1; }
.champ label { font-size: 12.5px; color: var(--texte-2); font-weight: 600; }
.champ label .oblig { color: var(--orange); }
.champ input, .champ select, .champ textarea { width: 100%; padding: 11px 13px; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--r-s); color: var(--texte); font-size: 14.5px; outline: none; transition: border-color .2s ease, background .2s ease; }
.champ input:focus, .champ select:focus, .champ textarea:focus { border-color: var(--bord-fort); background: var(--surface-h); }
.champ input::placeholder, .champ textarea::placeholder { color: var(--texte-3); }
.champ textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
.champ select { cursor: pointer; }

.choix-couleur { display: flex; gap: 10px; flex-wrap: wrap; }
.choix-couleur input { position: absolute; opacity: 0; width: 0; height: 0; }
.choix-couleur label { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--bord); color: var(--texte-2); cursor: pointer; font-size: 13.5px; transition: all .2s ease; }
.choix-couleur label:hover { border-color: var(--bord-fort); color: var(--texte); }
.choix-couleur input:checked + label { background: var(--surface-h); border-color: var(--bord-fort); color: var(--texte); }

.etoiles { display: flex; gap: 6px; font-size: 26px; color: var(--texte-3); }
.etoile { cursor: pointer; user-select: none; transition: transform .12s ease, color .12s ease; }
.etoile:hover { transform: scale(1.15); }
.etoile.pleine { color: var(--orange); }

.cep-liste { display: flex; flex-direction: column; gap: 10px; }
.cep-rang { display: grid; grid-template-columns: 1fr 88px 40px; gap: 10px; align-items: center; }
.cep-rang input { margin: 0; }
.btn-retirer-cep { width: 38px; height: 40px; border-radius: var(--r-s); border: 1px solid var(--bord); color: var(--texte-3); display: inline-flex; align-items: center; justify-content: center; transition: all .2s ease; }
.btn-retirer-cep:hover { color: var(--vin-2); border-color: rgba(194,51,70,0.5); }
.btn-retirer-cep svg { width: 16px; height: 16px; }
.btn-ajouter-cep { align-self: flex-start; margin-top: 4px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px dashed var(--bord-fort); color: var(--orange); font-size: 13px; font-weight: 600; transition: all .2s ease; }
.btn-ajouter-cep:hover { background: rgba(255, 106, 61, 0.08); }
.btn-ajouter-cep svg { width: 15px; height: 15px; }

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; padding-bottom: 8px; }
.btn-principal { padding: 13px 28px; border-radius: var(--r-pill); background: var(--vin); color: #fff; font-weight: 600; font-size: 14px; transition: background .2s ease, transform .15s ease; }
.btn-principal:hover { background: var(--vin-2); transform: translateY(-1px); }
.btn-secondaire { padding: 13px 24px; border-radius: var(--r-pill); border: 1px solid var(--bord); color: var(--texte-2); font-weight: 600; font-size: 14px; transition: all .2s ease; }
.btn-secondaire:hover { border-color: var(--bord-fort); color: var(--texte); }

/* ---------- 18. PLAN DE CAVE (visuel clayettes) ---------- */
.plan-tete { margin-bottom: 16px; }
.plan-nom { font-family: var(--f-titre); font-size: 30px; font-weight: 500; color: var(--texte); }
.plan-sous { font-size: 13px; color: var(--texte-3); margin-top: 2px; }

.cave-cadre {
    border: 2px solid var(--bord-fort); border-radius: 14px; padding: 8px;
    background: linear-gradient(180deg, #17130f, #100d0b);
    box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}
.compartiment + .compartiment { margin-top: 6px; }
.compartiment-tete {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px 8px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--texte-3); font-weight: 600;
}
.compartiment-temp { color: var(--orange); letter-spacing: .5px; }

.clayette { margin-bottom: 8px; }
.clayette:last-child { margin-bottom: 2px; }
.clayette-plateau {
    display: flex; align-items: flex-end; flex-wrap: wrap; gap: 8px;
    min-height: 52px; padding: 12px 14px 10px;
    background: rgba(255,255,255,0.015); border-radius: 8px 8px 0 0;
}
.clayette-vide { font-size: 12px; color: var(--texte-3); font-style: italic; align-self: center; }
.clayette-etiquette {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 14px; border-radius: 0 0 6px 6px;
    background: linear-gradient(180deg, var(--bois-h), var(--bois));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}
.clayette-nom { font-size: 14px; font-weight: 700; color: #f3e7d6; }
.clayette-compte { font-size: 12.5px; color: rgba(255,255,255,0.72); font-variant-numeric: tabular-nums; }

/* Points-bouteilles */
.dot {
    border-radius: 50%; border: 2px solid #14100f;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5); cursor: pointer; padding: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}
.dot:hover { transform: translateY(-3px) scale(1.08); box-shadow: 0 5px 10px rgba(0,0,0,0.6); }
.dot--s   { width: 18px; height: 18px; }
.dot--m   { width: 26px; height: 26px; }
.dot--l   { width: 30px; height: 30px; }
.dot--xl  { width: 36px; height: 36px; }
.dot--xxl { width: 42px; height: 42px; }
.dot-plus { align-self: center; font-size: 12px; color: var(--texte-2); font-weight: 600; padding-left: 4px; }

.plan-legende { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: var(--texte-2); }
.plan-legende > span { display: inline-flex; align-items: center; gap: 7px; }
.dot-mini { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.plan-astuce { color: var(--texte-3); font-size: 12px; }

/* ---------- 19. TOASTS ---------- */
#toasts { position: fixed; z-index: 80; bottom: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: min(92vw, 400px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--bord-fort); box-shadow: var(--ombre); font-size: 14px; color: var(--texte); animation: toast-in .3s ease both; }
.toast.sortir { animation: toast-out .3s ease forwards; }
.toast-pt { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }
.toast.succes .toast-pt { background: #7fb069; }
.toast.erreur .toast-pt { background: var(--vin-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(14px); } }

/* ---------- 20. UTILITAIRES ---------- */
.txt-or { color: var(--orange); }

/* ============================================================
   21. PHOTO DE BOUTEILLE (v2.1)
   ============================================================ */
/* Miniature dans la liste : remplit le créneau .vin-photo */
.vin-photo-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Photo sur la fiche */
.fiche-entete { display: flex; gap: 22px; align-items: flex-start; }
.fiche-entete-txt { flex: 1; min-width: 0; }
.fiche-photo {
    flex-shrink: 0; width: 108px; height: 150px; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--bord-fort); background: #14100f; box-shadow: var(--ombre);
}
.fiche-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 560px) {
    .fiche-entete { flex-direction: column-reverse; align-items: stretch; }
    .fiche-photo { width: 120px; height: 168px; align-self: flex-start; }
}

/* Champ photo dans le formulaire */
.photo-champ { display: flex; gap: 16px; align-items: center; }
.photo-apercu {
    width: 84px; height: 116px; flex-shrink: 0; border-radius: 10px; overflow: hidden;
    border: 1px dashed var(--bord-fort); background: var(--surface);
    display: flex; align-items: center; justify-content: center; color: var(--texte-3);
}
.photo-apercu img { width: 100%; height: 100%; object-fit: cover; }
.photo-apercu svg { width: 30px; height: 30px; opacity: .5; }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.btn-photo { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r-pill); border: 1px solid var(--bord-fort); color: var(--texte); font-size: 13px; font-weight: 600; cursor: pointer; transition: all .2s ease; }
.btn-photo:hover { background: var(--surface-h); }
.btn-photo svg { width: 15px; height: 15px; }
.btn-photo-suppr { font-size: 12.5px; color: var(--texte-3); transition: color .2s ease; }
.btn-photo-suppr:hover { color: var(--vin-2); }

/* ============================================================
   22. DOUBLE NOTATION (v2.1)
   ============================================================ */
/* Note « nous » dans la liste (petites étoiles) */
.note-nous { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--bord); font-size: 11px; color: var(--texte-2); }
.note-nous-lbl { font-size: 9.5px; letter-spacing: .5px; text-transform: uppercase; color: var(--texte-3); }
.note-nous-etoiles { color: var(--orange); letter-spacing: 1px; font-size: 12px; }

/* Blocs de note sur la fiche */
.fiche-notes { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.note-bloc { padding: 10px 16px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(0,0,0,0.2); }
.note-bloc-lbl { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--texte-3); margin-bottom: 5px; }
.note-bloc-val { font-size: 18px; font-weight: 700; color: var(--texte); }
.note-bloc-val .rating-star { color: var(--orange); }
.note-etoiles { color: var(--orange); letter-spacing: 2px; font-size: 17px; }
.note-hint { color: var(--texte-3); font-weight: 400; }

/* ============================================================
   23. JAUGE DE MATURITÉ — état « fenêtre non renseignée »
   ============================================================ */
.jauge-astuce { font-size: 11.5px; color: var(--texte-3); }

/* ============================================================
   24. FENÊTRE DE CONSOMMATION (formulaire, v2.2)
   ============================================================ */
.form-aide { font-size: 12.5px; color: var(--texte-3); margin: -4px 0 14px; line-height: 1.5; }
.btn-suggerer {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
    padding: 9px 16px; border-radius: var(--r-pill); border: 1px dashed var(--bord-fort);
    background: transparent; color: var(--texte-2); font-size: 13px; font-weight: 600;
    cursor: pointer; transition: all .2s ease;
}
.btn-suggerer:hover { border-color: var(--barre-2); color: var(--texte); background: rgba(133,95,50,.1); }
.btn-suggerer svg { width: 15px; height: 15px; }

/* ============================================================
   25. HISTORIQUE (vins consommés, v2.3)
   ============================================================ */
.vin-ligne--histo { opacity: .82; }
.vin-ligne--histo .vin-photo { filter: grayscale(.35); }
.vin-ligne--histo:hover { opacity: 1; }
.tag-consomme {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px;
    font-size: 10.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase;
    color: var(--texte-3); background: rgba(255,255,255,.05); border: 1px solid var(--bord);
}
.btn-racheter {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--r-pill);
    background: var(--vin); color: #fff; font-size: 12.5px; font-weight: 600;
    cursor: pointer; transition: background .2s ease, transform .15s ease;
}
.btn-racheter svg { width: 14px; height: 14px; }
.btn-racheter:hover { background: var(--vin-2); transform: translateY(-1px); }
