/* POS Lite demo (Skillkraft). Light and calm: warm sand paper, white cards, lagoon teal for actions, one coral accent.
   No government colours, seals or logos. Big touch targets (48 px and up). No inline styles anywhere (strict CSP on
   Labs): data-driven sizes are custom properties set through the CSSOM. */
:root {
  color-scheme: light;
  --paper: #f8f4ec;
  --surface: #ffffff;
  --surface-2: #fbf9f4;
  --hover: #eef5f3;
  --ink: #1d2523;
  --ink-2: #36423f;
  --muted: #5a6662;
  --line: #e6e1d6;
  --line-2: #cfd8d3;
  --accent: #0f6b6b;
  --accent-2: #0a5252;
  --accent-soft: #dff0ec;
  --coral: #e8774a;
  --coral-ink: #9c3f17;
  --coral-soft: #fdebe2;
  --ok: #1b6642;
  --ok-soft: #e3f2e8;
  --warn: #8a4b0c;
  --warn-soft: #fdf0dc;
  --bad: #a33219;
  --bad-soft: #fbe5df;
  --banner-bg: #1e2a28;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 37, 35, 0.05), 0 6px 18px rgba(29, 37, 35, 0.06);
  --tabbar-h: 0px;
}
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/instrument-sans-var-latin.woff2") format("woff2"); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; font-weight: 650; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; margin-bottom: 10px; }
p { margin: 0 0 8px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-2); }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-xs { width: 13px; height: 13px; }
.ic-sm { width: 16px; height: 16px; vertical-align: -3px; }
.ic-lg { width: 28px; height: 28px; }
.ic-xl { width: 40px; height: 40px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ok-t { color: var(--ok); }
.warn-t { color: var(--warn); }
.bad-t { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; box-shadow: var(--shadow); }
.skip:focus { top: 8px; }
.noscript { padding: 24px; }
.eyebrow { font-size: 13px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--coral-ink); margin-bottom: 6px; }
.print-only, .print-area { display: none; }

/* ---------- honesty banner (always visible) ---------- */
.demo-banner { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 16px; background: var(--banner-bg); color: #f2f6f5; font-size: 14px; line-height: 1.35; text-align: center; }
.demo-banner b { font-weight: 650; }
.demo-tag { flex: none; padding: 1px 8px; border-radius: 999px; background: #f6d3bf; color: #4a1f0a; font-size: 12px; font-weight: 650; letter-spacing: 0.03em; text-transform: uppercase; }
.banner-fiction { color: #c4d2cf; }

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar1 { display: flex; align-items: center; gap: 12px; max-width: 1280px; margin: 0 auto; padding: 10px 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
.mark { width: 40px; height: 40px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.mark-ic { width: 22px; height: 22px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; }
.brand-t b { font-size: 19px; letter-spacing: -0.015em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.shop-pick { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); color: var(--muted); min-width: 0; }
.select { border: 0; background: transparent; min-height: 44px; padding: 0 6px; font-weight: 600; color: var(--ink); max-width: 100%; }
.status { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pill:hover { background: var(--hover); color: var(--ink); }
.pill-sync.is-ok { background: var(--ok-soft); border-color: #bfdcc9; color: var(--ok); }
.pill-sync.is-wait { background: var(--accent-soft); border-color: #b8d9d2; color: var(--accent-2); }
.pill-sync.is-off { background: var(--warn-soft); border-color: #ecd2a8; color: var(--warn); }
.pill-sync.is-syncing { background: var(--accent-soft); color: var(--accent-2); }
.pill-sync.is-syncing .ic { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* ---------- tabs: top row on wide screens, bottom bar on phones ---------- */
.tabbar { background: var(--surface); border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.tabs { display: flex; gap: 2px; list-style: none; margin: 0 auto; padding: 0 16px; max-width: 1280px; overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 14px; border: 0; background: none; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; white-space: nowrap; position: relative; }
.tab:hover { color: var(--accent-2); background: var(--hover); }
.tab[aria-current="page"], .tab.is-current { color: var(--accent-2); border-bottom-color: var(--accent); }
.tab-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--coral); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.tab-more-li { display: none; }
.more-menu { position: absolute; right: 12px; bottom: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 230px; display: flex; flex-direction: column; }
.more-a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.more-a:hover, .more-a[aria-current="page"] { background: var(--hover); color: var(--accent-2); }

/* ---------- layout ---------- */
main { outline: none; }
.view { max-width: 1280px; margin: 0 auto; padding: 22px 24px 40px; }
.page { display: flex; flex-direction: column; gap: 16px; }
.view-head { margin-bottom: 4px; }
.report { display: flex; flex-direction: column; gap: 16px; }
.view-head p { margin: 4px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); min-width: 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.empty { padding: 30px 10px; text-align: center; color: var(--muted); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-2); }
.alert p { margin: 0; }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.bullets { margin: 0; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.log li { padding: 8px 0; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.log li:first-child { border-top: 0; }

/* ---------- buttons, inputs, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.btn-big { min-height: 54px; padding: 0 16px; font-size: 16px; }
.btn-xl { min-height: 60px; padding: 0 20px; font-size: 18px; border-radius: 14px; }
.btn-wide { width: 100%; }
.btn-wa { border-color: #b7dcc5; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: none; }
.icon-btn:hover { background: var(--hover); }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; min-height: 44px; }
.input { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.input:focus { border-color: var(--accent); }
.input-xl { min-height: 60px; font-size: 24px; font-weight: 650; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.form { display: flex; flex-direction: column; gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: 15px; }
.chip-btn:hover { background: var(--hover); }
.chip-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.chip-soft { background: #eef0ec; color: var(--ink-2); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: #ece8de; gap: 2px; flex-wrap: wrap; }
.seg-btn { min-height: 42px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--accent-2); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }

/* ---------- sell ---------- */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.sell-tools { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.sell-tools .input { max-width: 420px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile-wrap { display: flex; }
.tile { position: relative; width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 10px 12px; min-height: 210px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; box-shadow: var(--shadow); transition: transform 0.08s ease, border-color 0.12s ease; }
.tile:hover { border-color: var(--accent-mid, #8cc3ba); }
.tile:active { transform: scale(0.98); }
.tile:disabled { opacity: 0.55; cursor: not-allowed; }
.tile-on { border-color: var(--accent); background: #f6fbfa; }
.tile-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; display: block; margin-bottom: 4px; }
.tile-name { font-weight: 650; font-size: 15.5px; line-height: 1.25; }
.tile-price { font-size: 19px; font-weight: 700; color: var(--accent-2); font-variant-numeric: tabular-nums; }
.tile-count { position: absolute; top: 6px; right: 6px; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px; background: var(--coral); color: #fff; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(232, 119, 74, 0.4); }
.cart-panel { position: sticky; top: 46px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.cart-h { margin: 0; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 0; color: var(--muted); text-align: center; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "img t sum" "img qty qty"; gap: 4px 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.cart-img { grid-area: img; width: 44px; height: 44px; border-radius: 8px; }
.cart-t { grid-area: t; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.cart-t span { font-size: 13px; }
.cart-sum { grid-area: sum; }
.qty { grid-area: qty; display: flex; align-items: center; gap: 6px; }
.qty-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); display: grid; place-items: center; }
.qty-btn:hover { background: var(--hover); }
.qty-n { min-width: 30px; text-align: center; font-weight: 700; font-size: 18px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; margin: 4px 0; }
.cart-total b { font-size: 30px; font-variant-numeric: tabular-nums; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clear-cart { align-self: center; }
.cart-bar { display: none; }
.cart-sheet { display: flex; flex-direction: column; gap: 12px; }

/* ---------- payment, receipt ---------- */
.pay { display: flex; flex-direction: column; gap: 14px; }
.quick-cash { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.change { font-size: 22px; margin: 0; }
.change b { font-size: 30px; color: var(--ok); }
.saved-note { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.rc-dialog { display: flex; flex-direction: column; gap: 12px; }
.receipt { background: #fffefb; border: 1px dashed var(--line-2); border-radius: 10px; padding: 16px 18px; font-size: 15px; max-width: 380px; width: 100%; margin: 0 auto; }
.rc-shop { text-align: center; font-weight: 700; font-size: 18px; margin: 0; }
.rc-sub { text-align: center; color: var(--muted); margin: 0; font-size: 14px; }
.rc-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; color: var(--muted); border-top: 1px dashed var(--line-2); margin-top: 10px; padding-top: 8px; flex-wrap: wrap; }
.rc-lines { width: 100%; border-collapse: collapse; margin: 6px 0; }
.rc-lines td { padding: 3px 0; vertical-align: top; }
.rc-total { display: flex; justify-content: space-between; border-top: 1px dashed var(--line-2); padding-top: 8px; font-size: 18px; margin: 0; }
.rc-pay { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.rc-thanks { text-align: center; margin: 10px 0 0; font-weight: 600; }
.rc-sync { text-align: center; font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.share { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }

/* ---------- lists: stock, receipts, catalogue ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; box-shadow: var(--shadow); min-width: 0; }
.kpi-l { font-size: 13.5px; color: var(--muted); }
.kpi-v { font-size: 24px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.kpi-main { background: var(--accent); border-color: var(--accent); }
.kpi-main .kpi-l, .kpi-main .kpi-v { color: #fff; }
.kpi-warn .kpi-v { color: var(--warn); }
.kpi-bad .kpi-v { color: var(--bad); }
.kpi-ok .kpi-v { color: var(--ok); }
.kpi-muted .kpi-v { color: var(--muted); font-size: 17px; }
.stock-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stock-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 80px 92px 92px; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); }
.stock-row:first-child { border-top: 0; }
.stock-row.st-low, .stock-row.st-out { background: #fffaf2; }
.stock-img { width: 52px; height: 52px; border-radius: 10px; }
.stock-t { display: flex; flex-direction: column; min-width: 0; }
.stock-n { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.stock-n b { font-size: 24px; }
.rc-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.rc-list li + li { border-top: 1px solid var(--line); }
.rc-row { width: 100%; display: grid; grid-template-columns: 76px 120px minmax(0, 1fr) auto 28px 84px; gap: 12px; align-items: center; min-height: 58px; padding: 8px 14px; border: 0; background: none; text-align: left; }
.rc-row:hover { background: var(--hover); }
.rc-no { font-weight: 700; font-variant-numeric: tabular-nums; }
.rc-items { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.sync-dot { color: var(--muted); display: grid; place-items: center; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.cat-card > .btn { grid-column: 1 / -1; }
.cat-img { width: 76px; height: 76px; border-radius: 12px; }
.cat-t { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.cat-price { font-weight: 700; }
.pic-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; }
.pic-big { width: 120px; height: 120px; border-radius: 14px; border: 1px solid var(--line); }
.pic-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.pic-opt { padding: 2px; border-radius: 10px; border: 2px solid transparent; background: none; min-height: 48px; }
.pic-opt img { width: 100%; height: auto; border-radius: 8px; display: block; }
.pic-opt[aria-checked="true"] { border-color: var(--accent); }
.locked { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 50px 20px; color: var(--muted); }
.locked h1 { color: var(--ink); }

/* ---------- reports ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl thead th { border-top: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tbody th { font-weight: 500; }
.r-strong th, .r-strong td { font-weight: 700; }
.r-good th, .r-good td { font-weight: 700; color: var(--ok); background: var(--ok-soft); }
.r-bad th, .r-bad td { font-weight: 700; color: var(--bad); background: var(--bad-soft); }
.tbl-req td { font-size: 14.5px; }
.bar { display: block; height: 6px; background: #eef0ec; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: var(--w, 0%); background: var(--accent); border-radius: 3px; }
.chart { margin: 0; }
.bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 220px; }
.bars-many { gap: 2px; }
.bcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.btrack { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.vbar-fill { display: block; width: 72%; max-width: 44px; height: var(--h, 0%); min-height: 2px; background: linear-gradient(180deg, var(--accent) 0%, #2f8f86 100%); border-radius: 6px 6px 2px 2px; }
.bcol-future .vbar-fill { background: #e3e7e2; }
.bval { font-size: 11.5px; color: var(--muted); height: 16px; white-space: nowrap; }
.blabel { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.bars-many .bval { display: none; }
.bars-many .blabel { font-size: 10px; }
.owed { list-style: none; margin: 0 0 4px; padding: 0; }
.owed li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.owed li:first-child { border-top: 0; }
.grt { border-left: 4px solid var(--coral); }
.diff { font-size: 20px; font-weight: 650; margin: 4px 0; }
.denoms summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent-2); }
.denom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.denom { display: grid; grid-template-columns: 44px 1fr; gap: 6px; align-items: center; font-weight: 600; }

/* ---------- switch user, sync ---------- */
.user-box { display: flex; flex-direction: column; gap: 12px; }
.roles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); text-align: left; min-height: 110px; }
.role-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.pin { text-align: center; letter-spacing: 0.4em; max-width: 220px; align-self: center; }
.pinpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; justify-content: center; }
.pin-k { height: 60px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 22px; font-weight: 650; }
.pin-k:hover { background: var(--hover); }
.switch { display: inline-flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 52px; height: 30px; margin: 0; cursor: pointer; }
.switch-k { width: 52px; height: 30px; border-radius: 15px; background: #cfd5d1; position: relative; flex: none; transition: background 0.15s; }
.switch-k::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked + .switch-k { background: var(--warn); }
.switch input:checked + .switch-k::after { transform: translateX(22px); }
.switch input:focus-visible + .switch-k { outline: 3px solid var(--coral); outline-offset: 2px; }

/* ---------- Digital Village (website look) ---------- */
.village { display: flex; flex-direction: column; gap: 18px; }
.v-hero { background: linear-gradient(135deg, #fdf3e7 0%, #e7f3ef 100%); border: 1px solid var(--line); border-radius: 22px; padding: 34px 32px; }
.v-hero h1 { font-size: 34px; max-width: 760px; letter-spacing: -0.02em; }
.v-lede { font-size: 18px; color: var(--ink-2); max-width: 680px; margin-top: 10px; }
.v-note { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); background: rgba(255, 255, 255, 0.7); padding: 6px 10px; border-radius: 10px; margin: 6px 0 0; }
.v-shop { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.v-shop-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.v-shop h2 { font-size: 22px; margin-bottom: 2px; }
.v-story { color: var(--ink-2); max-width: 760px; margin: 10px 0 14px; }
.v-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.v-card { display: flex; flex-direction: column; gap: 3px; }
.v-img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; margin-bottom: 4px; }
.v-price { font-weight: 700; color: var(--coral-ink); }
.v-how { border-left: 4px solid var(--accent); }

/* ---------- dialog, toast, footer ---------- */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); color: var(--ink); background: var(--surface); }
.dlg-wide { width: min(760px, calc(100vw - 24px)); }
.dlg::backdrop { background: rgba(20, 28, 26, 0.45); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 6px 22px; position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dlg-title { font-size: 20px; margin: 0; }
.dlg-body { padding: 8px 22px 22px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--tabbar-h)); transform: translate(-50%, 30px); opacity: 0; pointer-events: none; z-index: 90; max-width: min(560px, calc(100vw - 32px)); background: #1f2b29; color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 550; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); transition: opacity 0.2s, transform 0.2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.foot { border-top: 1px solid var(--line); background: var(--surface-2); padding-bottom: var(--tabbar-h); }
.foot-in { max-width: 1280px; margin: 0 auto; padding: 18px 24px 22px; font-size: 14px; color: var(--muted); }
.foot-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 0; }
.foot-mark { display: inline-flex; gap: 8px; align-items: center; }

/* ---------- tablet: cart becomes a bar at the bottom ---------- */
@media (max-width: 1099px) {
  .sell { grid-template-columns: minmax(0, 1fr); }
  .cart-panel { display: none; }
  .cart-bar { display: block; position: fixed; left: 0; right: 0; bottom: var(--tabbar-h); z-index: 45; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(248, 244, 236, 0.94); border-top: 1px solid var(--line); backdrop-filter: blur(6px); }
  body[data-view="sell"] .foot { padding-bottom: calc(var(--tabbar-h) + 84px); }
  body[data-view="sell"] .view { padding-bottom: 110px; }
  .cart-bar-btn { width: 100%; max-width: 640px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; min-height: 58px; padding: 0 16px; border-radius: 16px; border: 0; background: var(--accent); color: #fff; font-size: 16px; font-weight: 600; text-align: left; }
  .cart-bar-btn:disabled { background: #9fb8b4; cursor: default; }
  .cart-bar-btn b { font-size: 20px; font-variant-numeric: tabular-nums; }
  .cart-bar-pay { background: var(--coral); padding: 6px 14px; border-radius: 10px; }
  .cart-bar-pay:empty { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- phone: tabs move to a bottom bar ---------- */
@media (max-width: 899px) {
  :root { --tabbar-h: 66px; }
  .bar1 { padding: 8px 16px; gap: 8px; }
  .brand-sub { display: none; }
  .shop-pick { order: 3; flex: 1 1 100%; }
  .select { width: 100%; }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--line); border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05); }
  .tabs { padding: 0 4px; overflow: visible; }
  .tabs > li { flex: 1 1 0; min-width: 0; }
  .tab-extra { display: none; }
  .tab-more-li { display: block; }
  .tab { flex-direction: column; justify-content: center; gap: 2px; width: 100%; min-height: 64px; padding: 4px 2px; font-size: 12px; border-bottom: 0; border-top: 3px solid transparent; }
  .tab[aria-current="page"], .tab.is-current { border-top-color: var(--accent); background: var(--hover); }
  .tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
  .tab .ic-xs { position: absolute; top: 8px; right: calc(50% - 22px); }
  .view { padding: 16px 16px 30px; }
  h1 { font-size: 23px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 0; padding: 8px 8px 10px; }
  .tile-name { font-size: 14.5px; }
  .tile-price { font-size: 17px; }
  .card { padding: 14px 14px; }
  .kpi { padding: 12px; }
  .kpi-v { font-size: 20px; }
  .stock-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "img t n" "img chip btn"; gap: 6px 10px; }
  .stock-img { grid-area: img; width: 44px; height: 44px; }
  .stock-t { grid-area: t; }
  .stock-n { grid-area: n; }
  .stock-row > .chip { grid-area: chip; justify-self: start; }
  .stock-row > .btn, .stock-row > span:last-child { grid-area: btn; justify-self: end; }
  .rc-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no when total" "items items items" "chip . dot"; gap: 2px 10px; }
  .rc-no { grid-area: no; }
  .rc-when { grid-area: when; color: var(--muted); font-size: 14px; }
  .rc-items { grid-area: items; white-space: normal; }
  .rc-row > .chip { grid-area: chip; justify-self: start; }
  .sync-dot { grid-area: dot; justify-self: end; }
  .rc-row > b { grid-area: total; }
  .two { grid-template-columns: 1fr; }
  .pic-row { grid-template-columns: 96px 1fr; }
  .pic-big { width: 96px; height: 96px; }
  .v-hero { padding: 22px 18px; }
  .v-hero h1 { font-size: 25px; }
  .v-lede { font-size: 16px; }
  .v-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .v-shop { padding: 16px; }
  .dlg { border-radius: 18px; }
  .dlg-sheet { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; max-height: 88dvh; }
  .dlg-body { padding: 6px 16px 18px; }
  .dlg-head { padding: 12px 10px 4px 16px; }
  .demo-banner { font-size: 13px; padding: 6px 12px; }
  .banner-fiction { display: none; }
  .status .pill { min-height: 38px; padding: 0 10px; font-size: 13px; }
  .pinpad { grid-template-columns: repeat(3, 68px); }
}
@media (max-width: 380px) {
  .status .pill-sync span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .share { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roles { grid-template-columns: 1fr; }
  .role-btn { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- print: only the receipt (58-80 mm roll or A4) or the report ---------- */
@media print {
  @page { margin: 8mm; }
  body { background: #fff; }
  body[data-print] > *:not(#print-area) { display: none !important; }
  body[data-print] #print-area { display: block !important; }
  body[data-print="receipt"] .receipt { border: 0; max-width: 72mm; padding: 0; font-size: 12px; margin: 0; }
  body[data-print="receipt"] .rc-shop { font-size: 15px; }
  body[data-print="receipt"] .rc-total { font-size: 14px; }
  body[data-print="report"] .print-only { display: block; font-weight: 600; margin-bottom: 8px; }
  body[data-print="report"] .no-print { display: none !important; }
  body[data-print="report"] .card, body[data-print="report"] .kpi { box-shadow: none; break-inside: avoid; }
  body[data-print="report"] .two-col { grid-template-columns: 1fr 1fr; }
  body[data-print="report"] .kpis { grid-template-columns: repeat(4, 1fr); }
  body:not([data-print]) .demo-banner, body:not([data-print]) .tabbar, body:not([data-print]) .cart-bar { position: static; }
}
