/* =============================================================================
   COMPONENTI — riutilizzati da entrambe le schermate.
   Naming: .btn, .campo, .chip, .card, .tbl, .sheet, .toast, .skel, .stato, .stepper, .badge
   ============================================================================= */

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  height: var(--h-control); padding: 0 var(--sp-4);
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--fs-14); white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
@media (hover: hover) { .btn:hover { border-color: var(--gold-500); color: var(--accent-ink); } }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
@media (hover: hover) { .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); } }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
@media (hover: hover) { .btn-ghost:hover { background: var(--surface-2); border-color: transparent; } }
.btn-danger { color: var(--danger); }
@media (hover: hover) { .btn-danger:hover { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); } }
.btn-sm { height: var(--h-control-sm); padding: 0 var(--sp-3); font-size: var(--fs-13); }
.btn-icon { width: var(--h-control); padding: 0; }
.btn-icon.btn-sm { width: var(--h-control-sm); }
.btn-block { width: 100%; }
.btn .cnt { background: rgba(0,0,0,.14); border-radius: var(--r-pill); padding: 0 7px; font-size: var(--fs-12); min-width: 20px; line-height: 20px; }

/* ---------- Campi ---------- */
.campo {
  display: block; width: 100%;
  height: var(--h-control); padding: 0 var(--sp-3);
  border-radius: var(--r-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-size: var(--fs-16); /* iOS: sotto i 16px Safari zooma al focus */
}
@media (hover: hover) { .campo:hover { border-color: var(--muted); } }
.campo:focus { border-color: var(--gold-500); outline: 2px solid var(--gold-500); outline-offset: 0; }
.campo::placeholder { color: var(--muted); }
/* cresce col testo (UI.autoAltezza) fino a max-height; la barra di scorrimento, quando serve, è sottile
   e non copre gli angoli arrotondati */
textarea.campo { height: auto; min-height: 76px; max-height: 220px; padding: var(--sp-2) var(--sp-3); resize: none; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
select.campo { padding-right: 34px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.6 6 6.4 11 1.6' fill='none' stroke='%2378808f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
/* ---- Tendina fatta in casa (UI.tendina) — vedi il commento in js/ui.js -----------
   Il pulsante è un `.campo` a tutti gli effetti, così sta in fila con gli altri campi del
   foglio; la freccia è la stessa della `select`, disegnata da noi.
   ⚠️ `.tendina-list` è figlia del `<body>` e posizionata dal JS: qui NON si mettono `top`,
   `left` o `width`, che il JS riscrive a ogni apertura. Lo z-index deve stare sopra il
   foglio (`.sheet-host` è a 100), o il pannello finirebbe dietro al velo. */
.tendina { position: relative; }
.tendina-btn { display: flex; align-items: center; width: 100%; text-align: left; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.6 6 6.4 11 1.6' fill='none' stroke='%2378808f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
.tendina-testo { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tendina-list { position: fixed; z-index: 120; overflow: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tendina-list li { padding: 10px 12px; border-radius: var(--r-sm); font-size: var(--fs-14); cursor: pointer; }
@media (hover: hover) { .tendina-list li:hover { background: var(--surface-2); } }
.tendina-list li:focus { outline: none; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--primary); }
.tendina-list li[aria-selected="true"] { font-weight: 600; color: var(--accent-ink); }

.campo-label { display: block; font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); margin-bottom: var(--sp-1); }
.campo-hint { font-size: var(--fs-12); color: var(--muted); margin-top: var(--sp-1); }
.campo-gruppo { margin-bottom: var(--sp-4); }
.campo.errore { border-color: var(--danger); }

/* Ricerca: icona a sinistra, cancella a destra */
.ricerca { position: relative; display: flex; align-items: center; }
.ricerca .campo { padding-left: 38px; padding-right: 36px; }
.ricerca > svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.ricerca .btn-x { position: absolute; right: 4px; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
@media (hover: hover) { .ricerca .btn-x:hover { color: var(--accent-ink); background: var(--surface-2); } }
.ricerca .btn-x svg { width: 16px; height: 16px; }
.ricerca input[type=search]::-webkit-search-cancel-button, .ricerca input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

/* Segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 3px; gap: 2px; }
.seg button { border: 0; border-radius: 7px; background: none; padding: 6px 12px; border-radius: 7px; font-size: var(--fs-13); font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
/* variante con icona: su mobile solo icone, su desktop icona + etichetta */
.seg-icone button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; }
.seg-icone button svg { width: 18px; height: 18px; }
.seg-icone button.on svg { color: var(--accent-ink); }
.seg-icone button span { display: none; }
@media (min-width: 1024px) { .seg-icone button { padding: 6px 12px; } .seg-icone button span { display: inline; } }

/* Switch */
.switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line); }
.switch:last-child { border-bottom: 0; }
.switch .lbl { flex: 1 1 200px; min-width: 0; }
.switch .lbl b { display: block; font-weight: 600; }
.switch .lbl span { display: block; font-size: var(--fs-13); color: var(--muted); }
.toggle { position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); padding: 0; border: 0; background: var(--line-strong); flex: 0 0 auto; transition: background var(--t-base); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t-base); }
.toggle[aria-checked="true"] { background: var(--gold-500); }
.toggle[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- Chip ---------- */
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 2px 0; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
  font-size: var(--fs-13); font-weight: 600; white-space: nowrap;
}
@media (hover: hover) { .chip:hover { border-color: var(--gold-500); color: var(--accent-ink); } }
.chip.on { background: var(--navy-800); border-color: var(--navy-800); color: var(--paper); }
[data-theme="dark"] .chip.on { background: var(--gold-500); border-color: var(--gold-500); color: var(--on-primary); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }

/* ---------- Badge ---------- */
/* ---------- «A colore»: il tasto che porta allo spettro ----------
   Il BORDO è una sfumatura di spettro, l'interno resta il fondo della scheda: così il testo
   conserva lo stesso contrasto di ogni altro tasto e la sfumatura non se lo mangia.
   ⚠️ Il trucco sono DUE sfondi: il primo, tinta piatta, riempie il riquadro dentro il bordo
   (`padding-box`); il secondo, lo spettro, arriva fin sotto il bordo (`border-box`). Il bordo
   è trasparente, quindi di lui si vede il secondo. Serve `background-origin: border-box`, o il
   secondo sfondo partirebbe da dentro e il bordo resterebbe scoperto.
   ⚠️ L'interno usa `--surface`, non un bianco fisso: di notte deve seguire il tema.
   Passandoci sopra, lo spettro affiora anche dentro, appena accennato (16%): abbastanza da
   far capire che il tasto è quello dei colori, troppo poco per rendere illeggibile la scritta. */
.btn-spettro {
  position: relative; isolation: isolate;
  /* ⚠️ Bordo di 2px, non 1: a un pixel solo lo spettro si legge come un filo grigiastro,
     perché sette colori in un pixel di altezza si mescolano all'occhio. `box-sizing` è
     `border-box`, quindi il tasto non cresce: si stringe di un pixel l'interno. */
  border-width: 2px; border-color: transparent;
  background-image:
    linear-gradient(var(--surface), var(--surface)),
    var(--spettro);
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
.btn-spettro::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  border-radius: inherit; opacity: 0;
  background: var(--spettro);
  transition: opacity var(--t-fast);
}
@media (hover: hover) {
  .btn-spettro:hover { border-color: transparent; }
  .btn-spettro:hover::before { opacity: .16; }
}

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.badge-gold { background: var(--gold-100); color: var(--gold-600); }
[data-theme="dark"] .badge-gold { background: rgba(200,153,46,.18); color: var(--gold-400); }
.badge-muted { background: var(--surface-3); color: var(--ink-2); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-num { min-width: 20px; justify-content: center; padding: 0 6px; background: var(--gold-500); color: var(--on-primary); text-transform: none; letter-spacing: 0; }

/* ---------- Card ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: var(--sp-4); }

/* ---------- Tabella ---------- */
/* Tabella prezzi: è la cosa che il rivenditore cerca, quindi ha più peso del resto della card:
   testata oro chiaro, prezzi a 14px in grassetto, bordo più deciso, zebratura su tutta la riga. */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-14); }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
.tbl thead th { background: var(--tbl-head-bg); color: var(--tbl-head-ink); font-weight: 700; font-size: var(--fs-12); text-transform: uppercase; letter-spacing: .06em; border-bottom-color: var(--line-strong); }
.tbl tbody th { text-align: left; font-weight: 600; color: var(--ink); background: inherit; position: sticky; left: 0; }
.tbl thead th:first-child { text-align: left; position: sticky; left: 0; z-index: 1; }
.tbl tbody tr { background: var(--surface); }
.tbl tbody tr:nth-child(even) { background: var(--zebra); }
.tbl tbody tr:last-child th, .tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.tbl td.na { color: var(--muted); font-weight: 400; }

/* ---------- Stepper quantità ---------- */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; border-radius: 0; background: none; color: var(--ink-2); display: flex; align-items: center; justify-content: center; }
.stepper button svg { width: 16px; height: 16px; }
@media (hover: hover) { .stepper button:hover { background: var(--surface-2); color: var(--accent-ink); } }
.stepper button:disabled { opacity: .35; }
.stepper input { width: 44px; height: 34px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; text-align: center; background: transparent; font-size: var(--fs-16); font-variant-numeric: tabular-nums; appearance: none; -webkit-appearance: none; }
.stepper.on { border-color: var(--gold-500); }
.stepper.on input { color: var(--accent-ink); font-weight: 700; }
.stepper.sm button { width: 30px; height: 30px; }
.stepper.sm input { width: 40px; height: 30px; font-size: var(--fs-16); }

/* ---------- Sheet / modale ----------
   Mobile: foglio che sale dal basso, quasi a tutto schermo.
   Desktop: finestra centrata (o pannello laterale con .sheet-side).            */
.sheet-host { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(8,12,20,.55); animation: fade var(--t-base); } /* niente backdrop-filter: lag su iPhone */
.sheet {
  width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-lg);
  animation: rise var(--t-base);
}
.sheet-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); background: var(--surface); border-radius: inherit; }
.sheet-head h2 { font-size: var(--fs-16); font-weight: 700; flex: 1; min-width: 0; }
.sheet-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: var(--sp-4); }
.sheet-foot { display: flex; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-3) var(--sp-4) calc(var(--sp-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.sheet-foot .spacer { flex: 1; }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 768px) {
  .sheet-host { align-items: center; padding: var(--sp-6); }
  .sheet { max-width: 640px; max-height: 88vh; max-height: 88dvh; border-radius: var(--r-lg); }
  .sheet.lg { max-width: 880px; }
  .sheet-foot { border-radius: 0 0 var(--r-lg) var(--r-lg); }
}

/* ---------- Toast ---------- */
/* Mobile: in alto, perché in basso ci sono tab bar, barra azioni e sheet. Desktop: in basso a destra. */
.toasts { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); transform: translateX(-50%); z-index: 150; display: grid; gap: var(--sp-2); width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px 10px 14px; border-radius: var(--r-md); background: var(--navy-800); color: var(--paper); box-shadow: var(--shadow-md); font-size: var(--fs-14); animation: rise var(--t-base); border-left: 3px solid var(--gold-500); }
.toast.success { border-left-color: var(--success); }
.toast.danger { border-left-color: #e57373; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: var(--gold-400); font-weight: 700; padding: 4px 6px; }
@media (min-width: 1024px) { .toasts { left: auto; right: 24px; top: auto; bottom: 24px; transform: none; } }

/* ---------- Skeleton ---------- */
.skel { position: relative; overflow: hidden; background: var(--surface-3); border-radius: var(--r-sm); }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: shimmer 1.4s infinite; }
[data-theme="dark"] .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { display: grid; gap: var(--sp-3); padding: var(--sp-4); }
.skel-card .row { display: flex; gap: var(--sp-3); }
.skel-riga { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 0; border-bottom: 1px solid var(--line); }
.skel-riga .skel:first-child { flex: 1; height: 16px; }

/* ---------- Stati: vuoto, errore ---------- */
.stato { text-align: center; padding: var(--sp-10) var(--sp-4); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--ink-2); background: var(--surface); }
.stato .ico { width: 44px; height: 44px; margin: 0 auto var(--sp-3); color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-2); }
.stato .ico svg { width: 22px; height: 22px; }
.stato h3 { font-size: var(--fs-16); color: var(--ink); margin-bottom: var(--sp-1); }
.stato p { font-size: var(--fs-14); max-width: 380px; margin: 0 auto; }
.stato .btn { margin-top: var(--sp-4); }
.stato.errore { border-style: solid; border-color: var(--danger); background: var(--danger-bg); }
.stato.errore .ico { color: var(--danger); background: rgba(179,38,30,.12); }

/* ---------- Avviso inline ---------- */
.avviso { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-3); border-radius: var(--r-md); font-size: var(--fs-13); background: var(--info-bg); color: var(--ink-2); }
.avviso svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--info); margin-top: 1px; }
.avviso.warning { background: var(--warning-bg); } .avviso.warning svg { color: var(--warning); }
.avviso.success { background: var(--success-bg); } .avviso.success svg { color: var(--success); }

/* ---------- Lista definizioni (scheda tecnica) ---------- */
.dl { display: grid; gap: var(--sp-2); }
.dl > div { display: flex; gap: var(--sp-3); align-items: flex-start; padding: 8px 10px; background: var(--surface-2); border-radius: var(--r-sm); font-size: var(--fs-14); }
.dl svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--gold-500); margin-top: 2px; }
.dl b { color: var(--ink); }
.dl span { color: var(--ink-2); }

/* ---------- Intestazione di sezione sticky ---------- */
/* Lo sfondo della testata è dipinto da ::before, che sporge 12px sopra (il margin-top) e 8px ai lati:
   quando è agganciata copre eventuali pixel di sfasamento rispetto alla barra superiore, anche per le
   righe evidenziate che sporgono di 8px (.riga.dentro); nel flusso copre solo margine e sfondo. */
.sec-head { position: sticky; top: calc(var(--h-top, var(--h-topbar)) + var(--h-sub, 0px)); z-index: 5; display: flex; align-items: baseline; justify-content: center; gap: var(--sp-3); padding: var(--sp-3) 0 var(--sp-2); margin: var(--sp-3) 0 var(--sp-3); border-bottom: 1px solid var(--line); }
.sec-head::before { content: ""; position: absolute; z-index: -1; left: calc(-1 * var(--sp-2)); right: calc(-1 * var(--sp-2)); top: calc(-1 * var(--sp-3)); bottom: 0; background: var(--bg); }
/* ⚠️ Maiuscoletto spaziato e centrato, come nel catalogo stampato e nella vecchia versione a
   schermo: è la stessa gerarchia, e chi ha in mano il PDF ritrova la stessa forma.
   La spaziatura non è un vezzo: in maiuscolo le lettere si toccano e la riga si legge peggio,
   quindi passa da -.01em (che stringe, e serve alle minuscole) a +.08em. */
.sec-head h2 { font-size: var(--fs-16); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; text-align: center; color: var(--accent-ink); }
/* ⚠️ `.sec-head:first-child` colpiva TUTTE le testate, non la prima della pagina: ogni
   `.sec-head` è il primo figlio della **sua** `<section class="sec">`. Risultato: margine
   superiore azzerato ovunque, zero spazio fra l'ultima card di una sezione e la testata
   successiva, e il velo del `::before` — che sporge 12px in su apposta, per coprire le card
   che passano sotto quando la testata è agganciata — finiva a tagliare la card precedente.
   La condizione va messa sulla SEZIONE: solo la prima non ha niente sopra di sé. */
.sec:first-child > .sec-head { margin-top: 0; }

/* ---------- Menu a tendina semplice ---------- */
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 200px; padding: 6px; margin: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-md); }
.menu-list button { display: flex; align-items: center; gap: var(--sp-2); width: 100%; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: var(--r-sm); font-size: var(--fs-14); }
@media (hover: hover) { .menu-list button:hover { background: var(--surface-2); } }
.menu-list button svg { width: 16px; height: 16px; color: var(--muted); }
.menu-list button.danger { color: var(--danger); }
/* dentro un piè di foglio il tasto è in fondo allo schermo: la lista si apre verso l'alto, allineata a sinistra */
.sheet-foot .menu-list, .carrello-foot .menu-list { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }

/* ---- barretta «è disponibile una versione aggiornata» (js/pwa.js) --------------
   Sta sopra la barra in basso, non sopra il contenuto: chi sta scrivendo un ordine non
   deve trovarsi una striscia in mezzo alle righe. Su mobile lascia in pace la tab bar,
   e `body.hasupd` alza il resto di quel tanto. */
.upd{
  position:fixed; left:50%; transform:translateX(-50%);
  bottom:calc(var(--h-bottom, 0px) + 12px + env(safe-area-inset-bottom, 0px));
  z-index:60; display:flex; align-items:center; gap:10px;
  max-width:min(560px, calc(100vw - 24px));
  padding:10px 12px; border-radius:10px;
  background:var(--brand-bg); color:#fff;
  border:1px solid var(--brand-line);
  box-shadow:0 6px 24px rgba(0,0,0,.28);
  font-size:14px;
}
.upd span{flex:1; min-width:0}
.upd .btn-ghost{color:rgba(255,255,255,.72)}
@media (max-width:1023px){
  .upd{ bottom:calc(var(--h-tab, 56px) + var(--h-obar, 0px) + 12px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion:no-preference){
  .upd{animation:updSu .22s ease-out}
  @keyframes updSu{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
}

/* Il nome del cliente, che arriva dal server con la chiave: non si scrive, si legge.
   Ha l'aria di un dato confermato — segno di spunta e fondo tenue — non di un campo
   vuoto in attesa, perché non c'è niente da compilare. */
.chi-ordina{
  display:flex; align-items:center; gap:8px;
  padding:9px 12px; border-radius:var(--rad-sm, 6px);
  background:var(--success-bg); color:var(--ink);
  border:1px solid color-mix(in srgb, var(--success) 26%, transparent);
  font-size:14px;
}
.chi-ordina svg{width:16px; height:16px; flex-shrink:0; color:var(--success)}
.chi-ordina b{font-weight:600; min-width:0; overflow-wrap:anywhere}
