/* Design: a shop counter's paper trail. Ruled ledgers, receipts, IMEI labels. See CLAUDE.md section 4. */
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #f3efe6;
  --sheet: #fbf9f4;
  --ink: #16181a;
  --ink-2: #4b4f52;
  --ink-3: #6f7275;
  --rule: #d8d2c3;
  --rule-strong: #16181a;
  --accent: #0a5a48;
  --accent-ink: #f3efe6;
  --accent-soft: #dbe8e1;
  --signal: #b93a14;
  --signal-soft: #f6e0d6;
  --warn: #8a5a00;
  --warn-soft: #f4e7c5;
  --night: #15181a;
  --night-2: #23282b;
  --night-ink: #e8e4da;
  --night-dim: #8f9496;
  --sans: "Plex Sans", system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --radius: 2px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--sans); }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.mono, code { font-family: var(--mono); font-feature-settings: "zero"; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.dim { color: var(--ink-3); }
.small { font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.label { font: 500 11px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; background: var(--ink); color: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); font: 600 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-quiet { background: transparent; color: var(--ink); }
.btn-quiet:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-danger { background: transparent; color: var(--signal); border-color: var(--signal); }
.btn-danger:hover { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Forms */
.field { display: block; margin-bottom: 16px; }
.field > .label { display: block; margin-bottom: 6px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; background: var(--sheet); color: var(--ink);
  border: 1px solid var(--ink-3); border-radius: var(--radius); font: 400 15px/1.4 var(--sans);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field-error { display: block; margin-top: 5px; color: var(--signal); font-size: 13px; font-weight: 500; }
.field-hint { display: block; margin-top: 5px; color: var(--ink-3); font-size: 13px; }
.check { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 20px; }

/* Notices */
.notice { margin-bottom: 18px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--accent-soft); font-size: 14px; }
.notice-error { border-color: var(--signal); background: var(--signal-soft); }
.notice-warn { border-color: var(--warn); background: var(--warn-soft); }

/* Sign-in: a receipt on the counter */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.auth-side { background: var(--night); color: var(--night-ink); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-brand { font: 500 13px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.receipt { width: min(100%, 320px); align-self: center; padding: 22px 20px 26px; background: var(--sheet); color: var(--ink); font: 400 13px/1.7 var(--mono); transform: rotate(-1.2deg); }
.receipt-title { text-align: center; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.receipt-rule { border: 0; border-top: 1px dashed var(--ink-3); margin: 10px 0; }
.receipt-line { display: flex; justify-content: space-between; gap: 12px; }
.auth-note { color: var(--night-dim); font-size: 13px; max-width: 36ch; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: min(100%, 390px); }
.auth-form h1 { font-size: 30px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; margin: 6px 0 26px; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: 14px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 14px; margin-bottom: 18px; background: var(--sheet); border: 1px dashed var(--ink-3); font-family: var(--mono); font-size: 14px; }
.qr { display: inline-block; padding: 10px; margin-bottom: 14px; background: #fff; border: 1px solid var(--rule); line-height: 0; }
.secret { display: block; margin-bottom: 18px; padding: 8px 10px; background: var(--sheet); border: 1px dashed var(--ink-3); font-size: 13px; word-break: break-all; }

/* Panel shell */
.shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.side { background: var(--night); color: var(--night-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-head { padding: 18px 18px 14px; border-bottom: 1px solid var(--night-2); }
.side-shop { display: block; font-weight: 600; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.side-role { display: block; margin-top: 3px; font: 500 11px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--night-dim); }
.side-nav { flex: 1; padding: 10px 0 18px; }
.nav-group { display: block; padding: 16px 18px 5px; font: 500 11px/1.3 var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--night-dim); }
.nav-link { display: block; padding: 7px 18px; border-left: 3px solid transparent; color: var(--night-ink); font-size: 14px; text-decoration: none; }
.nav-link:hover { background: var(--night-2); color: #fff; }
.nav-link.is-active { background: var(--night-2); border-left-color: #6fbf9f; color: #fff; font-weight: 600; }
.side-foot { padding: 14px 18px; border-top: 1px solid var(--night-2); font-size: 13px; }
.side-foot .who { display: block; margin-bottom: 8px; color: var(--night-dim); overflow-wrap: anywhere; }
.side-foot button { padding: 0; background: none; border: 0; color: var(--night-ink); font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.topbar { display: none; }
.main { min-width: 0; padding: 28px 32px 56px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding-bottom: 14px; margin-bottom: 22px; border-bottom: 2px solid var(--rule-strong); }
.page-head h1 { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.015em; }

/* Figures: ruled columns, not floating cards */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 30px; border-bottom: 1px solid var(--rule); }
.figure { padding: 4px 18px 16px; border-left: 1px solid var(--rule); }
.figure:first-child { padding-left: 0; border-left: 0; }
.figure-value { display: block; margin-top: 8px; font: 500 30px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.figure-alert .figure-value { color: var(--signal); }

.section { margin-bottom: 32px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.section-head h2 { font-size: 16px; font-weight: 700; }

/* Ledger tables */
.table-wrap { overflow-x: auto; }
.ledger { width: 100%; border-collapse: collapse; font-size: 14px; }
.ledger th { padding: 7px 10px; border-bottom: 1px solid var(--rule-strong); text-align: left; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.ledger th.num { text-align: right; }
.ledger td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ledger tbody tr:hover { background: var(--sheet); }
.ledger th:first-child, .ledger td:first-child { padding-left: 0; }
.ledger th:last-child, .ledger td:last-child { padding-right: 0; }
.empty { padding: 28px 0; color: var(--ink-3); border-bottom: 1px solid var(--rule); }

.tag { display: inline-block; padding: 1px 6px; border: 1px solid currentColor; border-radius: var(--radius); font: 500 11px/1.5 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.tag-ok { color: var(--accent); }
.tag-bad { color: var(--signal); }
.tag-warn { color: var(--warn); }

.sheet { max-width: 720px; padding: 22px; background: var(--sheet); border: 1px solid var(--rule); }

/* Public pages */
.public-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 32px; border-bottom: 2px solid var(--rule-strong); }
.public-brand { font: 500 14px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); text-decoration: none; }
.public-links { display: flex; flex-wrap: wrap; gap: 18px; font-size: 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }
.lead { padding: 64px 0 44px; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 48px; align-items: end; border-bottom: 1px solid var(--rule); }
.lead h1 { font-size: clamp(38px, 6vw, 68px); font-weight: 700; line-height: 1; letter-spacing: -.035em; }
.lead p { color: var(--ink-2); font-size: 17px; }
.lead .btn-row { margin-top: 18px; }
.spec { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.spec h2 { font: 500 12px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.spec p { max-width: 62ch; }
.foot { padding: 28px 0 44px; color: var(--ink-3); font-size: 13px; }

.state-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.state-box { max-width: 460px; }
.state-code { font: 500 13px/1.3 var(--mono); letter-spacing: .1em; color: var(--signal); }
.state-box h1 { margin: 8px 0 10px; font-size: 30px; letter-spacing: -.02em; line-height: 1.1; }
.state-box p { color: var(--ink-2); margin-bottom: 18px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 18px 16px; }
  .auth-side .receipt, .auth-note { display: none; }
  .auth-main { padding: 28px 16px; align-items: flex-start; }
  .shell { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: var(--night); color: var(--night-ink); }
  .topbar button { padding: 6px 10px; background: none; border: 1px solid var(--night-dim); border-radius: var(--radius); color: inherit; font: 500 12px/1.2 var(--mono); cursor: pointer; }
  .side { display: none; position: static; height: auto; }
  .side.is-open { display: flex; }
  .main { padding: 20px 16px 44px; }
  .figure { padding-left: 12px; }
  .figure-value { font-size: 24px; }
  .public-bar { padding: 12px 16px; }
  .wrap { padding: 0 16px; }
  .lead { grid-template-columns: 1fr; gap: 20px; padding: 36px 0 28px; }
  .spec { grid-template-columns: 1fr; gap: 6px; }
}
@media print { .side, .topbar, .no-print { display: none !important; } .shell { display: block; } body { background: #fff; } }

/* Filters, inline forms and small pieces */
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.input-small { min-height: 30px; padding: 4px 8px; font-size: 13px; width: 150px; }
.figure-word { font-size: 20px; text-transform: capitalize; letter-spacing: 0; overflow-wrap: anywhere; }
.bank { margin: 6px 0 18px; padding: 10px 12px; border: 1px dashed var(--ink-3); background: var(--paper); white-space: pre-wrap; font-size: 13px; }
.lead-tight { padding: 36px 0 22px; display: block; border-bottom: 0; }
.form-page { margin-bottom: 20px; }
.checks { border: 0; padding: 0; margin: 0 0 16px; }
.checks legend { padding: 0; margin-bottom: 8px; }
.checks .check { margin-bottom: 6px; }

/* Product lines on purchases and transfers */
.lines { margin: 8px 0 18px; }
.line-results { list-style: none; margin: -8px 0 10px; padding: 0; border: 1px solid var(--rule-strong); background: var(--sheet); max-height: 260px; overflow-y: auto; }
.line-results button { display: block; width: 100%; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.line-results button:hover, .line-results button:focus { background: var(--accent-soft); }
.line-quantity textarea { width: 100%; min-width: 180px; font-family: var(--mono); font-size: 13px; }
.lines [hidden] { display: none; }

/* Printed price labels */
.label-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.price-label { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px dashed var(--rule-strong); background: #fff; color: #000; break-inside: avoid; }
.price-label-name { font-size: 12px; font-weight: 600; line-height: 1.2; }
.price-label-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.barcode { display: block; width: 100%; height: 42px; }
@media print { .label-sheet { gap: 2mm; } .price-label { border-color: #bbb; } .main { padding: 0; } .page-head { display: none; } }

/* Invoice */
.invoice { padding: 18px; border: 1px solid var(--rule); background: var(--sheet); }
.invoice-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.invoice-meta { text-align: right; }
.invoice-meta .label { display: block; }
.invoice-foot { margin-top: 18px; white-space: pre-line; }
.section-gap { margin-top: 12px; }
.totals { margin: 16px 0 0 auto; max-width: 320px; font-variant-numeric: tabular-nums; }
.totals div { display: flex; justify-content: space-between; gap: 18px; padding: 3px 0; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; }
.totals-grand { border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 6px !important; font-weight: 600; }
.totals-grand dt { color: inherit; }
@media (max-width: 860px) { .invoice { padding: 12px; } .invoice-meta { text-align: left; } }
@media print { .invoice { border: 0; padding: 0; } .main { padding: 0; } }

/* Thermal receipt: black on white, one column, sized to the printer roll */
.receipt-page { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.thermal { margin: 0 auto 24px; padding: 3mm; background: #fff; color: #000; font: 12px/1.35 var(--mono); }
.thermal-80 { width: 80mm; max-width: 100%; }
.thermal-58 { width: 58mm; max-width: 100%; font-size: 10.5px; }
.thermal p { margin: 0 0 8px; overflow-wrap: anywhere; }
.thermal-center { text-align: center; }
.thermal-items { width: 100%; border-top: 1px dashed #000; border-bottom: 1px dashed #000; border-collapse: collapse; }
.thermal-items td { padding: 1px 0; vertical-align: top; overflow-wrap: anywhere; }
.thermal .totals { margin: 6px 0 8px; max-width: none; }
.thermal .totals dt { color: #000; }
.thermal .totals div { padding: 1px 0; }
.thermal-row { display: flex; justify-content: space-between; gap: 8px; margin: 0 !important; }
.thermal-code { margin: 8px 0; }
.thermal-code .barcode { height: 36px; }
@media print { @page { margin: 0; } .thermal { margin: 0; padding: 2mm; } body { background: #fff; } }

/* POS: a dark bar, a light work surface, big targets for a counter touchscreen */
.pos { display: grid; grid-template: auto 1fr / 1fr 340px; height: 100vh; height: 100dvh; background: var(--paper); }
.pos [hidden] { display: none !important; }
.pos kbd { padding: 0 4px; border: 1px solid currentColor; border-radius: 2px; font: 500 11px/1.4 var(--mono); opacity: .75; }
.pos-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 14px; background: var(--night); color: var(--night-ink); }
.pos-bar select { min-height: 32px; background: var(--night-2); color: inherit; border: 1px solid var(--night-dim); border-radius: var(--radius); padding: 2px 6px; font: inherit; }
.pos-exit { color: inherit; font: 500 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.pos-warn { color: #ffb59c; }
.pos-keys { margin-left: auto; color: var(--night-dim); font-size: 12px; }
.pos-cart { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 14px; }
.pos-scan input { width: 100%; min-height: 48px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--sheet); color: var(--ink); font: 500 17px/1.2 var(--mono); }
.pos-results { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--rule-strong); background: var(--sheet); max-height: 40vh; overflow-y: auto; }
.pos-results button { display: block; width: 100%; min-height: 42px; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--rule); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pos-results button:hover, .pos-results button:focus { background: var(--accent-soft); }
.pos-message { min-height: 20px; margin: 6px 0; font-size: 13px; color: var(--ink-2); }
.pos-message.is-error { color: var(--signal); font-weight: 600; }
.pos-lines { flex: 1; min-height: 0; overflow-y: auto; border-top: 1px solid var(--ink); }
.pos-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pos-table th { position: sticky; top: 0; padding: 6px 8px; background: var(--paper); border-bottom: 1px solid var(--rule-strong); font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); text-align: left; }
.pos-table th.num { text-align: right; }
.pos-table td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.pos-item-name { display: block; font-weight: 600; }
.pos-item-price { display: block; font-size: 12px; color: var(--ink-3); }
.pos-table select { margin-top: 4px; min-height: 34px; max-width: 100%; font: 13px var(--mono); }
.pos-qty { white-space: nowrap; }
.pos-qty button { width: 34px; height: 34px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet); color: inherit; font: 600 16px/1 var(--mono); cursor: pointer; }
.pos-qty button:disabled { opacity: .35; cursor: default; }
.pos-qty input { width: 48px; height: 34px; margin: 0 2px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet); text-align: center; font: inherit; }
.pos-discount { width: 76px; height: 34px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--sheet); text-align: right; padding: 2px 6px; font: inherit; }
.pos-remove { width: 30px; height: 30px; border: 0; background: none; color: var(--signal); font: 600 14px/1 var(--mono); cursor: pointer; }
.pos-empty { padding: 28px 8px; color: var(--ink-3); text-align: center; }
.pos-side { display: flex; flex-direction: column; gap: 14px; padding: 12px 14px; border-left: 1px solid var(--rule-strong); background: var(--sheet); overflow-y: auto; }
.pos-label { display: block; margin-bottom: 4px; font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.pos-customer input, .pos-payment input { width: 100%; min-height: 40px; margin-bottom: 4px; padding: 6px 8px; border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; }
.pos-chosen { display: flex; justify-content: space-between; gap: 8px; margin: 0; font-weight: 600; }
.pos-chosen button, .pos-link { padding: 4px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.pos-totals { margin: auto 0 0; font-variant-numeric: tabular-nums; }
.pos-totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.pos-totals dd { margin: 0; }
.pos-grand { margin-top: 6px; padding-top: 8px !important; border-top: 2px solid var(--ink); font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.pos-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pos-button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 12px; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--sheet); color: var(--ink); font: 600 14px/1.2 var(--sans); text-decoration: none; cursor: pointer; }
.pos-button:hover { background: var(--accent-soft); }
.pos-primary { flex-basis: 100%; min-height: 58px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 17px; }
.pos-primary:hover { background: var(--ink); border-color: var(--ink); }
.pos-primary:disabled { opacity: .4; cursor: default; }
.pos-new-customer { margin-top: 6px; }
.pos-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(21, 24, 26, .72); }
.pos-panel { width: 100%; max-width: 500px; max-height: 100%; overflow-y: auto; padding: 18px; background: var(--sheet); border-top: 4px solid var(--accent); }
.pos-panel h2 { margin: 0 0 10px; font-size: 20px; }
.pos-due { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0; font-variant-numeric: tabular-nums; }
.pos-due strong { font-size: 22px; }
.pos-change { color: var(--signal); font-size: 30px !important; }
.pos-methods { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pos-methods .pos-button { min-height: 40px; font-size: 13px; }
.pos-payment { display: grid; grid-template-columns: 1fr 110px 1fr 30px; align-items: center; gap: 6px; margin-bottom: 4px; }
.pos-payment input { margin: 0; text-align: right; }
.pos-payment [data-payment-reference] { text-align: left; }
@media (max-width: 860px) {
  .pos { display: block; height: auto; min-height: 100dvh; }
  .pos-keys { display: none; }
  .pos-lines { max-height: none; }
  .pos-side { border-left: 0; border-top: 1px solid var(--rule-strong); }
  .pos-totals { margin-top: 0; }
  .pos-payment { grid-template-columns: 1fr 100px 30px; }
  .pos-payment [data-payment-reference] { grid-column: 1 / -1; grid-row: 2; }
  .pos-table th:first-child, .pos-table td:first-child { min-width: 120px; }
}

/* Online store: a stock list, not a row of cards. */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0; margin: 16px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); border-left: 1px solid var(--rule); }
.shelf-item { display: flex; flex-direction: column; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--sheet); }
.shelf-link { display: block; flex: 1; padding: 10px; color: var(--ink); text-decoration: none; }
.shelf-link:hover .shelf-name { text-decoration: underline; }
.shelf-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--paper); }
.shelf-photo-none { display: flex; align-items: center; justify-content: center; color: var(--ink-3); font: 600 30px/1 var(--mono); }
.shelf-name { display: block; margin-top: 8px; font-weight: 600; line-height: 1.25; }
.shelf-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.product-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.product-page > :only-child { grid-column: 1 / -1; max-width: 620px; }
.product-photo { display: block; width: 100%; max-height: 460px; object-fit: contain; background: var(--sheet); border: 1px solid var(--rule); }
.product-price { margin: 8px 0; font-size: 26px; font-weight: 700; }
.product-text { white-space: pre-line; }
@media (max-width: 640px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-page { grid-template-columns: 1fr; }
}

/* Reports */
.report-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ledger tfoot th { border-top: 1px solid var(--rule-strong); }
@media (max-width: 760px) {
  .report-pair { grid-template-columns: 1fr; gap: 0; }
}
