/* CAM POS. Tokens from the CAM POS design system (platform/web/src/index.css + POS additions). */
:root {
  --ink: #0e1b24; --ink-soft: #4d6068; --canvas: #e8eef0; --panel: #ffffff;
  --line: #cdd7db; --line-soft: #e1e8ea; --th-bg: #f4f7f8; --row-hover: #f4f9f9;
  --brand: #0b5563; --brand-deep: #08404b; --on-brand: #ffffff; --link: #12a3a0;
  --good: #17874f; --good-bg: #e1f2e8; --warn: #9a6f00; --warn-mark: #c99700; --warn-bg: #faf0cf; --env-stripe: #f4e3a8;
  --bad: #c9302c; --bad-bg: #fbe4e2; --grey: #7b8a93; --grey-bg: #e6ebee; --tag-open-bg: #d7ecef;
  --tape: #fffef9; --ribbon-bg: #f4f8f9; --ribbon-hatch: #eef3f5;
  --rail: #0e1b24; --rail-text: #b9c9cf; --rail-group: #7f949c;
  --plain: #6a3d5a; --plain-deep: #4f2c43; --plain-bg: #f3e9ef; --plain-stripe: #e9dbe4;
  --font-ui: "Schibsted Grotesk", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Spline Sans Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-tick: 1px; --r-tag: 4px; --r-ribbon: 6px; --r-control: 8px; --r-panel: 12px; --r-pill: 99px;
  --key-min: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--ink); font-family: var(--font-ui); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { font-weight: 650; letter-spacing: -0.015em; line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1rem; max-width: 68ch; }
a { color: var(--brand); text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-soft); font-size: 0.86rem; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

/* header */
.top { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; padding: 0.6rem 1rem; padding-top: max(0.6rem, env(safe-area-inset-top)); background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.brand .wordmark { height: 23px; width: auto; display: block; }
.brand .appname { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; padding-left: 0.7rem; border-left: 1px solid var(--line); line-height: 1.2; }
.who { font-size: 0.8rem; color: var(--ink-soft); }
.tabs { display: flex; gap: 0.25rem; margin-left: auto; }
.tabs a { color: var(--ink-soft); text-decoration: none; padding: 0.45rem 0.7rem; border-radius: var(--r-control); border-bottom: 3px solid transparent; }
.tabs a:hover { background: var(--row-hover); color: var(--ink); }
.tabs a.active { background: var(--tag-open-bg); border-bottom-color: var(--link); color: var(--brand-deep); font-weight: 600; }
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--panel); padding: 3px; gap: 3px; }
.mode button { font-weight: 600; border: 1px solid transparent; background: transparent; color: var(--ink-soft); padding: 0.45rem 0.8rem; border-radius: 6px; cursor: pointer; display: inline-flex; gap: 0.45rem; align-items: center; min-height: 40px; }
.mode button.is-fiscal[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.mode button.is-plain[aria-pressed="true"] { background: repeating-linear-gradient(135deg, var(--plain-bg) 0 6px, var(--plain-stripe) 6px 12px); color: var(--plain); border: 1px dashed var(--plain); }
.mode button:disabled { opacity: 0.45; cursor: not-allowed; }

/* ZIMRA link bar */
.zlink { display: flex; align-items: center; gap: 0.5rem 0.9rem; flex-wrap: wrap; padding: 0.55rem 1rem; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 0.88rem; position: sticky; top: 0; z-index: 5; }
.zlink .state { font-weight: 600; }
.zlink.is-down { background: var(--bad-bg); border-bottom-color: var(--bad); color: var(--bad); }
.zlink.is-off { background: repeating-linear-gradient(135deg, var(--plain-bg) 0 8px, var(--plain-stripe) 8px 16px); border-bottom-color: var(--plain); color: var(--plain); }
.zlink.is-demo { background: repeating-linear-gradient(135deg, var(--warn-bg) 0 8px, var(--env-stripe) 8px 16px); border-bottom-color: var(--warn-mark); color: var(--warn); }
.zlink .spacer { flex: 1; }
.zlink .time { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-soft); }
.zlink.is-down .time, .zlink.is-off .time, .zlink.is-demo .time { color: inherit; }
.zlink svg { flex: none; }
.env { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.05rem 0.55rem; border-radius: var(--r-tag); }
.env-test { color: var(--warn); background: repeating-linear-gradient(135deg, var(--warn-bg) 0 6px, var(--env-stripe) 6px 12px); border: 1px solid var(--warn-mark); }
.env-production { color: var(--on-brand); background: var(--brand); }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 2.4s ease-out infinite; transform-origin: center; transform-box: fill-box; }
  @keyframes pulse { 0% { opacity: .9; transform: scale(.6); } 70%, 100% { opacity: 0; transform: scale(1.6); } }
}

main { padding: 1rem; max-width: 1280px; margin: 0 auto; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

/* buttons */
.btn { font-weight: 600; border-radius: var(--r-control); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 44px; }
.btn-primary { background: var(--brand); color: var(--on-brand); border: none; padding: 0.6rem 1.15rem; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); padding: 0.5rem 0.95rem; font-weight: 400; }
.btn-secondary:hover { border-color: var(--ink-soft); }
.btn-plain { background: var(--plain); color: var(--on-brand); border: none; padding: 0.6rem 1.15rem; }
.btn-plain:hover { background: var(--plain-deep); }
.btn-danger { background: var(--panel); color: var(--bad); border: 1px solid var(--bad); padding: 0.5rem 0.95rem; }
.btn:disabled { background: var(--line); color: var(--ink-soft); border-color: var(--line); cursor: not-allowed; }
.btn-key { min-height: var(--key-min); font-size: 18px; width: 100%; }
.btn-small { min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.88rem; }

/* tags */
.tag { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 0.1rem 0.55rem; border-radius: var(--r-tag); background: var(--grey-bg); color: var(--ink-soft); white-space: nowrap; }
.tag-green { background: var(--good-bg); color: var(--good); }
.tag-yellow { background: var(--warn-bg); color: var(--warn); }
.tag-red { background: var(--bad-bg); color: var(--bad); }
.tag-open { background: var(--tag-open-bg); color: var(--brand-deep); }
.tag-plain { background: repeating-linear-gradient(135deg, var(--plain-bg) 0 6px, var(--plain-stripe) 6px 12px); color: var(--plain); border: 1px dashed var(--plain); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.1rem 1.25rem; margin-bottom: 1rem; }
.card > h2:first-child { margin-top: 0; }
.error-banner { background: var(--bad-bg); color: var(--bad); border: 1px solid var(--bad); border-radius: var(--r-control); padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-size: 0.92rem; }
.info-banner { background: var(--tag-open-bg); color: var(--brand-deep); border-radius: var(--r-control); padding: 0.7rem 0.9rem; margin-bottom: 1rem; font-size: 0.92rem; }
.empty { padding: 2rem; text-align: center; color: var(--ink-soft); background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r-panel); }

/* sell */
.sell { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.search { width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--panel); margin-bottom: 0.75rem; min-height: 44px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.product { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-control); padding: 0.7rem 0.8rem; cursor: pointer; min-height: 84px; display: flex; flex-direction: column; justify-content: space-between; gap: 0.3rem; }
.product:hover { border-color: var(--ink-soft); }
.product:active { background: var(--row-hover); }
.product .pname { font-weight: 600; line-height: 1.25; }
.product .pmeta { display: flex; justify-content: space-between; align-items: baseline; gap: 0.4rem; }
.product .pprice { font-family: var(--font-mono); }
.taxcode { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
.side { display: grid; gap: 1rem; position: sticky; top: 3.4rem; }

.basket { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.basket table { width: 100%; border-collapse: collapse; }
.basket th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); background: var(--th-bg); white-space: nowrap; }
.basket td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.basket .num { text-align: right; font-size: 0.9em; }
.qty { display: inline-flex; align-items: center; gap: 0.3rem; }
.qty button { width: 34px; height: 34px; border-radius: var(--r-control); border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 600; }
.qty span { min-width: 1.6rem; text-align: center; font-family: var(--font-mono); }
.sums { padding: 0.7rem 0.9rem 0.9rem; border-top: 1px solid var(--line); }
.sumline { display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 0.9rem; }
.sumline .num { color: var(--ink); }
.due { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-top: 0.3rem; }
.due-amt { font-family: var(--font-mono); font-size: 40px; font-weight: 500; line-height: 1.1; font-variant-numeric: tabular-nums; }
.plainnote { margin-top: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--plain); }

.pay { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1rem 1.1rem; display: grid; gap: 0.75rem; }
.pay-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.modebadge { display: inline-flex; font-size: 0.8rem; font-weight: 600; padding: 0.1rem 0.6rem; border-radius: var(--r-tag); }
.modebadge.is-fiscal { background: var(--brand); color: var(--on-brand); }
.modebadge.is-plain { background: repeating-linear-gradient(135deg, var(--plain-bg) 0 6px, var(--plain-stripe) 6px 12px); color: var(--plain); border: 1px dashed var(--plain); }
.tenders { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 0.4rem; }
.tenders button { min-height: 48px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-control); cursor: pointer; font-weight: 600; }
.tenders button[aria-pressed="true"] { border: 2px solid var(--brand); color: var(--brand-deep); background: var(--tag-open-bg); }
.says { font-size: 0.82rem; color: var(--ink-soft); margin: 0; }

/* fields */
.field { margin-bottom: 0.9rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field select { width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--panel); min-height: 44px; }
.field .hint { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.25rem; }
.row { display: flex; gap: 0.9rem; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 160px; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.9rem; }
.check input { margin-top: 0.3rem; width: 18px; height: 18px; }

/* tables */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); overflow-x: auto; margin-bottom: 1rem; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th { text-align: left; font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); background: var(--th-bg); white-space: nowrap; }
.table-wrap td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table-wrap tr:last-child td { border-bottom: none; }
.table-wrap .num { text-align: right; }
tr.click { cursor: pointer; } tr.click:hover { background: var(--row-hover); }
.filters { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.filters button { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-pill); padding: 0.3rem 0.85rem; cursor: pointer; min-height: 36px; }
.filters button.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* day: ribbon + tape */
.day-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.day-head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.ribbon { position: relative; height: 38px; border-radius: var(--r-ribbon); background: linear-gradient(90deg, transparent calc(100% - 1px), var(--line-soft) 0) 0 0 / calc(100% / 24) 100%, var(--ribbon-bg); border: 1px solid var(--line); overflow: hidden; }
.ribbon.is-closed { background: repeating-linear-gradient(135deg, var(--ribbon-bg) 0 8px, var(--ribbon-hatch) 8px 16px); }
.ribbon .caution { position: absolute; top: 0; bottom: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(201, 151, 0, .18) 0 5px, rgba(201, 151, 0, .05) 5px 10px); border-left: 1px solid var(--warn-mark); }
.ribbon .tick { position: absolute; top: 7px; bottom: 7px; width: 4px; margin-left: -2px; border-radius: var(--r-tick); }
.tick-Green, .sw-Green { background: var(--good); } .tick-Yellow, .sw-Yellow { background: var(--warn-mark); }
.tick-Grey, .sw-Grey { background: var(--grey); } .tick-Red, .sw-Red { background: var(--bad); }
.tick-wait { background: var(--panel); border: 1px dashed var(--ink-soft); }
.ribbon .now { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: var(--link); }
.ribbon-scale { display: flex; justify-content: space-between; margin-top: 0.3rem; font-family: var(--font-mono); font-size: 0.75rem; color: var(--ink-soft); }
.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-soft); margin-top: 0.7rem; }
.legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.sw { display: inline-block; width: 5px; height: 14px; border-radius: var(--r-tick); }
.tape { background: var(--tape); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.1rem 1.4rem; font-family: var(--font-mono); font-size: 0.86rem; margin-bottom: 1rem; }
.tape h2 { font-family: var(--font-ui); margin: 0 0 0.6rem; font-size: 1rem; }
.tape .line { display: flex; align-items: baseline; gap: 0.4rem; padding: 0.2rem 0; }
.tape .lead { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-3px); min-width: 1rem; }
.tape .label { font-family: var(--font-ui); }
.tape .total { border-top: 1px dashed var(--ink-soft); margin-top: 0.5rem; padding-top: 0.5rem; font-weight: 500; }
.tape .note { font-family: var(--font-ui); color: var(--ink-soft); font-size: 0.8rem; margin: 0.6rem 0 0; }

/* receipt */
.receipt { width: 300px; max-width: 100%; background: var(--tape); border: 1px solid var(--line); border-radius: var(--r-control); padding: 1rem 1.1rem 1.2rem; font-family: var(--font-mono); font-size: 12px; line-height: 1.45; color: var(--ink); margin: 0 auto; }
.receipt .c { text-align: center; }
.receipt .seller { font-family: var(--font-ui); font-weight: 600; font-size: 13px; }
.receipt .title { font-family: var(--font-ui); font-weight: 700; font-size: 14px; letter-spacing: 0.02em; text-align: center; margin: 0.5rem 0 0.4rem; }
.receipt .rule { border-top: 1px dashed var(--ink-soft); margin: 0.5rem 0; }
.receipt .kv { display: flex; justify-content: space-between; gap: 0.5rem; }
.receipt .kv span:first-child { color: var(--ink-soft); }
.receipt .kv.total { font-weight: 600; font-size: 14px; }
.receipt .kv.total span:first-child { color: var(--ink); }
.receipt .code { font-size: 14px; font-weight: 500; letter-spacing: 0.08em; text-align: center; margin: 0.3rem 0; }
.receipt .qr { display: flex; justify-content: center; margin: 0.4rem 0; }
.receipt .qr svg { width: 120px; height: 120px; }
.receipt .small { font-size: 10px; }
.receipt .gap { height: 0.6rem; }
.stamp { display: block; text-align: center; font-family: var(--font-ui); font-weight: 700; font-size: 12px; padding: 0.3rem; border-radius: var(--r-tag); margin: 0.4rem 0; }
.stamp.is-plain { color: var(--plain); border: 1.5px dashed var(--plain); background: repeating-linear-gradient(135deg, var(--plain-bg) 0 6px, var(--plain-stripe) 6px 12px); }
.stamp.is-pending { color: var(--warn); border: 1.5px dashed var(--warn-mark); background: var(--warn-bg); }
.stamp.is-test { color: var(--warn); border: 1px solid var(--warn-mark); background: repeating-linear-gradient(135deg, var(--warn-bg) 0 6px, var(--env-stripe) 6px 12px); }

dialog { border: none; border-radius: var(--r-panel); padding: 1rem; background: var(--canvas); max-width: calc(100vw - 2rem); max-height: calc(100vh - 2rem); }
dialog::backdrop { background: rgba(14, 27, 36, 0.55); }
.dialog-actions { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.9rem; }
.dialog-actions .btn { min-width: 130px; }

#toast { position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 0.65rem 1rem; border-radius: var(--r-control); max-width: calc(100vw - 2rem); z-index: 20; font-size: 0.92rem; }
#print-area { display: none; }

/* CAM POS Cloud: sign-in gate, sync status, account */
#gate { position: fixed; inset: 0; z-index: 30; background: var(--canvas); overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
#gate[hidden] { display: none; }
body.gated > header, body.gated > #zlink, body.gated > main { display: none; }
.gate-card { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.75rem 1.5rem; margin-top: 4vh; }
.gate-card h1 { margin: 0.75rem 0 0.25rem; }
.gate-card .wordmark-lg { height: 40px; width: auto; display: block; }
.gate-card .btn-key { margin-top: 0.4rem; }
.gate-alt { margin: 1rem 0 0.5rem; }
.gate-foot { margin: 1.5rem 0 0; }
.linkbtn { background: none; border: none; padding: 0; color: var(--brand); text-decoration: underline; cursor: pointer; font: inherit; }
.small { font-size: 0.82rem; }
.sync { font-size: 0.78rem; color: var(--ink-soft); }
.sync.is-warn { color: var(--warn); font-weight: 600; }
.kvs { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0 0 1rem; }
.kvs dt { color: var(--ink-soft); }
.kvs dd { margin: 0; }
.tabs a[hidden] { display: none; }

/* stock */
.stockbadge { align-self: flex-start; font-size: 0.72rem; font-weight: 600; padding: 0 0.4rem; border-radius: var(--r-tag); background: var(--grey-bg); color: var(--ink-soft); }
.stockbadge.is-low { background: var(--warn-bg); color: var(--warn); }
.stockbadge.is-out { background: var(--bad-bg); color: var(--bad); }
.product.is-out { background: var(--th-bg); }
.product.is-out .pname, .product.is-out .pprice { color: var(--ink-soft); }
.stock-bar { display: flex; gap: 0.75rem 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.stock-bar .search { flex: 1; min-width: 220px; margin-bottom: 0; }
.filters .count { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; background: var(--bad); color: #fff; border-radius: var(--r-pill); padding: 0 0.4rem; margin-left: 0.25rem; }
table.edit input:not([type]), table.edit input[type="text"], table.edit select { min-height: 40px; padding: 0.3rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--panel); font: inherit; color: inherit; }
table.edit input[type="checkbox"] { width: 20px; height: 20px; }
table.edit .w-name { width: 100%; min-width: 11rem; }
table.edit .w-sku { width: 9rem; }
table.edit .w-num { width: 6.5rem; text-align: right; }
table.edit .w-qty { width: 5rem; text-align: right; }
table.edit select { max-width: 16rem; }
.recv-sum { font-size: 1.05rem; }
.recv-sum .muted { margin-right: 0.6rem; }

/* books */
.books-bar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.books-bar .filters { margin-bottom: 0; }
.period { display: flex; flex-wrap: wrap; gap: 0.4rem 0.6rem; align-items: center; font-size: 0.88rem; color: var(--ink-soft); }
.period input { font: inherit; padding: 0.3rem 0.5rem; border: 1px solid var(--line); border-radius: var(--r-control); background: var(--panel); color: var(--ink); min-height: 36px; margin-left: 0.3rem; }
.books-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.books-grid .tape, .books-grid .card { margin-bottom: 0; }
table.journal tr.jstart td { border-top: 1px solid var(--line); }
table.journal td { font-size: 0.9rem; }
tr.tbtotal td { background: var(--th-bg); }
#refund-btn[hidden] { display: none; }
.paybar { display: none; }
@media (max-width: 900px) {
  .paybar { display: flex; position: sticky; bottom: calc(0.5rem + env(safe-area-inset-bottom)); margin-top: 1rem; width: 100%; min-height: var(--key-min); align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0 1rem; border: none; border-radius: var(--r-control); background: var(--brand); color: var(--on-brand); font-weight: 600; cursor: pointer; z-index: 4; }
  .paybar.is-plain { background: var(--plain); }
  .paybar strong { font-size: 1.15rem; font-weight: 500; }
}

@media (max-width: 900px) {
  .sell, .day-grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .tabs { margin-left: 0; order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; }
  .mode { margin-left: auto; }
  .due-amt { font-size: 32px; }
}
@media (max-width: 520px) {
  .who { display: none; }
  .tabs a { padding: 0.45rem 0.5rem; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zlink .time { display: none; }
}

/* print: only the receipt, sized for an 80mm roll */
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .receipt { width: 100%; border: none; border-radius: 0; padding: 0; background: #fff; color: #000; }
  #print-area .receipt + .receipt { break-before: page; }
  #print-area.paper-58 .receipt { font-size: 10px; }
  #print-area.paper-58 .receipt .title { font-size: 12px; }
  #print-area .stamp { background: none !important; color: #000 !important; border-color: #000 !important; }
  #print-area .receipt .kv span:first-child, #print-area .muted { color: #000; }
}

/* Paying for CAM POS (Settings -> CAM POS account, and the locked screen) */
.billing { margin: 0.75rem 0; }
.gate-card .billing { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.billing .row .field { flex: 1 1 10rem; }
.billing select { width: 100%; }
.bill-total { margin: 0.25rem 0 0.5rem; font-size: 1.05rem; }
.billing .table-wrap { margin-top: 1rem; }
.gate-card .billing .row .field { flex-basis: 100%; }
