/* La spesa ideale · liste vere (si appoggia agli stili dei mockup) */

.tab.disabled { opacity: .45; cursor: default; }

.thumb.photo { object-fit: contain; background: var(--white); border: 1px solid var(--line); padding: 2px; flex-shrink: 0; }

/* Riga prodotto */
.item-row form { margin: 0; }
.item-row .qty { color: var(--muted); font-weight: 700; }

.empty-list { padding: 18px 16px; }
.empty-list p { margin: 0 0 10px; color: var(--muted); }
.empty-list p strong { color: var(--ink); font-size: 17px; }

/* Menu della lista: rinomina, nuova lista, elimina */
.list-menu .menu-form { border-bottom: 1px solid var(--line); }
.list-menu .menu-form summary { padding: 12px 16px; cursor: pointer; font-weight: 700; list-style: none; }
.list-menu .menu-form summary::-webkit-details-marker { display: none; }
.list-menu .menu-form form { display: flex; gap: 8px; padding: 0 16px 12px; }
.list-menu .menu-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
}
.list-menu .menu-danger {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  padding: 12px 16px;
  text-align: left;
  font: inherit;
  color: #b3261e;
  cursor: pointer;
}

.search[data-product-search] input::-webkit-search-cancel-button { cursor: pointer; }

/* Cuore dei prodotti preferiti */
.heart {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.heart.on { color: var(--carrot); }
.heart.on svg { fill: currentColor; }

/* Lista passata: quantità e + sulla stessa riga */
.item-row .qty + form, .item-row .qty + .in-list { margin-left: 8px; }

/* Liste condivise */
.shared-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 10px;
  color: var(--green-900);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.member-role select {
  margin-top: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--white);
}
.invite-link, .invite-form { padding: 16px; }
.invite-link .row-meta { margin: 4px 0 12px; }
.link-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--cream);
}
.invite-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.invite-form .question { margin-top: 0; }
.email-invite { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.email-invite summary { cursor: pointer; font-weight: 700; color: var(--green-900); list-style: none; }
.email-invite summary::-webkit-details-marker { display: none; }
.email-invite form { margin-top: 12px; }
.email-invite .choices { margin-bottom: 14px; }
.bottom-note { margin: 0 4px 10px; color: var(--muted); font-size: 14px; text-align: center; }

/* Persone delle liste condivise: foto oppure iniziali nel colore della persona */
.person {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--person-color, var(--green-900));
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.02em;
  object-fit: cover;
}
img.person { background: var(--sand); }
.person.xs { width: 22px; height: 22px; font-size: 9px; }
.person.sm { width: 28px; height: 28px; font-size: 11px; border: 2px solid var(--cream); }
.person.lg { width: 44px; height: 44px; }
.person.xl { width: 120px; height: 120px; font-size: 40px; }
.people { display: flex; }
.people .person + .person { margin-left: -6px; }
.person-tip {
  position: relative;
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: middle;
  cursor: pointer;
}
.person-tip.show::after {
  content: attr(data-person-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 5;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.avatar-preview { display: flex; justify-content: center; margin: 24px 0; }
.file-button { position: relative; overflow: hidden; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.profile-photo { display: inline-flex; }

/* Avviso in alto quando un'altra persona cambia la lista condivisa */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 6px 20px rgba(29, 36, 32, .2);
  transform: translate(-50%, -150%);
  transition: transform .25s ease;
}
.toast.show { transform: translate(-50%, 0); }

/* Scansione del codice a barre: il video riempie lo schermo, fuori dalla cornice si scurisce */
.scanner { position: relative; overflow: hidden; }
.scanner > :not(.scan-video) { position: relative; z-index: 1; }
.scan-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #141a17; }
.scanner .frame { width: min(300px, 82vw); height: 170px; border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(10, 14, 12, .55); }
.scanner h1 { text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.scan-status { text-align: center; color: #e4e8e5; margin: 0 24px; font-size: 15px; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.scan-status a { color: var(--lime); }
.scanner [data-torch][aria-pressed="true"] { background: var(--lime); color: var(--green-900); }
.scan-result .row { gap: 12px; }
.scan-result .row + .row { border-top: 1px solid #2d3833; margin-top: 12px; padding-top: 12px; }
.scan-result .row-title { color: var(--white); }
.scan-result .ok-dot.warn { background: #d08a12; }
.scan-result .scan-action { border: 0; background: none; color: var(--lime); font: inherit; font-weight: 700; white-space: nowrap; padding: 6px 0; text-decoration: none; cursor: pointer; }
.scan-result .scan-action:disabled { opacity: .5; }
.scan-result .ean { font-variant-numeric: tabular-nums; }

/* /price-check: fotocamera in alto, sotto i prezzi per insegna (pieno a destra, promo accanto) */
.pc-camera { position: relative; height: 190px; border-radius: var(--radius); overflow: hidden; background: #141a17; }
.pc-camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-frame { position: absolute; inset: 40px 12%; border: 3px solid var(--white); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(10, 14, 12, .4); }
.pc-frame::after { content: ""; position: absolute; inset-inline: -8px; top: 50%; border-top: 3px solid var(--lime); }
.pc-camera [data-torch] { position: absolute; top: 10px; right: 10px; background: rgba(255, 255, 255, .2); color: var(--white); }
.pc-camera [data-torch][aria-pressed="true"] { background: var(--lime); color: var(--green-900); }
.pc-status { min-height: 1.4em; margin: 8px 4px; color: var(--muted); font-size: 14px; }
.pc-hint { color: var(--muted); margin: 4px; }
.pc-product { margin: 4px 4px 12px; }
.pc-product .row-title { font-family: var(--font-title); font-size: 19px; }
.pc-empty { display: grid; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); }
.pc-prices .row { align-items: center; }
.pc-promo-label { color: #b3261e; font-size: 13px; font-weight: 700; margin-top: 2px; }
.pc-amounts { display: flex; align-items: baseline; gap: 10px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-full { font-family: var(--font-title); font-size: 20px; font-weight: 700; min-width: 4.6em; text-align: right; }
.pc-full.best { color: var(--green-700); }
.pc-promo { padding: 3px 8px; border-radius: 999px; background: #fde8e6; color: #b3261e; font-weight: 800; font-size: 15px; }

/* Altri formati: etichetta dell'eccezione nella riga, riquadro nel pannello della voce, scelte (anche nel profilo) */
.format-tag { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: #fbeadc; color: #b25d1d; font-size: 12px; font-weight: 700; }
.formats-box { margin-top: 22px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.formats-box summary { list-style: none; cursor: pointer; display: grid; gap: 4px; }
.formats-box summary::-webkit-details-marker { display: none; }
.formats-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.formats-head .format-link { color: var(--green-700); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
.formats-box[open] .formats-head .format-link { display: none; }
.formats-now { color: var(--muted); font-size: 14px; }
.formats-now strong { color: var(--ink); }
.formats-box .format-options { margin-top: 12px; }
.format-options { display: grid; gap: 8px; }
.format-option { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.format-option:has(.format-main input:checked) { border-color: var(--green-700); }
.format-main { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px; cursor: pointer; }
.format-main input { position: absolute; opacity: 0; pointer-events: none; }
.format-dot { width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--muted); }
.format-main input:checked + .format-dot { border-color: var(--green-700); background: radial-gradient(circle, var(--green-700) 45%, transparent 50%); }
.format-main input:focus-visible + .format-dot { outline: 3px solid var(--lime); outline-offset: 2px; }
.format-text strong { display: block; }
.format-text small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.format-range { display: none; padding: 0 12px 12px 44px; gap: 10px; }
.format-option:has(.format-main input:checked) .format-range { display: grid; }
.format-range-row { display: grid; gap: 6px; }
.format-range-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.format-range .choices { gap: 6px; }
.format-range .choice span { min-height: 36px; padding: 0 12px; font-size: 14px; }
.format-example { margin: 4px 4px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--green-100); font-size: 14px; }
.format-example p { margin: 0; }
.format-example p + p { margin-top: 4px; }

/* Piano della spesa */
.plan-store { padding-bottom: 6px; }
.plan-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.plan-line .qty, .check-head .qty { color: var(--muted); font-weight: 600; font-size: 14px; margin-left: 4px; }
.plan-body { flex: 1; min-width: 0; }
.plan-price { font-weight: 700; white-space: nowrap; }
.plan-tag { display: inline-block; margin: 4px 6px 0 0; padding: 2px 9px; border-radius: 999px; background: #fbeadc; color: #b25d1d; font-size: 12px; font-weight: 700; }
.plan-tag.muted { background: #eeebe4; color: var(--muted); }
.plan-tag.warn { background: #fde7e4; color: #b3261e; }
.plan-hint { margin: 6px 0 0; color: var(--green-700); font-size: 13px; font-weight: 600; }
.plan-note { margin: 0 16px 8px; color: var(--muted); font-size: 13px; }
.plan-points { list-style: none; margin: 0 16px 8px; padding: 0; color: var(--muted); font-size: 14px; }
.plan-points li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
a.plan-alert { text-decoration: none; margin: 0 0 12px; background: #fde7e4; color: #8c1d18; }
.plan-alternatives { padding: 12px 0 8px; }
.plan-alternatives h3 { font-family: var(--font-body); font-size: 16px; margin: 0 16px 6px; }
.plan-alternatives small { display: block; color: var(--muted); font-size: 12px; }
.plan-alternatives .price-line > span:first-child { flex: 1; min-width: 0; }
.plan-alternatives .price-line > span:nth-child(2) { flex-shrink: 0; min-width: 76px; text-align: right; white-space: nowrap; }
.plan-check { padding: 0 0 4px; }
.check-head { padding: 14px 16px 10px; }
.check-head .row-meta strong { color: var(--ink); }
.plan-option { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); }
.plan-delta { font-weight: 700; white-space: nowrap; }
.plan-format { padding: 10px 16px; border-top: 1px solid var(--line); background: #fdf6ee; }
.plan-format p { margin: 0 0 4px; font-size: 14px; }
.plan-format .link, .plan-change summary { background: none; border: 0; padding: 0; color: var(--green-700); font: inherit; font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.plan-change { border-top: 1px solid var(--line); }
.plan-change summary { display: block; padding: 10px 16px; }
.plan-change .note { margin: 6px 16px 10px; }
.toggle-row { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; }
.toggle-row .row-body { flex: 1; }
.toggle-row .row-meta { display: block; }
form:has([data-min-saving-toggle]:not(:checked)) [data-min-saving-amounts] { opacity: .45; }

/* Lista pronta */
.ready-items { list-style: none; margin: 0; padding: 0; }
.ready-item .row-title small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.ready-item .check-row input:checked ~ .row-title small { text-decoration: none; }
.ready-move { padding: 0 16px 10px 54px; }
.ready-move label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.ready-move select { font: inherit; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); }
.ready-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary .right strong { white-space: nowrap; }

/* Azioni sulla voce in lista: tocco sulla riga, pannello dal basso sul telefono, menu ⋯ su desktop */
[data-item-row] { position: relative; cursor: pointer; }
.card:has(> [data-item-row]) { overflow: visible; }
.card > .item-row:first-child { border-top-left-radius: inherit; border-top-right-radius: inherit; }
.card > .item-row:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.row-fav { display: inline-flex; vertical-align: -1px; margin-left: 4px; color: var(--carrot); }
.row-fav svg { fill: currentColor; }
.item-row.excluded .thumb.generic { opacity: .5; }
.item-row.excluded > .row-body > .row-title { color: var(--muted); }
.excluded-tag { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; border: 1px dashed #b5b0a5; color: var(--muted); font-size: 12px; font-weight: 700; }

.item-menu { position: relative; flex-shrink: 0; }
.item-more { list-style: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.item-more::-webkit-details-marker { display: none; }
.item-more:hover, .item-menu[open] .item-more { background: var(--green-100); color: var(--green-900); }
.item-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 20;
  width: 290px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(29, 36, 32, .16);
  cursor: default;
}
.item-menu-panel form { margin: 0; }
.item-menu-head { display: none; }
.item-act {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.item-act:hover { background: var(--cream); }
.item-act-icon { width: 26px; display: grid; place-items: center; flex-shrink: 0; color: var(--green-900); }
.item-act.on .item-act-icon { color: var(--carrot); }
.item-act.on .item-act-icon svg { fill: currentColor; }
.item-act-text { flex: 1; min-width: 0; display: grid; }
.item-act-text strong { font-size: 15px; }
.item-act-text small { color: var(--muted); font-size: 13px; }
.item-act.danger, .item-act.danger .item-act-icon { color: #b3261e; }
.item-act-chevron { color: var(--muted); display: grid; }
.item-act-switch { position: relative; flex-shrink: 0; width: 40px; height: 24px; border-radius: 999px; background: #d8d4cb; }
.item-act-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.item-act-switch.on { background: var(--green-900); }
.item-act-switch.on::after { transform: translateX(16px); }

/* Desktop: il ⋯ compare passando sopra la riga */
@media (hover: hover) {
  .item-more { opacity: 0; transition: opacity .12s; }
  .item-row:hover .item-more, .item-more:focus-visible, .item-menu[open] .item-more { opacity: 1; }
}

/* Telefono: pannello dal basso, la parte alta mostra la voce e sotto le azioni */
@media (hover: none) {
  .has-js .item-more { display: none; }
  .item-menu-panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    width: auto;
    max-width: 440px;
    margin: 0 auto;
    padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 24px 24px 0 0;
    animation: item-sheet-in .2s ease;
  }
  .item-menu-panel::before { content: ""; display: block; width: 40px; height: 5px; margin: 2px auto 6px; border-radius: 3px; background: #cfc9bd; }
  .item-menu-head { display: flex; align-items: center; gap: 14px; padding: 8px 4px 16px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  .item-menu-head .thumb { width: 64px; height: 64px; font-size: 18px; }
  .item-menu-head .row-title { font-family: var(--font-title); font-size: 18px; }
  .item-menu-qty { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; background: var(--green-100); color: var(--green-900); font-size: 12px; font-weight: 700; }
  .item-menu-panel > form + form, .item-menu-panel > form + a, .item-menu-panel > a + form { border-top: 1px solid var(--line); }
  .item-act { padding: 13px 4px; }
  .item-act:hover { background: none; }
  .has-js [data-item-row] { touch-action: pan-y; }
}
@keyframes item-sheet-in { from { transform: translateY(100%); } }
.item-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(29, 36, 32, .35); }

/* Swipe a sinistra sul telefono: sotto la riga compare Elimina */
.item-row.swiping { overflow: hidden; background: #b3261e; }
.item-row.swiping::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--white); transform: translateX(var(--dx, 0)); transition: transform .2s ease; }
.item-row.swiping::after { content: "Elimina"; position: absolute; top: 0; right: 0; bottom: 0; width: 88px; display: grid; place-items: center; color: var(--white); font-weight: 700; }
.item-row.swiping > * { position: relative; z-index: 2; transform: translateX(var(--dx, 0)); transition: transform .2s ease; }
.item-row.dragging::before, .item-row.dragging > * { transition: none; }

/* "Tolto · Annulla" dopo l'eliminazione */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: calc(100% - 32px);
  max-width: 408px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(29, 36, 32, .2);
  transform: translateX(-50%);
}
.undo-toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.undo-toast button { border: 0; background: none; color: var(--lime); font: inherit; font-weight: 700; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .item-menu-panel { animation: none; } .item-row.swiping::before, .item-row.swiping > * { transition: none; } }
.item-row[hidden], .item-backdrop[hidden], .undo-toast[hidden] { display: none; }

/* Confronto del piano con un solo supermercato */
.summary-link { display: inline-block; margin-top: 6px; color: inherit; font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
.compare-target { padding: 12px 16px; margin-bottom: 12px; }
.compare-target-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.compare-target-head small { color: var(--muted); font-size: 12px; font-weight: 700; }
.compare-target-head h3 { font-family: var(--font-body); font-size: 18px; margin: 2px 0 0; }
.compare-target-head .plan-tag { margin: 0 0 0 4px; vertical-align: 2px; }
.compare-target-head a { color: var(--green-700); font-weight: 700; font-size: 14px; text-decoration: underline; text-underline-offset: 2px; }
.compare-target details { margin-top: 4px; }
.compare-target summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; }
.compare-points { list-style: none; margin: 4px 0 0; padding: 0; color: var(--muted); font-size: 13px; }
.compare-points li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.compare-points li span:last-child { white-space: nowrap; }
.compare-head, .compare-line { display: grid; grid-template-columns: 1fr 64px 72px 72px; gap: 6px; padding: 9px 16px; align-items: baseline; }
.compare-head { padding-top: 12px; color: var(--muted); font-size: 12px; font-weight: 700; }
.compare-head span, .compare-line span { overflow-wrap: anywhere; }
.compare-head span:not(:first-child), .compare-line span:not(:first-child) { text-align: right; }
.compare-line span:not(:first-child) { white-space: nowrap; }
.compare-line { border-top: 1px solid var(--line); font-size: 14px; }
.compare-line small { display: block; color: var(--muted); font-size: 12px; }
.compare-line.total { font-weight: 700; }
.compare-line .save { color: var(--green-700); font-weight: 700; }
.compare-line .worse { color: #b3261e; font-weight: 700; }
.compare-note { margin-top: 0; }
.compare-chain { margin: 18px 4px 6px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.compare-group { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px; cursor: pointer; }
.compare-group + .compare-group { border-top: 1px solid var(--line); }
.compare-group input { margin-top: 3px; accent-color: var(--green-700); width: 18px; height: 18px; flex-shrink: 0; }
.compare-group .row-title { display: block; }
.compare-covered { display: block; margin-top: 3px; color: var(--green-700); font-size: 12px; font-weight: 700; }
.compare-covered.none { color: var(--muted); }

/* Scheda Offerte */
.offer-tools { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 10px; padding: 0 16px; scrollbar-width: none; }
.offer-tools > * { flex-shrink: 0; }
.tool-chip { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; color: var(--green-900); white-space: nowrap; }
.tool-chip.on { background: var(--green-900); border-color: var(--green-900); color: var(--white); }
.chain-chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.chain-chip { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 2px solid var(--line); background: var(--white); font-weight: 700; font-size: 14px; }
.chain-chip.all { padding: 4px 12px; min-height: 38px; }
.chain-chip.on { border-color: var(--green-900); background: var(--green-100); color: var(--green-900); }
.chip-logo, .where-logo { flex-shrink: 0; display: inline-grid; place-items: center; object-fit: contain; background: var(--white); border: 1px solid var(--line); }
.chip-logo { width: 26px; height: 26px; border-radius: 50%; }
.where-logo { width: 18px; height: 18px; border-radius: 4px; }
.chip-logo.initials, .where-logo.initials { background: var(--chain, var(--green-900)); color: var(--white); font-size: 9px; font-weight: 800; border: 0; }
.plan-hint { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 12px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-900); font-size: 14px; font-weight: 600; }
.plan-hint b { font-weight: 800; }
.plan-hint .tool-chip { margin-left: auto; padding: 4px 10px; font-size: 13px; }
.count-line { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-weight: 600; margin: 0 4px 8px; }
.offer { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; align-items: start; scroll-margin-top: 80px; }
.offer + .offer { border-top: 1px solid var(--line); }
.offer .row-title { line-height: 1.25; }
.offer .row-meta { font-size: 13px; }
.offer .thumb { width: 42px; height: 42px; }
.offer .offer-price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.offer .offer-price del { display: inline; margin-right: 2px; color: var(--muted); font-size: 13px; }
.offer .offer-price strong { font-size: 17px; color: var(--green-900); }
.offer .offer-price .pl { white-space: nowrap; }
.offer .offer-price .save { font-size: 12px; color: var(--green-700); font-weight: 700; }
.offer-note { grid-column: 2 / 4; margin: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.offer-foot { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.offer-where { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.offer-where b { color: var(--ink); }
.offer-where .soon { color: var(--carrot); }
.tag-card { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; background: #f3ebc9; color: #6b5310; font-size: 11px; font-weight: 700; }
.offer .round-add { width: 32px; height: 32px; flex-shrink: 0; }
.offer .in-list { width: 32px; height: 32px; display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--green-100); color: var(--green-900); font-weight: 800; }
.cheaper { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 6px; border-radius: 999px; border: 0; background: #fdeee2; color: #a2492a; font-size: 12px; font-weight: 700; cursor: pointer; text-align: left; }

/* Pannelli dal basso (Ordina e filtra, confronto) */
.sheet-over { position: fixed; inset: 0; z-index: 20; background: rgba(29, 36, 32, .35); display: flex; flex-direction: column; justify-content: flex-end; }
.sheet-over[hidden] { display: none; }
body.sheet-open { overflow: hidden; }
.sheet-panel { width: 100%; max-width: 440px; margin: 0 auto; background: var(--cream); border-radius: 28px 28px 0 0; padding: 0 16px 24px; max-height: 92vh; overflow: auto; }
.sheet-panel h2 { font-family: var(--font-body); font-size: 20px; color: var(--green-900); margin: 14px 4px 4px; }
.sheet-panel h3 { font-family: var(--font-body); font-size: 15px; color: var(--green-900); margin: 18px 4px 8px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
li + li > .opt { border-top: 1px solid var(--line); }
.opt .row-body small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.opt input.radio, .opt input.box { appearance: none; margin: 0; flex-shrink: 0; width: 22px; height: 22px; border: 2px solid #cfc9bd; background: var(--white); cursor: pointer; }
.opt input.radio { border-radius: 50%; }
.opt input.radio:checked { border: 7px solid var(--green-900); }
.opt input.box { border-radius: 6px; display: grid; place-items: center; }
.opt input.box:checked { background: var(--green-900); border-color: var(--green-900); }
.opt input.box:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--white); border-width: 0 3px 3px 0; transform: translateY(-1px) rotate(45deg); }
.opt input:focus-visible { outline: 3px solid var(--lime); }
.opt .chain-logo { width: 32px; height: 32px; border-radius: 8px; font-size: 11px; }
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--white); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 14px; color: var(--green-900); cursor: pointer; }
.day-chip input:checked + span { background: var(--green-900); border-color: var(--green-900); color: var(--white); }
.day-chip input:focus-visible + span { outline: 3px solid var(--lime); }
.day-input { display: block; margin: 10px 0 0; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--white); font: inherit; color: var(--ink); }
.day-input[hidden] { display: none; }
.sticky-cta { position: sticky; bottom: -24px; margin: 16px -16px -24px; padding: 12px 16px 20px; background: linear-gradient(to top, var(--cream) 80%, rgba(250, 248, 245, 0)); }
.cmp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; }
.cmp-row + .cmp-row { border-top: 1px solid var(--line); }
.cmp-row .chain-logo { width: 34px; height: 34px; border-radius: 8px; font-size: 11px; }
.cmp-row .row-body small { display: block; color: var(--muted); font-size: 13px; }
.cmp-row strong { white-space: nowrap; font-size: 17px; }
.cmp-row.best { background: var(--green-100); }
.cmp-row.this { background: #fdf6ee; }
.lbl { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }
.lbl.g { background: var(--green-900); color: var(--white); }
.lbl.o { background: var(--carrot); color: var(--white); }
.diff { margin: 12px 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: #fdeee2; color: #a2492a; font-weight: 700; font-size: 14px; }

/* Loghi delle insegne nel piano e nella lista pronta */
.store-head.with-logo { align-items: center; }
.store-name { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.store-name .chain-logo { width: 44px; height: 44px; padding: 4px; }
.store-name .chain-logo.initials { padding: 0; }
.chain-minis { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 2px; }
.chain-mini { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 600; }
.chain-mini-logo { width: 20px; height: 20px; flex-shrink: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--white); object-fit: contain; padding: 1px; }
.chain-mini-logo.initials { display: grid; place-items: center; padding: 0; border: 0; background: var(--chain, var(--green-900)); color: var(--white); font-size: 9px; font-weight: 800; }

/* Profilo: Carte fedeltà, Preferiti e Non propormi mai */
.seg { display: flex; gap: 8px; margin: 14px 0 12px; }
.seg .tool-chip { flex: 1; justify-content: center; }
.seg .tool-chip.on { background: var(--green-900); color: var(--white); border-color: var(--green-900); }
.card-row { gap: 12px; padding: 12px 14px; }
.card-row + .card-row { border-top: 1px solid var(--line); }
.card-row .chain-logo { width: 36px; height: 36px; }
.row-body .excluded-tag { display: table; }

/* Carta fedeltà: promemoria nella lista pronta, avviso nelle Offerte */
.card-remind { display: flex; align-items: center; gap: 6px; margin: 0 16px 6px; color: #6b5310; font-size: 13px; font-weight: 600; }
.ready-item .tag-card { margin-top: 2px; }
.nocard { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 8px 10px; border-radius: 10px; background: #fdeee2; color: #a2492a; font-size: 13px; }
.nocard svg { margin-top: 1px; }
.nocard .inline-form { display: inline; }
.nocard .link { color: var(--green-900); text-decoration: underline; font-size: 13px; }

/* Controlla i prodotti: "Non propormi mai questo prodotto" */
.plan-block { padding: 0 16px 12px; }
.plan-block .link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

/* Controlla i prodotti: foto nelle righe e dettaglio del prodotto */
.check-head.with-photo { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-head.with-photo:focus-visible { outline: 3px solid var(--lime); outline-offset: -3px; border-radius: 16px; }
.check-body { flex: 1; min-width: 0; }
.plan-photo { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; background: var(--white); border: 1px solid var(--line); flex-shrink: 0; padding: 3px; box-sizing: border-box; display: block; }
.plan-photo.mini { width: 36px; height: 36px; border-radius: 8px; padding: 2px; }
.plan-photo.none { display: grid; place-items: center; color: #b9b3a6; background: #f1ede5; }
.photo-btn { border: 0; background: none; padding: 0; cursor: pointer; flex-shrink: 0; border-radius: 8px; }
.detail-chev { align-self: center; color: var(--muted); display: flex; }
.detail-title { justify-content: flex-end; }
.detail-photo { margin: 4px auto 10px; width: 200px; height: 200px; background: var(--white); border-radius: 20px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.detail-photo img { max-width: 92%; max-height: 92%; object-fit: contain; }
.detail-nophoto { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #b9b3a6; font-size: 13px; font-weight: 600; }
.detail-brand { text-align: center; color: var(--muted); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.sheet-panel .detail-name { text-align: center; margin: 2px 4px; }
.detail-size { text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; margin: 0 0 4px; }
.detail-text { margin: 0 4px; font-size: 14px; line-height: 1.45; }
.detail-more summary { list-style: none; cursor: pointer; }
.detail-more summary::-webkit-details-marker { display: none; }
.detail-more summary .link { text-decoration: underline; }
.detail-more[open] summary { display: none; }
.detail-source { margin: 16px 4px 0; color: var(--muted); font-size: 12px; }
.detail-source a { color: var(--muted); }
.detail-actions { margin-top: 14px; }

/* Altre possibilità: righe da toccare, pannello dal basso (al centro su schermi grandi), scelta dei supermercati */
.plan-alt-open { width: 100%; background: none; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; align-items: center; }
.plan-alt-open > svg { flex-shrink: 0; color: var(--muted); }
.plan-alt-open:hover { background: #faf7f1; }
.plan-chosen { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: #fdf6ee; font-size: 14px; }
.plan-chosen .link { background: none; border: 0; padding: 0; margin-top: 4px; color: var(--green-700); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.plan-sheet { width: 100%; max-width: 520px; max-height: 88vh; margin: auto auto 0; padding: 18px 16px 16px; border: 0; border-radius: 22px 22px 0 0; background: var(--bg, #f7f4ee); color: inherit; overflow: auto; }
.plan-sheet::backdrop { background: rgba(20, 30, 20, .45); }
@media (min-width: 700px) { .plan-sheet { margin: auto; border-radius: 22px; } }
.plan-sheet h2 { margin: 0 0 4px; font-family: var(--font-title); font-size: 22px; color: var(--green-900); }
.plan-sheet-sub { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.plan-sheet-summary { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 12px 14px; border-radius: 16px; background: var(--green-900); color: var(--white); }
.plan-sheet-summary small { display: block; font-size: 12px; opacity: .85; }
.plan-sheet-summary strong { font-family: var(--font-title); font-size: 20px; white-space: nowrap; }
.plan-sheet-summary .right { text-align: right; }
.plan-sheet-store { margin-bottom: 10px; }
.card.plan-sheet-store + .card { margin-top: 0; }
.plan-sheet-head { display: flex; justify-content: space-between; padding: 10px 12px 2px; font-weight: 700; }
.plan-sheet-head span:last-child { color: var(--muted); }
.plan-sheet-address { margin: 0 12px 6px; color: var(--muted); font-size: 12px; }
.plan-sheet-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 14px; }
.plan-sheet-line > span:last-child { text-align: right; white-space: nowrap; }
.plan-sheet-line small { display: block; color: var(--muted); font-size: 12px; }
.plan-sheet-line.moved { background: #fdf6ee; }
.plan-sheet-line .worse { color: #b3261e; font-weight: 700; }
.plan-sheet-line .save { color: var(--green-700); font-weight: 700; }
.plan-sheet-actions { display: grid; gap: 8px; margin-top: 8px; }

/* Scheda del prodotto dalla lista e dalla ricerca: foto grande da toccare, schermo intero */
.detail-photo-zoom { position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: none; display: grid; place-items: center; cursor: zoom-in; }
.detail-photo-zoom img { max-width: 92%; max-height: 92%; object-fit: contain; }
.zoom-hint { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); display: grid; place-items: center; color: var(--green-900); }
.photo-zoom { position: fixed; inset: 0; z-index: 60; background: var(--white); display: grid; place-items: center; padding: calc(56px + env(safe-area-inset-top, 0px)) 12px calc(24px + env(safe-area-inset-bottom, 0px)); cursor: zoom-out; touch-action: pinch-zoom; }
.photo-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-zoom-close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); color: var(--green-900); font-size: 18px; font-weight: 700; cursor: pointer; }

/* Lista: in alto nel pannello della voce la foto grande, poi prezzi e (chiusi) descrizione e ingredienti */
.item-menu-head.big { display: block; text-align: center; padding: 4px 4px 12px; margin-bottom: 4px; border-bottom: 0; }
.item-menu-head.big .detail-photo { width: 180px; height: 180px; margin: 4px auto 10px; }
.item-menu-head.big .row-title { font-family: var(--font-title); font-size: 18px; color: var(--green-900); }
.item-menu-head.big .row-meta { color: var(--muted); font-size: 14px; }
.item-menu-head.big .item-menu-qty { display: inline-block; margin-top: 6px; padding: 2px 9px; border-radius: 999px; background: var(--green-100); color: var(--green-900); font-size: 12px; font-weight: 700; }
.item-detail { margin: 0 0 8px; }
.item-detail:empty { display: none; }
.item-detail h3 { font-family: var(--font-body); font-size: 14px; color: var(--green-900); margin: 4px 4px 6px; }
.item-detail .card { border: 1px solid var(--line); box-shadow: none; }
.item-detail .note { margin: 6px 4px; }
.item-detail .cmp-row { padding: 9px 12px; }
.item-detail .cmp-row strong { font-size: 16px; }
.item-detail + form, .item-detail + a { border-top: 1px solid var(--line); }
.detail-fold { margin: 10px 0 0; border-radius: var(--radius-sm); background: var(--white); border: 1px solid var(--line); }
.detail-fold summary { list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; font-weight: 700; color: var(--green-900); cursor: pointer; }
.detail-fold summary::-webkit-details-marker { display: none; }
.detail-fold[open] summary svg { transform: rotate(180deg); }
.detail-fold > :not(summary) { margin-left: 14px; margin-right: 14px; }
.detail-fold > :last-child { margin-bottom: 12px; }
.detail-fold h3 { margin: 8px 14px 4px; }
.detail-fold .detail-text, .detail-fold .detail-source { margin-left: 14px; margin-right: 14px; }
/* Desktop: il menu ⋯ con la scheda diventa più largo e scorre se serve */
@media (hover: hover) {
  .item-menu-panel:has(.item-menu-head.big) { width: 340px; max-height: min(80vh, 720px); overflow: auto; }
}
@media (hover: none) {
  .item-menu-panel { max-height: 90vh; overflow: auto; }
}

/* Ricerca: foto e nome si toccano per la scheda; cuore e + restano come prima */
.result-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; margin: -6px 0; padding: 6px 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: var(--radius-sm); }
.result-open .row-body, .result-open .row-title, .result-open .row-meta { display: block; }
.result-open:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.result-open .excluded-tag { display: inline-block; }
#product-detail .sheet-panel { padding-bottom: 0; }
#product-detail { z-index: 30; }
.detail-block { margin: 14px 0 0; text-align: center; }
.detail-block button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.detail-blocked { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 14px 4px 0; color: var(--muted); font-size: 13px; }
.detail-bar { position: sticky; bottom: 0; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 14px -16px 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); background: var(--cream); border-top: 1px solid var(--line); }
.detail-bar form { margin: 0; }
.detail-bar form:last-child { flex: 1; }
.detail-bar .heart { width: 52px; height: 52px; border: 2px solid var(--line); background: var(--white); }
.detail-in-list { flex: 1; justify-content: center; min-height: 48px; font-size: 16px; }

/* Il confronto: righe che si toccano e dettaglio di una voce nel pannello dal basso */
.compare-table .compare-head, .compare-table .compare-line { grid-template-columns: 1fr 60px 68px 68px 14px; }
.compare-line.tap { cursor: pointer; }
.compare-line.tap:hover { background: #f6f3ec; }
.compare-line.tap:focus-visible { outline: 3px solid var(--lime); outline-offset: -3px; }
.compare-chev { color: var(--muted); align-self: center; display: flex; justify-content: flex-end; }
.cmp-detail-title { align-items: flex-start; gap: 10px; margin-top: 10px; }
.cmp-detail-title h2 { margin: 0; }
.cmp-detail-title small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.cmp-result { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-900); font-size: 14px; }
.cmp-result b { font-size: 20px; }
.cmp-result.worse { background: #fbe4e1; color: #b3261e; }
.cmp-result.same { background: #eeebe4; color: var(--ink); }
.cmp-side { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin-top: 10px; }
.cmp-side-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.cmp-side-label .plan-tag { margin: 0; text-transform: none; letter-spacing: 0; }
.cmp-prod { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.cmp-prod .plan-photo.mini { width: 48px; height: 48px; }
.cmp-prod-name { font-weight: 700; font-size: 14px; line-height: 1.25; }
.link-btn { padding: 0; border: 0; background: none; color: var(--green-700); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.cmp-calc { margin-top: 6px; font-size: 14px; }
.cmp-calc > div:first-child, .cmp-calc-sum { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.cmp-calc > div:first-child span:last-child, .cmp-calc-sum span:last-child { white-space: nowrap; }
.cmp-calc-note { color: var(--muted); font-size: 12px; padding: 1px 0; }
.cmp-calc-note s { color: var(--muted); }
.cmp-calc-sum { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 7px; font-weight: 700; font-size: 14px; }
.cmp-calc-sum .plan-tag { margin: 0 0 0 6px; font-size: 11px; }
.cmp-units { display: flex; gap: 8px; margin-top: 10px; }
.cmp-units div { flex: 1; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; color: var(--muted); font-size: 12px; }
.cmp-units b { display: block; color: var(--ink); font-size: 16px; }
.cmp-why { margin: 12px 4px 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.cmp-why li { margin: 3px 0; }

/* Dettatura della spesa (dettatura.js) */
.add-modes > [hidden] { display: none; }
.add-modes:has(> [hidden]) { grid-template-columns: 1fr; }
.dictation-example { color: var(--muted); font-size: 14px; margin: 10px 4px 0; }
.search:has(.search-mic) input { min-width: 0; }
.search-mic { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--green-100); color: var(--green-900); display: grid; place-items: center; cursor: pointer; }
.search-mic[hidden], .dictation-mic[hidden] { display: none; }
.search-mic.listening { background: var(--carrot); color: var(--white); animation: dictation-pulse 1.2s ease-in-out infinite; }

#dictation-sheet { z-index: 40; }
.dictation-panel { text-align: center; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.dictation-panel h2 { text-align: left; }
.dictation-ring { width: 96px; height: 96px; margin: 18px auto 14px; border: 0; border-radius: 50%; background: var(--green-100); display: grid; place-items: center; cursor: pointer; }
.dictation-ring span { width: 66px; height: 66px; border-radius: 50%; background: var(--green-900); color: var(--white); display: grid; place-items: center; }
.listening .dictation-ring { animation: dictation-ring 1.6s ease-out infinite; }
.dictation-live { min-height: 72px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); text-align: left; font-size: 17px; line-height: 1.45; }
.dictation-live[hidden] { display: none; }
.dictation-live i { color: var(--muted); }
.dictation-help { color: var(--muted); font-size: 14px; margin: 10px 4px 0; text-align: left; }
.dictation-help[hidden] { display: none; }
.dictation-panel .btn-pair { display: flex; gap: 10px; margin-top: 16px; }
.dictation-panel .btn-pair .btn { flex: 1; }
.dictation-write { display: inline-block; margin-top: 14px; color: var(--green-900); font-weight: 700; }
.dictation-privacy { color: var(--muted); font-size: 12px; margin: 10px 8px 0; }
@keyframes dictation-ring { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .35); } 100% { box-shadow: 0 0 0 26px rgba(16, 185, 129, 0); } }
@keyframes dictation-pulse { 50% { opacity: .6; } }

.dictation-text { display: block; width: 100%; padding: 12px 14px; border: 2px solid var(--green-900); border-radius: var(--radius-sm); background: var(--white); font: inherit; font-size: 17px; line-height: 1.45; resize: vertical; }
.dictation-text:focus { outline: 3px solid var(--lime); outline-offset: 1px; }
.dictation-mic { margin-top: 12px; }
.dictation-mic.listening { background: var(--green-100); }

.dictation-rows { margin-bottom: 24px; }
.dictation-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; }
.dictation-row + .dictation-row { border-top: 1px solid var(--line); }
.dictation-row.check, .dictation-row.missing { background: #fdf1e6; }
.dictation-row.off .row-body, .dictation-row.off .dictation-stepper { opacity: .55; }
.dictation-row .row-body { flex: 1; min-width: 0; }
.dictation-include { flex: none; padding-top: 2px; }
.dictation-include input { width: 22px; height: 22px; margin: 0; accent-color: var(--green-900); }
.dictation-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 6px; background: #f6dcc5; color: #9a4b12; font-size: 12px; font-weight: 700; vertical-align: 1px; }
.dictation-heard { color: var(--muted); font-size: 13px; margin-top: 2px; }
.dictation-note { color: #9a4b12; font-size: 13px; margin-top: 4px; }
.dictation-options { gap: 6px; margin-top: 8px; }
.dictation-options .choice span { min-height: 32px; padding: 0 12px; font-size: 13px; border-color: var(--green-900); color: var(--green-900); background: transparent; text-align: left; }
.dictation-search { display: inline-block; margin-top: 8px; color: var(--green-900); font-weight: 700; font-size: 14px; }
.dictation-stepper { flex: none; align-self: center; }
.dictation-stepper button { width: 32px; height: 32px; }
.dictation-stepper input { width: 28px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.dictation-stepper input::-webkit-outer-spin-button, .dictation-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bottom .btn:disabled { opacity: .5; }

/* Righe appena dettate, per qualche secondo */
.item-row { transition: background-color .6s ease; }
.item-row.just-added { background: #e4f1e6; }
@media (prefers-reduced-motion: reduce) { .listening .dictation-ring, .search-mic.listening { animation: none; } }

/* Dettatura: Generico o Prodotto a colpo d'occhio, alternative con foto e marca */
.dictation-head { display: flex; align-items: flex-start; gap: 10px; }
.dictation-head[hidden] { display: none; }
.dictation-head > .thumb { width: 46px; height: 46px; flex: none; }
.dictation-head-text { flex: 1; min-width: 0; }
.dictation-row .dictation-heard, .dictation-row .dictation-note { margin-left: 56px; }
.thumb.manual { background: var(--sand); color: var(--muted); font-size: 18px; }
.dictation-kind { display: inline-block; margin-bottom: 2px; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; vertical-align: 1px; }
.dictation-kind.generic { background: var(--white); border: 1.5px dashed #b9b2a4; color: var(--muted); }
.dictation-kind.product { background: var(--green-900); color: var(--white); }
.dictation-kind.manual { background: var(--sand); color: var(--muted); }
.dictation-brand { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.dictation-alts { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); overflow: hidden; }
.dictation-alt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.dictation-alt + .dictation-alt { border-top: 1px solid var(--line); }
.dictation-alt:has(input:checked) { background: var(--green-100); }
.dictation-alt input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--green-900); }
.dictation-alt .thumb { width: 36px; height: 36px; flex: none; font-size: 12px; border-radius: 9px; }
.dictation-alt-text { min-width: 0; }
.dictation-alt-text b { display: block; font-size: 14px; }
.dictation-alt-text small { color: var(--muted); font-size: 12px; }
.dictation-qty { display: flex; align-items: center; gap: 10px; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 600; }
.dictation-qty .stepper { margin-left: auto; }
.dictation-status { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--green-900); }
.dictation-status.paused { color: #9a4b12; }

/* Offerte: i tuoi prodotti preferiti in offerta, e il cuore con il numero sull'icona del menu */
.fav-box { border: 2px solid #f6c9a6; background: #fffaf5; }
.fav-box .offer + .offer, .fav-head + .offer { border-top: 1px solid #f3e2d3; }
.fav-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 4px; color: #a2492a; font-weight: 800; }
.fav-head svg { color: var(--carrot); fill: var(--carrot); }
.fav-head small { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.fav-head + .offer { border-top: 0; }
.fav-rest { margin-top: 8px; }
.fav-rest summary { cursor: pointer; text-align: center; padding: 8px; font-weight: 700; color: var(--green-700); font-size: 14px; list-style: none; }
.fav-rest summary::-webkit-details-marker { display: none; }
.fav-rest[open] summary { display: none; }
.section-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 20px 4px 8px; color: var(--green-900); font-weight: 800; }
.section-label small { color: var(--muted); font-weight: 600; font-size: 13px; }
.tab { position: relative; }
.tab-badge { position: absolute; top: 0; left: calc(50% + 4px); display: inline-flex; align-items: center; gap: 2px; padding: 1px 6px 1px 4px; border-radius: 999px; background: var(--carrot); color: var(--white); font-size: 11px; font-weight: 800; line-height: 16px; border: 2px solid var(--white); }
.tab-badge svg { fill: currentColor; }

/* Notifiche: campanella nel Profilo, impostazioni, "Le tue notifiche" */
.title-actions { display: flex; align-items: center; gap: 8px; }
.bell { position: relative; }
.bell .bell-dot { position: absolute; top: 5px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--carrot); border: 2px solid var(--white); }
.push-state { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.push-state svg { margin-top: 1px; }
.push-state.ok { background: var(--green-100); color: var(--green-900); }
.push-state.warn { background: #fdeee2; color: #a2492a; }
.push-explain { padding: 18px 16px; text-align: center; margin-top: 12px; }
.push-explain.left { text-align: left; }
.push-explain h2 { font-size: 20px; color: var(--green-900); margin-bottom: 8px; }
.push-explain p { color: var(--muted); margin: 0 0 6px; font-size: 14px; }
.push-big { width: 64px; height: 64px; margin: 4px auto 12px; border-radius: 20px; background: var(--green-100); color: var(--green-900); display: grid; place-items: center; }
.push-example { text-align: left; margin: 14px 0; padding: 12px; border-radius: 14px; background: #f3f1ec; font-size: 13px; }
.push-example b { display: block; }
.push-howto { display: block; margin: 10px 0 0; padding-left: 20px; font-size: 14px; list-style: decimal; }
.push-howto li { display: list-item; margin: 4px 0; }
.push-error { color: #a2492a !important; font-weight: 600; margin-top: 10px !important; }
.toggle-row .icon, .device-row .icon { color: var(--muted); }
.device-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.device-row + .device-row { border-top: 1px solid var(--line); }
.device-row .row-body { flex: 1; }
.device-row .row-title { display: block; font-weight: 700; }
.device-row .row-meta { display: block; color: var(--muted); font-size: 13px; }
.link-danger { border: 0; background: none; padding: 6px 0; color: #a2492a; font-weight: 700; font-size: 14px; }
.inbox-day { margin: 18px 4px 8px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.msg { display: flex; gap: 12px; padding: 14px 16px; }
.msg + .msg { border-top: 1px solid var(--line); }
.msg-icon { width: 38px; height: 38px; border-radius: 50%; background: #fdeee2; color: var(--carrot); display: grid; place-items: center; flex-shrink: 0; }
.msg-icon svg { fill: var(--carrot); }
.msg-body { flex: 1; font-size: 14px; min-width: 0; }
.msg-body > b { display: block; font-size: 15px; }
.msg-body > small { color: var(--muted); font-weight: 600; }
.msg.unread .msg-body > b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--carrot); margin-left: 6px; vertical-align: 2px; }
.msg-body ul { margin: 6px 0 4px; }
.msg-body li { padding: 2px 0; }
.msg-body li em { font-style: normal; color: #a2492a; font-weight: 700; }
.msg-body li.expired, .msg-body li.expired em { color: var(--muted); }
.msg-card { display: block; color: #6b5310; font-size: 12px; font-weight: 600; }
.msg-go { display: inline-block; margin-top: 4px; color: var(--green-700); font-weight: 700; }

/* Lista pronta: EAN dell'insegna sotto il prodotto, ultime 5 cifre in evidenza */
.ready-item .row-title small.ready-ean { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ready-item .row-title small.ready-ean b { color: var(--ink); font-weight: 600; }
.ready-ean-note { margin: 0 4px 12px; }

/* Lista pronta: foto del prodotto nella riga (tocco = foto grande, non spunta) */
.ready-item .ready-photo, .ready-item .ready-photo .plan-photo { width: 48px; height: 48px; }
.ready-item .ready-photo .plan-photo, .ready-item .plan-photo.ready-photo { border-radius: 10px; }
.ready-item .check-row input:checked ~ .ready-photo { opacity: .45; }
.photo-zoom { position: fixed; inset: 0; z-index: 30; background: rgba(29, 36, 32, .8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; cursor: zoom-out; }
.photo-zoom[hidden] { display: none; }
.photo-zoom img { max-width: min(100%, 420px); max-height: 75vh; object-fit: contain; background: var(--white); border-radius: 20px; padding: 12px; box-sizing: border-box; }
.photo-zoom small { color: #fff; font-size: 13px; }

/* Ricerca: "Mostra altri" sotto Altri prodotti */
.load-more { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px 0 4px; }
.load-more .btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.load-more-count { color: var(--muted); font-size: 13px; }
.dictation-keyboard-hint { display: flex; gap: 8px; align-items: flex-start; margin: 0 4px 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-900); font-size: 14px; font-weight: 600; }
.dictation-keyboard-hint[hidden] { display: none; }
.dictation-keyboard-hint svg { margin-top: 2px; }
