/* Cantina — foglio di stile.
   Stile «achromatic ledger» (taste-skill, seed 1179313177): nessun colore sull'interfaccia, inchiostro e grigi;
   l'unica tinta è il colore del vino, sul dato principale (finestre di bevuta, prezzi, posti in rastrelliera).
   Fondo pietra di cantina, carte bianche con filo da 1px, nessuna ombra a riposo.

   Griglia (desktop >= 1100px): barra laterale 240 + tela con margine 32; colonna max 1080.
   12 colonne, gap 12: colonna = (1080 - 11*12) / 12 = 79 px; 8 colonne = 716, 4 colonne = 352.
   Tablet 700-1099: barra laterale 220, una colonna. Telefono < 700: barra in basso con 5 voci, margini 16. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/font/geist-latin.woff2) format("woff2");
  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: "Geist"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/font/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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; }

:root {
  --ground: #f4f3f1;   /* pietra */
  --surface: #ffffff;
  --raised: #efeeeb;
  --active: #e7e5e1;   /* pillola della voce attiva */
  --border: #e4e2de;
  --rule: #efeeeb;
  --control: #d2cfca;
  --text: #0a0a0a;
  --muted: #5e5e5e;
  --faint: #6b6b6b;
  --primary: #141414; --primary-ink: #ffffff;
  --positive: #2e7d32; --negative: #c4242a; --warning: #92400e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fffbeb; --pill-warning-ink: #92400e;
  --pill-neutral-bg: #eeeeee; --pill-neutral-ink: #3d3d3d;
  --grid: #ebe9e5; --axis: #6b6b6b;
  /* il vino */
  --vino: #8a1f33;                    /* la tinta del dato principale */
  --v-rosso: #7d1f30; --v-bianco: #e3cb6c; --v-bianco-filo: #b89a2e; --v-rosato: #e8959b; --v-orange: #cf7631; --v-ignoto: #9b9b9b;
  --vuoto-filo: #cfccc6;

  --font: "Geist", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-title: 24px; --fs-section: 16px; --fs-kpi: 30px; --fs-body: 14px; --fs-small: 13px; --fs-tick: 12px;
  --radius-card: 8px; --radius-control: 6px;
  --gap: 12px; --pad: 32px; --card-pad: 20px;
  --control-height: 36px; --row-height: 44px; --nav-row: 32px;
  --sidebar: 240px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #000000; --surface: #111111; --raised: #1c1c1c; --active: #222222;
    --border: #2a2a2a; --rule: #1d1d1d; --control: #444444;
    --text: #ffffff; --muted: #b4b4b4; --faint: #949494;
    --primary: #ffffff; --primary-ink: #000000;
    --positive: #3fc07a; --negative: #e5566f; --warning: #e5a93b;
    --pill-positive-bg: #172a1d; --pill-positive-ink: #3fc07a;
    --pill-negative-bg: #2c1a20; --pill-negative-ink: #e5566f;
    --pill-warning-bg: #2b2414; --pill-warning-ink: #e5a93b;
    --pill-neutral-bg: #222222; --pill-neutral-ink: #ffffff;
    --grid: #262626; --axis: #949494;
    --vino: #e0697d; --v-rosso: #b8344b; --v-bianco-filo: #e3cb6c; --vuoto-filo: #4a4a4a;
    color-scheme: dark;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--text); font: var(--fs-body)/20px var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
table, .num, .cifra b, .quante { font-variant-numeric: tabular-nums; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tenue { color: var(--muted); }
.piccolo { font-size: var(--fs-small); line-height: 18px; }
.errore { color: var(--negative); }
.ok { color: var(--positive); display: inline-flex; align-items: center; gap: 6px; }
.attenzione { padding: 10px 12px; border: 1px solid #fde68a; border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.caricamento { padding: 48px; color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- guscio: barra laterale sul fondo pagina ---------- */
.guscio { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100svh; }
.barra { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 28px 12px 16px; }
.marchio { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; margin-bottom: 24px; font-weight: 500; text-decoration: none; }
.marchio svg { width: 22px; height: 22px; }
.voci { display: grid; gap: 2px; }
.voci a { display: flex; align-items: center; gap: 10px; height: var(--nav-row); padding: 0 10px; border-radius: 8px; color: var(--muted); text-decoration: none; transition: background-color 150ms ease, color 150ms ease; }
.voci a:hover { background: var(--raised); color: var(--text); }
.voci a[aria-current="page"] { background: var(--active); color: var(--text); }
.chi { margin-top: auto; padding: 0 10px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; }
.chi b { display: block; color: var(--text); font-weight: 500; font-size: var(--fs-body); line-height: 20px; }
.contenuto { min-width: 0; width: 100%; max-width: calc(1080px + 2 * var(--pad)); padding: 32px var(--pad) 64px; }
.contenuto > * + * { margin-top: var(--gap); }
.contenuto > .testa + * { margin-top: 0; }

/* banda dello spostamento in corso */
.banda { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--primary); color: var(--primary-ink); }
.banda button { height: 30px; background: transparent; color: inherit; border-color: currentColor; }
.banda button:hover { background: transparent; }

/* ---------- titolo della pagina ---------- */
.testa { display: flex; align-items: center; gap: 8px; min-height: 40px; margin-bottom: 20px; }
.testa h1 { flex: 1; min-width: 0; font-size: var(--fs-title); line-height: 30px; font-weight: 500; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.sotto-titolo { margin: -16px 0 20px; color: var(--muted); }
.contenuto > .sotto-titolo { margin-top: -16px; }
.scheda .testa { margin-bottom: 12px; min-height: 0; }
.scheda .testa h2 { flex: 1; margin: 0; }

/* ---------- pannelli ---------- */
.scheda { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); min-width: 0; }
.scheda h2 { font-size: var(--fs-section); line-height: 24px; font-weight: 500; margin-bottom: 12px; }
.scheda .testa h2 { margin-bottom: 0; }
.scheda > * + * { margin-top: 12px; }
.scheda > h2 + *, .scheda > .testa + * { margin-top: 0; }
.griglia-2 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.griglia-2 > :first-child { grid-column: span 8; }
.griglia-2 > :last-child { grid-column: span 4; }
.griglia-2 > div { display: grid; gap: var(--gap); min-width: 0; }
.griglia-2 > div > * { min-width: 0; }
.griglia-2.pari { align-items: stretch; }
.griglia-2.pari > div { align-content: start; }
.griglia-2.pari > section { display: flex; flex-direction: column; }
.griglia-2.pari .posti { flex: 1; align-content: center; }
.riassunto { margin: -4px 0 12px; color: var(--muted); }
.riassunto b { color: var(--text); font-weight: 500; }

/* cifre: una striscia divisa, etichetta sopra il numero */
.cifre { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.cifra { padding: 16px var(--card-pad); min-width: 0; }
.cifra + .cifra { border-left: 1px solid var(--border); }
.cifra > span { display: block; color: var(--muted); }
.cifra b { display: block; margin-top: 6px; font-size: var(--fs-kpi); line-height: 36px; font-weight: 500; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cifra b.soldi { font-weight: 700; }
.cifra b.zero { color: var(--muted); font-weight: 400; }
.cifra small { display: block; margin-top: 4px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; }

/* ---------- controlli ---------- */
button, .bottone { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--control-height); padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--control); background: var(--surface); color: var(--text); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms ease, transform 120ms var(--ease-out); }
button:hover, .bottone:hover { background: var(--raised); }
button:active, .bottone:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; color: var(--muted); background: var(--raised); }
.primario { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.primario:hover { background: var(--primary); opacity: 0.88; }
.primario:disabled { background: var(--raised); color: var(--muted); opacity: 1; }
.pericolo { color: var(--negative); }
.piccolo:is(button, .bottone) { height: 32px; padding: 0 10px; }
.piccolo:is(button, .bottone)[aria-label]:has(> svg:only-child) { width: 32px; padding: 0; }
.testo-azione { height: auto; padding: 0; border: 0; background: none; color: var(--text); text-decoration: underline; text-decoration-color: var(--control); font-weight: 500; }
.testo-azione:hover { background: none; text-decoration-color: currentColor; }
.azioni { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proposte { flex-direction: column; align-items: stretch; }
.proposta { height: auto; min-height: 44px; padding: 10px 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; white-space: normal; max-width: 100%; }
.proposta span { font-size: 13px; color: var(--muted); font-weight: 400; }
.azioni.fondo { justify-content: flex-end; margin-top: 20px; }

label { display: block; font-weight: 500; margin-bottom: 8px; }
label:has(> input[type="checkbox"]) { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); }
textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 20px; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%235e5e5e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); flex: none; }
input[type="file"] { max-width: 100%; }
.campi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.campi > * { min-width: 0; }
.campi > .meta { grid-column: span 2; }
.campi > .largo { grid-column: 1 / -1; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* scelte: pillole compatte; la scelta fatta prende l'inchiostro come filo e il grigio come fondo */
.scelte { display: flex; flex-wrap: wrap; gap: 6px; }
.scelte button { height: 32px; padding: 0 12px; border-radius: 999px; font-weight: 400; color: var(--muted); }
.scelte button[aria-pressed="true"] { background: var(--active); border-color: var(--text); color: var(--text); font-weight: 500; }
.scelte button svg.i { width: 18px; height: 18px; }
.scelte button[aria-pressed="true"] svg.i { fill: currentColor; }

.ricerca { position: relative; flex: 1; min-width: 200px; }
.ricerca svg.i { position: absolute; left: 13px; top: 11px; width: 14px; height: 14px; color: var(--muted); }
.ricerca input { padding-left: 36px; height: 36px; }
.filtri { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }

/* ---------- elenchi e tabelle ---------- */
.elenco > li + li { border-top: 1px solid var(--rule); }
.elenco > li.vuoto { border: 1px dashed var(--control); border-radius: var(--radius-control); padding: 10px 12px; color: var(--muted); }
.riga-vino { display: flex; align-items: center; gap: 12px; min-height: var(--row-height); padding: 10px 0; color: inherit; text-decoration: none; }
a.riga-vino:hover .titolo { text-decoration: underline; text-decoration-color: var(--control); }
button.riga-vino { width: 100%; height: auto; border: 0; border-radius: 0; background: none; text-align: left; font-weight: 400; justify-content: flex-start; }
button.riga-vino:hover { background: none; }
.riga-vino .testo { flex: 1; min-width: 0; }
.titolo { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sotto { color: var(--muted); font-size: var(--fs-small); line-height: 18px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quante { min-width: 32px; text-align: right; font-weight: 500; }
.quante.ok { color: var(--positive); display: inline; }
.quante.tenue { color: var(--muted); }
.miniatura { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; flex: none; background: var(--raised); }
.pallino { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--v-ignoto); }
.pallino.rosso { background: var(--v-rosso); }
.pallino.bianco { background: var(--v-bianco); box-shadow: inset 0 0 0 1px var(--v-bianco-filo); } /* taste-skill-ignore: filo del bianco, non ombra */
.pallino.rosato { background: var(--v-rosato); }
.pallino.orange { background: var(--v-orange); }

.scorre { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 12px; text-align: left; font-weight: 400; font-size: var(--fs-small); color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
tbody tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; white-space: nowrap; }
td .sotto { white-space: normal; }
td.vino-cella { width: 100%; }
td.vino-cella a { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
td.vino-cella .pallino { transform: translateY(-1px); }
td.vino-cella a:hover .titolo { text-decoration: underline; text-decoration-color: var(--control); }
td.vino-cella .titolo { white-space: normal; }
td.vino-cella .sotto { white-space: normal; }
td.zero, .zero { color: var(--muted); }

.chip, .etichetta-chip { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: var(--fs-small); font-weight: 500; text-decoration: none; white-space: nowrap; }
.etichetta-chip { height: auto; min-height: 28px; padding: 4px 10px; border-radius: 14px; font-size: var(--fs-body); white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.chip svg.i, .etichetta-chip svg.i { width: 14px; height: 14px; flex: none; }
.chip svg.i, .etichetta-chip svg.i { width: 14px; height: 14px; }
dl.dati { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 8px 16px; }
dl.dati dt { color: var(--muted); }
details > summary { cursor: pointer; padding: 8px 0; font-weight: 500; }
details[open] > summary { margin-bottom: 8px; }

.vuoto { display: grid; justify-items: start; gap: 8px; padding: 16px; border: 1px dashed var(--control); border-radius: var(--radius-control); color: var(--muted); }
.scheda.vuoto { border-style: dashed; background: transparent; }
.vuoto svg.i { width: 20px; height: 20px; }

/* ---------- calendario di bevuta ---------- */
.calendario { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); column-gap: 16px; }
.cal-intesta { color: var(--muted); font-size: var(--fs-small); align-self: end; padding-bottom: 6px; }
.cal-asse { position: relative; height: 26px; color: var(--axis); font-size: var(--fs-tick); }
.cal-asse span { position: absolute; bottom: 6px; transform: translateX(-50%); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-asse span.oggi { color: var(--text); font-weight: 500; }
.cal-nome { display: block; padding: 8px 0; min-width: 0; text-decoration: none; border-top: 1px solid var(--rule); }
.cal-nome:hover .titolo { text-decoration: underline; text-decoration-color: var(--control); }
.cal-traccia { position: relative; border-top: 1px solid var(--rule); min-height: 53px; }
.cal-traccia i { position: absolute; top: 50%; height: 8px; margin-top: -4px; border-radius: 2px; background: var(--control); }
.cal-traccia i.ora { background: var(--v-ignoto); }
.cal-traccia i.ora.rosso { background: var(--v-rosso); }
.cal-traccia i.ora.bianco { background: var(--v-bianco); box-shadow: inset 0 0 0 1px var(--v-bianco-filo); } /* taste-skill-ignore: filo del bianco */
.cal-traccia i.ora.rosato { background: var(--v-rosato); }
.cal-traccia i.ora.orange { background: var(--v-orange); }
.cal-traccia i.oltre { background: var(--control); }
.cal-traccia i.dopo { background: transparent; border: 1px solid var(--vuoto-filo); }
.negativo { color: var(--negative); }
.cal-traccia em { position: absolute; top: 50%; z-index: 1; transform: translateY(-50%); padding: 0 4px; background: var(--surface); font-style: normal; font-size: var(--fs-small); line-height: 18px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-traccia em.dentro { background: none; color: var(--surface); }
.cal-traccia .oggi, .cal-asse .linea-oggi { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--text); pointer-events: none; }
.cal-asse .linea-oggi { top: auto; height: 6px; }
.cal-piede { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); }

/* ---------- grafico prezzi ---------- */
.grafico { width: 100%; height: 200px; overflow: visible; }
.grafico .gl { stroke: var(--grid); stroke-width: 1; }
.grafico .tk { fill: var(--axis); font-size: 12px; font-variant-numeric: tabular-nums; }
.grafico .linea { fill: none; stroke: var(--vino); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.grafico .rif { stroke: var(--text); stroke-width: 1; }
.grafico .rif-et { fill: var(--text); font-size: 12px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }

/* ---------- rastrelliera: l'elemento di questa app ---------- */
.posti { display: grid; gap: 4px; padding: 12px; border-radius: var(--radius-card); background: var(--raised); overflow-x: auto; justify-content: center; padding: 24px 12px; }
.posti.filtrata .posto.pieno:not(.acceso)::before { opacity: 0.18; }
.posto.acceso::before { outline: 2px solid var(--text); outline-offset: 2px; }
.scegli-vino { height: auto; padding: 10px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: var(--radius-control); background: none; text-align: left; justify-content: flex-start; }
.scegli-vino[aria-pressed="true"] { background: var(--active); }
.quante-uscire { display: flex; align-items: center; gap: 8px; margin: 0; }
.quante-uscire select { width: 64px; height: 32px; }
.posti.rombo { row-gap: 0; padding-bottom: 28px; }
.solo-lettori { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.blocco-ais { border-bottom: 1px solid var(--rule); }
.blocco-ais > summary { min-height: 52px; display: grid; gap: 2px; align-content: center; padding: 8px 0; cursor: pointer; }
.blocco-ais .riepilogo-ais { font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocco-ais[open] .riepilogo-ais { display: none; }
.altri-dati { border-top: 1px solid var(--rule); padding-top: 12px; }
.altri-dati > summary { min-height: 44px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 600; cursor: pointer; }
.altri-dati > .campi { margin-top: 12px; }
.posti .asse { display: grid; place-items: center; min-height: 20px; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-2, var(--muted)); }
.posti .asse.riga { justify-items: end; padding-right: 4px; }
.posto { position: relative; width: 100%; height: auto; aspect-ratio: 1; min-width: 30px; min-height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.posto::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; border: 1.5px solid var(--vuoto-filo); background: var(--surface); }
.posto:hover { background: transparent; }
.posto:hover::before { border-color: var(--text); }
.posto.pieno::before { border: 0; background: var(--v-ignoto); }
.posto.pieno.rosso::before { background: var(--v-rosso); }
.posto.pieno.bianco::before { background: var(--v-bianco); box-shadow: inset 0 0 0 1.5px var(--v-bianco-filo); } /* taste-skill-ignore: filo del bianco */
.posto.pieno.rosato::before { background: var(--v-rosato); }
.posto.pieno.orange::before { background: var(--v-orange); }
.posto.pieno:disabled { cursor: default; background: transparent; }
.posto.pieno:disabled::before { opacity: 0.4; }
.posto.scelto::before { border: 2px solid var(--text); background: var(--text); box-shadow: inset 0 0 0 4px var(--surface); } /* taste-skill-ignore: anello di selezione */
.posto.evidenzia::before { border: 1.5px dashed var(--text); }
.posto.sfasato { transform: translateY(50%); }
.legenda { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: var(--fs-small); }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }

.contenitori { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--gap); }
.contenitore { display: grid; gap: 4px; align-content: start; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); color: inherit; text-decoration: none; transition: border-color 150ms ease; }
.contenitore:hover { border-color: var(--control); }
.contenitore b { font-weight: 500; }
.filtri-avanzati { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 4px 0 16px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); }
.filtri-avanzati[hidden] { display: none; }
.filtri-avanzati .campo { display: grid; gap: 4px; }
.filtri-avanzati .campo > span { font-size: 13px; color: var(--muted, inherit); }
.filtri-avanzati select { width: 100%; min-width: 0; }
.filtri-avanzati .azioni { grid-column: 1 / -1; }
.elenco.vitigni li { padding: 10px 0; }
.contenitori.fitti {grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.contenitori.fitti .contenitore { padding: 10px 12px; }
.contenitori.fitti .mini-rastrelliera { margin-top: 6px; }
.barra-piena { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.barra-piena i { display: block; height: 100%; background: var(--text); }
.mini-rastrelliera { display: grid; gap: 2px; margin-top: 10px; max-width: 220px; }
.mini-rastrelliera i { aspect-ratio: 1; border-radius: 50%; background: var(--rule); }
.mini-rastrelliera i.pieno { background: var(--v-ignoto); }
.mini-rastrelliera i.rosso { background: var(--v-rosso); } .mini-rastrelliera i.bianco { background: var(--v-bianco); }
.mini-rastrelliera i.rosato { background: var(--v-rosato); } .mini-rastrelliera i.orange { background: var(--v-orange); }

/* ---------- foto ---------- */
.foto-scelta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.slot { position: relative; display: grid; place-items: center; height: 168px; margin: 0; border: 1px dashed var(--control); border-radius: var(--radius-card); color: var(--muted); font-weight: 400; cursor: pointer; overflow: hidden; }
.slot > span { display: grid; justify-items: center; gap: 8px; }
.slot svg.i { width: 20px; height: 20px; }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.carica { position: relative; cursor: pointer; }
.carica input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.carica:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.spunta { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; color: var(--muted); font-weight: 400; }
.slot:hover { border-color: var(--text); color: var(--text); }
.foto-vino { width: 140px; height: 186px; object-fit: cover; border-radius: 4px; background: var(--raised); }
.mappa-zona { width: 100%; max-height: 220px; }
.scheda-kb { margin-top: var(--gap); }
.vino-griglia .scheda-kb { margin-top: 0; }
.sez-prezzi:not(.tutti-prezzi) tr.oltre-tre { display: none; }
.sez-prezzi > .testo-azione { margin-top: 8px; }
.tabella-vini .posto-cella { min-width: 176px; }
.kb-zona.con-mappa { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.kb-zona p + p { margin-top: 8px; }
.scheda-kb td { min-width: 96px; }
.scheda-kb td:nth-child(2) { min-width: 240px; }
.mappa-zona path { fill: var(--raised); stroke: var(--text); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.attesa { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.rotella { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--control); border-top-color: var(--text); animation: gira 0.8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- finestre e avvisi (galleggiano: qui l'ombra è ammessa) ---------- */
dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100svh - 32px); padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16); } /* taste-skill-ignore: finestra in primo piano */
dialog::backdrop { background: rgba(10, 10, 10, 0.32); }
dialog > h2 { font-size: 18px; line-height: 24px; font-weight: 500; margin-bottom: 16px; }
dialog .azioni.fondo { margin-top: 24px; }
dialog > div:not(.azioni) > * + * { margin-top: 12px; }
#avviso { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 12px); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); opacity: 0; pointer-events: none; transition: opacity 150ms ease, transform 200ms var(--ease-out); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); } /* taste-skill-ignore: notifica galleggiante */
#avviso.visibile { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; cursor: pointer; }
#avviso.errore { background: var(--negative); color: #fff; }
#copia { position: sticky; top: 0; z-index: 40; padding: 8px 16px; background: var(--surface-2, #efe9dc); color: var(--ink); border-bottom: 1px solid var(--rule); font-size: 14px; text-align: center; }
#avviso .azione-avviso { margin-left: 8px; min-height: 36px; padding: 0 12px; background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 6px; font-weight: 600; }

/* ---------- degustazione AIS ---------- */
.ais { display: grid; gap: 0; margin-bottom: 16px; }
.ais .scelte { gap: 8px; }
.ais .scelte button { height: auto; min-height: 44px; }
.ais fieldset { display: grid; gap: 16px; padding-bottom: 20px; }
.ais legend { font-size: var(--fs-section); line-height: 24px; font-weight: 500; margin-bottom: 4px; padding: 0; }

/* ---------- accesso ---------- */
.accesso { width: min(400px, calc(100vw - 32px)); margin: 12vh auto 0; display: grid; gap: 16px; }
.accesso .marchio { padding: 0; margin: 0; }
.accesso h1 { font-size: var(--fs-title); line-height: 30px; font-weight: 500; }
.accesso .scheda > * + * { margin-top: 16px; }

/* ---------- impostazioni in due colonne ---------- */
.sezione { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 24px; padding: 32px 0; border-top: 1px solid var(--border); }
.testa + .sezione { border-top: 0; padding-top: 8px; }
.sezione > div:first-child h2 { font-size: var(--fs-section); line-height: 24px; font-weight: 500; margin-top: 8px; }
.sezione > div:first-child p { margin-top: 4px; color: var(--muted); }
.pannello { padding: 16px; border-radius: var(--radius-card); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 16px; align-content: start; min-width: 0; }
.interruttore { display: flex; align-items: flex-start; gap: 16px; margin: 0; font-weight: 400; cursor: pointer; }
.interruttore > div { flex: 1; }
.interruttore b { font-weight: 500; }
.interruttore p { color: var(--muted); margin-top: 2px; }
.switch, input[type="checkbox"].switch { appearance: none; width: 32px; height: 20px; margin: 0; border-radius: 999px; background: var(--control); position: relative; cursor: pointer; flex: none; transition: background-color 200ms ease; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 200ms var(--ease-out); }
.switch:checked { background: var(--text); }
.switch:checked::after { transform: translateX(12px); background: var(--surface); }

/* ---------- tablet ---------- */
@media (max-width: 1099px) {
  :root { --sidebar: 220px; --pad: 24px; }
  .griglia-2 > * { grid-column: 1 / -1 !important; }
  .sezione { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  /* scheda vino con disciplinare: una colonna, prezzi subito dopo le bottiglie */
  .vino-griglia.con-kb > div { display: contents; }
  .vino-griglia.con-kb > div > * { grid-column: 1 / -1; }
  .vino-griglia .sez-foto { order: -3; }
  .vino-griglia .sez-bottiglie { order: -2; }
  .vino-griglia .sez-prezzi { order: -1; }
  .vino-griglia .sez-kb { order: 9; }
}

/* ---------- sotto i 900px le cifre vanno su due colonne (quattro in fila si troncano) ---------- */
@media (max-width: 899px) {
  .tabella-vini thead { display: none; }
  .tabella-vini tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  .tabella-vini tbody tr:last-child { border-bottom: 0; }
  .tabella-vini td { padding: 0; border: 0; }
  .tabella-vini td.vino-cella { grid-column: 1; }
  .tabella-vini td.quante-cella { grid-column: 2; grid-row: 1; }
  .tabella-vini td.extra { display: none; }
  .tabella-vini td.riga2 { display: block; grid-column: 1 / -1; padding-left: 20px; color: var(--muted); font-size: var(--fs-small); line-height: 16px; text-align: left; }
  .cifre { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cifra + .cifra { border-left: 0; }
  .cifra:nth-child(n + 3) { border-top: 1px solid var(--border); }
  .cifra:nth-child(2n) { border-left: 1px solid var(--border); }
  .cifra:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- telefono: la barra laterale diventa la barra in basso ---------- */
@media (max-width: 699px) {
  :root { --pad: 16px; --card-pad: 16px; --fs-kpi: 24px; }
  .guscio { grid-template-columns: minmax(0, 1fr); }
  .barra { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 10; height: auto; padding: 0 4px env(safe-area-inset-bottom); flex-direction: row; background: var(--surface); border-top: 1px solid var(--border); }
  .marchio, .chi { display: none; }
  .voci { flex: 1; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
  .voci a { flex-direction: column; justify-content: center; gap: 2px; height: 52px; padding: 4px 0; border-radius: 10px; font-size: var(--fs-small); line-height: 16px; margin: 6px 2px; }
  .voci a:hover { background: transparent; }
  .voci a[aria-current="page"] { background: var(--active); }
  .voci a svg.i { width: 20px; height: 20px; }
  .contenuto { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .testa h1 { font-size: 22px; line-height: 28px; }
  .campi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .campi > .meta { grid-column: 1 / -1; }
  .calendario { grid-template-columns: minmax(0, 1fr); }
  .cal-intesta { display: none; }
  .cal-nome { padding-bottom: 0; }
  .cal-traccia { border-top: 0; min-height: 28px; }
  .kb-zona.con-mappa { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .kb-zona .mappa-zona { max-height: 160px; }
  .riga-vino.gruppo { flex-wrap: wrap; row-gap: 8px; }
  .riga-vino.gruppo .testo { flex: 1 0 100%; }
  .azioni.fondo { position: sticky; bottom: calc(68px + env(safe-area-inset-bottom)); padding: 12px 0; background: var(--ground); }
  .azioni.fondo > * { flex: 1; }
  dialog .azioni.fondo { position: static; background: none; padding: 0; }
  .foto-vino { width: 112px; height: 150px; }
  dl.dati { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.dati dd { margin-bottom: 8px; }
  #avviso { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .posto { min-width: 34px; min-height: 34px; }
  button, .bottone { min-height: 40px; }
  .piccolo:is(button, .bottone) { min-height: 40px; height: 40px; }
  .piccolo:is(button, .bottone)[aria-label]:has(> svg:only-child) { width: 40px; }
  .scelte button { height: 36px; min-height: 36px; }
}
@media (min-width: 900px) { .tabella-vini td.riga2 { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* offerte trovate online: prezzo sulla riga del venditore, niente scorrimento orizzontale sul telefono */
.offerte td:first-child { width: 32px; vertical-align: top; padding-top: 14px; }
.offerta-testa { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.offerta-testa .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
