/* Cantina Follie - Cassa.
   Due impaginazioni: "stretta" (tablet in verticale, telefono): una sezione alla volta;
   "larga" (>= 1000px: desktop, tablet in orizzontale): sezioni affiancate. */

@font-face { font-family: 'Figtree'; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-weight: 100 900; font-style: normal; font-display: swap; src: url(fonts/fraunces-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-weight: 100 900; font-style: italic; font-display: swap; src: url(fonts/fraunces-latin-wght-italic.woff2) format('woff2'); }

:root {
  --bg: #F3ECDF;
  --surface: #FBF8F2;
  --card: #FFFFFF;
  --chip: #EDE3D2;
  --line: #E2D7C4;
  --line-2: #CDBFA8;
  --ink: #2B201A;
  --muted: #6F6155;
  --muted-2: #7A6A5C;
  --accent: #7B2230;
  --accent-soft: #F8EBEC;
  --accent-soft-2: #E8C9CD;
  --accent-line: #C9A0A6;
  --slate: #3F5E7A;
  --ok: #2F6B3A;

  --st-libero: #5E8C5A;
  --st-aperto: #2F7F7A;
  --st-servizio: #7B2230;
  --st-consegnato: #C9892B;
  --st-preconto: #3F5E7A;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.25 var(--sans);
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}
input, textarea { -webkit-user-select: text; user-select: text; font: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:active { filter: brightness(.92); }
button:disabled { opacity: .4; }
[hidden] { display: none !important; }
.serif { font-family: var(--serif); }

#app { height: 100dvh; display: flex; flex-direction: column; margin: 0 auto; }

/* ---------- testata ---------- */
.hdr {
  flex: none; height: 72px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; padding-top: env(safe-area-inset-top);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.hdr .logo { height: 44px; width: auto; display: block; }
.hdr .spacer { flex: 1; }
.hdr .clock { text-align: right; line-height: 1.12; }
.hdr .clock b { display: block; font: 600 26px var(--serif); }
.hdr .clock span { font-size: 12px; color: var(--muted-2); text-transform: capitalize; }
.ibtn {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); flex: none;
}
.ibtn.brown { background: var(--accent); color: #fff; border-color: var(--accent); }
.ibtn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-back {
  height: 48px; padding: 0 16px 0 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  display: flex; align-items: center; gap: 4px; font-weight: 600; flex: none;
}
.btn-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ttl { font: 600 32px/1 var(--serif); white-space: nowrap; }
.pill { height: 30px; padding: 0 12px; border-radius: 15px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; }
.pill.st-libero { background: var(--st-libero); } .pill.st-aperto { background: var(--st-aperto); }
.pill.st-servizio { background: var(--st-servizio); } .pill.st-consegnato { background: var(--st-consegnato); color: #2B201A; }
.pill.st-preconto { background: var(--st-preconto); }

/* ---------- pannello tavoli ---------- */
.panel { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 20px; }
.chips { display: flex; gap: 8px; padding: 14px 20px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.fchip {
  flex: none; height: 44px; padding: 0 14px; border-radius: 22px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); white-space: nowrap;
}
.fchip i { width: 9px; height: 9px; border-radius: 5px; background: var(--c, #2B201A); display: block; }
.fchip b { opacity: .7; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip.on i { background: #fff; }

.floor { padding: 0 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; }
.tbtn {
  height: 92px; border-radius: 14px; padding: 9px 11px; text-align: left; border: 1px solid var(--bd, var(--line));
  background: var(--bg-t, var(--surface)); color: var(--fg, var(--ink));
  display: flex; flex-direction: column; justify-content: space-between; min-width: 0;
}
.tbtn .n { font: 600 28px/1 var(--serif); }
.tbtn .l { font-size: 12px; font-weight: 700; color: var(--sub, var(--muted)); }
.tbtn .m { font-size: 12px; font-weight: 600; margin-top: -3px; min-height: 14px; color: var(--sub, var(--muted)); }
.tbtn.st-libero { --bg-t: var(--surface); --bd: var(--line); --fg: var(--ink); --sub: #6F6155; }
.tbtn.st-aperto { --bg-t: #DCEDEA; --bd: #9CC7C1; --fg: #1F2D2B; --sub: #3E5C58; }
.tbtn.st-servizio { --bg-t: #7B2230; --bd: #7B2230; --fg: #fff; --sub: #F2D6DA; }
.tbtn.st-consegnato { --bg-t: #F6E4BE; --bd: #E0BE75; --fg: #2B201A; --sub: #6A5217; }
.tbtn.st-preconto { --bg-t: #3F5E7A; --bd: #3F5E7A; --fg: #fff; --sub: #D6E2EC; }
.tbtn.dim { opacity: .28; }

.summary {
  grid-column: 1 / -1; margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.kpi b { display: block; font: 600 28px/1 var(--serif); }
.kpi b small { font: 600 15px var(--sans); color: var(--muted-2); }
.kpi span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }
.todo { display: flex; flex-direction: column; gap: 8px; }
.todo button {
  display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); text-align: left;
}
.todo .b { width: 34px; height: 34px; border-radius: 9px; color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; background: var(--st-servizio); }
.todo .b.p { background: var(--st-preconto); }
.todo .w { flex: 1; font-size: 15px; font-weight: 600; }
.todo .t { font-size: 14px; font-weight: 600; color: var(--muted); }
.none { color: var(--muted-2); font-size: 14px; }

/* ---------- tavolo ---------- */
.tvbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.covers { flex: none; padding: 12px 20px 0; display: flex; align-items: center; gap: 6px; }
.covers .lab { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-2); width: 66px; flex: none; }
.covers .lab span + span { display: none; }
.chip {
  flex: 1 1 0; min-width: 0; height: 44px; padding: 0; border-radius: 10px; font-size: 16px; font-weight: 700;
  background: var(--card); border: 1px solid var(--line);
}
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.free .lw { display: none; }
.chip.free { flex: 0 0 56px; margin-left: 4px; border-color: var(--accent-line); color: var(--accent); }

.cats { flex: none; padding: 12px 20px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex: none; height: 48px; padding: 0 18px; border-radius: 24px; white-space: nowrap; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface);
}
.cat.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.center { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 20px; gap: 10px; }
.cscroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.ctitle { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctitle h2 { margin: 0; font: 600 26px var(--serif); }
.ctitle span { font-size: 13px; color: var(--muted-2); }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.abtn {
  min-height: 84px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); padding: 9px 12px;
  text-align: left; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; line-height: 1.2;
  font-size: 16px; font-weight: 600; word-break: break-word;
}
.abtn .pr { font-size: 15px; font-weight: 700; color: var(--accent); }
.abtn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.abtn.sel .pr { color: #F2D6DA; }
.abtn.opt { min-height: 60px; background: var(--surface); }
.abtn.opt.sel { background: var(--ink); border-color: var(--ink); }
.abtn.opt.sel .pr { color: #E2D7C4; }
.subtitle { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }

/* produttori + vini */
.viniwrap { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.prods { flex: none; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.prods::-webkit-scrollbar { display: none; }
.prod {
  flex: none; height: 46px; padding: 0 16px; border-radius: 23px; white-space: nowrap; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface);
}
.prod.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.vcol { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 6px; }
.wines { display: flex; flex-direction: column; gap: 8px; }
.wine {
  min-height: 68px; border-radius: 14px; padding: 8px 16px; display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--card);
}
.wine .wn { flex: 1; min-width: 0; font-size: 17px; font-weight: 600; }
.wine .wp { font: 600 22px var(--serif); }
.wine.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.wine small { display: block; font-size: 13px; font-weight: 500; margin-top: 2px; opacity: .8; }

/* editor riga */
.editor {
  flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px;
  box-shadow: 0 -2px 12px rgba(43, 32, 26, .06);
}
.editor input[type=text], .editor input.in {
  height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 12px; font-size: 16px; min-width: 0; width: 100%;
}
.editor .desc { font-weight: 700; }
.editor .e-row { display: grid; grid-template-columns: 1fr 108px; gap: 8px; grid-column: 1 / -1; }
.editor .qty { display: flex; align-items: center; gap: 4px; }
.qty button { width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 24px; font-weight: 500; }
.qty .qv { min-width: 40px; text-align: center; font: 600 24px var(--serif); }
.editor .go { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.btn { height: 52px; border-radius: 12px; font-size: 16px; font-weight: 700; padding: 0 18px; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.slate { background: var(--slate); border-color: var(--slate); color: #fff; }
.btn.ghost-r { border-color: var(--accent-line); color: var(--accent); }
.bdg { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: #fff; color: var(--accent); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

/* comanda */
.side { display: contents; }
.sheet {
  flex: none; height: 520px; display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; box-shadow: 0 -6px 24px rgba(43, 32, 26, .10);
}
.sheet.open { height: calc(100dvh - 72px - 60px); }
.sheet .grab { flex: none; display: flex; justify-content: center; padding-top: 8px; }
.sheet .grab i { width: 44px; height: 5px; border-radius: 3px; background: #D5C8B1; display: block; }
.sh-h { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 20px 8px; }
.sh-h b { font-size: 18px; }
.sh-h span { color: var(--muted); font-weight: 500; font-size: 14px; }
.sh-h button { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 600; }
.orders { flex: 1; min-height: 0; overflow-y: auto; padding: 0 20px; }
.empty { padding: 26px; text-align: center; color: var(--muted-2); }
.row { display: flex; gap: 12px; align-items: center; padding: 9px 20px; margin: 0 -20px; border-bottom: 1px solid #E8DECB; min-height: 58px; }
.row.new { background: var(--accent-soft); }
.row .q { min-width: 30px; height: 30px; border-radius: 8px; background: var(--chip); font-weight: 700; display: grid; place-items: center; flex: none; padding: 0 4px; }
.row.new .q { background: var(--accent-soft-2); }
.row .d { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.2; }
.row .d .o { display: block; font-size: 13px; font-weight: 400; color: var(--muted-2); margin-top: 2px; }
.row .d .n { display: block; font-size: 13px; font-weight: 400; font-style: italic; color: var(--muted-2); margin-top: 2px; }
.row .d .s { display: block; font-size: 12px; font-weight: 700; margin-top: 3px; color: var(--accent); }
.row.done .d .s { color: var(--ok); }
.row .p { font-size: 16px; font-weight: 700; flex: none; }
.row .chk {
  width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); flex: none;
  display: grid; place-items: center; color: transparent;
}
.row.done .chk { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sh-f { flex: none; padding: 12px 20px 16px; border-top: 1px solid var(--line); background: var(--card); }
.tots { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; }
.tots span { font-size: 14px; color: var(--muted); }
.tots b { font: 600 30px/1.05 var(--serif); }
.tots small { display: block; font-size: 13px; color: var(--accent); font-weight: 600; }
.acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.acts .wide2 { grid-column: 1 / -1; }
.acts .btn { padding: 0 12px; white-space: nowrap; }

/* ---------- modali ---------- */
.ov { position: fixed; inset: 0; background: rgba(43, 32, 26, .62); display: grid; place-items: center; padding: 14px; z-index: 50; }
.dlg { background: var(--surface); color: var(--ink); border-radius: 22px; width: min(94vw, 520px); max-height: 94dvh; overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.dlg.wide { width: min(96vw, 560px); }
.dlg h2 { margin: 0; padding: 18px 22px 6px; font: 600 24px/1.15 var(--serif); }
.dlg .bd { padding: 12px 22px; display: flex; flex-direction: column; gap: 12px; }
.dlg .ft { display: flex; gap: 10px; padding: 6px 22px 22px; }
.dlg .ft button { flex: 1; height: 54px; border-radius: 12px; font-size: 17px; font-weight: 700; background: var(--card); border: 1px solid var(--line); }
.dlg .ft .pri { background: var(--accent); border-color: var(--accent); color: #fff; }
.dlg .ft .dng { background: var(--card); border-color: var(--accent-line); color: var(--accent); }
.dlg label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 4px; }
.dlg input[type=text], .dlg input[type=number], .dlg input.in {
  width: 100%; height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; font-size: 19px; background: var(--card); color: var(--ink);
}
.dlg .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 56px; height: 52px; font-size: 28px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.stepper b { min-width: 48px; text-align: center; font: 600 28px var(--serif); }
.dlg label.switch { display: flex; color: var(--ink); margin: 0; font-size: 16px; }
.switch { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600; min-height: 48px; }
.switch input { width: 26px; height: 26px; accent-color: var(--accent); }
.note { color: var(--muted-2); font-size: 14px; }
.pctl { display: flex; flex-direction: column; gap: 12px; }
.pres { display: flex; gap: 8px; }
.pres button { flex: 1; height: 50px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 17px; font-weight: 700; }
.pres button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* scontrino */
.pre { background: var(--card); border-radius: 6px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(43, 32, 26, .10); font-size: 15px; }
.pre .hd { text-align: center; padding-bottom: 12px; border-bottom: 1px dashed var(--line-2); margin-bottom: 10px; }
.pre .hd b { display: block; font: italic 500 24px var(--serif); color: var(--accent); }
.pre .hd small { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); }
.pre .l { display: flex; gap: 10px; padding: 4px 0; line-height: 1.25; }
.pre .l .qq { width: 24px; text-align: right; flex: none; font-weight: 700; }
.pre .l .dd { flex: 1; }
.pre .l .oo { color: var(--muted-2); }
.pre .l .pp { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.pre .sum { border-top: 1px dashed var(--line-2); margin-top: 8px; padding-top: 8px; display: flex; justify-content: space-between; color: var(--muted); }
.pre .sum + .sum { border-top: 0; margin-top: 2px; padding-top: 2px; }
.pre .sum.sc { color: var(--accent); font-weight: 600; }
.pre .big { color: var(--ink); align-items: baseline; }
.pre .big b { font: 600 32px/1 var(--serif); }
.pre .big span { font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }

/* tastierino */
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad button { height: 64px; font: 600 26px var(--serif); border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.pad button.fn { background: var(--chip); font-size: 20px; }
.pad button.go { background: var(--accent); border-color: var(--accent); color: #fff; font-family: var(--sans); font-size: 20px; font-weight: 700; }
.pin { text-align: center; font-size: 34px; letter-spacing: 12px; min-height: 52px; color: var(--ink); }

/* login */
.login { flex: 1; display: grid; place-items: center; padding: 16px; }
.login .box { width: min(92vw, 380px); display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.login .logo { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.login .msg { min-height: 22px; text-align: center; color: var(--accent); font-size: 15px; font-weight: 600; }

/* menu servizio */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-list button { height: 56px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 17px; font-weight: 600; text-align: left; padding: 0 18px; }
.menu-list button.dng { border-color: var(--accent-line); color: var(--accent); }

/* toast e offline */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(43, 32, 26, .94); color: #fff; padding: 12px 20px; border-radius: 24px; font-size: 16px; font-weight: 600; transition: .2s; z-index: 80; max-width: 90vw; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--accent); }
#offline { position: fixed; top: 0; left: 0; right: 0; background: var(--accent); color: #fff; text-align: center; padding: 6px; z-index: 90; font-weight: 600; }

/* ---------- impaginazione larga: sezioni affiancate ---------- */
@media (min-width: 1000px) {
  .dlg.wide { width: min(96vw, 940px); }
  .dlg.wide .bd.preg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .hdr { padding-left: 24px; padding-right: 24px; }
  .chips { padding: 16px 24px; }
  .panel { padding-bottom: 20px; }
  .floor { padding: 0 24px; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; grid-auto-rows: 80px; }
  .tbtn { height: 80px; padding: 8px 12px; grid-column: var(--c); grid-row: var(--r); }
  .tbtn .n { font-size: 26px; }
  .summary { grid-column: 5 / 9; grid-row: 2 / span var(--sr, 6); margin: 0; padding: 22px 24px; gap: 18px; }
  .summary.free { grid-column: 1 / -1; grid-row: auto; }
  .kpi { padding: 14px 16px; } .kpi b { font-size: 38px; } .kpi span { font-size: 14px; }
  .todo button { height: 56px; } .todo .b { width: 38px; height: 38px; } .todo .w { font-size: 16px; }

  .tvbody { display: grid; grid-template-columns: 188px minmax(0, 1fr) 372px; grid-template-rows: minmax(0, 1fr); gap: 16px; padding: 16px; }
  .cats { flex-direction: column; overflow: hidden auto; padding: 0; gap: 6px; }
  .cat { height: 54px; border-radius: 12px; text-align: left; padding: 0 14px; border-color: transparent; background: var(--chip); }
  .cat.on { border-color: var(--accent); background: var(--accent); }
  .center { padding: 0; }
  .side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
  .covers { padding: 14px 14px 12px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .covers .lab { grid-column: 1 / -1; width: auto; display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 1.4px; }
  .covers .lab span + span { display: inline; }
  .chip.free { grid-column: span 2; flex: none; margin: 0; }
  .chip.free .lw { display: inline; }
  .sheet { flex: 1; min-height: 0; height: auto; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .sheet.open { height: auto; }
  .sheet .grab, .sh-h button { display: none; }
  .sh-h { padding: 12px 14px 6px; }
  .orders { padding: 0 14px; }
  .row { padding-left: 14px; padding-right: 14px; margin: 0 -14px; }
  .sh-f { padding: 12px 14px 14px; }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .viniwrap { flex-direction: row; gap: 12px; }
  .prods { flex-direction: column; overflow: hidden auto; width: 200px; flex: none; gap: 4px; }
  .prod { height: 46px; border-radius: 10px; text-align: left; border-color: transparent; background: var(--chip); }
  .prod.on { border-color: var(--accent); background: var(--accent); }
}
@media (max-width: 999px) {
  .sheet { height: 400px; }
  .abtn.opt { min-height: 52px; }
  .vcol .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .abtn { min-height: 76px; }
  .sh-f { display: flex; align-items: center; gap: 10px; padding: 12px 20px 18px; }
  .tots { margin: 0 auto 0 0; flex-direction: column; align-items: flex-start; gap: 0; }
  .acts { display: flex; gap: 8px; }
  .acts .btn { height: 56px; padding: 0 16px; }
  .viniwrap { overflow: hidden; }
  .covers { order: 1; } .cats { order: 2; } .center { order: 3; } .sheet { order: 4; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .floor { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ttl { font-size: 24px; }
  .hdr .clock { display: none; }
  .sheet { height: 440px; }
}
