/* Cassa Ropa De Gorila — bianco e nero, tasti grandi per il tablet accanto alla cassa */
:root {
  --bg: #F2F2F7;
  --card: #FFFFFF;
  --ink: #111111;
  --muted: #6E6E73;
  --line: #E5E5EA;
  --green: #1F7A37;
  --red: #C4221B;
  --orange: #B25000;
  --radius: 22px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { user-select: none; -webkit-user-select: none; }
input { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
button:disabled { opacity: .35; cursor: default; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#app { min-height: 100%; display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.center-text { text-align: center; }

/* Barra in alto */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; padding: calc(10px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); background: #000; color: #fff; min-height: 64px; }
.top .brand { padding: 0; display: flex; align-items: center; min-height: 44px; }
.top .brand img { height: 26px; display: block; }
.top .back { display: inline-flex; align-items: center; gap: 4px; font-size: 18px; font-weight: 600; min-height: 44px; padding: 0 10px 0 0; }
.top .shop { flex: 1; font-size: 17px; font-weight: 600; text-align: center; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .right { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.clock { opacity: .85; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 14px; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.status i { width: 9px; height: 9px; border-radius: 50%; background: #34C759; }
.status.wait i { background: #FF9F0A; }
.status.off i { background: #FF453A; }

/* Collegamento e messaggi a tutto schermo */
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 20px; gap: 12px; background: #000; color: #fff; }
.center p { max-width: 520px; color: #c7c7cc; font-size: 17px; line-height: 1.45; margin: 0; }
.biglogo { width: 200px; max-width: 50vw; margin-bottom: 8px; }
.pair form { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.pair input { font: inherit; font-size: 30px; font-weight: 700; letter-spacing: .12em; text-align: center; width: 280px; max-width: 80vw; padding: 14px; border-radius: 16px; border: 0; text-transform: uppercase; }
.pair .err { color: #FF6961; font-weight: 600; }
.primary { background: #fff; color: #000; font-weight: 700; font-size: 19px; padding: 0 28px; min-height: 60px; border-radius: 16px; }
main .primary { background: #000; color: #fff; }
h1 { font-size: 30px; letter-spacing: -0.02em; margin: 0; }

/* Commessi */
main.staff { flex: 1; padding: 28px max(20px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 22px; }
main.staff h1 { text-align: center; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.person { min-height: 150px; border-radius: var(--radius); color: #fff; font-size: 36px; font-weight: 800; letter-spacing: -0.01em; padding: 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, .12); word-break: break-word; }
.person:active { transform: scale(.98); }
.undo { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--card); border-radius: 18px; padding: 14px 18px; font-size: 17px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.btn-ghost { background: #FFECEB; color: var(--red); font-weight: 700; padding: 0 18px; min-height: 52px; border-radius: 14px; font-size: 17px; }

/* Scelta cliente */
main.choice { flex: 1; padding: 28px 20px; display: flex; flex-direction: column; gap: 22px; align-items: center; justify-content: center; }
.who { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.who .dot { width: 14px; height: 14px; border-radius: 50%; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; width: min(860px, 100%); }
.big { min-height: 180px; border-radius: var(--radius); font-size: 28px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.big svg { width: 54px; height: 54px; }
.big.yes { background: #000; color: #fff; }
.big.no { background: var(--card); border: 2px solid #000; }
.big.danger { border-color: var(--red); color: var(--red); }

/* Ricerca */
main.search { flex: 1; padding: 20px max(20px, env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 14px; }
main.search .row { display: flex; gap: 10px; }
main.search input { flex: 1; min-width: 0; font: inherit; font-size: 20px; padding: 0 18px; min-height: 60px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); }
main.search input:focus { outline: none; border-color: #000; }
.results { display: flex; flex-direction: column; gap: 8px; }
.res { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; background: var(--card); border-radius: 16px; padding: 0 20px; min-height: 64px; font-size: 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }

/* Fotocamera */
main.scan { flex: 1; position: relative; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
main.scan video { width: min(640px, 100%); max-height: 70vh; border-radius: 18px; background: #111; object-fit: cover; }
main.scan .frame { position: absolute; width: min(300px, 60vw); aspect-ratio: 1; border: 4px solid #fff; border-radius: 24px; pointer-events: none; opacity: .8; }
main.scan p { font-size: 18px; }

/* Importo */
main.amount { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; padding: 20px max(20px, env(safe-area-inset-left)) calc(20px + env(safe-area-inset-bottom)); }
main.amount .left, main.amount .right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.display { background: #000; color: #fff; border-radius: var(--radius); font-size: clamp(40px, 7vw, 64px); font-weight: 800; text-align: right; padding: 18px 24px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; }
.display.empty { color: #8e8e93; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; flex: 1; }
.keypad button { background: var(--card); border-radius: 18px; font-size: 34px; font-weight: 700; min-height: 76px; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); display: flex; align-items: center; justify-content: center; }
.keypad button:active { background: #e5e5ea; }
.keypad button svg { width: 34px; height: 34px; }
.cust { background: var(--card); border-radius: 18px; padding: 16px 18px; font-size: 17px; display: flex; flex-direction: column; gap: 6px; }
.cust.none { color: var(--muted); }
.cname { font-size: 22px; font-weight: 800; }
.bday { background: #FFF4E5; color: var(--orange); font-weight: 700; padding: 8px 12px; border-radius: 12px; }
.cbtoggle { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 18px; padding: 0 18px; min-height: 64px; font-size: 20px; font-weight: 700; }
.cbtoggle input { width: 30px; height: 30px; accent-color: #000; }
.sum { background: var(--card); border-radius: 18px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; font-size: 18px; }
.sum > div { display: flex; justify-content: space-between; gap: 12px; }
.sum .due { font-size: 26px; font-weight: 800; border-top: 1px solid var(--line); padding-top: 10px; }
.sum .earn { color: var(--green); font-weight: 600; font-size: 16px; }
.warn { color: var(--orange); font-weight: 600; }
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: auto; }
.pay-btn { min-height: 96px; border-radius: 20px; font-size: 24px; font-weight: 800; color: #fff; }
.pay-btn.cash { background: var(--green); }
.pay-btn.card { background: #0A64D6; }
.pay-btn.mixed { background: #4B4B4F; }
.pay-btn.ok { background: #000; grid-column: 1 / -1; }

/* Fatto */
main.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; font-size: 19px; }
main.done p { margin: 0; }
main.done h1 { font-size: 56px; }
.tick { width: 110px; height: 110px; border-radius: 50%; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; }
.tick.pending { background: #FF9F0A; }
.tick svg { width: 64px; height: 64px; stroke-width: 3; }
main.done .primary { margin-top: 16px; }

/* Menu */
main.menu { flex: 1; padding: 24px 20px; display: flex; flex-direction: column; gap: 18px; max-width: 860px; width: 100%; margin: 0 auto; }
main.menu .list { background: var(--card); border-radius: 18px; overflow: hidden; }
main.menu .list > div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 17px; }
main.menu .list > div:first-child { border-top: 0; }
main.menu .list.bad b { color: var(--red); }
main.menu .big { min-height: 90px; font-size: 20px; }

/* Messaggio a comparsa */
.flash { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); background: #000; color: #fff; padding: 14px 22px; border-radius: 16px; font-size: 17px; font-weight: 600; max-width: min(640px, 92vw); text-align: center; transition: transform .25s; z-index: 20; pointer-events: none; }
.flash.show { transform: translate(-50%, 0); }
.flash.bad { background: var(--red); }
.flash:empty { display: none; }

/* Tablet in verticale e telefoni */
@media (max-width: 820px) and (orientation: portrait), (max-width: 700px) {
  main.amount { grid-template-columns: 1fr; }
  .keypad button { min-height: 64px; }
  .pay-btn { min-height: 80px; font-size: 21px; }
}
@media (max-width: 560px) {
  .top .clock, .top .shop { display: none; }
  .person { min-height: 110px; font-size: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .big { min-height: 130px; font-size: 22px; }
  h1 { font-size: 24px; }
  .pay { grid-template-columns: 1fr 1fr; }
  .pay-btn.mixed { grid-column: 1 / -1; min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) { .flash { transition: none; } }
main.done.unsure h1 { font-size: 40px; }
main.done.unsure p { max-width: 640px; line-height: 1.4; }
main.done.unsure .two { margin-top: 14px; }
main.done.unsure .big { min-height: 110px; font-size: 24px; }
.unsure-banner { border: 2px solid #FF9F0A; margin-bottom: 10px; }
.unsure-banner + .undo { margin-top: 0; }
main.done.unsure .btn-ghost { margin-top: 10px; background: transparent; color: #3a3a3c; text-decoration: underline; }

/* Tablet piccoli (Galaxy Tab A11 8,7": per il browser è circa 893×533, con le barre di Android anche meno).
   Tutto deve stare in uno schermo: tastierino che si stringe, riquadri più compatti, pagamenti sempre visibili. */
.keypad { grid-auto-rows: minmax(44px, 1fr); min-height: 0; }
@media (orientation: landscape) and (max-height: 640px) {
  .top { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  main.amount { gap: 14px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  main.amount .left, main.amount .right { gap: 8px; }
  .display { font-size: 40px; padding: 6px 18px; }
  .keypad { gap: 8px; }
  .keypad button { min-height: 0; font-size: 28px; border-radius: 14px; }
  .cust { padding: 8px 14px; gap: 3px; font-size: 15px; }
  .cname { font-size: 18px; }
  .bday { padding: 4px 10px; font-size: 15px; }
  .cbtoggle { min-height: 46px; font-size: 17px; }
  .cbtoggle input { width: 24px; height: 24px; }
  .sum { padding: 8px 14px; gap: 4px; font-size: 15px; }
  .sum .due { font-size: 21px; padding-top: 6px; }
  .sum .earn { font-size: 14px; }
  .pay { gap: 8px; }
  .pay-btn { min-height: 60px; font-size: 20px; border-radius: 16px; }
  main.staff { padding-top: 12px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); gap: 12px; }
  main.staff h1 { font-size: 24px; margin: 0; }
  .person { min-height: 92px; font-size: 26px; padding: 10px; }
  .undo { padding: 8px 14px; font-size: 15px; }
}
@media (orientation: portrait) and (max-height: 960px) {
  .top { padding-top: calc(4px + env(safe-area-inset-top)); padding-bottom: 4px; }
  main.amount { gap: 10px; padding-top: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  main.amount .left, main.amount .right { gap: 8px; }
  .display { font-size: 40px; padding: 6px 18px; }
  .keypad { gap: 8px; }
  .keypad button { min-height: 0; font-size: 28px; border-radius: 14px; }
  .cust { padding: 8px 14px; gap: 3px; font-size: 15px; }
  .cname { font-size: 18px; }
  .bday { padding: 4px 10px; font-size: 15px; }
  .cbtoggle { min-height: 46px; font-size: 17px; }
  .sum { padding: 8px 14px; gap: 4px; font-size: 15px; }
  .sum .due { font-size: 21px; padding-top: 6px; }
  .pay-btn { min-height: 60px; font-size: 20px; }
}

/* Contorno chiaro leggero su tutti i tasti dei commessi (anche il nero resta ben distinto) */
.person { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .3), 0 6px 20px rgba(0, 0, 0, .12); }

/* Altri commessi (chi viene a sostituire da un altro negozio) */
.others-btn { align-self: center; font-size: 17px; }
.others-title { margin: 4px 0 -6px; }
.grid.others .person.small { min-height: 84px; font-size: 24px; }

/* QR della tessera mostrato di nuovo al cliente */
.card-btn { align-self: flex-start; padding: 6px 0; min-height: 36px; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.cardqr { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cardqr-box { background: #fff; border-radius: 24px; padding: 20px 24px; max-width: 420px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; max-height: 100%; overflow: auto; }
.cardqr-box h2 { margin: 0; font-size: 22px; }
.cardqr-box p { margin: 0; color: var(--muted); font-size: 15px; }
.cardqr-box .qr { width: min(280px, 60vh); }
.cardqr-box .qr svg { width: 100%; height: auto; display: block; }
.others-btn { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.card-btn { background: transparent; color: var(--ink); font-weight: 600; }
.cardqr .primary { background: #000; color: #fff; width: 100%; }
.bday.new { background: #F2F2F7; color: #48484A; font-weight: 600; }
.pair .warn.ios { max-width: 560px; background: #FFF4E5; color: #8A3D00; padding: 12px 16px; border-radius: 14px; text-align: left; line-height: 1.4; }

/* Resi, cambi e buoni */
.btn-plain { background: none; color: #0A64D6; font-weight: 600; font-size: 16px; padding: 6px 4px; align-self: flex-start; }
.vbtn { background: #EEF4FF; color: #0A4DB0; min-height: 52px; }
.cvouchers { display: flex; flex-direction: column; gap: 8px; }
.vchip { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #EEF4FF; color: #0A4DB0; border-radius: 14px; padding: 10px 14px; font-size: 17px; }
.reso-btn { background: var(--card); color: #000; border: 2px solid #000; }
.pay.two-col { grid-template-columns: 1fr 1fr; }
main.vdone .vcode { font-size: clamp(40px, 8vw, 64px); font-weight: 800; letter-spacing: .08em; background: #000; color: #fff; border-radius: 18px; padding: 8px 24px; }
main.vdone .qr { width: 180px; background: #fff; padding: 8px; border-radius: 12px; }
/* QR (per le fotocamere) e codice a barre (per le pistole 1D) affiancati, per non allungare la schermata. */
main.vdone .vcodes { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
main.vdone .bc { width: min(300px, 80vw); background: #fff; padding: 8px 4px; border-radius: 10px; }
main.vdone .bc svg { display: block; width: 100%; height: 64px; }
main.vdone .qr svg { width: 100%; height: auto; display: block; }
@media (orientation: landscape) and (max-height: 640px) {
  main.vdone { gap: 6px; font-size: 16px; }
  main.vdone .qr { width: 120px; }
  main.vdone .vcode { font-size: 38px; padding: 4px 16px; }
  main.vdone h1 { font-size: 24px; margin: 0; }
}
.sum .vlink { align-self: flex-end; padding: 0; margin-bottom: -4px; font-size: 15px; }
.cvouchers { gap: 2px; }
.cname-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cname-row .vlink { margin: 0; padding: 0 2px; font-size: 15px; white-space: nowrap; }
.cust.none .cname-row span { color: var(--muted); }
@media (orientation: landscape) and (max-height: 640px) {
  main.choice { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
  main.choice h1 { font-size: 24px; margin: 0; }
  main.choice .big { min-height: 120px; font-size: 24px; }
  main.choice .big svg { width: 40px; height: 40px; }
  main.choice p { margin: 0; }
  .reso-btn { min-height: 44px; font-size: 16px; }
}

/* Ultimo commesso che ha usato la cassa */
.person.last { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .85), 0 0 0 3px #000, 0 6px 20px rgba(0, 0, 0, .18); }

/* Fine vendita: promemoria per il registratore e resto */
.regbox { background: var(--card); border-radius: 16px; padding: 10px 16px; min-width: min(380px, 92vw); display: flex; flex-direction: column; gap: 4px; font-size: 17px; text-align: left; }
.regbox > div { display: flex; justify-content: space-between; gap: 14px; }
.regbox .regh { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.change { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 17px; }
.change .note { background: var(--card); border: 2px solid #000; border-radius: 12px; min-height: 48px; min-width: 72px; font-size: 18px; font-weight: 700; }
.change .note.on { background: #000; color: #fff; }
.change .resto { font-size: 24px; margin-left: 6px; }

/* Vendite di oggi e chiusura */
main.menu.today .tlist { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 17px; }
.trow:first-child { border-top: 0; }
.trow .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.trow i { font-style: normal; font-size: 14px; color: var(--muted); }
.trow.gone { opacity: .45; text-decoration: line-through; }
.trow.queued { background: #FFF8E6; }
.trow .nobtn { width: 70px; }
.trow .btn-plain { color: var(--red); min-width: 70px; }
main.menu.close .list .strong { font-weight: 800; }
main.menu.close .list.result { border: 2px solid #000; }
.list .ok { color: var(--green); }
.list .warn, .list .bad { color: var(--red); }
.closeform { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
.closeform label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 600; color: var(--muted); }
.closeform label i { font-style: normal; font-weight: 400; }
.closeform input, .closeform select { font: inherit; font-size: 20px; min-height: 52px; border-radius: 14px; border: 2px solid var(--line); padding: 0 14px; background: var(--card); color: #000; }
.closeform .wide { grid-column: 1 / -1; }
.closeform .primary { grid-column: 1 / -1; background: #000; color: #fff; }
.res.phone { background: #EEF4FF; }

/* Fine vendita su due colonne in orizzontale: a sinistra l'esito, a destra registratore e resto */
main.done.sold .dl, main.done.sold .dr { display: flex; flex-direction: column; align-items: center; gap: 10px; }
main.done.sold .dr { gap: 12px; }
@media (orientation: landscape) {
  main.done.sold { flex-direction: row; gap: 40px; }
  main.done.sold .dl { flex: 1 1 0; max-width: 520px; }
  main.done.sold .dr { flex: 1 1 0; max-width: 460px; }
}
@media (orientation: landscape) and (max-height: 640px) {
  main.done.sold { padding: 12px 20px; }
  main.done.sold .tick { width: 64px; height: 64px; }
  main.done.sold .tick svg { width: 38px; height: 38px; }
  main.done.sold h1 { font-size: 40px; margin: 0; }
  main.done.sold { font-size: 16px; }
  main.done.sold .primary { margin-top: 6px; min-height: 52px; }
  .regbox { font-size: 15px; padding: 8px 14px; gap: 2px; }
  .change .note { min-height: 42px; min-width: 60px; font-size: 16px; }
}
/* Menu della cassa: tasti meno alti */
main.menu .big { min-height: 84px; font-size: 21px; }
@media (orientation: landscape) and (max-height: 640px) {
  main.menu { padding-top: 12px; gap: 10px; }
  main.menu h1 { font-size: 22px; margin: 0; }
  main.menu .list > div { padding: 8px 16px; font-size: 15px; }
  main.menu .big { min-height: 60px; font-size: 18px; }
  main.menu .two { gap: 10px; }
}

/* ---------- Telefono (Giarre) ----------
   Lo schermo è basso: la pagina scorre, ma i tasti per incassare (o per chiudere) restano sempre in basso
   a portata di pollice. */
@media (max-width: 560px) {
  main.amount { padding-bottom: 0; }
  main.amount .pay { position: sticky; bottom: 0; z-index: 4; margin: auto -20px 0; padding: 10px 20px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); box-shadow: 0 -10px 20px rgba(0, 0, 0, .08); grid-template-columns: 1fr 1fr auto; gap: 8px; }
  main.amount .pay-btn { min-height: 58px; font-size: 19px; border-radius: 14px; }
  main.amount .pay-btn.mixed { grid-column: auto; min-height: 58px; padding: 0 14px; font-size: 16px; }
  main.amount .pay-btn.ok { grid-column: 1 / -1; }
  main.choice { padding: 16px; gap: 14px; justify-content: flex-start; }
  main.choice .big { min-height: 96px; font-size: 21px; gap: 8px; }
  main.choice .big svg { width: 30px; height: 30px; }
  main.choice h1 { font-size: 22px; text-align: center; }
  main.done { justify-content: flex-start; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); gap: 8px; }
  main.done h1 { font-size: 38px; }
  main.done > .primary, main.done .actions-bottom { position: fixed; left: 16px; right: 16px; bottom: calc(12px + env(safe-area-inset-bottom)); margin: 0; z-index: 4; }
  main.vdone .vcode { font-size: 34px; padding: 6px 16px; }
  main.vdone .qr, main.vdone svg.qr { max-width: 150px; }
  main.menu { padding: 16px; gap: 12px; }
  main.menu .big { min-height: 64px; font-size: 18px; }
}
@media (max-width: 420px) {
  main.staff { padding-top: 16px; gap: 14px; }
  main.staff .grid { gap: 10px; }
  .person { min-height: 78px; font-size: 21px; overflow-wrap: normal; word-break: normal; hyphens: manual; padding: 6px; }
  main.menu .list > div { padding: 10px 14px; font-size: 15px; }
  main.menu .big { min-height: 56px; }
}

/* ---- 1.4: più negozi, uscite dal cassetto, presenze, riposi, fondo cassa ---- */
.top .shop-switch { display: inline-flex; align-items: center; justify-content: center; gap: 4px; color: #fff; min-height: 44px; padding: 0 8px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.top .shop-switch svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; }
.pair .pair-cancel { background: transparent; color: #c7c7cc; text-decoration: underline; }
main.menu.profiles .plist, main.menu.presence .plist { display: flex; flex-direction: column; gap: 10px; }
.prof { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px 20px; font-size: 22px; }
.prof.on { border-color: #000; }
.prof i, .pname i { font-style: normal; font-size: 15px; color: var(--muted); }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--card); border-radius: 18px; padding: 12px 16px; }
.pname { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; font-size: 22px; min-width: 0; }
.pname .dot { width: 14px; height: 14px; border-radius: 50%; grid-row: span 2; }
.pbtns { display: flex; gap: 10px; }
.pbtns button { min-height: 60px; min-width: 120px; border-radius: 14px; font-size: 19px; font-weight: 800; background: var(--card); border: 2px solid #000; }
.pbtns button.go { background: #000; color: #fff; }
.pbtns button:disabled { opacity: .5; }
.pres-btn { align-self: center; }
.rests { align-self: center; background: #EEF4FF; color: #0A4DB0; border-radius: 14px; padding: 10px 16px; font-size: 17px; text-align: center; }
.exp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.exp-head h2 { margin: 0; font-size: 19px; }
.exp-add { background: var(--card); color: var(--ink); border: 2px solid #000; min-height: 48px; }
main.menu.close .tlist { display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; }
.exp-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.exp-form select, .exp-form input { font: inherit; font-size: 19px; min-height: 54px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--ink); }
.exp-form input:focus, .exp-form select:focus { outline: none; border-color: #000; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 99px; background: #F2F2F7; font-size: 16px; font-weight: 600; }
.chip.on { background: #000; color: #fff; }
.pay-btn:disabled { opacity: .45; }
.closeform .hint { margin: -4px 0 0; font-size: 15px; color: var(--muted); }
.closeform .hint b { color: var(--ink); }
span.bad { color: var(--red); font-weight: 600; }
main.menu .tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.tool { min-height: 56px; border-radius: 14px; background: var(--card); border: 2px solid #000; font-size: 17px; font-weight: 700; padding: 0 12px; }
.tool.danger { border-color: var(--red); color: var(--red); }
.top .shop-switch { flex: 1; min-width: 0; max-width: 60%; margin: 0 auto; }
.top .shop-switch span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .top .shop-switch { display: inline-flex; font-size: 15px; }
  main.expense .keypad button { min-height: 56px; font-size: 28px; }
  main.expense .display { font-size: 40px; padding: 12px 18px; }
}
/* Uscita dal cassetto su schermi bassi (tablet in orizzontale, computer piccoli): tutto in una schermata */
@media (max-height: 700px) and (min-width: 561px) {
  main.expense .exp-form { padding: 10px 14px; gap: 4px; }
  main.expense .exp-form label { gap: 4px; font-size: 15px; }
  main.expense .exp-form select, main.expense .exp-form input { min-height: 44px; font-size: 17px; }
  main.expense .chips { gap: 6px; }
  main.expense .chip { min-height: 36px; font-size: 15px; padding: 0 12px; }
  main.expense .right > .muted { display: none; }
}
/* Entrata/uscita su schermi bassi: righe più strette */
@media (max-height: 700px) {
  main.presence { gap: 10px; padding-top: 12px; }
  main.presence .prow { padding: 8px 12px; }
  main.presence .pbtns button { min-height: 48px; }
  main.presence > .muted { margin: 0; font-size: 15px; }
}
