/* =========================================================
   Helmet Shop – app styles
   Desktop (≥861px): normal website with top menu
   Phone  (≤860px): app look – header, bottom tabs, cards
   ========================================================= */
:root {
  --bg: #f3f4f6; --card: #fff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb;
  --brand: #111827; --accent: #f59e0b; --accent-soft: #fef3c7; --accent-ink: #111;
  --ok: #047857; --ok-soft: #d1fae5; --err: #b91c1c; --err-soft: #fee2e2;
  --radius: 14px; --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Kn", "Noto Sans Kannada", "Nirmala UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: #1d4ed8; }
h1, h2 { margin: 0 0 12px; } h2 { font-size: 18px; }
main { max-width: 1200px; margin: 0 auto; padding: 16px; }
.ic { width: 22px; height: 22px; flex: none; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 14px; background: var(--brand); color: #fff; padding: 0 16px;
  min-height: 56px; position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top, 0); }
.top .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; text-decoration: none; font-size: 17px; white-space: nowrap; min-width: 0; }
.top .brand img { width: 30px; height: 30px; border-radius: 8px; }
.top .brand span { overflow: hidden; text-overflow: ellipsis; }
.top .page-title { display: none; }
.gst-pill { font-size: 11px; font-weight: 700; letter-spacing: .4px; padding: 3px 8px; border-radius: 99px; background: #374151; color: #d1d5db; white-space: nowrap; }
.gst-pill.on { background: var(--ok-soft); color: var(--ok); }
.desk-nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.desk-nav a { color: #d1d5db; text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.desk-nav a:hover { color: #fff; background: #1f2937; }
.desk-nav a.on { color: var(--accent-ink); background: var(--accent); font-weight: 600; }

/* ---------- bottom tabs + sheet (phone only) ---------- */
.tabbar, .sheet, .sheet-bg, .paybar { display: none; }

/* ---------- common ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card.flush { padding: 4px 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.r { text-align: right; } .c { text-align: center; } .nowrap { white-space: nowrap; } .neg { color: var(--err); font-weight: 600; }
.flash { padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 500; }
.flash.err { background: var(--err-soft); color: var(--err); }
.tt-amt { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid #d1d5db; background: #fff; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { border-color: #9ca3af; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ghost { border-color: transparent; }
.btn.big { padding: 13px 20px; font-size: 16px; }
.chip { display: inline-block; padding: 6px 12px; border-radius: 99px; background: #f3f4f6; border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }
button.link { background: none; border: 0; padding: 4px; color: #1d4ed8; cursor: pointer; font: inherit; }
button.link.del { color: var(--err); font-size: 17px; }
form.inline { display: inline; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; }
label.chk { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
label.chk input { width: auto; }
input.num { width: 96px; text-align: right; padding: 7px 9px; }
input.qty { width: 64px; text-align: center; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 16px; }
.form-grid h2, .form-grid .wide { grid-column: 1 / -1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.toolbar .search { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 240px; flex-wrap: wrap; }
.toolbar .search input[name=q] { flex: 1; min-width: 160px; }
.filters { justify-content: flex-start; }
.filters label { min-width: 150px; flex: 1; }

/* tables */
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 10px 8px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; } .tbl th.c, .tbl td.c { text-align: center; }
.tbl tr.dim td { opacity: .5; }
.tbl td.act { white-space: nowrap; text-align: right; }

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px; transition: transform .1s; }
.tile:active { transform: scale(.97); }
.tile .ic { width: 28px; height: 28px; margin-bottom: 8px; color: var(--accent); }
.tile small { color: var(--muted); }
.tile.main { background: var(--brand); color: #fff; border-color: var(--brand); }
.tile.main small { color: #9ca3af; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; }
.stat span { color: var(--muted); font-size: 13px; } .stat b { font-size: 24px; } .stat small { color: var(--muted); }

/* billing / stock / labels */
.bill-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.bill-layout .card { margin-bottom: 0; min-width: 0; }
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 72px; }
.picker { margin-bottom: 12px; position: relative; }
.picker input { font-size: 17px; padding: 13px 14px; border-radius: 12px; background: #f9fafb; }
.picker.has-cam input { padding-right: 56px; }
.cam-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 44px; height: 40px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; }
.cam-btn svg { width: 22px; height: 22px; }
.pick-list { display: none; position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid #d1d5db; border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.14); z-index: 20; max-height: 340px; overflow-y: auto; }
.pick-list div { padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.pick-list div small { display: block; color: var(--muted); }
.pick-list div.on, .pick-list div:hover { background: var(--accent-soft); }

.cart-list { display: flex; flex-direction: column; gap: 10px; }
.ci { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-top small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ci-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ci-row .rate { flex-direction: row; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); }
.ci-row .amt { margin-left: auto; font-size: 16px; }
.step { display: inline-flex; border: 1px solid #d1d5db; border-radius: 10px; overflow: hidden; }
.step button { width: 38px; border: 0; background: #f3f4f6; font-size: 20px; cursor: pointer; color: var(--ink); }
.step input { width: 48px; border: 0; border-radius: 0; text-align: center; padding: 7px 0; -moz-appearance: textfield; }
.step input::-webkit-inner-spin-button { -webkit-appearance: none; }
.empty-cart { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; border: 2px dashed var(--line); border-radius: 12px; }
.empty-cart b { color: var(--ink); }
details.cust summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.cust[open] summary { margin-bottom: 8px; }
details.cust label { margin-bottom: 8px; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin: 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.totals .grand { font-size: 22px; font-weight: 800; }
.seg { display: flex; background: #f3f4f6; border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; width: 1px; }
.seg span { display: block; text-align: center; padding: 9px 0; cursor: pointer; border-radius: 9px; font-weight: 600; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.print-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.print-btns .btn { padding: 12px 0; }

/* camera overlay */
.cam-ov { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.cam-ov video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: relative; width: 78vw; max-width: 360px; height: 150px; border: 3px solid var(--accent); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
.cam-ov p { position: relative; margin-top: 18px; font-weight: 600; }
.cam-ov button { position: absolute; bottom: calc(30px + var(--safe-b)); padding: 12px 28px; border-radius: 99px; border: 0; background: #fff; font: inherit; font-weight: 700; }

/* settings */
.gst-card { display: flex; flex-direction: column; gap: 14px; border-width: 2px; }
.gst-card.is-on { border-color: var(--ok); background: linear-gradient(#fff, #f0fdf4); }
.switch-row { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; cursor: pointer; }
.switch-row b { font-size: 18px; display: block; }
.switch-row small { color: var(--muted); font-weight: 400; }
.switch { appearance: none; -webkit-appearance: none; width: 64px; height: 36px; border-radius: 99px; background: #d1d5db; position: relative; cursor: pointer;
  transition: background .2s; flex: none; border: 0; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(28px); }
.gst-card:not(.is-on) .gst-extra { display: none; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.thumb { width: 110px; font-weight: 400; font-size: 12px; }
.thumb img { width: 110px; height: 80px; object-fit: cover; border-radius: 10px; }
.thumb span { flex-direction: row; display: flex; align-items: center; gap: 4px; }
.thumb input { width: auto; }

/* login */
body.center { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--brand); }
.login { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login .logo { width: 56px; height: 56px; border-radius: 14px; }

/* =========================================================
   PHONE – app view
   ========================================================= */
@media (max-width: 860px) {
  body.app { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  main { padding: 12px; }
  input, select, textarea { font-size: 16px; }        /* stops iPhone zoom on focus */
  .desk-nav, .desk-only { display: none !important; }
  .top { min-height: 54px; gap: 10px; }
  .top .brand span { display: none; }
  .top .page-title { display: block; font-weight: 700; font-size: 18px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { border-radius: 16px; padding: 14px; margin-bottom: 12px; }
  .card.flush { padding: 0; background: transparent; border: 0; }
  h2 { font-size: 17px; }

  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
    height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; }
  .tabbar .on { color: var(--ink); }
  .tabbar .on .ti { background: var(--accent-soft); }
  .tabbar .ti { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 99px; }
  .tabbar .fab .ti { width: 52px; height: 52px; margin-top: -26px; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 6px 16px rgba(245,158,11,.45); border: 4px solid var(--bg); }
  .tabbar .fab .ic { width: 26px; height: 26px; }

  .sheet-bg { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sheet { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: #fff; border-radius: 20px 20px 0 0;
    padding: 8px 12px calc(16px + var(--safe-b)); transform: translateY(105%); transition: transform .25s ease; }
  .sheet-open .sheet { transform: none; }
  .sheet-open .sheet-bg { opacity: 1; pointer-events: auto; }
  .sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #d1d5db; margin: 4px auto 10px; }
  .sheet a { display: grid; grid-template-columns: 28px 1fr; column-gap: 12px; align-items: center; padding: 13px 8px; color: var(--ink);
    text-decoration: none; font-weight: 600; border-radius: 12px; }
  .sheet a:active { background: #f3f4f6; }
  .sheet a small { grid-column: 2; color: var(--muted); font-weight: 400; font-size: 12.5px; }
  .sheet a .ic { grid-row: span 2; color: var(--muted); }

  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { padding: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats .stat:first-child { grid-column: 1 / -1; }
  .stat b { font-size: 20px; }

  /* tables become cards */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody { display: block; }
  .tbl.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; background: #fff; border: 1px solid var(--line);
    border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
  .tbl.stack td { display: flex; flex-direction: column; border: 0; padding: 0; text-align: left !important; font-size: 14px; }
  .tbl.stack td[data-label]::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; }
  .tbl.stack td.tt { grid-column: 1 / -1; font-weight: 700; font-size: 15px; flex-direction: row; justify-content: space-between; gap: 8px; padding-right: 26px; }
  .tbl.stack td.tt small { font-weight: 400; }
  .tbl.stack td.act { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 6px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
  .tbl.stack td.x { position: absolute; top: 8px; right: 8px; }
  .tbl.stack td.muted { grid-column: 1 / -1; }
  .tbl.stack .tt-amt { display: inline; }
  .tbl.stack input.num { width: 100%; text-align: left; }

  .bill-layout { grid-template-columns: 1fr; gap: 12px; }
  .side { position: static; }
  .toolbar .search { min-width: 0; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters label:nth-child(3) { grid-column: 1 / -1; }

  /* sticky pay bar above the tabs on the billing screen */
  .paybar { display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; z-index: 35;
    bottom: calc(var(--tab-h) + var(--safe-b)); background: var(--brand); color: #fff; padding: 10px 14px; }
  .paybar div { display: flex; flex-direction: column; line-height: 1.15; }
  .paybar small { color: #9ca3af; } .paybar b { font-size: 22px; }
  .paybar .btn { margin-left: auto; padding: 12px 16px; }
  .bill-layout:has(.paybar) { padding-bottom: 70px; }
  .side .print-btns + .small { display: none; }
}
@media (max-width: 380px) {
  .tiles small { display: none; }
}

/* ---------- language switch ---------- */
.lang-sw { display: inline-flex; background: #1f2937; border-radius: 99px; padding: 3px; gap: 2px; flex: none; }
.lang-sw a { color: #d1d5db; text-decoration: none; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; line-height: 1.3; }
.lang-sw a.on { background: #fff; color: var(--ink); }
.lang-sw.big { background: #f3f4f6; padding: 4px; }
.lang-sw.big a { color: var(--ink); font-size: 16px; padding: 9px 22px; }
.lang-sw.big a.on { background: var(--brand); color: #fff; }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.login .lang-sw { background: #f3f4f6; } .login .lang-sw a { color: var(--ink); } .login .lang-sw a.on { background: var(--brand); color: #fff; }
.lang-kn h2, .lang-kn .page-title { line-height: 1.35; }
.lang-kn .tabbar a, .lang-kn .tabbar button { font-size: 10.5px; letter-spacing: -.1px; }
.lang-kn .tabbar span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }

/* ---------- printers ---------- */
.bt-status { font-size: 13.5px; font-weight: 600; align-self: center; }
.bt-status.ok { color: var(--ok); } .bt-status.err { color: var(--err); }
.bt-intro { background: var(--accent-soft); border-color: var(--accent); }
.bt-intro p { margin: 6px 0 0; }
.card h2 .ic { vertical-align: -4px; margin-right: 4px; color: var(--accent); }
.btn .ic { width: 18px; height: 18px; }
ul.help { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 6px; }
.bt-preview { background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; padding: 12px; border-radius: 12px; overflow-x: auto; min-height: 40px; }
.bt-preview canvas { display: block; margin: 0 auto; box-shadow: 0 2px 10px rgba(0,0,0,.15); max-width: 100%; height: auto; }
@media (max-width: 860px) {
  .top .lang-sw a { padding: 4px 8px; }
  .gst-pill { display: none; }
}
.lang-kn .tbl th, .lang-kn .tbl.stack td[data-label]::before { letter-spacing: 0; text-transform: none; }

/* direct Bluetooth printing */
.bt-bar { display: flex; align-items: center; gap: 8px; font-size: 13.5px; background: #f3f4f6; border-radius: 10px; padding: 8px 10px; }
.bt-bar #btName { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: #9ca3af; flex: none; }
.bt-bar .dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.done-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 45; background: var(--brand); color: #fff;
  border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px));
  box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.done-toast.ok b { color: #6ee7b7; } .done-toast.err b { color: #fca5a5; }
.done-toast .chip { background: #374151; color: #fff; border-color: #4b5563; }
button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 860px) { .done-toast { bottom: calc(var(--tab-h) + var(--safe-b) + 74px); } }

[hidden] { display: none !important; }

/* bill preview sheet */
.sheet-modal { position: fixed; inset: 0; z-index: 60; background: rgba(17,24,39,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sm-box { background: #fff; border-radius: 20px; width: min(460px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.sm-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 17px; }
.sm-head .link { font-size: 20px; color: var(--muted); }
.paper { overflow-y: auto; background: #eef0f3; padding: 18px; flex: 1; }
.paper canvas { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08); }
.sm-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; align-items: center; }
.sm-foot > .btn.primary { flex: 1; }
#pvDone { flex-direction: column; align-items: stretch; }
#pvDone .row { display: flex; gap: 8px; flex-wrap: wrap; }
#pvDone .row .primary { flex-basis: 100%; }
.done-msg { font-weight: 700; } .done-msg.ok { color: var(--ok); } .done-msg.err { color: var(--err); }
body.modal-open { overflow: hidden; }
.side .go { width: 100%; }
@media (max-width: 860px) {
  .sheet-modal { align-items: flex-end; padding: 0; }
  .sm-box { border-radius: 20px 20px 0 0; width: 100%; max-height: 92vh; padding-bottom: var(--safe-b); }
  .side .go { display: none; }
}

/* product / simple lists */
.plist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.pitem { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; color: inherit; text-decoration: none; }
.pitem.dim { opacity: .5; }
.pthumb { width: 52px; height: 52px; border-radius: 10px; background: #f3f4f6; display: grid; place-items: center; overflow: hidden; flex: none; color: #9ca3af; }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pinfo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pstock { text-align: center; min-width: 54px; display: flex; flex-direction: column; line-height: 1.1; }
.pstock b { font-size: 20px; } .pstock small { font-size: 11px; color: var(--muted); }
.pstock.low b { color: var(--err); }
.pact { display: flex; gap: 6px; }
@media (max-width: 520px) { .pitem { flex-wrap: wrap; } .pact { width: 100%; justify-content: flex-end; } }
.step.big button { width: 48px; font-size: 22px; }
.step.big input { width: 70px; font-size: 18px; font-weight: 700; }
label .step { align-self: flex-start; }
.photo-field { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-field img { width: 84px; height: 84px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.photo-field label:not(.chk) { flex: 1; min-width: 220px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
@media (max-width: 860px) {
  .toolbar .search { flex-wrap: nowrap; width: 100%; }
  .toolbar .search input[name=q] { min-width: 0; }
  .toolbar > .btn.primary { width: 100%; }
}
/* bill size switch */
.size-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg2 { display: inline-flex; background: #f1f2f4; border-radius: 12px; padding: 4px; }
.seg2 button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; padding: 8px 13px; border-radius: 9px; color: #6b7280; cursor: pointer; }
.seg2 button.on { background: #111827; color: #fff; }
.pv-size { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.pv-size .bt-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid #e5e7eb; background: #fff; border-radius: 99px;
  padding: 6px 12px 6px 10px; font: inherit; font-size: 13px; font-weight: 700; color: #374151; cursor: pointer; }
.pv-size .bt-badge .dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; }
.pv-size .bt-badge.connected { border-color: #16a34a; color: #15803d; background: #f0fdf4; }
.pv-size .bt-badge.connected .dot { background: #16a34a; }
.pv-size .bt-badge.connecting .dot { background: #f59e0b; }
.pv-size .bt-badge[hidden] { display: none; }
.paper canvas { width: auto; max-width: min(100%, 290px); }
.top .ver { font-size: 11px; color: #6b7280; font-weight: 600; }
