/* ==========================================================================
   Studio register (POS). Drawn by assets/js/app/pos-studio.js; Classic is the
   default and keeps pages-business.css. Everything is under .pst (the
   register) or its pop-ups (.pst-cs, .pst-cmodal, .pst-shift-figs, .pst-wait).

   Compact on purpose, with solid colours that say what a thing is: each
   category has its colour, Cash is green, MoMo yellow, Card black, stock is a
   green / amber / red pill, Hold is amber and Clear is red.

   The layout follows the register's own width (container queries), not the
   window's, so the app's sidebar never squeezes the order panel. Large
   screens: the register fills the page box and only the tiles and order lines
   scroll. Phones: the page scrolls and the order opens as a sheet.
   ========================================================================== */
.pst {
    --g: #0e7a55; --g2: #0a5e42; --gs: #e8f5ee;
    --line: #e4e8e6; --soft: #f3f5f4; --mut: #4b5650;
    --cash: #16a34a; --momo: #facc15; --card: #2563eb;
    container-type: inline-size; container-name: pst;
    background: var(--soft); color: #000; font-size: 13px;
    display: grid; grid-template-rows: auto minmax(0, 1fr);
}
.pst button { font: inherit; color: inherit; }
.pst kbd { font-family: inherit; }

/* ---- The page box ----------------------------------------------------- */
#main-app .page-content > .pst { max-width: none !important; margin: 0 !important; }
@media (min-width: 860px) {
    #main-app .page-content:has(> .pst) { padding: 0 !important; overflow: hidden !important; scrollbar-gutter: auto; }
    #main-app .page-content > .pst { height: 100%; }
}
@media (max-width: 859px) {
    #main-app .page-content:has(> .pst) {
        padding: 0 0 calc(var(--bnav-h, 64px) + max(var(--safe-b, 0px), env(safe-area-inset-bottom, 0px)) + 84px) !important;
    }
}
body.pos-fullscreen #main-app .page-content:has(> .pst) { top: 0 !important; left: 0 !important; padding: 0 !important; }

/* ---- Register bar ---------------------------------------------------- */
.pst-top { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.pst-store { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 200px; }
.pst-mk { position: relative; width: 32px; height: 32px; border-radius: 9px; background: var(--g); color: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.pst-mk em { font-style: normal; font-weight: 800; font-size: 13px; }
.pst-mk img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.pst-store-tx { min-width: 0; }
.pst-store-tx b { display: block; font-size: 13.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.pst-store-tx small { display: block; font-size: 11px; color: var(--mut); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-search { flex: 1 1 280px; min-width: 140px; max-width: 520px; height: 36px; border-radius: 10px; background: var(--soft); display: flex; align-items: center; gap: 8px; padding: 0 4px 0 11px; border: 1px solid transparent; margin: 0; cursor: text; }
.pst-search:focus-within { background: #fff; border-color: var(--g); box-shadow: 0 0 0 3px rgba(14, 122, 85, .12); }
.pst-search > .bi { color: #000; font-size: 14px; }
.pst-search input { flex: 1; min-width: 0; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; font-size: 13px; font-weight: 600; color: #000; padding: 0 !important; height: 34px; }
.pst-search input::placeholder { color: #5b6660; font-weight: 500; }
.pst-kbd { font-size: 10.5px; font-weight: 700; color: #334155; background: #fff; border: 1px solid #d9dedb; border-radius: 5px; padding: 1px 6px; }
.pst-search:focus-within .pst-kbd { display: none; }
.pst-scan { width: 28px; height: 28px; border-radius: 8px; background: #000; color: #fff !important; border: 0; display: grid; place-items: center; cursor: pointer; flex: none; font-size: 13px; }
.pst-top-r { margin-left: auto; display: flex; align-items: center; gap: 6px; min-width: 0; flex: none; }
.pst-top-r .branch-selector, .pst-top-r select { max-width: 150px; }
.pst-pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px !important; font-weight: 800 !important; white-space: nowrap; cursor: pointer; }
.pst-pill.is-sync { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.pst-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pst-shift:empty { display: none; }
/* Shift: green when open, amber to open one. */
.pst-shift-pill { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.pst-shift-pill .bi { font-size: 13px; }
.pst-shift-pill.is-off { background: #f59e0b; border-color: #f59e0b; color: #000 !important; }
.pst-cs-pill .bi { font-size: 13px; }
.pst-cs-pill.is-on { background: #16a34a; border-color: #16a34a; color: #fff !important; }
.pst-cs-pill.is-wait { background: #fef3c7; border-color: #f59e0b; }
.pst-ib { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; font-size: 14px; cursor: pointer; flex: none; }
.pst-ib:hover { background: var(--soft); }
.pst-fs { display: none; }
@media (min-width: 860px) { .pst-fs { display: grid; } }

/* ---- Body: rail · products · order ---------------------------------------- */
.pst-main { --rail: 70px; --order: 336px; display: grid; grid-template-columns: var(--rail) minmax(0, 1fr) var(--order); min-height: 0; }
.pst-rail { background: #fff; border-right: 1px solid var(--line); padding: 8px 6px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; scrollbar-width: none; }
.pst-rail::-webkit-scrollbar { display: none; }
.pst-rb { appearance: none; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border-radius: 12px; cursor: pointer; flex: none; }
.pst-ri { width: 34px; height: 34px; border-radius: 10px; background: var(--rc, #111827); color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; transition: transform .12s ease, box-shadow .12s ease; }
.pst-rl { max-width: 100%; font-size: 10px; font-weight: 700; color: #334155; text-align: center; line-height: 1.15; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: normal; overflow-wrap: normal; }
.pst-rb:hover .pst-ri { transform: translateY(-1px); }
.pst-rb.is-on { background: color-mix(in srgb, var(--rc, #111827) 12%, #fff); }
.pst-rb.is-on .pst-ri { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--rc, #111827); }
.pst-rb.is-on .pst-rl { color: #000; font-weight: 900; }

.pst-center { min-height: 0; overflow-y: auto; padding: 12px 12px 20px; }
.pst-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.pst-head h1 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; margin: 0; color: #000; }
.pst-head > span { font-size: 12px; color: var(--mut); font-weight: 700; }
.pst-chips { margin-left: auto; display: flex; gap: 6px; }
.pst-chip { height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid #d9dedb; background: #fff; font-size: 12px !important; font-weight: 800 !important; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.pst-chip:hover { border-color: #000; }

/* ---- Tiles ------------------------------------------------------------ */
.pst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 9px; }
.pst-t { appearance: none; position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; min-width: 0; }
.pst-t:hover { box-shadow: 0 10px 22px -18px rgba(15, 23, 42, .5); border-color: #cfd6d2; }
.pst-t:active { transform: scale(.98); }
.pst-t.is-in { border-color: var(--g); box-shadow: 0 0 0 1px var(--g); }
.pst-t.is-out { cursor: default; opacity: .6; }
.pst-t.is-out:hover { box-shadow: none; border-color: var(--line); }
/* The picture fills its box edge to edge (absolute, so no gap on any screen). */
.pst-ph { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(140deg, color-mix(in srgb, var(--pos-tint, #059669) 15%, #fff), color-mix(in srgb, var(--pos-tint, #059669) 6%, #fff)); }
.pst-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.pst-ph em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 22px; color: color-mix(in srgb, var(--pos-tint, #059669) 75%, #000); }
.pst-q { position: absolute; top: 6px; right: 6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--g); color: #fff; font-size: 11.5px; font-weight: 900; display: grid; place-items: center; padding: 0 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.pst-opt { position: absolute; top: 6px; left: 6px; height: 20px; padding: 0 7px; border-radius: 10px; background: #000; color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }
.pst-tb { display: flex; flex-direction: column; padding: 7px 8px 8px; gap: 4px; min-width: 0; flex: 1; }
.pst-nm { font-size: 12px; font-weight: 700; line-height: 1.25; height: 30px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #000; }
.pst-pr { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: auto; flex-wrap: wrap; }
.pst-pr b { font-size: 13.5px; font-weight: 900; white-space: nowrap; color: #000; }
.pst-pr b small { font-size: 10.5px; font-weight: 700; color: var(--mut); }
/* Stock: a solid pill. */
.pst-st { font-size: 10px; font-weight: 800; color: #fff; background: #16a34a; border-radius: 999px; padding: 2px 7px; display: inline-flex; align-items: center; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pst-st i { display: none; }
.pst-st.is-low { background: #f59e0b; color: #000; }
.pst-st.is-out { background: #dc2626; color: #fff; }
.pst-none { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 40px 16px; color: var(--mut); }
.pst-none i { font-size: 24px; color: #000; }
.pst-none b { color: #000; font-size: 14px; }
.pst-none small { font-size: 12.5px; font-weight: 600; max-width: 380px; }

/* ---- Order panel ------------------------------------------------------- */
.pst-order { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.pst-o-top { padding: 9px 12px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.pst-o-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pst-o-row h2 { font-size: 15px; font-weight: 800; margin: 0; color: #000; }
.pst-o-n { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #000; color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.pst-o-n.pos-bump { animation: pstBump .35s ease; }
@keyframes pstBump { 50% { transform: scale(1.25); } }
.pst-o-name { flex: 1; min-width: 0; height: 30px; border-radius: 8px !important; border: 1px solid var(--line) !important; background: var(--soft) !important; font-size: 12px !important; font-weight: 700; padding: 0 9px !important; color: #000; }
.pst-o-name:focus { background: #fff !important; border-color: var(--g) !important; outline: 0; }
.pst-o-acts { display: flex; gap: 5px; }
.pst-sb { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; background: #fff; cursor: pointer; flex: none; }
.pst-sb:hover { filter: brightness(.96); }
.pst-sb.is-hold { background: #f59e0b; border-color: #f59e0b; color: #000 !important; }
.pst-sb.is-clear { background: #fee2e2; border-color: #fecaca; color: #b91c1c !important; }
.pst-o-close { display: none; }
.pst-o-row2 { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
#pst-cust-host { flex: 1; min-width: 0; display: flex; }
.pst-o-row2 select { width: 112px; flex: none; min-width: 0; height: auto; border-radius: 10px; border: 1px solid var(--line); font-size: 11.5px; font-weight: 700; padding: 0 24px 0 8px; background-color: #fff; color: #000; }
.pst-o-row2 .pst-sb { height: auto; }
.pst-cust { width: 100%; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-align: left; cursor: pointer; }
.pst-cust.is-empty { border-style: dashed; border-color: #c8cfcb; }
.pst-cust:hover { border-color: var(--g); }
.pst-cav { width: 28px; height: 28px; border-radius: 50%; background: #f59e0b; color: #000; display: grid; place-items: center; font-weight: 900; font-size: 11.5px; flex: none; }
.pst-cust.is-empty .pst-cav { background: var(--g); color: #fff; font-size: 14px; }
.pst-ctx { min-width: 0; flex: 1; }
.pst-ctx b { display: block; font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.pst-ctx small { display: block; font-size: 10.5px; color: var(--mut); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-pts { font-size: 10.5px; font-weight: 900; color: #000; background: #facc15; border-radius: 999px; padding: 3px 7px; white-space: nowrap; }

/* Lines: name and total on top; price, steps and remove under it. */
.pst-lines { flex: 1; min-height: 70px; overflow-y: auto; padding: 2px 12px; }
.pst-ln { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid #eff2f0; }
.pst-ln.is-new { animation: pstNew 2.4s ease; }
@keyframes pstNew { 0%, 35% { background: #dcfce7; } 100% { background: transparent; } }
.pst-ln.is-sel { background: #f0fdf4; box-shadow: inset 3px 0 0 var(--g); margin: 0 -12px; padding: 7px 12px; }
.pst-lth { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; background: var(--soft); display: grid; place-items: center; position: relative; }
.pst-lth img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pst-lth em { font-style: normal; font-weight: 800; font-size: 11px; color: var(--g2); }
.pst-lm { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.pst-lr1 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.pst-lr1 b { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #000; }
.pst-lv { font-size: 12.5px; font-weight: 900; white-space: nowrap; color: #000; }
.pst-lr2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pst-lr2 small { flex: 1; min-width: 0; font-size: 11px; color: var(--mut); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-step { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; height: 26px; overflow: hidden; flex: none; }
.pst-step button { width: 24px; height: 24px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; font-size: 13px; }
.pst-step button:hover { background: var(--soft); }
.pst-step input { width: 30px; height: 24px; border: 0 !important; text-align: center; font-weight: 800; font-size: 12px; padding: 0 !important; background: transparent !important; box-shadow: none !important; -moz-appearance: textfield; color: #000; }
.pst-step input::-webkit-outer-spin-button, .pst-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pst-meas { height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 11.5px !important; font-weight: 800 !important; padding: 0 8px; display: inline-flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; flex: none; }
.pst-lx { width: 22px; height: 22px; border-radius: 6px; border: 0; background: #fee2e2; color: #b91c1c !important; display: grid; place-items: center; cursor: pointer; font-size: 10px; flex: none; }
.pst-lx:hover { background: #dc2626; color: #fff !important; }
.pst-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; padding: 26px 10px; color: var(--mut); height: 100%; }
.pst-empty span { width: 44px; height: 44px; border-radius: 13px; background: var(--g); color: #fff; display: grid; place-items: center; font-size: 19px; margin-bottom: 5px; }
.pst-empty b { color: #000; font-size: 13px; }
.pst-empty small { font-size: 11.5px; font-weight: 600; }

/* Number pad */
.pst-pad { border-top: 1px solid var(--line); padding: 7px 12px; background: #fbfcfb; }
.pst-pad[hidden] { display: none; }
.pst-pad-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pst-pad-modes { display: flex; background: var(--soft); border-radius: 8px; padding: 2px; flex: none; }
.pst-pad-modes button { border: 0; background: transparent; height: 26px; padding: 0 9px; border-radius: 7px; font-size: 11.5px !important; font-weight: 800 !important; color: #334155 !important; cursor: pointer; }
.pst-pad-modes button.is-on { background: #000; color: #fff !important; }
.pst-pad-val { flex: 1; min-width: 0; text-align: right; }
.pst-pad-val small { display: block; font-size: 10.5px; color: var(--mut); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pst-pad-val b { font-size: 18px; font-weight: 900; color: #94a3b8; line-height: 1.1; }
.pst-pad.is-typing .pst-pad-val b { color: #000; }
.pst-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pst-k { height: 34px; border-radius: 8px; background: #fff; border: 1px solid #e1e5e3; font-size: 15px !important; font-weight: 800 !important; color: #000 !important; cursor: pointer; display: grid; place-items: center; }
.pst-k:active { background: var(--soft); transform: scale(.97); }
.pst-k.is-fn { font-size: 11.5px !important; background: #f1f5f9; }
.pst-k.is-ok { grid-row: span 2; height: auto; background: var(--g); border-color: var(--g); color: #fff !important; font-size: 14px !important; }
.pst-k.is-zero { grid-column: span 2; }

/* Totals, how they pay, Charge */
.pst-sum { padding: 7px 12px 0; border-top: 1px solid var(--line); }
.pst-sr { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: #334155; padding: 2px 0; }
.pst-sr > span:last-child { white-space: nowrap; }
.pst-sr .pst-x { width: 16px; height: 16px; border: 0; border-radius: 4px; background: #dc2626; color: #fff !important; display: inline-grid; place-items: center; font-size: 10px; vertical-align: -2px; cursor: pointer; margin-left: 4px; }
#pst-disc-row { color: var(--g2); font-weight: 800; }
.pst-sr.pst-tot { color: #000; font-size: 13.5px; font-weight: 800; padding-top: 4px; align-items: baseline; }
.pst-sr.pst-tot b { font-size: 21px; letter-spacing: -.02em; font-weight: 900; }
.pst-pay { padding: 7px 12px 10px; }
.pst-pm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
/* Each way to pay in its own colour: light until picked, solid when picked. */
.pst-pmb { --pc: #64748b; --pt: #fff; height: 36px; border-radius: 9px; border: 1.5px solid var(--pc); background: color-mix(in srgb, var(--pc) 10%, #fff); display: flex; align-items: center; justify-content: center; gap: 5px; font-size: 11.5px !important; font-weight: 800 !important; color: #000 !important; cursor: pointer; min-width: 0; white-space: nowrap; overflow: hidden; }
.pst-pmb .bi { font-size: 14px; }
.pst-pmb b { font-size: 12px; font-weight: 900; letter-spacing: .02em; line-height: 1; }
.pst-pmb.is-cash { --pc: var(--cash); }
.pst-pmb.is-momo { --pc: #eab308; --pt: #000; }
.pst-pmb.is-card { --pc: var(--card); }
.pst-pmb.is-on { background: var(--pc); color: var(--pt) !important; }
.pst-pmb.is-momo.is-on { background: var(--momo); }
.pst-padbtn { --pc: #475569; }
.pst-padbtn.is-on { --pc: #000; background: #000; color: #fff !important; }
.pst-padbtn span { display: none; }
.pst-qc { display: flex; gap: 5px; margin-top: 6px; }
.pst-qc:empty { display: none; }
.pst-qcb { flex: 1 1 0; min-width: 0; height: 30px; border-radius: 8px; border: 1.5px solid var(--cash); background: #fff; color: #14532d !important; font-size: 11.5px !important; font-weight: 800 !important; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; display: flex; align-items: center; justify-content: center; gap: 3px; line-height: 1; }
.pst-qcb small { font-size: 9.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .03em; }
.pst-qcb.is-exact { background: var(--cash); color: #fff !important; }
.pst-qcb:hover { filter: brightness(.95); }
.pst-charge { margin-top: 7px; width: 100%; height: 44px; border-radius: 11px; border: 0; background: var(--g); color: #fff !important; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px; font-size: 14.5px !important; font-weight: 800 !important; cursor: pointer; box-shadow: 0 8px 18px -12px var(--g); transition: background .15s ease, transform .1s ease; }
.pst-charge:hover { background: var(--g2); }
.pst-charge:active { transform: scale(.99); }
.pst-charge:disabled { background: #9db8ad; box-shadow: none; cursor: default; }
.pst-charge > span { display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; min-width: 0; }
.pst-charge b { font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.pst-charge kbd { font-size: 10.5px; font-weight: 700; background: rgba(255, 255, 255, .2); border-radius: 5px; padding: 2px 6px; color: #fff; border: 0; flex: none; }
/* With the keypad open the quick cash steps aside (the keypad is for typing). */
.pst-order.is-pad .pst-qc { display: none; }

/* ---- Sizes follow the register's own width (the sidebar included) ---------- */
@container pst (min-width: 1440px) {
    .pst-main { --rail: 76px; --order: 372px; }
    .pst-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@container pst (max-width: 1239px) {
    .pst-cs-pill .pst-cs-t, .pst-shift-pill .pst-shift-t { display: none; }
    .pst-cs-pill, .pst-shift-pill { padding: 0 10px; }
}
@container pst (max-width: 1099px) {
    .pst-main { --rail: 68px; --order: 312px; }
    .pst-store { flex: 0 0 auto; }
    .pst-store-tx { display: none; }
    .pst-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
    .pst-kbd { display: none; }
}
@container pst (max-width: 939px) {
    .pst-main { --rail: 54px; --order: 292px; }
    .pst-rl { display: none; }
    .pst-rb { padding: 5px 0; }
    .pst-pmb > span { display: none; }
}
/* Short screens (a 1366 x 768 laptop) */
@media (min-width: 860px) and (max-height: 800px) {
    .pst-ln { padding: 5px 0; }
    .pst-ln.is-sel { padding: 5px 12px; }
    .pst-k { height: 31px; }
    .pst-charge { height: 42px; }
}

/* ---- Phones and small tablets ---------------------------------------------- */
@media (max-width: 859px) {
    .pst { display: block; background: var(--soft); }
    .pst-top { flex-wrap: wrap; padding: 8px 10px; gap: 7px; position: sticky; top: 0; z-index: 20; }
    .pst-store { flex: 1 1 auto; }
    .pst-store-tx { display: block; }
    .pst-top-r { margin-left: 0; gap: 5px; }
    .pst-top-r .branch-selector, .pst-top-r select { display: none; }
    .pst-search { order: 3; flex: 1 1 100%; max-width: none; }
    .pst-kbd { display: none; }
    .pst-cs-pill .pst-cs-t, .pst-shift-pill .pst-shift-t { display: none; }
    .pst-cs-pill, .pst-shift-pill { padding: 0 10px; }
    .pst-main { display: block; }
    .pst-rail { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-right: 0; border-bottom: 1px solid var(--line); padding: 7px 10px; gap: 6px; }
    .pst-rb { flex-direction: row; gap: 6px; padding: 3px 10px 3px 3px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: #fff; white-space: nowrap; }
    .pst-ri { width: 26px; height: 26px; border-radius: 50%; font-size: 13px; }
    .pst-rl { display: block; font-size: 12px; -webkit-line-clamp: unset; }
    .pst-rb.is-on { background: var(--rc, #111827); border-color: var(--rc, #111827); }
    .pst-rb.is-on .pst-rl { color: #fff; }
    .pst-rb.is-on .pst-ri { box-shadow: none; background: rgba(255, 255, 255, .22); }
    .pst-center { overflow: visible; padding: 10px; }
    .pst-head h1 { font-size: 15px; }
    .pst-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .pst-order { display: none; }
    .pst.is-order-open .pst-order {
        display: flex; position: fixed; inset: var(--topbar-h, 60px) 0 0 0; z-index: 2400; border-left: 0;
        padding-bottom: max(var(--safe-b, 0px), env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -12px 30px -18px rgba(15, 23, 42, .4);
        animation: pstSheet .25s cubic-bezier(.2, .8, .2, 1);
    }
    .pst.is-order-open .pst-o-close { display: grid; }
    .pst-charge kbd { display: none; }
    .pst-charge { height: 48px; }
    .pst-pmb { height: 40px; }
    .pst-qcb { height: 34px; }
}
@media (min-width: 560px) and (max-width: 859px) { .pst-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@keyframes pstSheet { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }

/* The phone bar that opens the order sheet: solid green, phones only. */
.pst-mbar {
    position: fixed; left: 10px; right: 10px; z-index: 210;
    bottom: calc(var(--bnav-h, 64px) + max(var(--safe-b, 0px), env(safe-area-inset-bottom, 0px)) + 8px);
    display: none; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 9px 14px;
    border-radius: 14px; border: 0; background: #0e7a55; color: #fff; cursor: pointer; font: inherit;
    box-shadow: 0 14px 28px -12px rgba(14, 122, 85, .7);
}
.pst-mbar .pos-mc-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left; }
.pst-mbar .pos-mc-sub { font-size: 11.5px; font-weight: 700; color: #d1efdf; }
.pst-mbar .pos-mc-amt { font-size: 17px; font-weight: 900; white-space: nowrap; }
.pst-mbar .pos-mc-cta { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: #facc15; color: #000; font-weight: 900; font-size: 13px; white-space: nowrap; }
@media (min-width: 860px) { .pst-mbar { display: none !important; } }
/* The order sheet sits under pop-ups (2500) and over the app's bottom menu;
   these hide only while the sheet is really open. */
body:has(.pst.is-order-open) :is(#pos-mobile-checkout, .bottom-nav, #mobile-menu-fab) { display: none !important; }

/* ---- Pop-ups ------------------------------------------------------------ */
/* Customer screen set-up */
.pst-cs { display: flex; flex-direction: column; gap: 12px; color: #000; }
.pst-cs-lead { margin: 0; font-size: 13px; color: #334155; font-weight: 600; line-height: 1.45; }
.pst-cs-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .pst-cs-ways { grid-template-columns: 1fr; } }
.pst-cs-way { border: 1px solid #e3e7e5; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fff; min-width: 0; }
.pst-cs-wh { display: flex; gap: 10px; align-items: flex-start; }
.pst-cs-wi { width: 34px; height: 34px; border-radius: 10px; background: #16a34a; color: #fff; display: grid; place-items: center; font-size: 16px; flex: none; }
.pst-cs-wi.is-tab { background: #ea580c; }
.pst-cs-wh b { display: block; font-size: 13.5px; font-weight: 800; }
.pst-cs-wh small { display: block; font-size: 12px; color: #4b5650; font-weight: 600; line-height: 1.4; margin-top: 2px; }
.pst-cs-wh small b { display: inline; font-size: inherit; color: #000; }
.pst-cs-wb { margin-top: auto; display: flex; flex-direction: column; gap: 7px; align-items: stretch; min-width: 0; }
.pst-cs-state { font-size: 12px; font-weight: 800; color: #166534; min-height: 15px; display: flex; align-items: center; gap: 6px; }
.pst-cs-state .bi { font-size: 8px; color: #16a34a; }
.pst-cs-code { font-size: 28px; font-weight: 900; letter-spacing: .14em; text-align: center; background: #111827; color: #fff; border-radius: 10px; padding: 8px 6px; font-variant-numeric: tabular-nums; }
.pst-cs-code span { display: inline-block; width: 10px; }
.pst-cs-code.is-loading { font-size: 18px; color: #fff; }
.pst-cs-left { text-align: center; font-size: 11.5px; font-weight: 700; color: #4b5650; }
.pst-cs-link { display: flex; gap: 10px; align-items: center; border-top: 1px dashed #d6dcd9; padding-top: 9px; min-width: 0; }
.pst-cs-qr { width: 74px; height: 74px; flex: none; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 4px; line-height: 0; }
.pst-cs-qr svg { width: 100%; height: 100%; }
.pst-cs-lk { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.pst-cs-lk small { font-size: 11.5px; font-weight: 700; color: #334155; }
.pst-cs-lk input { width: 100%; height: 30px; border-radius: 8px; border: 1px solid #d6dcd9; font-size: 11.5px; padding: 0 8px; color: #000; background: #f8faf9; }
.pst-cs-lb { display: flex; gap: 6px; }
.pst-cs-err { font-size: 12.5px; font-weight: 700; color: #b91c1c; }
.pst-cs-paired { display: flex; gap: 9px; align-items: center; padding: 9px 11px; border-radius: 10px; background: #16a34a; color: #fff; }
.pst-cs-paired > .bi { font-size: 18px; }
.pst-cs-paired b { display: block; font-size: 13px; font-weight: 800; }
.pst-cs-paired small { display: block; font-size: 11.5px; color: #dcfce7; font-weight: 600; }
.pst-cs-unpair { color: #b91c1c !important; }
.pst-cs-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
@media (max-width: 640px) { .pst-cs-opts { grid-template-columns: 1fr; } }
/* position: relative keeps the hidden box inside its row. Placed against the
   pop-up instead, it sat below the scrolled list, and focusing it on a click
   scrolled the whole pop-up (title gone, blank strip at the bottom). */
.pst-cs-opt { position: relative; display: flex; gap: 9px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; border: 1px solid #e3e7e5; cursor: pointer; margin: 0; }
.pst-cs-opt input { position: absolute; top: 9px; left: 10px; width: 32px; height: 18px; margin: 0; opacity: 0; pointer-events: none; }
.pst-cs-sw { width: 32px; height: 18px; border-radius: 9px; background: #cbd5e1; position: relative; flex: none; margin-top: 1px; transition: background .15s; }
.pst-cs-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.pst-cs-opt input:checked + .pst-cs-sw { background: #16a34a; }
.pst-cs-opt input:checked + .pst-cs-sw::after { transform: translateX(14px); }
.pst-cs-opt input:focus-visible + .pst-cs-sw { box-shadow: 0 0 0 3px rgba(14, 122, 85, .25); }
.pst-cs-ot b { display: block; font-size: 12.5px; font-weight: 800; color: #000; }
.pst-cs-ot small { display: block; font-size: 11.5px; color: #4b5650; font-weight: 600; line-height: 1.35; margin-top: 2px; }

/* Waiting for the customer to pay on their screen */
.pst-wait { display: flex; flex-direction: column; gap: 10px; color: #000; text-align: center; }
.pst-wait-amt { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pst-wait-amt b { font-size: 26px; font-weight: 900; }
.pst-wait-pm { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; }
.pst-wait-pm.is-momo { background: #facc15; color: #000; }
.pst-wait-pm.is-card { background: #2563eb; color: #fff; }
.pst-wait p { margin: 0; font-size: 13.5px; color: #334155; font-weight: 600; line-height: 1.45; }
.pst-wait-spin { font-size: 13px; font-weight: 800; color: #0a5e42; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }

/* Customer pop-up */
.pst-c-list { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.pst-c-list:empty { display: none; }
.pst-c-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; border: 1px solid #e3e7e5; background: #fff; text-align: left; cursor: pointer; }
.pst-c-row:hover { border-color: #0e7a55; background: #f6faf8; }
.pst-c-row .pst-cav { background: #f59e0b; color: #000; }
.pst-c-row b { display: block; font-size: 12.5px; color: #000; }
.pst-c-row small { display: block; font-size: 11.5px; color: #4b5650; }

/* Shift pop-up */
.pst-shift-figs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.pst-shift-figs div { background: #f4f5f4; border-radius: 10px; padding: 9px 11px; }
.pst-shift-figs span { display: block; font-size: 11.5px; color: #4b5650; font-weight: 700; }
.pst-shift-figs b { display: block; font-size: 15px; font-weight: 800; color: #000; margin-top: 2px; }
