/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   Vetrina per reparti (spec Docs/superpowers/specs/2026-10-18-vetrina-reparti-simili-design.md, «Home C»).
   Riga delle scelte (reparti + Mostrami), file di card che scorrono di lato, card «a pila» dei gruppi,
   pannello del gruppo, «negli altri reparti». Solo token del tema: niente colori scritti qui.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Riga delle scelte ────────────────────────────────────────────────────────────────────────────── */
.ct-vbar { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ct-vbar__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.ct-vbar__head b { font-size: 20px; font-weight: 900; }
.ct-vbar__head span { font-size: 14px; color: var(--ink-muted); }
.ct-vbar__row { display: flex; flex-direction: column; gap: 10px; min-width: 0; }

.ct-vpick { min-width: 0; }
.ct-vpick__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-vpick__label { font-size: 16px; font-weight: 900; margin-right: 4px; }
.ct-vpick__chips .ct-chip { min-height: 40px; }
.ct-vpick__open { display: none; }
.ct-vpick__summary { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Negozi scelti togliibili sotto la riga: solo sul telefono (sul computer i chip della riga fanno già da interruttore) */
.ct-vbar__picked { display: none; }

.ct-vbar__hint { display: flex; gap: 8px; align-items: baseline; margin: 0; font-size: 14px; color: var(--ink-soft); }
.ct-vpick--stores .ct-store-chip .ct-storebadge__mark { width: 20px; height: 20px; }

/* Foglio dal basso: due colonne di chip larghi */
.ct-vsheet__hint { margin: 0; font-size: 13px; color: var(--ink-muted); }
/* Il foglio dei reparti ha sei figli (due sentinelle, maniglia, testata, nota, corpo) contro le quattro righe della
   griglia di .ct-fsheet: la testata finiva nella riga elastica e «Fatto» passava sopra la nota. In colonna, solo il
   corpo si stringe e scorre. */
/* ChoiceSheet porta anche .ct-vsheet, che in cartellino-cards.css (caricato dopo cartellino-filters.css) è il foglio
   dei coupon a tutto schermo: inset 0, z-index 300 e fondo velato. Senza rimettere qui ciò che decide .ct-fsheet il
   foglio finiva sotto il proprio velo (z-index 400), velato e non cliccabile. */
.ct-fsheet.ct-vsheet {
  display: flex; flex-direction: column; z-index: 410; top: auto;
  background: var(--surface); align-items: stretch; justify-content: flex-start;
}
.ct-vsheet > .ct-fsheet__head { flex: none; }
.ct-vsheet > .ct-fsheet__head .ct-chip { min-height: 44px; }
.ct-vsheet > .ct-fsheet__body { flex: 1 1 auto; min-height: 0; }
.ct-vsheet__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ct-vsheet__grid .ct-chip { justify-content: space-between; min-height: 48px; border-radius: 10px; text-align: left; white-space: normal; }
/* A 360 px «Grandi Elettrodomestici» spingeva il conteggio fuori dal bordo: il nome va a capo, il numero resta intero */
.ct-vsheet__grid .ct-chip { gap: 6px; padding-left: 12px; padding-right: 12px; }
.ct-vsheet__grid .ct-chip > span { min-width: 0; overflow-wrap: anywhere; }
.ct-vsheet__grid .ct-chip > small { flex: none; }

/* Telefono e tablet stretto: una riga con due pulsanti, incollata sotto la testata */
@media (max-width: 767.98px) {
  .ct-vbar {
    position: sticky; top: calc(var(--ct-header-h) + var(--ct-live-h)); z-index: 30;
    margin: 0 -16px; padding: 8px 16px; background: var(--paper); border-bottom: 1.5px dashed var(--rule);
  }
  /* La riga sticky crea un contesto di impilamento: col foglio aperto deve salire sopra testata (220) e barra (200) */
  .ct-vbar:has(.ct-fsheet) { z-index: 420; }
  /* Idem col pannello «Tutti i negozi» (Danny 21-10: testata e riga dei filtri gli finivano sopra) */
  .ct-vbar:has(.ct-picker) { z-index: 520; }
  .ct-vbar__head { display: none; }
  .ct-vbar__row { flex-direction: row; gap: 8px; }
  /* I tre pulsanti si dividono la riga secondo il testo (corto: «Reparti · 3», «Negozi»), senza tetti fissi: coi
     tetti del 19-10 a 360 px restava «Abbigl…» / «Tutti i…» */
  .ct-vbar__row > .ct-vpick { flex: 1 1 auto; }
  .ct-vpick__chips { display: none; }
  .ct-vpick__open { display: inline-flex; width: 100%; min-height: 44px; justify-content: center; gap: 4px; padding-left: 8px; padding-right: 8px; }
  /* Senza freccia, come la riga di /deals: con «Negozi · 2» a 360 px non ci stavano tutti e tre */
  .ct-vpick__open > .bi-chevron-down { display: none; }
  .ct-vbar__row { gap: 6px; }
  /* Un testo lungo («Più simili a confronto») va su due righe dentro il pulsante, invece di finire coi puntini */
  .ct-vbar:not(.ct-vbar--compact) .ct-vpick__summary {
    white-space: normal; text-align: center; line-height: 1.15;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere;
  }
  .ct-vbar__hint { font-size: 13px; }
  /* La fila dei negozi scelti sotto i tre pulsanti, a tutta larghezza, che scorre di lato */
  .ct-vbar__picked { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .ct-vbar__picked::-webkit-scrollbar { display: none; }
  .ct-vbar__picked .ct-chip { flex: none; min-height: 40px; }
  .ct-vbar__picked .ct-chip .bi-x-lg { font-size: 11px; }
}

/* ── Sezioni e file di card ───────────────────────────────────────────────────────────────────────── */
.ct-vsec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ct-vsec__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.ct-vsec__head h2 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.02em; }
.ct-vsec__note { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font: 500 13px var(--font-mono); color: var(--ink-muted); }
.ct-vsec__drops { color: var(--save); font-weight: 500; }
.ct-vsec__open { margin-left: auto; }
/* «Apri il reparto →» (Danny 31-10: «non è molto visibile»): un bottone vero col bordo d'inchiostro e l'ombra piena del
   tema, alto 44 px ovunque; inchiostro su carta (e su giallo al passaggio) tiene il contrasto AA in chiaro e scuro */
.ct-open-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 800 14px var(--font-sans); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow-hard-sm);
  align-self: center;
}
.ct-open-btn:hover { background: var(--tag); color: var(--tag-ink, var(--ink)); text-decoration: none; }
.ct-open-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.ct-open-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ct-open-btn:active { transform: none; } }
.ct-vsec__open-short { display: none; }
/* 📌 della testata (Danny 02-11 22:41-22:42): fissa il reparto in cima su questo dispositivo. Bottone tondo da 44 px
   accanto ad «Apri il reparto»; acceso = giallo del cartellino */
.ct-vsec__pin {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-size: 16px; cursor: pointer; align-self: center;
}
.ct-vsec__pin.is-on { background: var(--tag); color: var(--tag-ink, var(--ink)); box-shadow: var(--shadow-hard-sm); }
.ct-vsec__pin:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
/* Riga di stato del 📌 (tetto dei fissati). Vuota resta nell'albero di accessibilità (così il testo, quando arriva, si
   annuncia) ma fuori dal flusso: niente gap della sezione */
.ct-vsec__pin-note { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.ct-vsec__pin-note:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Sentinella delle file che arrivano scorrendo: un punto senza altezza dopo l'ultima fila montata */
.ct-lanes__more { height: 1px; }
.ct-vsec__subs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ct-vsec__subs::-webkit-scrollbar { display: none; }
.ct-vsec__subs .ct-chip { flex: none; }
.ct-vsec__subs a.ct-chip { text-decoration: none; color: var(--ink); }

/* La fila scorre di lato dentro la pagina: la pagina non scorre mai in orizzontale */
.ct-vrow {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr);
  gap: 20px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 2px 14px 16px 2px; min-width: 0;
}
.ct-vrow > [role="listitem"] { scroll-snap-align: start; min-width: 0; display: flex; position: relative; }

/* ── Card della vetrina ───────────────────────────────────────────────────────────────────────────── */
.ct-vcard { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.ct-vcard > .ct-deal { flex: 1; }
.ct-vkick { font: 500 12px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.ct-vkick.is-strong { color: var(--brand-text); }

/* «A pila»: due fogli dietro la card, ombra piena come il resto del tema */
.ct-vcard.is-stack > .ct-deal {
  box-shadow: var(--shadow-hard), 7px 7px 0 var(--surface), 9px 9px 0 var(--ink);
}
.ct-vcard__more {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; min-height: 44px;
  padding: 0 4px; margin-top: 4px; border: 0; background: none; color: var(--ink); cursor: pointer;
  font: 800 14px var(--font-sans); border-bottom: 2px solid var(--brand);
}
.ct-vcard__more:hover { color: var(--brand-text); }

/* Nelle file la card resta verticale anche sul telefono (nella griglia di /deals diventa orizzontale) */
@media (max-width: 639.98px) {
  /* scroll-padding: senza, lo snap allinea la prima card al bordo dello schermo e si mangia il margine di 16 px */
  .ct-vrow { grid-auto-columns: 168px; gap: 14px; margin: 0 -16px; padding: 2px 16px 14px; scroll-padding-inline: 16px; }
  .ct-vrow .ct-deal { display: flex; flex-direction: column; }
  .ct-vrow .ct-deal__media { min-height: 0; height: 120px; border-right: 0; border-bottom: 2px solid var(--ink); }
  .ct-vsec__head h2 { font-size: 22px; }
  .ct-vsec__open { padding: 0 14px; }
  .ct-vsec__open .ct-hide-phone { display: none; }
  .ct-vsec__open-short { display: inline; }
}

/* ── Pannello del gruppo: a destra sul computer, dal basso sul telefono ──────────────────────────── */
.ct-vpanel {
  position: fixed; z-index: 410; top: 0; right: 0; bottom: 0; width: min(440px, 100vw);
  display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow-y: auto;
  background: var(--surface); color: var(--ink); border-left: 2px solid var(--ink); box-shadow: -4px 0 0 var(--ink);
  overscroll-behavior: contain;
}
/* Pagina sotto ferma mentre il pannello è aperto (solo CSS) */
html:has(.ct-vpanel) { scrollbar-gutter: stable; }
html:has(.ct-vpanel), html:has(.ct-vpanel) body { overflow: hidden; }
.ct-vpanel__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ct-vpanel__head > div { display: flex; flex-direction: column; gap: 2px; }
.ct-vpanel__head b { font-size: 20px; font-weight: 900; }
.ct-vpanel__head span { font-size: 14px; color: var(--ink-muted); }
.ct-vpanel__loading { margin: 0; color: var(--ink-muted); }
.ct-vpanel__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ct-vpanel__row {
  position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; grid-template-areas: "media who price" "media who go";
  align-items: center; gap: 6px 10px;
  padding: 10px; border: 1.5px solid var(--ink); border-radius: var(--radius-lg, 10px); background: var(--surface);
}
/* Il tocco sulla riga apre il dettaglio: il pulsante trasparente la copre, come .ct-deal__hit; negozio e «Vai» stanno sopra */
.ct-vpanel__hit { position: absolute; inset: 0; z-index: 0; border: 0; padding: 0; background: transparent; border-radius: inherit; cursor: pointer; }
.ct-vpanel__media {
  grid-area: media; position: relative; width: 72px; height: 72px; overflow: hidden; background: var(--surface);
  border: 1.5px solid var(--ink); border-radius: var(--radius, 8px);
}
.ct-vpanel__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ct-vpanel__media .ct-stamp { position: absolute; left: 50%; top: 50%; bottom: auto; font-size: 10px; letter-spacing: 0; padding: 1px 4px; white-space: nowrap; transform: translate(-50%, -50%) rotate(-8deg); }
/* Foto e prezzo stanno sopra il velo di tocco (z 0): non devono intercettarlo, il tocco arriva al dettaglio */
.ct-vpanel__media, .ct-vpanel__price { pointer-events: none; }
.ct-vpanel__row.is-sold img { filter: grayscale(1); opacity: .55; }
.ct-vpanel__row.is-best { border-width: 2px; box-shadow: var(--shadow-hard-sm); }
.ct-vpanel__who { grid-area: who; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Il nome del negozio si taglia invece di passare sotto il prezzo: con «0,5 kg · €22,50/kg» la colonna del prezzo è più larga (21-11) */
.ct-vpanel__who > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-vpanel__store { position: relative; z-index: 1; color: inherit; text-decoration: none; width: fit-content; }
.ct-vpanel__store::after { content: ""; position: absolute; inset: -11px; }
.ct-vpanel__store:hover, .ct-vpanel__store:focus-visible { text-decoration: underline; }
.ct-vpanel__who span:not(.ct-vkick) { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* Prezzo della confezione e, sotto, il prezzo al kg o al litro (Danny 21-11) */
.ct-vpanel__price { grid-area: price; justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.ct-vpanel__unit { font-size: 11px; }
/* Quantità della confezione davanti al €/kg (Danny 21-11), con un punto in mezzo: «0,5 kg · €22,50/kg» */
.ct-vpanel__qty { color: var(--ink); font-weight: 700; }
.ct-vpanel__qty::after { content: " · "; color: var(--ink-muted); font-weight: 500; }
.ct-vpanel__go {
  grid-area: go; justify-self: end; position: relative; z-index: 1; min-height: 44px; padding: 0 4px; border: 0; background: none;
  color: var(--ink); cursor: pointer; font: 800 14px var(--font-sans); border-bottom: 2px solid var(--brand);
}
.ct-vpanel__go:hover { color: var(--brand-text); }
.ct-vpanel__go.is-busy { opacity: 0.6; cursor: progress; }
/* «Vedi sul negozio» sull'offerta finita: attivo ma secondario (Danny 22-11) */
.ct-vpanel__go--sold { color: var(--ink-muted); border-bottom-color: var(--rule); font-weight: 700; }
.ct-vpanel__go--sold:hover { color: var(--ink); }
.ct-vpanel__grab { display: none; }

@media (max-width: 639.98px) {
  .ct-vpanel {
    top: auto; left: 0; width: 100%; max-height: 85vh; max-height: 85dvh;
    border-left: 0; border-top: 2px solid var(--ink); border-radius: 18px 18px 0 0; box-shadow: 0 -4px 0 var(--ink);
    padding-bottom: calc(16px + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
  }
  /* Maniglia decorativa: il foglio si chiude con ✕, velo, Esc o Indietro, non trascinando */
  .ct-vpanel__grab { display: block; flex: none; width: 40px; height: 4px; margin: -6px auto 0; border-radius: 2px; background: var(--rule); }
}
@media (prefers-reduced-motion: no-preference) {
  .ct-vpanel { animation: ct-vpanel-in 180ms ease-out; }
  @keyframes ct-vpanel-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: no-preference) and (max-width: 639.98px) {
  .ct-vpanel { animation-name: ct-vpanel-up; }
  @keyframes ct-vpanel-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ── Home: ritmo verticale e messaggio della lente vuota ─────────────────────────────────────────── */
.ct-vhome { display: flex; flex-direction: column; gap: 34px; min-width: 0; }
.ct-vempty {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px;
  border: 2px dashed var(--rule); border-radius: var(--radius-lg, 10px); color: var(--ink-soft);
}
.ct-vempty p { margin: 0; flex: 1 1 240px; }


/* /deals con una riga di menu (Danny 18-10): «Reparto ▾ · Negozi ▾ · Mostrami ▾ · Altri filtri ▾» anche sul computer,
   le scelte attive sotto come pillole togliibili. Sul computer i fogli si aprono al centro, come «Tutti i negozi». */
.ct-vbar--compact .ct-vbar__row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.ct-vbar--compact .ct-vpick__chips { display: none; }
.ct-vbar--compact .ct-vpick__open { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
@media (min-width: 768px) {
  .ct-vbar--compact .ct-vsheet {
    left: 50%; right: auto; top: 50%; bottom: auto; transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 32px)); max-height: min(78vh, 720px);
    border-bottom: 2px solid var(--ink); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); padding-bottom: 16px;
  }
  .ct-vbar--compact .ct-vsheet .ct-fsheet__grab { display: none; }
  .ct-vbar--compact .ct-vsheet__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  /* Telefono: i tre pulsanti dividono la riga; la loro scelta si legge nelle pillole */
  .ct-vbar--compact .ct-vbar__row { flex-wrap: nowrap; }
  .ct-vbar--compact .ct-vbar__row > .ct-vpick { flex: 1 1 0; }
  .ct-vbar--compact .ct-vpick--lens .ct-vpick__open, .ct-vbar--compact .ct-vpick--stores .ct-vpick__open { max-width: none; }
  /* «Negozi · 2» deve starci intero: via la freccia, margini stretti */
  .ct-vbar--compact .ct-vpick__open { justify-content: center; padding-left: 8px; padding-right: 8px; }
  .ct-vbar--compact .ct-vpick__open > .bi-chevron-down { display: none; }
}

/* Scontrino in una riga sotto il titolo (D10) */
.ct-receipt-line { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; font: 500 13px var(--font-mono); color: var(--ink-muted); }
.ct-receipt-line b { font-family: var(--font-sans); font-weight: 900; color: var(--ink); }
.ct-receipt-line b.is-danger { color: var(--danger); }
.ct-receipt-line b.is-save { color: var(--save); }

/* Riquadri dei mondi in fondo alla Home */
.ct-vworlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; }
.ct-vworld { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 14px; color: var(--ink); text-decoration: none; }
.ct-vworld i { font-size: 22px; color: var(--brand-text); }
.ct-vworld small { margin-left: auto; font: 500 12px var(--font-mono); color: var(--ink-muted); }

@media (prefers-reduced-motion: no-preference) {
  .ct-vrow { scroll-behavior: smooth; }
}

/* ── Segno del negozio (StoreBadge): logo o iniziali su un colore stabile per negozio ────────────── */
.ct-storebadge { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ct-storebadge__mark {
  position: relative; flex: none; display: grid; place-items: center; overflow: hidden;
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--ink);
  font: 700 9px var(--font-mono); color: var(--surface);
}
/* Il logo copre le iniziali; se non carica si toglie da solo e restano le iniziali */
.ct-storebadge__mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.ct-storebadge__name { font: 700 12px var(--font-sans); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Sulla card prende il posto del nome in maiuscoletto grigio */
.ct-deal__body > .ct-storebadge.ct-deal__store { font: inherit; letter-spacing: 0; text-transform: none; }
.ct-storemark--0 { background: var(--brand-text); }
.ct-storemark--1 { background: var(--save); }
.ct-storemark--2 { background: var(--ink); }
.ct-storemark--3 { background: var(--danger); }
.ct-storemark--4 { background: var(--ink-soft); }
.ct-storemark--5 { background: var(--accent-travel); }
.ct-storemark--6 { background: var(--accent-realestate); }
.ct-storemark--7 { background: var(--ink-muted); }
/* Nella vetrina degli errori il segno prende il posto del nome in maiuscoletto grigio */
.ct-storebadge.ct-err-card__store { font: inherit; letter-spacing: 0; text-transform: none; }

/* Ricerca della testata dentro la selezione di /deals (Danny 18-10) */
.ct-search__scope { display: inline-flex; align-items: center; gap: 2px; flex: none; max-width: 40%; padding: 2px 4px 2px 10px; border-radius: 999px; background: var(--ink); color: var(--tag); font: 500 12px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Con più negozi l'etichetta è lunga: la casella non cresce col testo (sul telefono allargava la pagina a 790 px) e il
   testo finisce coi puntini prima della ✕, che resta sempre visibile */
.ct-search { min-width: 0; }
.ct-search__scope-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ct-search__scope-x { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
@media (max-width: 639.98px) { .ct-search__scope { max-width: 45%; font-size: 11px; } }

/* Prezzo delle card coi centesimi più piccoli (Danny 18-10: sempre coi centesimi) */
.ct-amount { white-space: nowrap; }
.ct-amount__cents { font-size: 0.62em; font-weight: inherit; vertical-align: 0.42em; margin-left: 1px; }
.ct-price-tag__was .ct-amount__cents { vertical-align: baseline; font-size: 0.85em; }

/* Blocco delle offerte non vantaggiose in /deals (Danny 18-10) */
.ct-vsaving { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 18px 0; padding: 18px; border: 2px dashed var(--ink); border-radius: var(--radius-lg, 10px); background: var(--surface-sunk); }
.ct-vsaving__icon { font-size: 22px; color: var(--ink-muted); }
.ct-vsaving__text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.ct-vsaving__text span { font: 500 13px var(--font-mono); color: var(--ink-muted); }
.ct-vsaving__end { margin: 18px 0; text-align: center; font-size: 14px; color: var(--ink-muted); }
.ct-deal__pack { align-self: flex-start; }
/* Consegna stimata (20-10): neutra, in ambra oltre due settimane */
/* Sulle card strette (168 px) «Consegna stimata dal 28 ott» andava a capo dentro l'etichetta, non fuori dalla card */
.ct-deal__delivery { align-self: flex-start; max-width: 100%; white-space: normal; line-height: 1.35; }
.ct-deal__delivery > .bi { flex: none; }
.ct-deal__delivery.is-late { background: var(--warning-light); color: var(--warning-dark, var(--warning)); border-color: var(--warning); }
.dd-delivery.is-late { color: var(--warning-dark, var(--warning)); font-weight: 600; }
/* Nel tema scuro --warning-dark resta il bruno del chiaro: illeggibile sul fondo scuro */
html[data-theme="dark"] .ct-deal__delivery.is-late, html[data-theme="dark"] .dd-delivery.is-late { color: var(--warning); }

/* File trascinabili col mouse (drag-scroll.js): mano aperta, chiusa mentre si trascina, niente selezione */
@media (hover: hover) and (pointer: fine) {
  .ct-vrow, .ct-vsec__subs, .ct-popular__row { cursor: grab; }
  .ct-vrow.is-dragging, .ct-vsec__subs.is-dragging, .ct-popular__row.is-dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; scroll-behavior: auto; }
  .ct-vrow.is-dragging img { pointer-events: none; }
}

/* ── Home: messaggi (Danny 21-10) ─────────────────── */
.ct-vsec { scroll-margin-top: calc(var(--ct-header-h, 56px) + var(--ct-live-h, 24px) + 72px); }
.ct-vsec.is-new { outline: 3px solid var(--brand); outline-offset: 4px; border-radius: 12px; transition: outline-color 1.2s; }
.ct-vtoast-host { position: absolute; width: 0; height: 0; }
.ct-vtoast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 600;
  bottom: calc(16px + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)));
  display: flex; align-items: center; gap: 14px; max-width: min(520px, calc(100vw - 24px));
  padding: 10px 14px; border-radius: 12px; background: var(--ink); color: var(--surface); font-size: 14px; box-shadow: var(--shadow-hard);
}
.ct-vtoast button { border: 0; background: none; color: var(--tag); font: 700 14px var(--font-sans); text-decoration: underline; cursor: pointer; flex: none; }
@media (max-width: 767.98px) {
  /* Sopra la barra in basso del telefono */
  .ct-vtoast { bottom: calc(72px + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px))); }
}
/* Fine della fila di card: la sentinella che chiede altre offerte. Sta dentro l'ultima card, 1 px sul suo bordo destro,
   fuori dalla griglia: come colonna sua prendeva il posto di una card (buco vuoto accanto a «Tutti i N») e a 360 px,
   a fila finita, restava fuori dallo schermo e le altre offerte non arrivavano più (Danny 15-11) */
.ct-vrow__more { position: absolute; top: 0; right: 0; width: 1px; height: 100%; pointer-events: none; }
/* «Tutti i N» in fondo alla fila (Home «F», spec 2026-10-28 §6.2): una card che porta al reparto in /deals */
.ct-vrow__all {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 180px; padding: 16px; text-align: center; text-decoration: none; color: var(--ink);
  border-style: dashed; font: 800 16px var(--font-sans);
}
.ct-vrow__all .bi { font-size: 22px; }
.ct-vrow__all:hover { color: var(--brand-text); }
.ct-vrow__all:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   Storie per reparto (spec Docs/superpowers/specs/2026-10-28-home-f-storie-scaffale-regole-design.md §8, «Home F»).
   Cerchi coi nomi in cima alla Home, sullo sfondo della pagina (76 px, 66 px sul telefono; Danny 22-11: niente più
   fascia scura), bollino del risparmio, puntina dei reparti scelti; visore a scheda centrata su PC e tablet, a tutto schermo sotto 641 px.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

/* ── Cerchi ───────────────────────────────────────────────────────────────────────────────────────── */
.ct-stories { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--ink); }
/* Le storie e il titolo sono un blocco solo: 16 px invece del ritmo di 34 della Home del sito */
.rd-web > .ct-stories { margin-bottom: -18px; }
.ct-stories__rules { margin: 0; font: 500 12px/1.3 var(--font-mono); color: var(--ink-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-stories__empty { margin: 0; font-size: 14px; color: var(--ink-soft); }

.ct-story-mode { display: inline-flex; align-self: flex-start; padding: 3px; gap: 2px; border-radius: 999px; border: 1.5px solid currentColor; }
.ct-story-mode__btn {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: inherit; font-weight: 700; font-size: 14px; cursor: pointer;
}
.ct-story-mode__btn.is-on { background: var(--ink); color: var(--paper); }
.ct-story-mode__btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.ct-story-ring {
  list-style: none; margin: 0; padding: 2px 6px 6px; display: flex; gap: 14px;
  overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: 6px; scrollbar-width: none;
}
.ct-story-ring::-webkit-scrollbar { display: none; }
.ct-story-ring > li { flex: none; scroll-snap-align: start; padding-top: 6px; }

.ct-story {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 84px;
  padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer;
}
.ct-story:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 12px; }
.ct-story__disc {
  position: relative; width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--brand);
}
/* Già sfogliato: anello sottile e grigio, disegno spento; il bollino della percentuale resta pieno e leggibile */
.ct-story.is-seen .ct-story__disc { box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--ink-muted); }
.ct-story.is-seen .ct-story__disc > .ct-dicon, .ct-story.is-seen .ct-story__initial { opacity: 0.55; }
.ct-story.is-seen .ct-story__name { color: var(--ink-muted); font-weight: 500; }
.ct-story__initial { font-size: 28px; font-weight: 900; }
.ct-story__badge {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  padding: 1px 7px; border-radius: 999px; border: 1.5px solid var(--ink);
  background: var(--save); color: var(--on-save); font: 700 12px var(--font-mono); white-space: nowrap;
}
.ct-story__pin {
  position: absolute; top: -2px; right: -2px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--ink);
  background: var(--tag); color: var(--tag-ink); font-size: 12px;
}
.ct-story__name {
  max-width: 84px; margin-top: 4px; font-size: 12px; line-height: 1.3; font-weight: 700; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Posto riservato mentre arrivano: overflow nascosto, così una fila senza comandi non prende il fuoco da tastiera */
.ct-stories.is-loading .ct-story-ring { overflow: hidden; }
.ct-stories.is-loading .ct-story { cursor: default; }
.ct-stories.is-loading .ct-story__disc { background: var(--surface-sunk); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--rule); }
.ct-stories.is-loading .ct-story__name { width: 48px; border-radius: 4px; background: var(--surface-sunk); }

@media (max-width: 640.98px) {
  .ct-story { width: 72px; }
  .ct-story__disc { width: 66px; height: 66px; }
  .ct-story__initial { font-size: 24px; }
  .ct-story__name { max-width: 72px; }
}

/* ── Riga «Più cliccate / Più commentate» (Danny 22-11): card basse da scorrere di lato nel proprio contenitore ── */
.ct-popular { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* Titolo o linguette a sinistra, periodi a destra: una riga sola di 44 px, con o senza periodi */
.ct-popular__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.ct-popular__head--tabs { border-bottom: 2px solid var(--ink); }
.ct-popular__title { margin: 0; min-width: 0; font-weight: 900; font-size: 22px; letter-spacing: -0.03em; line-height: 44px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-popular__tabs { display: flex; gap: 2px; min-width: 0; }
.ct-popular__tab {
  flex: none; min-height: 44px; padding: 8px 16px; margin-bottom: -2px;
  border: 2px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0;
  background: none; color: var(--ink-muted); font: 500 14px var(--font-mono); white-space: nowrap; cursor: pointer;
}
.ct-popular__tab:hover { color: var(--ink); }
.ct-popular__tab.is-on { border-color: var(--ink); background: var(--surface); color: var(--ink); font-weight: 700; }
.ct-popular__tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }
.ct-popular__short { display: none; }
/* Periodi di «Più cliccate»: parole piccole, ognuna con un bersaglio di almeno 44 × 44. Il radio copre tutta l'area */
.ct-popular__periods { flex: none; display: flex; }
.ct-popular__head--tabs .ct-popular__periods { margin-bottom: -2px; }
.ct-popular__period {
  position: relative; display: grid; place-items: center; min-width: 44px; height: 44px; margin: 0; padding: 0 7px;
  color: var(--ink-muted); font: 500 13px/1 var(--font-sans); white-space: nowrap; cursor: pointer;
}
.ct-popular__period + .ct-popular__period::before { content: "·"; content: "·" / ""; position: absolute; left: -4px; color: var(--ink-muted); }
.ct-popular__period:last-child::before { left: 0; }
.ct-popular__period input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ct-popular__period span { padding: 3px 0; border-bottom: 2px solid transparent; }
.ct-popular__period:hover span { color: var(--ink); }
.ct-popular__period input:checked + span { color: var(--ink); border-bottom-color: var(--ink); }
.ct-popular__period input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
/* Il margine interno lascia posto a ombra e contorno del fuoco, che overflow taglierebbe */
.ct-popular__row {
  list-style: none; margin: 0; padding: 5px 6px 8px 4px; display: flex; gap: 12px; min-width: 0;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 4px;
}
.ct-popular__row > li { flex: none; scroll-snap-align: start; }
.ct-popular__card {
  display: grid; grid-template-columns: 84px minmax(0, auto); align-items: center; gap: 10px;
  height: 90px; min-width: 190px; padding: 0 12px 0 0; overflow: hidden; text-align: left;
  border: 2px solid var(--ink); border-radius: 10px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-hard-sm); cursor: pointer;
}
.ct-popular__card:hover { background: var(--surface-sunk); }
.ct-popular__card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ct-popular__img { position: relative; display: grid; place-items: center; height: 100%; background: #fff; border-right: 2px solid var(--ink); }
.ct-popular__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.ct-popular__img > i { font-size: 26px; color: #6b6456; }
/* Il segnaposto si vede solo senza foto o con la foto rotta (onerror mette hidden) */
.ct-popular__img > img:not([hidden]) ~ i { display: none; }
.ct-popular__img > img[hidden] { display: none; }
.ct-popular__price { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.ct-popular__now { font-weight: 900; font-size: 20px; letter-spacing: -0.03em; white-space: nowrap; }
@media (max-width: 767px) {
  .ct-popular__tab { padding: 8px 12px; }
  .ct-popular__card { grid-template-columns: 78px minmax(0, auto); min-width: 176px; }
}
/* Linguette e periodi insieme: sotto questa larghezza le linguette usano il testo corto, non vanno a capo */
@media (max-width: 559px) {
  .ct-popular__head { gap: 4px; }
  .ct-popular__head.has-periods .ct-popular__long { display: none; }
  .ct-popular__head.has-periods .ct-popular__short { display: inline; }
  .ct-popular__head.has-periods .ct-popular__tab { padding: 8px 8px; font-size: 13px; }
  .ct-popular__period { padding: 0 5px; font-size: 12px; }
}
@media (max-width: 379px) {
  .ct-popular__head.has-periods .ct-popular__title { font-size: 19px; }
  .ct-popular__head.has-periods .ct-popular__tab { padding: 8px 4px; font-size: 12px; }
  .ct-popular__period { padding: 0 3px; font-size: 11px; }
}
@media (max-width: 339px) {
  .ct-popular__head.has-periods .ct-popular__title { font-size: 16px; }
  .ct-popular__head.has-periods .ct-popular__tab { padding: 8px 2px; font-size: 11px; }
}

/* ── Visore ───────────────────────────────────────────────────────────────────────────────────────── */
/* Visore aperto (stories.js lockScroll): la pagina sotto non scorre e non mostra la sua barra */
html.edp-story-open, html.edp-story-open body { overflow: hidden; }
.ct-story-veil { position: fixed; inset: 0; z-index: 420; background: rgba(27, 24, 19, 0.82); }
.ct-story-viewer {
  position: fixed; z-index: 430; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px;
  pointer-events: none;
}
.ct-story-viewer > * { pointer-events: auto; }
.ct-story-viewer > div[tabindex] { width: 0; height: 0; overflow: hidden; }
.ct-story-viewer__dept {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--ink);
  background: var(--surface); color: var(--ink); font-size: 20px; cursor: pointer;
}
.ct-story-viewer__dept:disabled { opacity: 0.35; cursor: default; }

.ct-story-card {
  position: relative; width: min(400px, 100%); height: min(720px, calc(100vh - 32px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 2px solid var(--ink); border-radius: var(--radius-xl, 14px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-hard);
}
/* Scelta C: un blocco per reparto, largo quanto le sue storie, col nome sopra; l'attivo non si tronca (al più metà della barra intera: 50cqi, misurato sul contenitore e non sul blocco) */
.ct-story-card__bars { display: flex; gap: 6px; padding: 10px 12px 0; container-type: inline-size; }
.ct-story-seg { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ct-story-seg.is-on { min-width: fit-content; }
.ct-story-seg__name { font: 600 10px var(--font-sans); color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-story-seg.is-on .ct-story-seg__name { color: var(--brand); font-weight: 800; max-width: 50cqi; }
.ct-story-seg__bars { display: flex; gap: 2px; }
.ct-story-card__bars i { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ct-story-card__bars i::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--ink); }
.ct-story-card__bars i.is-done::after { width: 100%; }
.ct-story-card__bars i.is-active::after { animation: ct-story-fill 4.5s linear forwards; }
.ct-story-card__bars.is-still i.is-active::after { animation: none; width: 100%; }
/* Mentre il cartello è su la barra attiva resta vuota: il conto parte quando sparisce */
.ct-story-card__bars.is-intro i.is-active::after { animation: none; width: 0; }
@keyframes ct-story-fill { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .ct-story-card__bars i.is-active::after { animation: none; width: 100%; }
}

.ct-story-card__top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
.ct-story-card__chip {
  flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 2px 10px;
  font-size: 14px; font-weight: 800;
}
.ct-story-card__chip .ct-dicon { flex: none; width: 16px; height: 16px; }
.ct-story-card__chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-story-card__top .ct-story-card__chip + * { margin-left: auto; }
.ct-story-card__count { font: 500 12px var(--font-mono); color: var(--ink-muted); }
.ct-story-card__loading { margin: auto; color: var(--ink-muted); }

/* Palco sotto la testata: il cartello del reparto nuovo lo copre tutto, barre, ✕ e pausa restano scoperti */
.ct-story-card__stage { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
/* Cartello di ~1 s a un cambio di reparto: nome grande su marchio, un tocco lo toglie. Nessuna animazione d'uscita */
.ct-story-intro {
  position: absolute; inset: 0; z-index: 2; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: var(--on-brand); text-align: center; padding: 16px;
  animation: ct-story-intro-in 160ms ease-out;
}
.ct-story-intro .ct-dicon { width: 48px; height: 48px; --ct-dicon-cut: var(--brand); }
.ct-story-intro__text { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ct-story-intro__name { font-size: 24px; font-weight: 900; line-height: 1.1; }
.ct-story-intro__count { font-size: 14px; font-weight: 600; }
@keyframes ct-story-intro-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .ct-story-intro { animation: none; }
}

/* Foto e corpo dell'offerta: entrano da destra (avanti) o da sinistra (indietro); il cartello sta nel palco, fuori */
.ct-story-card__slide { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ct-story-card__slide.is-from-right { animation: ct-story-in-right 220ms ease-out; }
.ct-story-card__slide.is-from-left { animation: ct-story-in-left 220ms ease-out; }
@keyframes ct-story-in-right { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ct-story-in-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .ct-story-card__slide { animation: none; }
}

.ct-story-card__media { position: relative; flex: 1; min-height: 0; background: var(--surface-sunk, var(--surface-1)); }
.ct-story-card__media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ct-story-card__stamp {
  position: absolute; top: 12px; left: 12px; transform: rotate(-4deg); pointer-events: none;
  padding: 4px 10px; border: 2px solid var(--danger); border-radius: 6px;
  background: var(--surface); color: var(--danger); font: 700 13px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em;
}
.ct-story-card__tap { position: absolute; top: 0; bottom: 0; border: 0; padding: 0; background: transparent; cursor: pointer; }
.ct-story-card__tap.is-prev { left: 0; width: 30%; }
.ct-story-card__tap.is-detail { left: 30%; width: 40%; }
.ct-story-card__tap.is-next { right: 0; width: 30%; }
.ct-story-card__tap:focus-visible { outline: 2px solid var(--brand); outline-offset: -4px; }

.ct-story-card__body { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-top: 1.5px solid var(--ink); }
.ct-story-card__title {
  margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.ct-story-card__price { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-story-card__usual { margin: 0; font-size: 13px; color: var(--ink-soft); }
.ct-story-card__actions { display: flex; align-items: center; gap: 10px; }
.ct-story-card__fav { display: contents; }
.ct-story-card__go {
  flex: 1; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px solid var(--ink); border-radius: var(--radius-lg, 10px);
  background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 15px; cursor: pointer;
}
.ct-story-card__go.is-busy { opacity: 0.6; cursor: progress; }
.ct-story-card__add { align-self: flex-start; min-height: 44px; }

@media (max-width: 640.98px) {
  .ct-story-viewer { padding: 0; gap: 0; }
  .ct-story-viewer__dept { display: none; }
  .ct-story-card { width: 100%; height: 100%; border: 0; border-radius: 0; box-shadow: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   Scaffale dei reparti, regole e foglio «Lista» (spec 2026-10-28 §6.2-6.4, §7, §9, «Home F»).
   Chi ospita mette lo scaffale e le corsie dentro .ct-shelf-layout: oltre 1100 px di AREA lo scaffale è una colonna
   di 236 px ferma a sinistra con le regole per intero; sotto è una fila ferma in alto con «Regola · N» in testa e ✎
   in fondo, e le regole stanno nel foglio. L'area si misura con la finestra (1200 px = 1100 di area + binario di
   78 px + margini) e non con una container query: container-type dà il contenimento di layout, che fa del
   contenitore il riferimento dei position: fixed e chiuderebbe dentro la colonna fogli, pannello negozi e messaggi.
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */

.ct-shelf-layout { min-width: 0; }
.ct-shelf-layout__grid { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ct-shelf-layout__main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* ── Fila stretta (predefinita) ───────────────────────────────────────────────────────────────────── */
.ct-shelf {
  position: sticky; top: calc(var(--ct-header-h, 64px) + var(--ct-live-h, 36px)); z-index: 30;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  margin: 0 -16px; padding: 8px 16px; background: var(--paper); border-bottom: 1.5px dashed var(--rule);
}
/* Come .ct-vbar: col foglio o col pannello dei negozi aperti la fila deve salire sopra testata e barra */
.ct-shelf:has(.ct-fsheet) { z-index: 420; }
.ct-shelf:has(.ct-picker) { z-index: 520; }
.ct-shelf__head, .ct-shelf__hint, .ct-shelf__rules { display: none; }
.ct-shelf.is-editing .ct-shelf__head { display: flex; }
.ct-shelf__head { align-items: center; gap: 8px; }
.ct-shelf__title { flex: 1; font-size: 16px; font-weight: 900; }
.ct-shelf__tools { display: inline-flex; gap: 6px; }
.ct-shelf__tools .ct-chip { min-height: 44px; }
.ct-shelf__hint { margin: 0; font-size: 13px; color: var(--ink-muted); }

.ct-shelf__list {
  display: flex; gap: 8px; margin: 0 -16px; padding: 2px 16px; list-style: none;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.ct-shelf__list::-webkit-scrollbar { display: none; }
.ct-shelf__list > li { flex: none; position: relative; }
.ct-shelf__list .ct-chip { min-height: 44px; white-space: nowrap; }

.ct-shelf__tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 700 14px var(--font-sans); white-space: nowrap; cursor: pointer;
}
.ct-shelf__tag:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.ct-shelf__count { font: 500 12px var(--font-mono); color: var(--ink-muted); }
.ct-shelf__item.is-active .ct-shelf__tag { background: var(--tag); color: var(--tag-ink, var(--ink)); box-shadow: 0 2px 0 var(--ink); }
.ct-shelf__item.is-active .ct-shelf__count { color: inherit; }

/* Sulla fila stretta «Regola · N» sta in testa, prima dei cartellini */
.ct-shelf__rules-btn { order: -2; }
/* Reparto fissato in cima sul dispositivo (Danny 02-11): puntina accanto al nome; si fissa dalla testata della sezione */
.ct-shelf__pin { font-size: 12px; color: var(--ink); }

/* Modifica: i cartellini tremano, la ✕ rossa compare, la fila non scorre la pagina mentre si trascina */
.ct-shelf.is-editing .ct-shelf__item { touch-action: none; user-select: none; -webkit-user-select: none; }
.ct-shelf:not(.is-auto).is-editing .ct-shelf__tag { cursor: grab; }
.ct-shelf__item.is-dragging { z-index: 5; }
.ct-shelf__item.is-dragging .ct-shelf__tag { cursor: grabbing; box-shadow: var(--shadow-hard); }
.ct-shelf__remove {
  position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; display: grid; place-items: center;
  border: 2px solid var(--surface); border-radius: 50%; background: var(--danger); color: var(--surface);
  font-size: 11px; cursor: pointer;
}
/* Il bersaglio al tocco della ✕ resta ≥ 44 px anche se il segno è piccolo */
.ct-shelf__remove::after { content: ""; position: absolute; inset: -10px; }
.ct-shelf__remove:focus-visible { outline: 3px solid var(--brand); outline-offset: 1px; }
@media (prefers-reduced-motion: no-preference) {
  .ct-shelf.is-editing .ct-shelf__item:not(.is-dragging) { animation: ct-shelf-wobble 0.32s ease-in-out infinite alternate; }
  .ct-shelf.is-editing .ct-shelf__item:nth-child(2n) { animation-delay: -0.16s; }
}
@keyframes ct-shelf-wobble { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }

/* ── Colonna larga: oltre 1100 px di area (1200 di finestra) ────────────────────────────────────────────────────── */
@media (min-width: 1200px) {
  .ct-shelf-layout__grid { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
  .ct-shelf {
    top: calc(var(--ct-header-h, 64px) + var(--ct-live-h, 36px) + 12px); margin: 0; padding: 14px;
    max-height: calc(100vh - var(--ct-header-h, 64px) - var(--ct-live-h, 36px) - 24px); overflow-y: auto;
    border: 2px solid var(--ink); border-radius: var(--radius-lg, 10px); background: var(--surface); box-shadow: var(--shadow-hard);
  }
  .ct-shelf__head, .ct-shelf__hint { display: flex; }
  .ct-shelf__list { flex-direction: column; margin: 0; padding: 0; overflow: visible; }
  .ct-shelf__rules-btn { display: none; }
  .ct-shelf__tag { width: 100%; border-radius: 10px; }
  .ct-shelf__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: left; }
  .ct-shelf__manage .ct-chip { width: 100%; justify-content: center; }
  .ct-shelf__rules { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; padding-top: 12px; border-top: 1.5px dashed var(--rule); }
  .ct-shelf__rules-title { font-size: 16px; font-weight: 900; }
}

/* ── Regole ───────────────────────────────────────────────────────────────────────────────────────── */
.ct-rules { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ct-rules__group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ct-rules__label { font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.ct-rules__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-rules__chips .ct-chip { min-height: 44px; }
.ct-rules__reset { align-self: flex-start; min-height: 44px; }
/* Nella colonna e nel foglio i negozi aprono solo il pannello: le chip con i loghi non ci stanno */
.ct-shelf__rules .ct-rules__group--stores .ct-vpick__chips,
.ct-fsheet .ct-rules__group--stores .ct-vpick__chips { display: none; }
.ct-shelf__rules .ct-rules__group--stores .ct-vpick__open,
.ct-fsheet .ct-rules__group--stores .ct-vpick__open { display: inline-flex; width: 100%; min-height: 44px; justify-content: space-between; }
/* Tablet e PC: il foglio delle regole è un pannello a destra invece che dal basso */
@media (min-width: 641px) {
  .ct-fsheet.ct-vsheet:has(.ct-rules) {
    left: auto; top: 0; width: min(380px, 92vw); max-height: none; height: 100vh; height: 100dvh;
    border-bottom: 2px solid var(--ink); border-right: 0; border-radius: 18px 0 0 18px; box-shadow: -4px 0 0 var(--ink);
  }
  .ct-fsheet.ct-vsheet:has(.ct-rules) .ct-fsheet__grab { display: none; }
}

/* ── Interruttore (role=switch) ───────────────────────────────────────────────────────────────────── */
.ct-switch {
  position: relative; flex: none; width: 48px; height: 28px; padding: 0; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--surface-sunk);
}
.ct-switch > span {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); transition: transform 0.15s;
}
.ct-switch.is-on { background: var(--brand); }
.ct-switch.is-on > span { transform: translateX(20px); }
.ct-switch::after { content: ""; position: absolute; inset: -9px -2px; }
.ct-switch:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ct-switch > span { transition: none; } }

/* ── Foglio «Lista» ───────────────────────────────────────────────────────────────────────────────── */
.ct-dlist { display: flex; flex-direction: column; gap: 6px; }
.ct-dlist__label { margin-top: 8px; font: 500 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); }
.ct-dlist__empty { margin: 0; font-size: 13px; color: var(--ink-muted); }
.ct-dlist__list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ct-dlist__row {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px;
  border: 1.5px solid var(--rule); border-radius: 10px; background: var(--surface);
}
.ct-dlist__row--switch { border-style: dashed; }
.ct-dlist__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ct-dlist__text b { overflow-wrap: anywhere; }
.ct-dlist__text small { font-size: 12px; color: var(--ink-muted); }
.ct-dlist__handle {
  flex: none; width: 44px; min-height: 44px; display: grid; place-items: center;
  font-size: 20px; color: var(--ink-muted); cursor: grab; touch-action: none; user-select: none;
}
.ct-dlist__row.is-dragging { z-index: 5; position: relative; box-shadow: var(--shadow-hard); border-color: var(--ink); }
.ct-dlist__row.is-dragging .ct-dlist__handle { cursor: grabbing; }
/* «Sposta su/giù»: fuori vista finché la riga non ha il fuoco (lettori di schermo e tastiera li trovano sempre) */
.ct-dlist__move { display: inline-flex; gap: 4px; }
.ct-dlist__move-btn {
  min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  border: 1.5px solid var(--ink); border-radius: 8px; background: var(--surface); color: var(--ink); cursor: pointer;
}
.ct-dlist__move-btn:disabled { opacity: 0.4; cursor: default; }
.ct-dlist__move-txt,
.ct-dlist__row:not(:focus-within) .ct-dlist__move {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.ct-dlist__add { min-width: 44px; min-height: 44px; justify-content: center; }

/* Al tocco le frecce «Sposta su/giù» della Lista restano visibili (al dito la sola maniglia non basta) */
@media (any-pointer: coarse) {
  .ct-dlist__row:not(:focus-within) .ct-dlist__move {
    position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
  }
}

/* ── Icone dei reparti (DepartmentIcons, stile «Ritaglio», Danny 28-10) ───────────────────────────── */
.ct-dicon { width: 1em; height: 1em; flex: none; overflow: visible; }
.ct-dicon .o, .ct-dicon .b, .ct-dicon .d { stroke-linecap: round; stroke-linejoin: round; }
.ct-dicon .o { fill: none; stroke: currentColor; stroke-width: 1.9; }
.ct-dicon .b { fill: currentColor; stroke: currentColor; stroke-width: 2; }
.ct-dicon .d { fill: none; stroke: var(--ct-dicon-cut, var(--surface)); stroke-width: 1.8; }
.ct-story__disc .ct-dicon { width: 40px; height: 40px; }
.ct-shelf__tag .ct-dicon { width: 20px; height: 20px; }
.ct-shelf__item.is-active .ct-shelf__tag { --ct-dicon-cut: var(--tag); }
.ct-vworld .ct-dicon { width: 26px; height: 26px; color: var(--brand-text); }
@media (max-width: 767.98px) {
  .ct-story__disc .ct-dicon { width: 34px; height: 34px; }
}

/* Colonna larga col mouse: regole più compatte (i 44 px servono al dito) e una sfumatura in fondo che dice che
   sotto c'è altro (verifica 28-10: a 1280×900 con 4 reparti «Negozi» e «Ordina per» restavano sotto il bordo) */
@media (min-width: 1200px) and (pointer: fine) {
  .ct-shelf__rules .ct-rules { gap: 10px; }
  .ct-shelf__rules .ct-rules__chips { gap: 4px; }
  .ct-shelf__rules .ct-rules__chips .ct-chip, .ct-shelf__rules .ct-rules__reset { min-height: 32px; padding-block: 4px; }
  .ct-shelf__tools .ct-chip { min-height: 34px; }
  .ct-shelf__tag { min-height: 40px; }
}
@media (min-width: 1200px) {
  /* Ombra in fondo solo quando sotto c'è altro: lo strato «local» la copre arrivati in fondo */
  .ct-shelf {
    background:
      linear-gradient(transparent, var(--surface) 70%) 0 100% / 100% 36px no-repeat local,
      linear-gradient(transparent, var(--rule)) 0 100% / 100% 16px no-repeat scroll,
      var(--surface);
  }
}

/* ── Pagina /assistente (MCP remoto, spec §10) ─────────────────────────────── */
.asp-page { display: flex; flex-direction: column; gap: 20px; max-width: 760px; margin: 0 auto; padding: 8px 0 32px; }
.asp-head { display: flex; flex-direction: column; gap: 10px; }
.asp-kicker { color: var(--brand-text); }
.asp-title { margin: 0; font-weight: 900; font-size: clamp(26px, 4vw, 38px); line-height: 1.02; letter-spacing: -0.03em; color: var(--ink); }
.asp-lines { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.asp-h2 { margin: 0 0 10px; font-weight: 800; font-size: 17px; color: var(--ink); }
.asp-copy, .asp-join { padding: 16px; }
.asp-phrase {
  margin: 0 0 12px; padding: 12px 14px; border: 2px dashed var(--ink); border-radius: 10px; background: var(--surface-sunk);
  font-family: var(--font-mono); font-size: 14px; line-height: 1.45; color: var(--ink); overflow-wrap: anywhere; user-select: all;
}
.asp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.asp-hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-muted); }
.asp-example-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.asp-example {
  padding: 10px 14px; border: 2px solid var(--ink); border-radius: 10px; background: var(--surface);
  font-size: 14px; line-height: 1.4; color: var(--ink);
}
.asp-join p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
/* /assistente per chi non ha fatto l'accesso: presentazione, cosa sa fare, tre passi */
.asp-lead { margin: 0; color: var(--ink-soft); font-size: 16px; line-height: 1.5; }
.asp-guest-head .asp-actions { margin-top: 4px; }
.asp-can-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.asp-can { padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.asp-can__icon { font-size: 22px; color: var(--brand-text); }
.asp-can__title { margin: 0; font-weight: 800; font-size: 15px; color: var(--ink); }
.asp-can__text { margin: 0; font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.asp-steps { padding: 16px; }
.asp-step-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-soft); font-size: 15px; line-height: 1.45; }
.asp-join .asp-h2 { margin-bottom: 6px; }
/* Riquadro «serve un account gratuito»: stessi colori della pagina di accesso (Apple nero/bianco, Google a contorno,
   Telegram azzurro), nell'ordine Apple · Google · Telegram, almeno 44 px */
.asp-login { display: flex; flex-direction: column; gap: 10px; max-width: 400px; }
.asp-login__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; padding: 0 0.75rem;
  border: 1px solid var(--rule); border-radius: 4px; font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  background: var(--surface); color: var(--ink);
}
.asp-login__btn .bi { font-size: 1.125rem; }
.asp-login__btn:hover { border-color: var(--ink-muted); }
.asp-login__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asp-login__btn--apple { background: #000; border-color: #000; color: #fff; }
.asp-login__btn--apple .bi { font-size: 1.25rem; }
.asp-login__btn--apple:hover { border-color: #000; opacity: 0.88; }
:root[data-theme="dark"] .asp-login__btn--apple { background: #fff; border-color: #fff; color: #000; }
.asp-login__btn--google .bi { color: #4285f4; }
.asp-login__btn--telegram { background: #229ed9; border-color: #229ed9; color: #fff; }
.asp-login__btn--telegram:hover { border-color: #1c8bc0; background: #1c8bc0; }
/* Linguette Claude · ChatGPT · Gemini (chi ha fatto l'accesso) */
.asp-tabs-card { padding: 16px; }
/* Danny 16-11: le linguette dividono la larghezza in parti uguali, cosi' a 360 px stanno tutte nello schermo */
.asp-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; margin: 0 0 14px; border-bottom: 2px solid var(--ink); }
.asp-tab {
  min-width: 0; min-height: 44px; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: -2px; border: 2px solid transparent; border-bottom: 0;
  border-radius: 10px 10px 0 0; background: transparent; color: var(--ink-soft); font-weight: 700; font-size: 15px; cursor: pointer;
}
.asp-tab:hover { color: var(--ink); }
.asp-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asp-tab--active { border-color: var(--ink); background: var(--surface); color: var(--ink); }
.asp-tabpanel { display: flex; flex-direction: column; gap: 14px; }
.asp-tabpanel:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.asp-notice {
  margin: 0; padding: 10px 12px; border-left: 4px solid var(--brand); border-radius: 6px; background: var(--surface-sunk);
  font-size: 14px; line-height: 1.45; color: var(--ink-soft);
}
.asp-h3 { margin: 0 0 8px; font-weight: 800; font-size: 15px; color: var(--ink); }
.asp-connector .asp-hint { margin: 0 0 10px; }
.asp-quick { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.asp-quick li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.asp-quick li > span { flex: 1 1 260px; }
.asp-details > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--ink); }
.asp-details > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asp-details[open] { display: flex; flex-direction: column; gap: 12px; }
.asp-commands { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.asp-commands li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.asp-command-name { flex: 0 0 110px; font-weight: 700; color: var(--ink); }
.asp-command { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; padding: 8px 10px; border-radius: 6px; background: var(--surface-sunk); font-size: 13px; }
.asp-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--surface-sunk); color: var(--ink-soft); font-size: 12px; font-weight: 700; vertical-align: middle; }
.asp-token-alt { border-top: 1px solid var(--surface-sunk); padding-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.asp-token-alt > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--ink); }
.asp-token-alt > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asp-token-alt[open] { display: flex; flex-direction: column; gap: 10px; }
.asp-token-alt p { margin: 0; }
@media (max-width: 560px) { .asp-can-grid { grid-template-columns: 1fr; } }
/* Programmi per sviluppatori: chiusi di base (Danny 16-11, la pagina va letta dal telefono) */
.asp-dev { padding: 0 16px; }
.asp-dev > summary { min-height: 52px; display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none; }
.asp-dev > summary::-webkit-details-marker { display: none; }
.asp-dev > summary .asp-h2 { margin: 0; flex: 1 1 auto; font-size: 16px; }
.asp-dev > summary::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: 16px; color: var(--ink-soft); transition: transform 0.15s; }
.asp-dev[open] > summary::after { transform: rotate(180deg); }
.asp-dev > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.asp-dev[open] { padding-bottom: 16px; }
.asp-phrase { overflow-wrap: anywhere; }
/* A 360 px quattro linguette da 68 px: «ChatGPT» ci sta solo a 13,5 px (misura del 16-11) */
@media (max-width: 400px) { .asp-tab { font-size: 13.5px; letter-spacing: -0.01em; } .asp-command-name { flex-basis: 100%; } }
@media (max-width: 639.98px) {
  .asp-actions .ct-btn { width: 100%; min-height: 44px; }
}
