/* Layout: left rail + work area on PC; bottom tab bar on phones. Sell screen = catalog | ticket. */
:root {
  /* Pleine de Vie: the logo's gold on white, with the angel's blush as the second color */
  --bg: #f8f6f2; --surface: #ffffff; --surface-2: #f3efe7; --ink: #2a2318; --muted: #7a6f5f; --line: #e9e2d5;
  --accent: #8f6a26; --accent-soft: #f6eedd; --accent-ink: #ffffff; --gold: #b5893a; --sun: #e3a48e; --sun-soft: #fbe9e3;
  --danger: #b8453c; --danger-soft: #f8e1df; --ok: #2f7d4f; --warn: #a8701a;
  --font-head: 'Outfit', 'Segoe UI', system-ui, sans-serif; --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --r: 10px; --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 4px 16px rgba(60, 45, 20, .07);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #14110c; --surface: #1d1913; --surface-2: #26211a; --ink: #f0e9dc; --muted: #a99c87; --line: #332c22;
  --accent: #d6aa58; --accent-soft: #3a2f1c; --accent-ink: #1b1408; --gold: #d6aa58; --sun: #e7a993; --sun-soft: #3d2620;
  --danger: #ef7d76; --danger-soft: #3d1d1b; --ok: #6fcf97; --warn: #e6b45a; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #14110c; --surface: #1d1913; --surface-2: #26211a; --ink: #f0e9dc; --muted: #a99c87; --line: #332c22;
  --accent: #d6aa58; --accent-soft: #3a2f1c; --accent-ink: #1b1408; --gold: #d6aa58; --sun: #e7a993; --sun-soft: #3d2620;
  --danger: #ef7d76; --danger-soft: #3d1d1b; --ok: #6fcf97; --warn: #e6b45a; --shadow: 0 1px 2px rgba(0,0,0,.4); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.num, td.n, .money { font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* shell */
#app { display: grid; grid-template-columns: 216px 1fr; height: 100%; }
.rail { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 10px; gap: 2px; overflow-y: auto; }
.brand { display: grid; gap: 2px; padding: 0 8px 14px; }
.brand .small { padding-left: 4px; letter-spacing: .08em; text-transform: uppercase; font-size: 10.5px; }
.brand-logo { display: block; width: 100%; max-width: 180px; height: auto; }
.brand-mark { width: 30px; height: auto; flex: none; }
.brand b { font-family: var(--font-head); font-size: 16px; display: block; line-height: 1.1; }
.nav-btn { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.nav-btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:hover { background: var(--surface-2); }
.nav-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.rail-foot { margin-top: auto; padding: 10px 8px 0; display: grid; gap: 6px; }
.main { min-width: 0; overflow-y: auto; display: flex; flex-direction: column; }
.page { padding: 20px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; align-content: start; max-width: 1400px; width: 100%; }
.page > *, #rb > *, #body > *, .grid2 > *, .grid3 > *, .grid4 > *, .stats > * { min-width: 0; }
.show-sm { display: none; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin-right: auto; }
.tabbar { display: none; }
.demo-band { background: var(--sun-soft); color: var(--ink); font-size: 12.5px; padding: 7px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; white-space: nowrap; min-height: 38px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 52px; font-size: 16px; padding: 12px 18px; border-radius: 10px; }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); font-weight: 500; }
.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
.in:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.in { min-height: 70px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chip { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-size: 13px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 12px; cursor: pointer; font-size: 13px; }
.seg button.on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* panels & tables */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.panel-b { padding: 16px; }
.tw { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.n, .t th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover { background: var(--surface-2); }
.t tfoot td { font-weight: 600; border-top: 2px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill.sun { background: var(--sun-soft); color: #a3503a; }
:root[data-theme="dark"] .pill.sun { color: var(--sun); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.sun { color: var(--sun); } }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; }
.stat .v { font-family: var(--font-head); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.hl { background: linear-gradient(135deg, var(--accent), var(--gold)); color: var(--accent-ink); border-color: var(--accent); }
.stat.hl .label, .stat.hl .s { color: inherit; opacity: .85; }

/* P&L statement */
.pl { display: grid; gap: 0; font-variant-numeric: tabular-nums; }
.pl div { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--line); gap: 12px; }
.pl div.sub { padding-left: 14px; color: var(--muted); font-size: 13px; }
.pl div.tot { font-weight: 700; border-bottom: 2px solid var(--ink); border-top: 1px solid var(--line); }
.pl div.big { font-family: var(--font-head); font-size: 18px; border-bottom: 0; }

/* charts */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
.chart .bar { fill: var(--accent); }
.chart .bar2 { fill: var(--sun); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.hbar { display: grid; grid-template-columns: minmax(90px, 1.2fr) 3fr auto; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; }
.hbar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* SELL screen */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 380px; height: 100%; min-height: 0; }
.catalog { min-width: 0; display: flex; flex-direction: column; min-height: 0; padding: 14px max(16px, env(safe-area-inset-left, 0px)) 14px 16px; gap: 12px; }
.scanbar { display: flex; gap: 8px; flex: none; }
.catalog > .chips { flex: none; }
.scanbar .in { min-height: 46px; font-size: 15px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; gap: 10px; overflow-y: auto; align-content: start; padding-bottom: 12px; min-height: 0; flex: 1 1 0; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0; cursor: pointer; text-align: left; overflow: hidden; display: flex; flex-direction: column; }
.pcard:hover { border-color: var(--accent); }
.pcard .img { aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); overflow: hidden; }
.pcard .img svg, .thumb svg { display: block; width: 100%; height: 100%; }
.pcard .img img { width: 100%; height: 100%; object-fit: cover; }
.pcard .meta { padding: 8px 10px 10px; display: grid; gap: 2px; }
.pcard .nm { font-weight: 600; font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pcard .pr { display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }
.pcard .pr b { font-size: 14px; }
.pcard s { color: var(--muted); font-size: 11.5px; }
.thumb { width: 40px; height: 40px; border-radius: 8px; background: var(--surface-2); flex: none; overflow: hidden; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ticket { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ticket-h { padding: 12px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.lines { overflow-y: auto; flex: 1; min-height: 80px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.line .nm { font-weight: 600; font-size: 13.5px; }
.line .vt { font-size: 12px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty button { width: 30px; height: 30px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 16px; }
.qty span { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.totals { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; font-variant-numeric: tabular-nums; }
.totals .r { display: flex; justify-content: space-between; }
.totals .grand { font-family: var(--font-head); font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.totals .lbp { color: var(--muted); font-size: 13px; text-align: right; }
.ticket-f { padding: 0 16px 16px; display: grid; gap: 8px; }
.cart-fab { display: none; }

/* variant picker */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.vbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 8px; cursor: pointer; display: grid; gap: 2px; text-align: center; }
.vbtn:hover { border-color: var(--accent); }
.vbtn b { font-size: 14px; }
.vbtn .s { font-size: 11.5px; color: var(--muted); }
.vbtn.out { opacity: .45; }

/* payment */
.paygrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.paybtn { border: 1px solid var(--line); background: var(--surface); padding: 12px 6px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.paybtn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.due { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); font-variant-numeric: tabular-nums; flex-wrap: wrap; gap: 8px; }
.due b { font-family: var(--font-head); font-size: 28px; }
.keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.keypad button { min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; }

/* modal & toast */
.scrim { position: fixed; inset: 0; background: rgba(10, 20, 16, .45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 14px; width: min(640px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); min-height: 0; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(1000px, 100%); }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h2 { margin-right: auto; }
.modal-b { padding: 18px; overflow-y: auto; display: grid; gap: 14px; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); width: 36px; height: 36px; border-radius: 8px; }
.x:hover { background: var(--surface-2); }
#toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 60; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; font-size: 13.5px; }
.toast.bad { background: var(--danger); color: #fff; }

/* login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.login-card { width: min(420px, 100%); display: grid; gap: 18px; }
.login-card .brand { justify-items: center; padding: 0; }
.login-card .brand-logo { max-width: 300px; }
.who { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.who button { padding: 14px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; gap: 2px; }
.who button.on { border-color: var(--accent); background: var(--accent-soft); }
.pin-dots { display: flex; gap: 12px; justify-content: center; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots i.f { background: var(--accent); border-color: var(--accent); }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad button { min-height: 58px; font-size: 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }

/* variant editor */
.vtable .in { min-height: 32px; padding: 4px 8px; }
.vtable td { padding: 5px 6px; }
.optbox { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.tick { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; cursor: pointer; font-size: 13px; user-select: none; }
.tick input { margin: 0; accent-color: var(--accent); }
.tick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.imgs { display: flex; gap: 8px; flex-wrap: wrap; }
.imgs .im { width: 84px; height: 84px; border-radius: 8px; overflow: hidden; position: relative; background: var(--surface-2); }
.imgs .im img { width: 100%; height: 100%; object-fit: cover; }
.imgs .im button { position: absolute; top: 2px; right: 2px; border: 0; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; cursor: pointer; width: 22px; height: 22px; }

/* receipt & labels (also used for printing) */
.receipt { width: 300px; max-width: 100%; margin: 0 auto; background: #fff; color: #000; padding: 16px 14px; font: 12.5px/1.4 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; border: 1px dashed #bbb; }
.receipt h3 { text-align: center; font: 700 17px var(--font-head); color: #000; }
.receipt .rlogo { display: block; width: 70%; margin: 0 auto 4px; filter: grayscale(1) contrast(1.6); }
.shiplabel .rlogo { height: 28px; width: auto; filter: grayscale(1) contrast(1.6); }
.receipt .c { text-align: center; }
.receipt .r { display: flex; justify-content: space-between; gap: 8px; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 8px 0; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, 50mm); gap: 3mm; }
.tag { width: 50mm; height: 30mm; border: 1px dashed #bbb; background: #fff; color: #000; padding: 2mm 3mm; display: grid; grid-template-rows: auto auto 1fr auto; font: 9px/1.2 var(--font-body); overflow: hidden; }
.tag .sh { font: 700 8px var(--font-head); text-transform: uppercase; letter-spacing: .08em; }
.tag .tn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag .tp { display: flex; justify-content: space-between; align-items: baseline; }
.tag .tp b { font: 700 13px var(--font-head); }
.shiplabel { width: 100mm; max-width: 100%; border: 2px solid #000; background: #fff; color: #000; padding: 12px; font: 13px/1.4 var(--font-body); display: grid; gap: 6px; }
.shiplabel .big { font: 700 20px var(--font-head); }
#print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { display: block !important; position: absolute; inset: 0; }
  .receipt { border: 0; width: 72mm; padding: 0; }
  .tag { border: 0; page-break-inside: avoid; }
  @page { margin: 4mm; }
}

/* phones */
@media (max-width: 860px) {
  #app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--surface); border-top: 1px solid var(--line); padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px)); }
  .tabbar button { border: 0; background: none; display: grid; justify-items: center; gap: 2px; padding: 6px 2px; font-size: 10.5px; color: var(--muted); cursor: pointer; }
  .tabbar button.on { color: var(--accent); font-weight: 600; }
  .tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .sell { grid-template-columns: 1fr; }
  .ticket { position: fixed; inset: 0; z-index: 40; border: 0; transform: translateY(100%); transition: transform .2s; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ticket.open { transform: none; }
  .cart-fab { display: flex; position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 30; justify-content: space-between; align-items: center; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow); cursor: pointer; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding-bottom: 80px; }
  .grid3, .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .paygrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scrim { padding: 0; align-items: end; }
  .modal, .modal.wide { width: 100%; border-radius: 14px 14px 0 0; max-height: 94vh; max-height: 94dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .hide-sm { display: none !important; }
  #toasts { bottom: calc(132px + env(safe-area-inset-bottom, 0px)); left: max(16px, env(safe-area-inset-left, 0px)); }
  .toast { max-width: none; }
  .page-head h1 { width: 100%; }
  /* orders become cards on phones */
  .orders-t thead, .orders-t .c-sel, .orders-t .c-items { display: none; }
  .orders-t tbody tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "num total" "cust st" "date date" "pay pay"; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .orders-t tbody td { border: 0; padding: 0; }
  .orders-t .c-num { grid-area: num; } .orders-t .c-total { grid-area: total; text-align: right; }
  .orders-t .c-cust { grid-area: cust; } .orders-t .c-st { grid-area: st; text-align: right; }
  .orders-t .c-date { grid-area: date; color: var(--muted); font-size: 12.5px; }
  .show-sm { display: inline; }
  .orders-t .c-ch { display: none; }
  .orders-t .c-pay { grid-area: pay; color: var(--muted); }
  .orders-t tbody tr td.empty { grid-column: 1 / -1; }
  .orders-t tfoot tr { display: flex; justify-content: space-between; padding: 10px 12px; }
  .orders-t tfoot td { border: 0; padding: 0; }
}
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
@media (min-width: 861px) { .ticket-close { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.panel, .grid2 > * > *, .grid3 > * > * { min-width: 0; }
