/* CollegePay merchant till (POS). Built on /shared/tokens.css: colour roles, 4px spacing, type scale, radius, two shadows.
   Tablet first (two columns from 900px); phones get a bottom sale bar that opens the sale as a sheet. */

body.pos { min-height: 100dvh; background: var(--bg); }
.boot { min-height: 100dvh; display: grid; place-items: center; color: var(--brand-600); }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.02em; }
.small { font-size: var(--t-sm); }
.eyebrow { font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-300); }
.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.form-error { padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--danger-bg); color: var(--danger); font-size: var(--t-sm); font-weight: 700; }
.btn-on-dark { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.btn-on-dark:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }

/* Touch screens: every control at least 44px tall */
@media (pointer: coarse) { .btn-sm { --h: 44px; } .chip { min-height: 44px; } .seg button { min-height: 44px; } }

/* ---- Brand + sign in ---------------------------------------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--t-lg); letter-spacing: -0.02em; }
.brand .mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--brand-400); color: var(--brand-950); }
.brand .tag { padding: 2px var(--s2); border-radius: var(--r-sm); background: var(--brand-100); color: var(--brand-800); font-size: var(--t-xs); letter-spacing: 0.06em; text-transform: uppercase; }

.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--s6) var(--s4);
  background: radial-gradient(900px 480px at 0% 0%, var(--brand-100), transparent 60%), radial-gradient(700px 420px at 100% 100%, var(--brand-200), transparent 60%), var(--bg); }
.login-card { width: min(440px, 100%); padding: var(--s8) var(--s6); display: grid; gap: var(--s5); }
.login-card h1 { font-size: var(--t-xl); }
.login-card form { display: grid; gap: var(--s4); }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--t-sm); }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.demo-list { display: grid; gap: var(--s2); }
.demo-btn { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: var(--s2) var(--s3);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); text-align: left; transition: background var(--fast), transform 120ms var(--spring); }
.demo-btn:hover { background: var(--surface-2); }
.demo-btn:active { transform: scale(0.98); }
.demo-btn b { display: block; font-size: var(--t-md); }
.demo-btn small { color: var(--muted); font-size: var(--t-sm); }

/* ---- Shell ---------------------------------------------------------------------------------------------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: var(--s4); padding: var(--s3) var(--s5);
  padding-top: calc(var(--s3) + env(safe-area-inset-top)); background: var(--brand-900); color: #fff; }
.bar-merchant { display: flex; align-items: center; gap: var(--s3); min-width: 0; flex: 1; }
.bar-merchant .icon-tile { background: #fff; }
.bar-merchant b { display: block; font-size: var(--t-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-merchant small { display: block; color: var(--brand-200); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-merchant > span { min-width: 0; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-full); background: rgba(255, 255, 255, 0.08); }
.tabs button { min-height: 44px; padding: 0 var(--s4); border: 0; border-radius: var(--r-full); background: transparent; color: var(--brand-200); font-weight: 700; font-size: var(--t-md);
  display: inline-flex; align-items: center; gap: 6px; transition: background var(--fast), color var(--fast); }
.tabs button:hover:not(:disabled):not([aria-current]) { color: #fff; }
.tabs button[aria-current="page"] { background: #fff; color: var(--brand-900); }
.tabs button:disabled { opacity: 0.4; cursor: not-allowed; }
.bar .btn-ghost { color: var(--brand-200); }
.bar .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.notice { display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s5); background: var(--warn-bg); color: var(--warn); font-size: var(--t-md); font-weight: 700; }
#view { flex: 1; min-width: 0; outline: none; }
@media (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: var(--s2) var(--s3); padding: var(--s2) var(--s4); padding-top: calc(var(--s2) + env(safe-area-inset-top)); }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1; justify-content: center; padding: 0 var(--s2); }
}

/* ---- Sell ------------------------------------------------------------------------------------------------- */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--s6); padding: var(--s6); align-items: start; }
.menu { min-width: 0; }
.chips { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: var(--s1); margin-bottom: var(--s4); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: var(--s3); }
.item { position: relative; display: grid; align-content: space-between; gap: var(--s3); min-height: 120px; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-xl);
  background: var(--surface); box-shadow: var(--shadow-1); text-align: left; transition: transform 120ms var(--spring), border-color var(--fast), background var(--fast);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.item:hover { border-color: var(--brand-300); }
.item:active { transform: scale(0.96); background: var(--brand-50); }
.item .name { font-weight: 700; font-size: var(--t-md); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .price { font-weight: 800; font-size: var(--t-base); color: var(--brand-700); }
.item .qty { position: absolute; top: var(--s3); right: var(--s3); min-width: 28px; height: 28px; padding: 0 var(--s2); border-radius: var(--r-full); background: var(--brand-700); color: #fff;
  display: grid; place-items: center; font-size: var(--t-sm); font-weight: 800; animation: pop 220ms var(--spring); }
@keyframes pop { from { transform: scale(0.6); } }
.item.custom { border-style: dashed; border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-800); box-shadow: none; }
.item.custom .ic { color: var(--brand-600); }

.cart { position: sticky; top: 96px; display: flex; flex-direction: column; max-height: calc(100dvh - 120px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--line); }
.cart-head h2 { font-size: var(--t-lg); }
.lines { list-style: none; margin: 0; padding: var(--s2) var(--s5); overflow-y: auto; flex: 1; min-height: 120px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s1) var(--s3); padding: var(--s3) 0; }
.line + .line { border-top: 1px solid var(--line); }
.line .t b { display: block; font-size: var(--t-md); overflow-wrap: anywhere; }
.line .t small { color: var(--muted); font-size: var(--t-sm); }
.line .sum { font-weight: 800; font-size: var(--t-md); text-align: right; }
.stepper { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: var(--s1); justify-self: start; }
.stepper button { width: 44px; height: 36px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); display: grid; place-items: center; touch-action: manipulation; }
.stepper button:active { transform: scale(0.94); }
.stepper output { min-width: 36px; text-align: center; font-weight: 800; }
.cart-empty { display: grid; justify-items: center; gap: var(--s2); padding: var(--s10) var(--s4); text-align: center; color: var(--muted); font-size: var(--t-md); }
.cart-empty .ic { color: var(--brand-300); }
.cart-foot { padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--line); display: grid; gap: var(--s3); }
.total { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; }
.total b { font-size: var(--t-2xl); letter-spacing: -0.02em; }
.cart-bar { display: none; }

@media (max-width: 899px) {
  .sell { grid-template-columns: minmax(0, 1fr); padding: var(--s4); padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
  .sell > .cart { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .cart-bar { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
    padding: var(--s3) var(--s4) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-2); }
  .cart-bar small { display: block; color: var(--muted); font-size: var(--t-sm); }
  .cart-bar b { font-size: var(--t-lg); }
}
.sheet .lines { padding: 0; max-height: none; }
.sheet .cart-foot { padding: var(--s4) 0 0; }

/* Custom amount keypad */
.pad-display { padding: var(--s4) 0 var(--s2); text-align: center; font-size: 44px; font-weight: 800; letter-spacing: -0.03em; }
.pad-display.is-empty { color: var(--line-strong); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); margin-top: var(--s4); }
.pad button { height: 60px; border: 0; border-radius: var(--r-lg); background: var(--surface-2); font-size: 24px; font-weight: 700; touch-action: manipulation; transition: transform 120ms var(--spring), background var(--fast); }
.pad button:active { transform: scale(0.95); background: var(--brand-100); }

/* ---- Charge (QR) --------------------------------------------------------------------------------------- */
.charge { min-height: calc(100dvh - 72px); display: grid; grid-template-columns: auto minmax(0, 420px); justify-content: center; align-items: center; gap: var(--s10);
  padding: var(--s8) var(--s6); background: linear-gradient(160deg, var(--brand-950), var(--brand-800)); color: #fff; }
.qr-card { display: grid; justify-items: center; gap: var(--s3); padding: var(--s6); border-radius: var(--r-2xl); background: #fff; color: var(--ink); box-shadow: var(--shadow-2); }
.qr-card svg { width: min(320px, 72vw); height: auto; }
.qr-card .code { font-size: var(--t-md); color: var(--muted); }
.qr-card .code b { color: var(--ink); font-size: var(--t-lg); }
.charge-info { display: grid; gap: var(--s4); min-width: 0; }
.charge-amount { font-size: clamp(40px, 7vw, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.charge-items { list-style: none; margin: 0; padding: 0; color: var(--brand-200); font-size: var(--t-md); }
.charge-items li { display: flex; justify-content: space-between; gap: var(--s4); padding: 2px 0; }
.charge-items li span:first-child { min-width: 0; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: var(--s3); justify-self: start; padding: var(--s3) var(--s4); border-radius: var(--r-full); background: rgba(46, 194, 126, 0.16);
  color: var(--brand-200); font-weight: 700; font-size: var(--t-md); }
.status .spinner { width: 18px; height: 18px; color: var(--brand-300); }
.status.is-warn { background: rgba(255, 191, 71, 0.16); color: #FFD891; }
.expires { color: var(--brand-200); font-size: var(--t-sm); font-weight: 600; }
.expires.is-late { color: #FFD891; }
.how { margin: 0; padding-left: var(--s5); color: var(--brand-200); font-size: var(--t-md); display: grid; gap: var(--s1); }
.charge-actions { display: flex; flex-wrap: wrap; gap: var(--s3); }
.charge-done { display: grid; justify-items: center; gap: var(--s3); text-align: center; grid-column: 1 / -1; max-width: 520px; }
.charge-done .tick { width: 96px; height: 96px; color: var(--brand-400); }
.charge-done h1 { font-size: clamp(32px, 6vw, 44px); }
.charge-done p { color: var(--brand-200); }
.charge-done .kv { width: 100%; margin: var(--s2) 0; padding: var(--s1) var(--s4); border-radius: var(--r-xl); background: rgba(255, 255, 255, 0.06); text-align: left; }
.charge-done .kv dt { color: var(--brand-200); }
.charge-done .charge-actions { justify-content: center; width: 100%; }
.charge-done .charge-actions .btn { flex: 1 1 200px; }
.charge-done .face { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #FFD891; }
@media (max-width: 899px) {
  .charge { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--s6); padding: var(--s6) var(--s4) var(--s8); align-content: start; }
  .charge-info { width: 100%; max-width: 420px; }
}

/* Key–value rows (receipts, sale detail) */
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; }
.kv > div + div { border-top: 1px solid var(--line); }
.charge-done .kv > div + div { border-top-color: rgba(255, 255, 255, 0.12); }
.kv dt { color: var(--muted); font-size: var(--t-md); }
.kv dd { margin: 0; min-width: 0; text-align: right; font-weight: 700; font-size: var(--t-md); overflow-wrap: anywhere; }

/* ---- Sales ------------------------------------------------------------------------------------------------ */
.page { padding: var(--s6); display: grid; gap: var(--s5); max-width: 1200px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); }
.page-head h1 { font-size: var(--t-xl); }
.page-head .sub { color: var(--muted); font-size: var(--t-md); margin-top: 2px; }
.page-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.page-tools .input { width: auto; min-width: 160px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s3); }
.kpi { padding: var(--s4); }
.kpi small { display: block; color: var(--muted); font-size: var(--t-sm); font-weight: 700; }
.kpi b { display: block; margin-top: var(--s1); font-size: var(--t-xl); letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-main { background: var(--brand-900); color: #fff; border-color: transparent; }
.kpi.is-main small { color: var(--brand-200); }
.sales-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s5); align-items: start; }
.rows { overflow: hidden; }
.row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); width: 100%; min-height: 56px; padding: var(--s2) var(--s4);
  border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; transition: background 80ms; }
.row:first-child { border-top: 0; }
.row:hover { background: var(--surface-2); }
.row .time { color: var(--muted); font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.row .t { min-width: 0; }
.row .t b { display: block; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { display: block; color: var(--muted); font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .v { display: grid; justify-items: end; gap: 2px; font-weight: 800; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
.row.is-refunded .v > span:first-child { color: var(--muted); text-decoration: line-through; }
.top-items { padding: var(--s4) var(--s5); }
.top-items h2 { font-size: var(--t-base); margin-bottom: var(--s2); }
.top-items ol { margin: 0; padding: 0; list-style: none; }
.top-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); padding: var(--s2) 0; font-size: var(--t-md); }
.top-items li + li { border-top: 1px solid var(--line); }
.top-items li span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-items li b { font-variant-numeric: tabular-nums; }
.more { display: flex; justify-content: center; padding: var(--s3); border-top: 1px solid var(--line); }
.sheet .lines-static { list-style: none; margin: 0 0 var(--s3); padding: 0; }
.sheet .lines-static li { display: flex; justify-content: space-between; gap: var(--s4); padding: var(--s2) 0; font-size: var(--t-md); }
.sheet .lines-static li + li { border-top: 1px solid var(--line); }
.sale-amount { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s3); }
.sale-amount b { font-size: var(--t-2xl); letter-spacing: -0.02em; }
@media (max-width: 899px) {
  .page { padding: var(--s4); }
  .sales-body { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: 56px minmax(0, 1fr) auto; padding: var(--s2) var(--s3); }
}

/* ---- Menu (manager) --------------------------------------------------------------------------------------- */
.menu-list .prow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--s3); min-height: 60px; padding: var(--s2) var(--s4); }
.menu-list .prow + .prow { border-top: 1px solid var(--line); }
.menu-list .prow.is-hidden .t, .menu-list .prow.is-hidden .price { opacity: 0.5; }
.menu-list .prow .t { min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; text-align: left; display: grid; align-content: center; border-radius: var(--r-sm); }
.menu-list .t b { display: block; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-list .t small { color: var(--muted); font-size: var(--t-sm); }
.menu-list .price { font-weight: 800; font-variant-numeric: tabular-nums; }
.menu-list .switch-row { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; font-size: var(--t-sm); color: var(--muted); cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.form-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 560px) {
  .menu-list .prow { grid-template-columns: auto minmax(0, 1fr) auto; }
  .menu-list .prow .price { grid-column: 2; grid-row: 2; }
  .menu-list .prow .switch-row { grid-column: 3; grid-row: 1 / span 2; }
  .menu-list .prow .edit { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- GCT and points on sales ------------------------------------------------------------------------------ */
.gct-note { margin: calc(var(--s2) * -1) 0 0; color: var(--muted); font-size: var(--t-sm); text-align: right; }
.charge-gct { color: var(--brand-200); font-size: var(--t-sm); }
.kv dd .dd-note { display: block; color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.charge-done .kv dd .dd-note { color: var(--brand-200); }
.switch-field { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: var(--s2) 0; cursor: pointer; }
.switch-field b { display: block; font-size: var(--t-md); }
.switch-field small { display: block; color: var(--muted); font-size: var(--t-sm); }

/* ---- Reports ------------------------------------------------------------------------------------------------ */
.reports .seg { flex-wrap: wrap; }
.rhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.rhead .back { margin: 0 0 var(--s1) calc(var(--s2) * -1); }
.rtitle { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--t-lg); outline: none; }
.rhead .sub { color: var(--muted); font-size: var(--t-md); margin-top: 2px; }
.kpi-sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--t-xs); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.is-main .kpi-sub { color: var(--brand-200); }
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--s4); margin-top: var(--s4); align-items: start; }
.rcard { padding: var(--s4) var(--s5); min-width: 0; }
.rcard h3 { font-size: var(--t-base); margin-bottom: var(--s2); }
.rcard .kv > div { padding: var(--s2) 0; }
.rcard .kv > div.is-strong dt, .rcard .kv > div.is-strong dd { color: var(--ink); font-weight: 800; }
.rcard .kv dd { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rtable { width: 100%; border-collapse: collapse; font-size: var(--t-md); }
.rtable th, .rtable td { padding: var(--s2) var(--s1); text-align: left; border-top: 1px solid var(--line); vertical-align: top; }
.rtable thead th { border-top: 0; color: var(--muted); font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.rtable tbody th { font-weight: 600; overflow-wrap: break-word; }
.rtable tbody th small { display: block; color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.rtable .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rscroll { max-height: 360px; overflow-y: auto; }
.rnote { display: flex; gap: var(--s2); align-items: flex-start; margin-top: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-800); font-size: var(--t-sm); }
.rnote .ic { flex: none; margin-top: 2px; }
.notice-inline { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--warn-bg); color: var(--warn); font-size: var(--t-sm); font-weight: 700; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.hbars li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--s3); font-size: var(--t-sm); }
.hbars .h { color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-track { height: 12px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--r-full); background: var(--brand-500); }
.hbars .v { text-align: right; font-weight: 700; }
.hbars .v small { display: block; color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.zrow { grid-template-columns: 76px minmax(0, 1fr) auto; }
.zrow .zlabel { font-weight: 800; color: var(--brand-700); }
.zrow .v small { color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.z-confirm { margin: var(--s3) 0; padding: var(--s1) var(--s4); border-radius: var(--r-lg); background: var(--surface-2); }
.st-tools { align-items: flex-end; }
.date-field { display: grid; gap: 2px; font-size: var(--t-xs); font-weight: 700; color: var(--muted); }
.date-field .input { min-width: 150px; }
.st-card { margin-top: var(--s4); overflow: hidden; }
.st-head, .st-line { display: grid; grid-template-columns: 84px minmax(0, 1fr) 120px 120px 130px; gap: var(--s3); align-items: start; padding: var(--s3) var(--s4); }
.st-head { color: var(--muted); font-size: var(--t-xs); font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.st-head .n, .st-line .num { text-align: right; }
.st-lines { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; }
.st-line + .st-line { border-top: 1px solid var(--line); }
.st-line { font-size: var(--t-md); }
.st-when small, .st-what small { display: block; color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
.st-what { min-width: 0; }
.st-what b { display: block; font-weight: 700; overflow-wrap: anywhere; }
.st-what small { overflow-wrap: anywhere; }
.st-in { color: var(--brand-700); font-weight: 700; }
.st-out { color: var(--ink-2); font-weight: 700; }
.st-bal { font-weight: 800; }
.st-line .lbl { display: none; }
@media (max-width: 899px) {
  .st-head { display: none; }
  .st-line { grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--s3); }
  .st-when { grid-column: 1 / -1; color: var(--muted); font-size: var(--t-sm); }
  .st-when small { display: inline; margin-left: var(--s1); }
  .st-what { grid-column: 1; grid-row: 2 / span 3; }
  .st-in, .st-out, .st-bal { grid-column: 2; }
  .st-in:empty, .st-out:empty { display: none; }
  .st-line .lbl { display: inline; color: var(--muted); font-size: var(--t-xs); font-weight: 600; }
}
@media (max-width: 560px) {
  .rhead .page-tools { width: 100%; }
  .rhead .page-tools .btn { flex: 1 1 auto; }
  .date-field { flex: 1 1 140px; }
  .date-field .input { min-width: 0; width: 100%; }
  .rcard { padding: var(--s4); }
}
/* Four tabs on a phone: labels only, so each stays readable and at least 44px tall */
@media (max-width: 440px) { .tabs button .ic { display: none; } .tabs button { font-size: var(--t-sm); } }
/* Report amounts are long (J$683,393.00): slightly smaller figures and wider tiles so they never get cut off */
.reports .kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.reports .kpi b { font-size: var(--t-lg); }
.z-hint { margin-bottom: var(--s4); }
@media (max-width: 560px) {
  .reports .kpis { grid-template-columns: 1fr 1fr; }
  .reports .kpi { padding: var(--s3); }
  .reports .kpi b { font-size: var(--t-base); }
  .reports .kpi.is-main { grid-column: 1 / -1; }
  .reports .kpi.is-main b { font-size: var(--t-xl); }
}

/* ---- Tap cards: "Pay with tap card", card PIN pad, camera, "Test card reader" ------------------------------- */
.tap-or { display: flex; gap: var(--s2); align-items: flex-start; color: var(--brand-200); font-size: var(--t-md); }
.tap-or .ic { flex: none; margin-top: 2px; color: var(--brand-300); }
.back-app { justify-self: center; }
.tap { display: grid; gap: var(--s4); }
.tap-amount { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--surface-2); }
.tap-amount .num { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -0.02em; }
.tap-amount small { min-width: 0; color: var(--muted); font-size: var(--t-sm); font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.tap-read { display: grid; gap: var(--s3); }
.tap-hint { display: flex; gap: var(--s3); align-items: center; }
.tap-hint-ic { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: var(--r-lg); background: var(--brand-100); color: var(--brand-700); }
.tap-hint b { display: block; font-size: var(--t-base); }
.tap-hint small { display: block; color: var(--muted); font-size: var(--t-sm); }
.tap-label { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.tap-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); }
.tap-row .input { font-size: 16px; } /* 16px or more: iPhones don't zoom in when the field gets focus */
.tap-ways { display: flex; flex-wrap: wrap; gap: var(--s2); }
.tap-ways .btn { flex: 1 1 200px; }
.scanner { display: grid; gap: var(--s2); justify-items: center; }
.scanner video { width: 100%; max-height: 300px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-lg); background: #0b1a14; }
.scan-msg { color: var(--muted); font-size: var(--t-sm); text-align: center; }
.tap-pin { display: grid; gap: var(--s3); }
.tap-holder { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3); }
.tap-holder b { display: block; font-size: var(--t-lg); overflow-wrap: anywhere; }
.tap-holder small { display: block; color: var(--muted); font-size: var(--t-sm); }
.tap-ask { text-align: center; font-size: var(--t-md); color: var(--ink-2); }
.pin-dots { display: flex; justify-content: center; gap: 16px; padding: var(--s1) 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brand-600); transition: background var(--fast), transform 200ms var(--spring); }
.pin-dots span.on { background: var(--brand-600); transform: scale(1.12); }
.tap-pad { max-width: 360px; width: 100%; margin: 0 auto; }
.tap-pad button:disabled { opacity: 0.45; }
.tap-pad button { display: grid; place-items: center; }
.tap-pad .key-text { font-size: var(--t-md); }
.tap-paying { display: flex; align-items: center; justify-content: center; gap: var(--s2); color: var(--brand-700); font-weight: 700; }
.tap-paying[hidden] { display: none; }
.tap-demo { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tap .form-error, .reader-test .form-error { margin: 0; }
@media (max-width: 480px) {
  .tap-holder { grid-template-columns: auto minmax(0, 1fr); }
  .tap-holder [data-other] { grid-column: 1 / -1; justify-self: start; }
  .tap-row { grid-template-columns: minmax(0, 1fr); }
}
/* Short landscape tablets: a slightly smaller keypad so the whole PIN step fits without scrolling */
@media (max-height: 800px) and (min-width: 900px) { .tap-pad button { height: 52px; } }
.reader-test { display: grid; gap: var(--s3); }
.reader-test form { display: grid; gap: var(--s2); }
.reader-results { display: grid; gap: var(--s2); }
.reader-result { display: grid; gap: 4px; padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.reader-result b { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-md); }
.reader-result.is-ok { border-color: var(--brand-300); background: var(--brand-50); }
.reader-result.is-ok b { color: var(--brand-800); }
.reader-result.is-warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-bg); }
.reader-result.is-warn b { color: var(--warn); }
.reader-result.is-bad { border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-bg); }
.reader-result.is-bad b { color: var(--danger); }
.reader-result .raw { font-weight: 700; overflow-wrap: anywhere; }
.reader-result small { color: var(--ink-2); font-size: var(--t-sm); }
