/* Whale POS screens, on top of the shared brand kit (ui.css). Phone < 700px, iPad 700-1099px, computer >= 1100px. No inline styles anywhere (strict CSP). */
.boot { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--navy); }
.boot .spinner { border-color: rgba(255,255,255,.2); border-top-color: var(--gold); width: 28px; height: 28px; }
.pad { padding: 24px; }
body.modal-open, body.cart-open { overflow: hidden; }
.ic { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.2em; }
.req { color: var(--bad); }
.ok { color: var(--ok); } .warn { color: var(--warn); } .bad { color: var(--bad); } .neg { color: var(--bad); }
.spacer { height: 12px; } .section { margin-top: 18px; } .toolbar { margin-bottom: 12px; } .filters { margin-bottom: 4px; } .filters .row { margin-top: 8px; }
.row.tight { gap: 6px; } .cart-head .row.tight { flex-wrap: nowrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.field.low { display: flex; align-items: flex-end; padding-bottom: 6px; }
.hide-sm { } .only-phone { display: none; }
code { background: var(--soft); padding: 1px 6px; border-radius: 6px; font-size: .85em; }
.tbl tr.clickable { cursor: pointer; } .tbl tr.clickable:focus-visible { outline-offset: -3px; }
.tbl td .row { flex-wrap: wrap; }

/* top bar extras */
.topbar .till { display: flex; align-items: center; } .till-select { width: auto; min-width: 140px; max-width: 220px; min-height: 36px; padding: 2px 10px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; } .pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.queue-btn { gap: 4px; }
.nav-foot { min-height: 46px; display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: 0; color: #cfe0f7; cursor: pointer; text-align: left; font: inherit; font-size: .85rem; padding: 4px; border-radius: 10px; }
.nav-foot:hover { background: rgba(255,255,255,.07); } .nav-foot svg { width: 22px; height: 22px; flex: none; }

/* sell screen */
.sell { display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 32vw, 420px); gap: 14px; align-items: start; }
.picker { min-width: 0; }
.searchrow { position: relative; } .searchrow .si { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; } .searchrow .si svg { width: 20px; height: 20px; display: block; }
.searchrow .sell-search { padding-left: 44px; min-height: 52px; font-size: 1.05rem; border-radius: 13px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.chip { flex: none; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--gold); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 10px; margin-top: 8px; }
.pgrid .empty.wide { grid-column: 1 / -1; }
.ptile { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-height: 100px; padding: 10px 12px; text-align: left; background: #fff; border: 1px solid var(--border); border-top: 3px solid transparent; border-radius: 13px; box-shadow: var(--shadow); font: inherit; color: var(--text); cursor: pointer; touch-action: manipulation; }
.ptile:active { transform: scale(.975); border-top-color: var(--gold); }
@media (hover: hover) { .ptile:hover { border-top-color: var(--gold); } }
.ptile .nm { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptile .pr { font-weight: 800; color: var(--navy); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ptile .st { font-size: .76rem; color: var(--muted); } .ptile.low .st { color: var(--warn); font-weight: 700; } .ptile.out { opacity: .55; } .ptile.out .st { color: var(--bad); font-weight: 700; }

.cart { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-top: 4px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); position: sticky; top: 76px; max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); }
.cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); } .cart-head h2 { margin: 0; }
.cart-lines { flex: 1; overflow-y: auto; min-height: 110px; -webkit-overflow-scrolling: touch; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; flex: 1; min-height: 150px; padding: 20px; color: var(--muted); text-align: center; } .cart-empty svg { width: 44px; height: 44px; opacity: .45; }
.cline { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nm amt" "sub rm"; gap: 6px 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.cline .nm { grid-area: nm; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; overflow-wrap: anywhere; }
.cline .amt { grid-area: amt; text-align: right; font-variant-numeric: tabular-nums; }
.cline .sub { grid-area: sub; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cline .rm { grid-area: rm; justify-self: end; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid #b9c7dc; border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; min-height: 40px; border: 0; background: var(--soft); color: var(--navy); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; } .stepper button:active { background: #dbe6f6; }
.stepper .q { width: 52px; min-height: 40px; text-align: center; border: 0; border-radius: 0; font-weight: 700; padding: 0; box-shadow: none; }
.totals { padding: 10px 14px; background: var(--soft); border-top: 1px solid var(--border); }
.totals .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.totals .r { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.totals .grand { font-size: 1.45rem; font-weight: 800; color: var(--navy); border-top: 1px dashed #c3d3ea; margin-top: 6px; padding-top: 8px; }
.cart-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 14px 14px; } .paybtn { grid-column: 1 / -1; min-height: 58px; font-size: 1.15rem; }
.cartbar { display: none; }

/* gate card (no open shift, empty states) */
.gate { max-width: 520px; margin: 6vh auto 0; text-align: center; padding: 30px 22px; } .gate .gate-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: #f8ecc9; color: var(--gold-3); display: grid; place-items: center; } .gate .gate-icon svg { width: 32px; height: 32px; }

/* payment and result dialogs */
.due { text-align: center; padding: 4px 0 12px; } .due .amt { font-size: 2.5rem; font-weight: 800; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.paylist .p { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; margin-bottom: 6px; background: var(--ok-bg); border-radius: 11px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; } .seg-btn { flex: 1 1 auto; min-height: 44px; padding: 6px 12px; border-radius: 11px; border: 1px solid var(--border); background: #fff; font: inherit; font-weight: 700; color: var(--navy); cursor: pointer; touch-action: manipulation; }
.seg-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: inset 0 -3px 0 var(--gold); }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 8px; margin: 8px 0; }
.changehint { min-height: 26px; font-size: 1.15rem; padding: 2px 0 8px; }
.qrbox { text-align: center; padding: 8px; border: 1px dashed var(--gold); border-radius: 14px; background: #fffdf6; } .qrbox img { width: min(260px, 70vw); height: auto; image-rendering: pixelated; }
.done-head { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; } .check-badge { width: 54px; height: 54px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; flex: none; } .check-badge svg { width: 30px; height: 30px; }
.change { font-size: 1.2rem; } .change b { color: var(--navy); font-size: 1.9rem; font-variant-numeric: tabular-nums; }
.rcpt-scroll { max-height: 52vh; max-height: 52dvh; overflow: auto; padding: 8px; background: var(--soft); border-radius: 12px; } .rcpt-scroll.flat { max-height: none; background: transparent; padding: 0; }
.held { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: #fff; } .held .grow { min-width: 0; }
.cust-list { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow: auto; } .cust { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: 11px; font: inherit; cursor: pointer; text-align: left; }
.retline { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.secret { font: 700 1.5rem/1.3 ui-monospace, Consolas, monospace; padding: 14px; background: var(--soft); border: 1px dashed var(--gold); border-radius: 12px; text-align: center; letter-spacing: .04em; user-select: all; word-break: break-all; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; } .more-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border: 1px solid var(--border); border-radius: 14px; background: #fff; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; } .more-item svg { width: 28px; height: 28px; color: var(--blue); }
.acct-head { display: flex; gap: 12px; align-items: center; } .avatar { width: 54px; height: 54px; border-radius: 50%; background: var(--navy); color: var(--gold-2); display: grid; place-items: center; flex: none; } .avatar svg { width: 28px; height: 28px; }

/* shift, reports, settings */
.shiftgrid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
.diff { min-height: 28px; margin: 4px 0 10px; font-size: 1.05rem; }
.kpi.sm .n { font-size: 1.1rem; }
.chart { width: 100%; height: auto; display: block; } .chart .bar { fill: var(--blue); } .chart .peak { fill: var(--gold); } .chart .tick { fill: var(--muted); font-size: 10px; }
.hbar { width: 100%; height: 8px; display: block; margin: 3px 0 10px; } .hbar .bg { fill: var(--soft); } .hbar .fg { fill: var(--gold); }
.form-card { max-width: 920px; }

/* the paper receipt (screen preview and 80 mm print) */
.rcpt { font-family: "Sarabun", "Leelawadee UI", "Courier New", monospace; font-size: 13px; line-height: 1.4; color: #000; background: #fff; padding: 14px 16px; width: 100%; max-width: 340px; margin: 0 auto; border: 1px dashed #b9c7dc; border-radius: 4px; }
.rcpt .c { text-align: center; } .rcpt .b { font-weight: 700; } .rcpt .big { font-size: 1.15em; } .rcpt .small { font-size: .85em; } .rcpt .muted { color: #555; }
.rcpt hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.rcpt .r2 { display: flex; justify-content: space-between; gap: 8px; } .rcpt .r2 .amt { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } .rcpt .sub { color: #444; font-size: .92em; }
.rcpt .it { margin-top: 3px; font-weight: 600; overflow-wrap: anywhere; } .rcpt .void { color: #b42318; letter-spacing: .06em; } .rcpt .warnline { color: #8a5300; margin: 4px 0; }
.rcpt.zrep { max-width: 380px; }
#print-root { display: none; }
@media print {
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .rcpt { width: 72mm; max-width: none; border: 0; padding: 0; margin: 0; font-size: 11pt; }
  @page { margin: 3mm; }
}

/* ── iPad / tablets ── */
@media (min-width: 700px) and (max-width: 1099px) {
  .sell { grid-template-columns: minmax(0, 1fr) clamp(300px, 38vw, 360px); gap: 12px; }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }
  .cart { top: 72px; }
  .nav-foot { justify-content: center; padding: 6px 0; }
}
@media (min-width: 700px) and (max-width: 899px) and (orientation: portrait) {
  .cline { padding: 8px 12px; } .totals { padding: 8px 12px; } .cart-actions { padding: 8px 12px 12px; }
}

/* ── phones ── */
@media (max-width: 699px) {
  .hide-sm { display: none !important; } .only-phone { display: inline-flex; }
  .sell { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .ptile { min-height: 92px; }
  .cart { position: fixed; inset: 0; z-index: 60; border-radius: 0; border: 0; max-height: none; transform: translateY(100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
          padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .cart.open { transform: none; visibility: visible; transition: transform .22s ease, visibility 0s; }
  .cart-lines { max-height: none; }
  .cartbar { display: flex; align-items: center; gap: 10px; position: fixed; left: 10px; right: 10px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 29; box-shadow: 0 10px 28px rgba(11,31,58,.35); } .cartbar .tl { text-align: left; }
  body:has(.cartbar:not([hidden])) .content { padding-bottom: calc(142px + env(safe-area-inset-bottom)); }
  .due .amt { font-size: 2.1rem; }
  .rcpt-scroll { max-height: 38vh; max-height: 38dvh; }
  .gate { margin-top: 2vh; }
  .till-select { min-width: 0; max-width: 120px; }
  .shiftgrid { grid-template-columns: 1fr; }
  .filters .grid.g4, .filters .grid.g3 { grid-template-columns: 1fr 1fr; } .filters .grid.g3 > :nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .filters .grid.g4, .filters .grid.g3 { grid-template-columns: 1fr; }
}

/* Whale Hub mode */
.hubbox { margin-top: 10px; padding: 10px 12px; background: var(--soft); border-radius: 12px; }
.hubbox .row { margin-top: 6px; }
