/* ============================================================
   EZPOSS POS — Standalone PWA Stylesheet
   Dark-first design, touch-optimised, offline-ready
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface2:   #22263a;
  --border:     #2e3350;
  --accent:     #4f8ef7;
  --accent-h:   #6aa0ff;
  --green:      #34c97b;
  --red:        #f05252;
  --yellow:     #f5a623;
  --text:       #e8eaf0;
  --text-dim:   #8890aa;
  --text-faint: #4a5070;
  /* Half & half. Teal and violet — deliberately NOT amber or blue: the
     store's accent colour is themeable and is most often a warm orange
     or a blue, and "1st half" must never be mistaken for the solid
     accent fill that means "whole". These two are far from each other
     and from both common accents, and the side each one fills carries
     the meaning even where colour cannot. */
  --portion-l:      #22c1d6;
  --portion-r:      #b06cf5;
  --portion-l-fill: rgba(34,193,214,.30);
  --portion-r-fill: rgba(176,108,245,.28);
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 20px rgba(0,0,0,.4);
}

html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; -webkit-tap-highlight-color: transparent; }

/* ── Screens ──────────────────────────────────────────────── */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

/* ── LOGIN SCREEN ─────────────────────────────────────────── */
#screen-login {
  flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1a2540 0%, var(--bg) 70%);
}
.login-logo { font-size: 2.4rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; margin-bottom: 6px; }
.login-sub  { color: var(--text-dim); font-size: .85rem; margin-bottom: 40px; }
.login-box  { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; width: 340px; box-shadow: var(--shadow); }
.login-box h2 { font-size: 1rem; font-weight: 600; color: var(--text-dim); margin-bottom: 20px; text-align: center; text-transform: uppercase; letter-spacing: .6px; }
.pin-display { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-align: center; font-size: 2rem; letter-spacing: 12px; padding: 14px; margin-bottom: 20px;
  min-height: 64px; color: var(--accent); font-weight: 700; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.numpad-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 1.3rem; font-weight: 600; padding: 18px;
  cursor: pointer; transition: background .12s, transform .1s; touch-action: manipulation; user-select: none; }
.numpad-btn:active { background: var(--accent); transform: scale(.96); }
.numpad-btn.del { color: var(--yellow); }
.numpad-btn.confirm { background: var(--accent); color: #fff; }
.numpad-btn.confirm:active { background: var(--accent-h); }
.login-error { color: var(--red); text-align: center; font-size: .85rem; margin-top: 14px; min-height: 20px; }
.offline-badge { position: fixed; top: 12px; right: 12px; background: var(--yellow);
  color: #000; font-size: .75rem; font-weight: 700; padding: 4px 10px;
  border-radius: 20px; display: none;
  pointer-events: none; /* never block taps on buttons underneath */
  z-index: 500; }
.offline-badge.show { display: block; }

/* ── REGISTER SCREEN ──────────────────────────────────────── */
#screen-register { flex-direction: column; }

/* Top bar */
.pos-topbar { display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 16px; height: 52px; flex-shrink: 0; }
.pos-topbar .brand { font-weight: 800; font-size: 1.1rem; color: var(--accent); letter-spacing: -.5px; }
.pos-topbar .register-info { font-size: .8rem; color: var(--text-dim); }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: .75rem; padding: 6px 12px; cursor: pointer;
  transition: color .15s, border-color .15s; }
.topbar-btn:hover { color: var(--text); border-color: var(--accent); }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); margin-right: 5px; vertical-align: middle; }
.online-dot.offline { background: var(--yellow); }

/* App body: sidebar + view area, sits below the topbar */
.pos-app-body { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR — dynamic nav, core + addon-provided sections ──── */
.sidebar-toggle-btn { display: none; margin-right: 4px; }
.pos-sidebar { width: 165px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 10px 8px; gap: 2px; overflow-y: auto; transition: width .15s, padding .15s; }
.pos-sidebar.collapsed { width: 0; padding: 0; overflow: hidden; border-right: none; }
.sidebar-item { display: flex; align-items: center; gap: 10px; background: none; border: none;
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: .85rem; font-weight: 500;
  padding: 10px 12px; text-align: left; cursor: pointer; transition: background .15s, color .15s;
  white-space: nowrap; }
.sidebar-item .dashicons { font-size: 18px; width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-item.active { background: var(--accent); color: #fff; }
.sidebar-item.locked { color: var(--text-faint); }
.sidebar-item.locked:hover { background: var(--surface2); color: var(--text-dim); }
.sidebar-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item-lock { font-size: .7rem; opacity: .6; }

/* ── VIEWS — one active at a time inside pos-app-body ──────── */
.pos-view { display: none; flex: 1; overflow: hidden; flex-direction: column; min-width: 0; }
.pos-view.active { display: flex; }

/* Main layout (register view: product grid + cart) */
.pos-main { display: flex; flex: 1; overflow: hidden; }

/* ── LEFT: categories + product grid ──── */
.pos-left { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; border-right: 1px solid var(--border); }

.category-bar { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto;
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.category-bar::-webkit-scrollbar { height: 3px; }
.category-bar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.cat-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 20px;
  color: var(--text-dim); font-size: .82rem; font-weight: 500; padding: 6px 14px;
  white-space: nowrap; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.cat-btn.active, .cat-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Category hierarchy ──────────────────────────────────────────────────
   The bar shows one level at a time, preceded by the trail that got you
   there. The trail is styled quieter than the level itself: it is context,
   not the choice being offered. */
.cat-btn.cat-up { font-weight: 700; padding-left: 12px; padding-right: 12px; }
.cat-btn.cat-crumb { background: transparent; border-style: dashed; color: var(--text-dim); }
.cat-btn.cat-crumb:hover { background: var(--surface2); color: var(--text); border-style: solid; }
.cat-btn.cat-crumb.active { background: var(--surface2); border-color: var(--border);
  color: var(--text); border-style: solid; }

/* A category that opens into more categories, rather than into food. */
.cat-has-kids { color: var(--text-dim); font-weight: 700; }
.category-tile.active .cat-has-kids { color: rgba(255,255,255,.75); }

.product-search-bar { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.product-search-bar input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem;
  padding: 8px 12px; outline: none; transition: border-color .15s; }
.product-search-bar input:focus { border-color: var(--accent); }
.product-search-bar input::placeholder { color: var(--text-faint); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px; padding: 12px; overflow-y: auto; flex: 1; align-content: start; }
.product-grid::-webkit-scrollbar { width: 5px; }
.product-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.product-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 10px; cursor: pointer; transition: border-color .15s, transform .12s, background .12s;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  user-select: none; touch-action: manipulation; position: relative; }
.product-tile:hover  { border-color: var(--accent); }
.product-tile:active { transform: scale(.97); background: var(--surface2); }
.product-tile.out-of-stock { opacity: .4; pointer-events: none; }
.product-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover;
  background: var(--surface2); margin-bottom: 8px; }
.product-thumb-placeholder { width: 64px; height: 64px; border-radius: 8px;
  background: var(--surface2); margin-bottom: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 1.6rem; }
.product-name { font-size: .82rem; font-weight: 500; color: var(--text); line-height: 1.3;
  margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-size: .95rem; font-weight: 700; color: var(--accent); }
.stock-badge { position: absolute; top: 6px; right: 6px; background: var(--yellow);
  color: #000; font-size: .65rem; font-weight: 700; padding: 2px 6px;
  border-radius: 10px; }
.product-empty { grid-column: 1/-1; text-align: center; color: var(--text-faint);
  padding: 60px 20px; font-size: .95rem; }

/* ── Tiles fill the space their hidden neighbours gave up ──────────────
   Hiding an element used to just leave a hole: a name-only tile kept the
   64px image gap and rendered small text in a mostly-empty box. The grid
   marks which parts are hidden and what remains grows to use the room,
   which is the whole reason a merchant turns something off — they want
   the thing they kept to be easier to hit. */
.product-grid.no-img .product-tile { justify-content: center; min-height: 84px; }
.product-grid.no-img .product-name  { font-size: 1.05rem; -webkit-line-clamp: 3; }
.product-grid.no-img .product-price { font-size: 1.15rem; }

/* Nothing but a name: make it the whole tile. */
.product-grid.no-img.no-price .product-name { font-size: 1.25rem; -webkit-line-clamp: 4;
  margin-bottom: 0; }
/* Nothing but a price: same treatment the other way round. */
.product-grid.no-img.no-name .product-price { font-size: 1.6rem; }

/* Image kept, text dropped — the full-bleed rule lives further down. */
.product-grid.no-name.no-price .product-thumb-placeholder { font-size: 2.6rem; }
.product-grid.no-name .product-thumb,
.product-grid.no-name .product-thumb-placeholder { width: 84px; height: 84px; }

/* Category tiles follow the same rule with their own switches. */
.product-grid.cat-no-img .category-tile { justify-content: center; min-height: 84px; }
.product-grid.cat-no-img .category-tile .product-name  { font-size: 1.15rem; -webkit-line-clamp: 3; }
.product-grid.cat-no-img.cat-no-count .category-tile .product-name { font-size: 1.35rem; margin-bottom: 0; }
.product-grid.cat-no-name .category-tile-icon,
.product-grid.cat-no-name .category-tile-img { width: 84px; height: 84px; font-size: 2.2rem; }

/* Image alone: it becomes the card.
   With both the name and the count hidden there is nothing else to make
   room for, so the picture goes edge to edge — a small thumbnail floating
   in an empty tile is exactly what turning the text off was meant to
   avoid. The tile's own padding is removed so nothing frames it. */
.product-grid.cat-no-name.cat-no-count .category-tile { padding: 0; overflow: hidden;
  min-height: 140px; }
.product-grid.cat-no-name.cat-no-count .category-tile .category-tile-img,
.product-grid.cat-no-name.cat-no-count .category-tile .category-tile-icon {
  width: 100%; height: 100%; margin: 0; display: flex; align-items: center;
  justify-content: center; font-size: 3rem; }
.product-grid.cat-no-name.cat-no-count .category-tile .category-tile-img img {
  width: 100%; height: 100%; border-radius: 0; object-fit: cover; }

/* Same rule for product tiles: picture only means picture everywhere. */
.product-grid.no-name.no-price .product-tile { padding: 0; overflow: hidden; min-height: 140px; }
.product-grid.no-name.no-price .product-thumb,
.product-grid.no-name.no-price .product-thumb-placeholder {
  width: 100%; height: 100%; min-height: 140px; margin: 0; border-radius: 0; object-fit: cover; }

/* ── RIGHT: cart panel ──────────────────── */
.pos-right { width: 385px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--surface); }

.cart-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cart-header h3 { font-size: .9rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.cart-customer-row { display: flex; gap: 8px; margin-top: 8px; }
.cart-customer-row input { flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .82rem; padding: 6px 10px; outline: none; }
.cart-customer-row input:focus { border-color: var(--accent); }

.cart-items { flex: 1; overflow-y: auto; padding: 8px 0; }
.cart-items::-webkit-scrollbar { width: 4px; }
.cart-items::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.cart-empty { text-align: center; color: var(--text-faint); padding: 40px 20px; font-size: .9rem; }

.cart-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px;
  border-bottom: 1px solid var(--border); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: .88rem; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-meta { font-size: .75rem; color: var(--text-dim); margin-top: 2px; }
.cart-item-price { font-size: .9rem; font-weight: 700; color: var(--text); margin-top: 2px; }
.cart-item-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-top: 2px; }
.qty-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--text); width: 26px; height: 26px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center; transition: background .12s; }
.qty-btn:hover { background: var(--accent); border-color: var(--accent); }
.qty-display { font-size: .88rem; font-weight: 700; min-width: 20px; text-align: center; }
.cart-item-remove { color: var(--text-faint); cursor: pointer; font-size: 1.1rem;
  padding: 2px 4px; border-radius: 4px; transition: color .12s; margin-left: 4px; }
.cart-item-remove:hover { color: var(--red); }

/* Coupon row */
.coupon-row { padding: 8px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; }
.coupon-row input { flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .82rem; padding: 6px 10px; outline: none; }
.coupon-row input:focus { border-color: var(--accent); }
.coupon-row input::placeholder { color: var(--text-faint); }
.coupon-apply-btn { background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: .8rem;
  padding: 6px 12px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.coupon-apply-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Totals */
.cart-totals { padding: 12px 16px; border-top: 1px solid var(--border); flex-shrink: 0; }
.totals-row { display: flex; justify-content: space-between; font-size: .85rem;
  color: var(--text-dim); margin-bottom: 6px; }
.totals-row.discount { color: var(--green); }
.totals-row.grand { font-size: 1.2rem; font-weight: 800; color: var(--text);
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: 4px; }

/* Charge button */
.charge-btn { margin: 12px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-size: 1.1rem; font-weight: 700; padding: 16px;
  width: calc(100% - 28px); cursor: pointer; transition: background .15s, transform .12s; }
.charge-btn:hover  { background: var(--accent-h); }
.charge-btn:active { transform: scale(.98); }
.charge-btn:disabled { background: var(--text-faint); cursor: not-allowed; }

/* ── PAYMENT MODAL ──────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7);
  display: none; align-items: center; justify-content: center; z-index: 100;
  backdrop-filter: blur(3px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  width: 480px; max-width: 96vw; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow); display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-dim); font-size: 1.4rem;
  cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: color .15s; }
.modal-close:hover { color: var(--red); }
.modal-body { padding: 20px 22px; flex: 1; }

/* Payment method tabs */
.pay-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.pay-tab { flex: 1; background: var(--surface2); border: 2px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: .88rem;
  font-weight: 600; padding: 10px 6px; cursor: pointer; text-align: center;
  transition: all .15s; }
.pay-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Cash payment */
.pay-total-display { background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); text-align: center; padding: 16px; margin-bottom: 16px; }
.pay-total-label { font-size: .8rem; color: var(--text-dim); margin-bottom: 4px; }
.pay-total-amount { font-size: 2.2rem; font-weight: 800; color: var(--accent); }
.pay-input-row { margin-bottom: 14px; }
.pay-input-row label { display: block; font-size: .82rem; color: var(--text-dim); margin-bottom: 6px; }
.pay-input-row input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 1.3rem; font-weight: 700;
  padding: 12px 14px; outline: none; transition: border-color .15s; }
.pay-input-row input:focus { border-color: var(--accent); }
.change-display { background: var(--surface2); border: 1px solid var(--green);
  border-radius: var(--radius-sm); padding: 12px 16px; text-align: center;
  display: none; margin-bottom: 16px; }
.change-display.show { display: block; }
.change-display .change-label { font-size: .8rem; color: var(--text-dim); }
.change-display .change-amount { font-size: 1.8rem; font-weight: 800; color: var(--green); }

/* Quick cash buttons */
.quick-cash { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.quick-cash-btn { background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-dim); font-size: .82rem;
  font-weight: 600; padding: 10px 4px; cursor: pointer; text-align: center;
  transition: all .15s; }
.quick-cash-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Card payment */
.card-info { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; margin-bottom: 16px; }
.card-info .card-icon { font-size: 3rem; margin-bottom: 12px; }
.card-info p { color: var(--text-dim); font-size: .9rem; line-height: 1.6; }
.card-info .card-amount { font-size: 2rem; font-weight: 800; color: var(--text); margin: 12px 0; }
.card-ref-row { margin-top: 12px; }
.card-ref-row input { width: 100%; background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem;
  padding: 10px 12px; outline: none; text-align: center; }

/* Split payment */
.split-section { margin-bottom: 16px; }
.split-section h4 { font-size: .82rem; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: 10px; }
.split-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.split-row label { font-size: .85rem; color: var(--text-dim); width: 60px; flex-shrink: 0; }
.split-row input { flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 1rem; font-weight: 700;
  padding: 10px 12px; outline: none; }
.split-row input:focus { border-color: var(--accent); }
.split-remaining { font-size: .85rem; margin-top: 8px; padding: 8px 12px;
  border-radius: var(--radius-sm); background: var(--surface2); }
.split-remaining.ok  { color: var(--green); }
.split-remaining.err { color: var(--red); }

/* Complete payment button */
.complete-pay-btn { width: 100%; background: var(--green); color: #fff; border: none;
  border-radius: var(--radius); font-size: 1.1rem; font-weight: 700; padding: 16px;
  cursor: pointer; transition: opacity .15s, transform .12s; margin-top: 8px; }
.complete-pay-btn:hover   { opacity: .92; }
.complete-pay-btn:active  { transform: scale(.98); }
.complete-pay-btn:disabled { background: var(--text-faint); cursor: not-allowed; }

/* ── RECEIPT MODAL ──────────────────────────────────────────── */
#modal-receipt .modal { width: 360px; }
.receipt-paper { background: #fff; color: #111; border-radius: var(--radius-sm);
  padding: 24px 20px; font-family: 'Courier New', monospace; font-size: .85rem; line-height: 1.7; }
.receipt-paper .r-store   { font-size: 1.1rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.receipt-paper .r-sub     { font-size: .75rem; text-align: center; color: #555; margin-bottom: 14px; }
.receipt-paper .r-divider { border-top: 1px dashed #ccc; margin: 10px 0; }
.receipt-paper .r-row     { display: flex; justify-content: space-between; }
.receipt-paper .r-total   { font-weight: 700; font-size: 1rem; margin-top: 4px; }
.receipt-paper .r-payment { color: #333; }
.receipt-paper .r-change  { color: #008000; font-weight: 700; }
.receipt-paper .r-footer  { text-align: center; color: #777; font-size: .75rem; margin-top: 12px; }
.receipt-actions { display: flex; gap: 10px; padding: 14px 22px 20px; }
.receipt-actions button { flex: 1; padding: 12px; border: none; border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600; cursor: pointer; }
.btn-print   { background: var(--surface2); color: var(--text); border: 1px solid var(--border) !important; }
.btn-new-sale { background: var(--accent); color: #fff; }

/* ── TOAST notifications ────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 999; pointer-events: none; }
.toast { background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 20px; font-size: .88rem; font-weight: 500;
  box-shadow: var(--shadow); opacity: 0; transform: translateY(12px);
  transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.show  { opacity: 1; transform: translateY(0); }
.toast.success { border-color: var(--green); }
.toast.error   { border-color: var(--red); }

/* ── ORDERS VIEW (core) ─────────────────────────────────────── */
.addon-view-header { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.addon-view-header h2 { font-size: 1.15rem; font-weight: 700; }
.orders-list { flex: 1; overflow-y: auto; padding: 12px 20px; }
.order-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 8px; }
.order-row-main { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.order-row-customer { color: var(--text-dim); font-size: .85rem; }
.order-row-meta { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--text-dim); }
.order-row-meta strong { margin-left: auto; color: var(--text); }
.order-status { padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600;
  text-transform: capitalize; background: var(--surface2); }
.order-status-completed { color: var(--green); }
.order-status-processing { color: var(--accent); }
.order-status-on-hold, .order-status-pending { color: var(--yellow); }

/* ── ADDON PLACEHOLDER — shown for sections not yet unlocked ──── */
.addon-placeholder { margin: auto; text-align: center; max-width: 360px; padding: 40px; color: var(--text-dim); }
.addon-placeholder-icon { font-size: 2.6rem; margin-bottom: 12px; opacity: .7; }
.addon-placeholder h2 { font-size: 1.2rem; color: var(--text); margin-bottom: 8px; }
.addon-placeholder p { font-size: .9rem; line-height: 1.5; }

/* ── SALE COMPLETE MODAL — fast post-sale screen ─────────────
   Shown immediately after a sale, no receipt HTML is built here. */
.modal-sale-complete { width: 400px; align-items: center; text-align: center; padding: 34px 30px 26px; gap: 4px; }
.sale-complete-check { width: 56px; height: 56px; border-radius: 50%; background: var(--green);
  color: #fff; font-size: 1.6rem; font-weight: 700; display: flex; align-items: center;
  justify-content: center; margin: 0 auto 14px; }
.sale-complete-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.sale-complete-total { font-size: 2.1rem; font-weight: 800; color: var(--accent); margin-bottom: 14px; }
.sale-complete-rows { width: 100%; margin-bottom: 6px; }
.sc-row { display: flex; justify-content: space-between; padding: 6px 4px; font-size: .95rem;
  border-bottom: 1px solid var(--border); }
.sc-row:last-child { border-bottom: none; }
.sc-change { font-weight: 700; color: var(--green); }
.sale-complete-email-row { width: 100%; display: flex; gap: 8px; margin: 10px 0; }
.sale-complete-email-row input { flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 9px 12px; font-size: .85rem; outline: none; }
.sale-complete-email-row input:focus { border-color: var(--accent); }
.btn-email-receipt { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-sm);
  padding: 0 16px; font-size: .8rem; font-weight: 600; cursor: pointer; }
.sale-complete-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 16px; }
.sale-complete-actions button { padding: 13px; border: none; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 700; cursor: pointer; transition: filter .15s; }
.sale-complete-actions button:hover { filter: brightness(1.1); }
.btn-print, .btn-toggle-email { background: var(--surface2); color: var(--text); border: 1px solid var(--border) !important; }
.btn-new-sale { background: var(--accent); color: #fff; }

/* ── PRINT — only the built receipt is visible when printing ── */
@media print {
  body * { visibility: hidden; }
  #receipt-content, #receipt-content * { visibility: visible; }
  #receipt-content { display: block !important; position: absolute; left: 0; top: 0; width: 100%; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .pos-right { width: 100%; position: fixed; bottom: 0; left: 0; right: 0;
    height: 50vh; border-top: 2px solid var(--border); border-right: none; z-index: 10; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .pos-left { height: 50vh; }
  .sidebar-toggle-btn { display: inline-block; }
  .pos-sidebar { position: fixed; top: 52px; left: 0; bottom: 0; z-index: 50;
    box-shadow: var(--shadow); }
  .pos-sidebar.collapsed { width: 0; }
  .pos-sidebar:not(.collapsed) { width: 190px; }
}

/* ============================================================
   DEVICE SETTINGS — light theme, settings modal, category tiles
   (added in v1.2.0; toggled from the in-app POS Settings modal)
   ============================================================ */

/* ── Light theme: variable overrides on body[data-theme="light"] ── */
body[data-theme="light"] {
  --bg:         #f2f4f8;
  --surface:    #ffffff;
  --surface2:   #e9edf4;
  --border:     #d4dae6;
  --accent:     #2f6fdb;
  --accent-h:   #4f8ef7;
  --green:      #1d9e5f;
  --red:        #d13438;
  --yellow:     #b97a00;
  --text:       #1c2333;
  --text-dim:   #5a6478;
  --text-faint: #9aa3b8;
  --shadow:     0 4px 20px rgba(30,40,70,.12);
  /* Deeper on white, where a light tint would wash out. */
  --portion-l:      #0f7c8c;
  --portion-r:      #7c3fbf;
  --portion-l-fill: rgba(15,124,140,.20);
  --portion-r-fill: rgba(124,63,191,.20);
}
body[data-theme="light"] #screen-login {
  background: radial-gradient(ellipse at 50% 30%, #dde7f8 0%, var(--bg) 70%);
}

/* ── Settings modal rows ── */
.ds-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.ds-row > label { font-size: .85rem; font-weight: 600; color: var(--text-dim); flex: 0 0 110px; }
.ds-seg { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-seg button {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: .8rem; padding: 8px 14px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.ds-seg button:hover { color: var(--text); border-color: var(--accent); }
.ds-seg button.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Category-first dashboard tiles ── */
.category-tile { display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 120px; background: var(--surface2); }
.category-tile .category-tile-icon { font-size: 2rem; margin-bottom: 8px; }
.category-tile .category-tile-img img {
  width: 56px; height: 56px; object-fit: cover; border-radius: 10px; display: block; margin: 0 auto;
}
.category-tile .product-name { font-weight: 700; }
.category-back-tile { background: var(--surface); border: 1px dashed var(--border); }

/* Brand doubles as a menu toggle (sidebar escape when panel is hidden) */
.pos-topbar .brand { cursor: pointer; user-select: none; }
.pos-topbar .brand:hover { color: var(--accent-h); }

/* Reports tab buttons */
.ez-rep-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Cart header: Hold / Held buttons ── */
.cart-header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cart-hold-btns { display: flex; gap: 6px; }
.cart-hold-btns .topbar-btn { padding: 4px 8px; font-size: .7rem; }

/* ── On-screen keyboard ── */
#ez-osk {
  position: fixed; left: 0; right: 0; bottom: -100%; z-index: 9999;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  transition: bottom .18s ease; box-shadow: 0 -6px 24px rgba(0,0,0,.35);
}
#ez-osk.show { bottom: 0; }
body.osk-open .pos-app-body { padding-bottom: 240px; }
#ez-osk .osk-row { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
#ez-osk button {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: 1.05rem; font-weight: 600; min-width: 44px; padding: 12px 0;
  cursor: pointer; touch-action: manipulation; user-select: none; flex: 1; max-width: 72px;
}
#ez-osk button:active { background: var(--accent); color: #fff; }
#ez-osk .osk-num { max-width: 320px; margin: 0 auto; }
#ez-osk .osk-full { max-width: 720px; margin: 0 auto; }
#ez-osk .osk-space { max-width: 300px; flex: 3; }
#ez-osk .osk-done { background: var(--accent); color: #fff; max-width: 160px; flex: 2; }
#ez-osk .osk-active { background: var(--accent); color: #fff; }

/* ── Themed dialogs (replace browser alert/confirm) ── */
.ez-dialog { max-width: 420px; text-align: center; padding: 28px 26px; }
.ez-dialog-icon { font-size: 2.2rem; margin-bottom: 10px; }
.ez-dialog-title { margin: 0 0 8px; font-size: 1.1rem; }
.ez-dialog-msg { color: var(--text-dim); font-size: .9rem; line-height: 1.5; margin: 0 0 20px; }
.ez-dialog-actions { display: flex; gap: 10px; justify-content: center; }
.ez-dialog-actions .topbar-btn { padding: 10px 22px; font-size: .85rem; }

/* ── Connection Setup screen: match the PIN login look ── */
#screen-connect { flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #1a2540 0%, var(--bg) 70%); }
body[data-theme="light"] #screen-connect {
  background: radial-gradient(ellipse at 50% 30%, #dde7f8 0%, var(--bg) 70%); }
.login-box input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  padding: 13px 14px; font-size: .95rem; }
.login-box input:focus { border-color: var(--accent); outline: none; }
.login-box input::placeholder { color: var(--text-faint); }

/* ── Editable cart lines ── */
.cart-item-editable { cursor: pointer; border-radius: var(--radius-sm); }
.cart-item-editable:hover { background: rgba(79,142,247,.08); }

/* ── Custom product / search bar button ── */
.product-search-bar { display: flex; gap: 8px; align-items: center; }
.product-search-bar input { flex: 1; }
.pay-note-row input { width: 100%; }

/* OSK must sit above every modal/dialog so notes inside modals can type */
#ez-osk { z-index: 10090; }

/* ============================================================
   TOUCH COMFORT (v1.11.1) — bigger targets where dense tapping
   happens, independent of the UI Size device setting.
   ============================================================ */

/* Product options picker: the busiest tap surface on the terminal */
#modal-product-config .modal { max-width: 720px; width: 94vw; }
body[data-pc-width="wide"] #modal-product-config .modal { max-width: 900px; }
body[data-pc-width="full"] #modal-product-config .modal { max-width: 1240px; }
#modal-product-config .ds-seg button {
  padding: 14px 20px; font-size: 1rem; min-height: 52px; min-width: 64px;
}
#modal-product-config .ds-row > label { font-size: .95rem; flex-basis: 130px; }
#modal-product-config #pc-price { font-size: 1.6rem; }
#modal-product-config #pc-add { min-height: 56px; font-size: 1.05rem; }

/* Line-edit modal: qty +/− and actions */
#modal-line-edit .qty-btn { width: 54px !important; height: 54px !important; font-size: 1.5rem !important; }
#modal-line-edit .topbar-btn, #modal-line-edit .complete-pay-btn { min-height: 48px; }

/* Themed dialogs: buttons easy to hit */
.ez-dialog-actions .topbar-btn, .ez-dialog-actions .complete-pay-btn { min-height: 48px; }

/* Payment modal: tabs, quick cash, complete buttons */
.pay-tab { min-height: 50px; font-size: 1rem; }
.quick-cash-btn { min-height: 52px; font-size: 1rem; }
.complete-pay-btn { min-height: 54px; }

/* Cart row controls */
.qty-btn { min-width: 42px; min-height: 42px; font-size: 1.15rem; }
.cart-item-remove { padding: 8px; font-size: 1.05rem; }

/* Sidebar + category chips + settings segments */
.sidebar-item { min-height: 48px; }
.cat-btn { min-height: 44px; padding: 10px 18px; font-size: .95rem; }
.ds-seg button { min-height: 44px; }
.topbar-btn { min-height: 40px; }

/* Numpad (PIN + OSK already large; keep parity) */
.numpad-btn { min-height: 60px; }

/* At larger UI sizes tall modals must scroll, never overflow off-screen */
.modal-overlay { overflow-y: auto; }
.modal { max-height: 90vh; overflow-y: auto; }

/* ── Settings modal tabs (v1.12.0) ─────────────────────────── */
.ds-tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.ds-tab { flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2, transparent); color: var(--text-dim); font-weight: 600; cursor: pointer; font-size: .85rem; }
.ds-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Branding (v1.12.0) ────────────────────────────────────── */
.brand-logo { height: 22px; width: auto; vertical-align: -5px; margin-right: 8px; border-radius: 4px; }
.login-logo-img { max-height: 64px; width: auto; margin-bottom: 10px; border-radius: 10px; }

/* ── Product-config modal: uniform choice grid (v1.12.2) ───── */
.pc-title-sub { color: var(--text-dim); font-weight: 500; font-size: .85em; }
.pc-section { margin-bottom: 16px; }
.pc-section-title { font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 10px; }
.pc-grid button { min-height: 56px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface2); color: var(--text);
  font-size: .85rem; font-weight: 600; cursor: pointer; user-select: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-align: center; line-height: 1.25; transition: background .12s, border-color .12s, transform .08s; }
.pc-grid button:active { transform: scale(.97); }
.pc-grid button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pc-grid .pc-delta { font-size: .72rem; font-weight: 500; color: var(--text-dim); }
.pc-grid button.active .pc-delta { color: rgba(255,255,255,.85); }

/* ── Half & half ────────────────────────────────────────────────────────
   The portion segment sets which side the next taps land on. It sits
   above the toppings because that is the order the cashier works in:
   choose the side, then tap what goes on it. */
.pc-portion { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.pc-portion button { padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface2); color: var(--text); font-size: .82rem; font-weight: 600;
  cursor: pointer; }
.pc-portion button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pc-portion-hint { font-size: .7rem; color: var(--text-dim); margin-left: auto; }

/* A topping's side must be readable at a glance on a crowded grid —
   colour alone would not survive a bright kitchen or a colour-blind
   cashier, so the half-moon glyph carries the meaning and the border
   only reinforces it. */
/*
 * A topping on half a pizza LOOKS like half a pizza.
 *
 * The button fills on the side the topping is going, with a hard edge
 * down the middle — the control becomes a small picture of the item
 * rather than a label that has to be read. Left and right get different
 * hues as well as different sides, so the two never rely on position
 * alone at a glance across a grid of twenty toppings.
 *
 * The fill is translucent over the button's own background rather than
 * an opaque colour, because the label spans both halves and has to stay
 * readable across the join.
 */
.pc-portion-badge { position: absolute; top: 4px; right: 6px; font-size: .95rem; line-height: 1; }
.pc-grid.has-portions button { position: relative; }

.pc-grid.has-portions button.active.portion-left,
.pc-grid.has-portions button.active.portion-right {
  color: var(--text);
}
.pc-grid.has-portions button.active.portion-left {
  border-color: var(--portion-l);
  background:
    linear-gradient(90deg,
      var(--portion-l-fill) 0 calc(50% - 1px),
      var(--portion-l)      calc(50% - 1px) calc(50% + 1px),
      transparent           calc(50% + 1px) 100%),
    var(--surface2);
}
.pc-grid.has-portions button.active.portion-right {
  border-color: var(--portion-r);
  background:
    linear-gradient(90deg,
      transparent           0 calc(50% - 1px),
      var(--portion-r)      calc(50% - 1px) calc(50% + 1px),
      var(--portion-r-fill) calc(50% + 1px) 100%),
    var(--surface2);
}
.pc-grid.has-portions button.active.portion-left  .pc-portion-badge { color: var(--portion-l); }
.pc-grid.has-portions button.active.portion-right .pc-portion-badge { color: var(--portion-r); }
.pc-grid.has-portions button.active.portion-left .pc-delta,
.pc-grid.has-portions button.active.portion-right .pc-delta { color: var(--text-dim); }

/* The mode buttons carry the same two colours, so the segment above the
   grid and the toppings below it are visibly the same idea. */
.pc-portion button[data-portion="left"].active {
  background: var(--portion-l); border-color: var(--portion-l); color: #04222a; }
.pc-portion button[data-portion="right"].active {
  background: var(--portion-r); border-color: var(--portion-r); color: #fff; }
.pc-portion button[data-portion="left"].active,
.pc-portion button[data-portion="right"].active { font-weight: 700; }
/* the config modal benefits from a bit more width for 3–4 columns */
#modal-product-config .modal { width: min(680px, 94vw); }

/*
 * Wide mode: one more column of toppings.
 *
 * The grid is auto-fill at 136px, so 680px gives about four columns and
 * 850px gives five — on a twenty-topping pizza that is the difference
 * between scrolling and not. It is a per-device setting because a 10"
 * tablet and a 22" counter screen do not want the same thing, and on the
 * small one the viewport cap means Wide correctly changes nothing.
 */
body[data-pc-width="wide"] #modal-product-config .modal { width: min(850px, 96vw); }

/*
 * Full: as much of the screen as the modal can honestly use.
 *
 * Past roughly six columns the eye has to travel and touch accuracy
 * drops, so this is not "bigger is better" — it is for a large counter
 * screen with a twenty-topping pizza, where the alternative is scrolling
 * mid-order.
 */
body[data-pc-width="full"] #modal-product-config .modal { width: min(1200px, 96vw); }

/* ── Settings modal: wide + card grid layout (v1.12.3) ─────── */
#modal-device-settings .modal { width: min(920px, 96vw); }
#modal-device-settings .ds-panel { display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 8px 10px; align-items: stretch; }
@media (max-width: 720px) { #modal-device-settings .ds-panel { grid-template-columns: repeat(2, 1fr); } }
#modal-device-settings .ds-panel > p { grid-column: 1 / -1; margin: 0 !important;
  font-size: .68rem !important; line-height: 1.35; }
#modal-device-settings .ds-row { display: flex; flex-direction: column; align-items: stretch;
  justify-content: flex-start; gap: 9px; margin: 0; background: rgba(255,255,255,.02);
  border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
#modal-device-settings .ds-row > label { flex: none; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
#modal-device-settings .ds-seg { gap: 6px; }
#modal-device-settings .ds-seg button { flex: 1 1 0; min-width: 0; white-space: nowrap; }
#modal-device-settings .ds-span { grid-column: 1 / -1; }
#modal-device-settings #ds-version { grid-column: 1 / -1; }
#ds-tile-toggles { display: contents; }
#ds-tile-toggles.dimmed .ds-row { opacity: .35; pointer-events: none; }

/* UI Size as A-size icons (v1.12.5) */
#modal-device-settings .ds-seg-size button { font-weight: 800; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* ============================================================
   v1.13.19 — cart quick-action row, top-bar extras, hand mode
   ============================================================ */

/* Quick actions sit on their OWN line under "Current Sale" so every
   button gets real width instead of being squeezed next to the title. */
.cart-quick-row { padding: 8px 14px 10px; border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; align-items: stretch; }
.cart-quick-row .coupon-apply-btn { flex: 1 1 0; min-width: 0; padding: 9px 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.cart-quick-row .coupon-apply-btn[hidden] { display: none; }

/* Lefty mode: cart on the LEFT, sidebar + products on the right.
   Pure flex-direction flips — no DOM moves, so every handler survives. */
body[data-hand="left"] .pos-app-body { flex-direction: row-reverse; }
body[data-hand="left"] .pos-main { flex-direction: row-reverse; }
body[data-hand="left"] .pos-sidebar { border-right: none; border-left: 1px solid var(--border); }
body[data-hand="left"] .pos-left { border-right: none; border-left: 1px solid var(--border); }
body[data-hand="left"] .pos-right { border-left: none; border-right: 1px solid var(--border); }

/* Title never wraps; the utility icons stay compact on line 1 so the
   equal-width action buttons own line 2 (v1.13.19). */
.cart-header-row h3 { white-space: nowrap; }
.cart-hold-btns .topbar-btn { padding: 5px 9px; font-size: .82rem; line-height: 1; }
#parked-count:not(:empty) { margin-left: 3px; font-size: .72em; }
.cart-quick-row { flex-wrap: nowrap; gap: 6px; }
/*
 * Text stays INSIDE the button.
 *
 * This used to allow overflow so a two-word label could spill rather than
 * be cut — which looked fine with three buttons and broke the moment there
 * were more, since every button is flex:1 1 0 and gets narrower with each
 * one added. Labels are now short or iconic, so clipping is the safety net
 * rather than the normal case.
 */
.cart-quick-row .coupon-apply-btn { flex: 1 1 0; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: .72rem; line-height: 1.15; padding: 7px 4px; }
/* The two state chips carry an icon and a short word; the icon alone is
   enough to find them, so they never need to grow. */
.cart-quick-row #cart-ot-btn,
.cart-quick-row #cart-dp-btn { flex: 0 1 auto; min-width: 40px; padding: 7px 8px; }
.cart-quick-row .coupon-apply-btn.active { border-color: var(--accent); color: var(--accent); }
.cart-quick-row #cart-more-btn { flex: 0 0 38px; min-width: 38px; padding: 9px 0; }

/* ============================================================
   v1.13.20 — mirrored top bar, cart header buttons, bottom actions
   ============================================================ */

/* Lefty also mirrors the TOP BAR so the brand/menu toggle sit above the
   products and the actions sit above the cart — nothing reads backwards. */
body[data-hand="left"] .pos-topbar { flex-direction: row-reverse; }
body[data-hand="left"] .topbar-actions { flex-direction: row-reverse; }

/* "Current Sale" now lives in the top bar, hugging whichever edge the
   cart is on (it is last in DOM order; row-reverse flips it in Lefty). */
.topbar-sale-label { font-size: .78rem; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }

/* Cart header: the utility buttons now own the whole row — equal width,
   roughly a Sync button each, with a colour cue per action. */
.cart-header-row { gap: 6px; }
.cart-hold-btns { flex: 1; gap: 6px; }
.cart-hold-btns .topbar-btn { flex: 1 1 0; min-width: 0; padding: 7px 2px; }
/* icon over label, icon carries the colour */
.cart-act { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cart-act .dashicons { font-size: 18px; width: 18px; height: 18px; line-height: 18px; }
.cart-act-label { font-size: .66rem; line-height: 1; color: var(--text-dim); }
/* Bill + Hold keep a soft background; the rest are colour-on-icon only. */
#btn-print-bill   { border-color: rgba(90,150,255,.45); background: rgba(90,150,255,.12); }
#btn-park-cart    { border-color: rgba(255,150,60,.45); background: rgba(255,150,60,.12); }
#btn-print-bill   .dashicons { color: #6aa0ff; }
#btn-clear-cart   .dashicons { color: var(--red); }
#btn-order-note   .dashicons { color: var(--yellow); }
#btn-park-cart    .dashicons { color: #ff9a3c; }
#btn-parked-carts .dashicons { color: var(--green); }

/* Log out at the foot of the left menu — reads as a real button.
   Colours come from theme vars so it works in dark AND light. */
.sidebar-logout { margin-top: auto; margin-bottom: 4px; justify-content: center;
  background: var(--red); color: #fff; border: 1px solid var(--red);
  font-weight: 600; padding: 10px 12px; border-radius: var(--radius-sm); }
.sidebar-logout .dashicons,
.sidebar-logout .sidebar-item-label { color: #fff; flex: 0 0 auto; }
.sidebar-logout:hover { background: #d63c3c; border-color: #d63c3c; color: #fff; }
.sidebar-logout:active { transform: scale(.985); }

/* "← Register" injected into every non-register section header (Idea 2) */
.ez-back-register { display: inline-flex; align-items: center; gap: 4px;
  margin-right: 12px; padding: 6px 12px; font-weight: 600;
  border-color: var(--accent); color: var(--accent); background: rgba(79,142,247,.12); }
.ez-back-register:hover { background: rgba(79,142,247,.22); color: var(--accent); }
.ez-back-register .dashicons { font-size: 16px; width: 16px; height: 16px; line-height: 16px; }
.ez-back-bar { padding: 10px 14px; }
.addon-view-header { gap: 8px; }

/* Sidebar glyph icons (addons may send an emoji instead of a dashicon) */
.sidebar-item-glyph { width: 18px; flex-shrink: 0; text-align: center; font-size: 15px; }

/* Tables button in the search bar uses the same dashicon as the menu item */
#btn-goto-tables .dashicons { font-size: 15px; width: 15px; height: 15px;
  line-height: 15px; vertical-align: -3px; }

/* Quick actions now sit at the BOTTOM of the cart, right above the totals. */
.cart-quick-row { border-bottom: none; border-top: 1px solid var(--border); }

/* Customer fields wrap instead of clipping the email box. */
.cart-customer-row { flex-wrap: wrap; gap: 6px; }
.cart-customer-row input { flex: 1 1 46%; min-width: 0; }
.cart-customer-row input#customer-email-input { flex: 1 1 100%; }

/* Sale label lights up when the sale has content */
.topbar-sale-label.is-active { color: var(--accent); }

/* Sale label spans the cart's width so it reads as the cart's own heading */
.topbar-sale-label { width: 385px; text-align: center; overflow: hidden;
  text-overflow: ellipsis; padding-left: 0; margin-left: 8px; }
body[data-hand="left"] .topbar-sale-label { padding-right: 0; margin: 0 8px 0 0; }
.order-view .dashicons { font-size: 15px; width: 15px; height: 15px; line-height: 15px; vertical-align: -3px; }

/* Order-view sheet rows (the receipt .r-row rules are scoped to .receipt-paper,
   so this sheet needs its own — that is why label/value had no gap). */
.ov-row { display: flex; justify-content: space-between; align-items: baseline;
  gap: 18px; padding: 3px 0; font-size: .88rem; }
.ov-row .ov-k { color: var(--text-dim); flex: 0 0 auto; }
.ov-row .ov-v { text-align: right; word-break: break-word; }
.ov-row.ov-sub { font-size: .76rem; color: var(--text-dim); padding: 1px 0 1px 12px; }
.ov-row.ov-total { font-weight: 800; font-size: 1.05rem; padding: 5px 0; }

/* Floating numpad ("Near field" docking, Settings → General).
   Overrides the bottom-bar rules: fixed at a computed left/top, compact. */
#ez-osk.osk-float {
  left: auto; right: auto; bottom: auto;
  border: 1px solid var(--border); border-top: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 10px; transition: none;
  transform-origin: top left; transform: scale(var(--osk-z, 1));
}
#ez-osk.osk-float .osk-num { max-width: none; }
#ez-osk.osk-float button { padding: 12px 0; font-size: 1.05rem; }

/* ════════════════ PAYMENT MODAL v4 (pm-*) ════════════════ */
.pm-modal { width: 720px; max-width: 96vw; height: 660px; max-height: 94vh;
  display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.pm-modal.has-rail { width: 880px; }
.pm-head { display: flex; align-items: center; gap: 12px; flex: 0 0 52px;
  padding: 0 14px; border-bottom: 1px solid var(--border); }
.pm-title { background: none; border: none; color: var(--text); font-size: 1rem;
  font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 6px 4px; }
.pm-title .pm-caret { color: var(--text-dim); font-size: .75rem; transition: transform .15s; }
.pm-title.rail-open .pm-caret { transform: rotate(90deg); }
.pm-tabs { flex: 1; margin-bottom: 0 !important; }
.pm-tabs .pay-tab { flex: 0 1 auto; padding: 8px 18px; font-size: .86rem; }
.pm-print { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); font-size: 1.1rem; padding: 6px 12px; cursor: pointer; }
.pm-print:hover { color: var(--accent); border-color: var(--accent); }
.pm-cols { display: flex; flex: 1; min-height: 0; }
.pm-rail { width: 150px; flex: 0 0 150px; border-right: 1px solid var(--border);
  padding: 10px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; }
.pm-sec { font-size: .6rem; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-faint); text-align: center; margin-bottom: 2px; }
#pay-gw-list { display: flex; flex-direction: column; gap: 7px; }
.pay-gw { border: 1px solid var(--border); background: var(--surface2); border-radius: 9px;
  padding: 11px 8px; font-size: .8rem; font-weight: 500; color: var(--text-dim);
  text-align: center; cursor: pointer; }
.pay-gw.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 12px 14px; }
.pm-band { display: flex; flex: 0 0 66px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 9px; }
.pm-cell { flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; min-width: 0; }
.pm-bl { font-size: .62rem; color: var(--text-dim); letter-spacing: .6px; text-transform: uppercase; }
.pm-bv { font-size: 1.45rem; font-weight: 800; }
.pm-due .pm-bv { color: var(--orange, #e8843c); }
.pm-tender { background: var(--bg); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.pm-chg .pm-bv { color: var(--green); }
.pm-tender input, .pm-chg input { width: 92%; background: none; border: none; color: var(--text);
  font-size: 1.45rem; font-weight: 800; text-align: center; outline: none; padding: 0; }
.pm-tender input::placeholder, .pm-chg input::placeholder { color: var(--text-faint); }
.pm-splitrow { display: flex; align-items: center; gap: 9px; flex: 0 0 36px;
  margin-bottom: 9px; font-size: .78rem; color: var(--text-dim); overflow: hidden; }
.pm-srlabel { white-space: nowrap; }
.pm-seg { display: flex; gap: 6px; }
.pm-seg button { background: var(--surface2); border: 1px solid var(--border); border-radius: 7px;
  padding: 6px 13px; font-weight: 600; color: var(--text-dim); cursor: pointer; font-size: .78rem; }
.pm-seg button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pm-srinfo { color: var(--yellow, #f5a623); font-size: .75rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.pm-srinfo.ok { color: var(--green); }
.pm-srinfo.err { color: var(--red); }
.pm-noterow { flex: 0 0 auto; margin-bottom: 9px; }
.pm-noterow input { width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; color: var(--text); font-size: .78rem; }
.pm-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr) 1.45fr;
  grid-template-rows: repeat(4, 1fr); gap: 7px; min-height: 0; }
.pm-k { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  font-weight: 600; color: var(--text); cursor: pointer; user-select: none; min-height: 0; }
.pm-k:active { transform: scale(.96); }
.pm-k.pm-fn { color: var(--text-dim); font-size: 1rem; }
.pm-k.pm-enter { grid-row: span 2; background: var(--accent); border-color: var(--accent);
  color: #fff; font-size: .95rem; font-weight: 700; flex-direction: column; gap: 2px; }
.pm-qcol { display: flex; gap: 7px; min-width: 0; }
.pm-q { flex: 1; background: #31427a; border: 1px solid #4f6ec0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: .92rem;
  font-weight: 800; color: #cfe0ff; cursor: pointer; user-select: none; min-width: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08); white-space: nowrap; overflow: hidden; }
.pm-q.pm-exact { background: #1d5c3c; border-color: var(--green); color: #b8f5d2; }
.pm-q.pm-share { background: #5c4a1d; border-color: var(--yellow, #f5a623); color: #ffe9b8; }
.pm-q.pm-dim { opacity: .28; pointer-events: none; }
.pm-togs { display: flex; gap: 8px; flex: 0 0 42px; align-items: center; margin-top: 9px; }
.pm-tg { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px; height: 38px;
  color: var(--text-dim); font-size: .76rem; cursor: pointer; }
.pm-tg.on { border-color: var(--green); color: var(--green); }
.pm-pill { width: 24px; height: 13px; border-radius: 8px; background: var(--surface2); position: relative; flex: 0 0 24px; }
.pm-pill::after { content: ''; position: absolute; left: 1px; top: 1px; width: 11px;
  height: 11px; border-radius: 50%; background: var(--text-dim); transition: left .12s; }
.pm-tg.on .pm-pill { background: var(--green); }
.pm-tg.on .pm-pill::after { left: 12px; background: #fff; }
.pm-actions { display: flex; gap: 10px; flex: 0 0 48px; margin-top: 9px; }
.pm-cancel { flex: 2; background: none; border: 1px solid var(--red); color: var(--red);
  border-radius: 10px; font-weight: 700; font-size: .95rem; cursor: pointer; }
.pm-spacer { flex: 1; }
.pm-pay { flex: 3; background: var(--green); border: none; border-radius: 10px;
  font-weight: 800; font-size: 1.05rem; color: #04220f; cursor: pointer; }
.pm-pay:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 900px) {
  .pm-modal, .pm-modal.has-rail { width: 96vw; height: 92vh; }
  .pm-rail { width: 120px; flex-basis: 120px; }
}

/* Split-by-items picker */
#modal-split-items .modal { width: 480px; max-width: 94vw; }
.spl-line { display: flex; align-items: center; gap: 10px; padding: 9px 4px;
  border-bottom: 1px solid var(--border); font-size: .88rem; }
.spl-line .spl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spl-line .spl-price { color: var(--text-dim); font-size: .8rem; }
.spl-qty { display: flex; align-items: center; gap: 6px; }
.spl-qty button { width: 30px; height: 30px; border-radius: 8px; background: var(--surface2);
  border: 1px solid var(--border); color: var(--text); font-size: 1rem; cursor: pointer; }
.spl-qty span { min-width: 34px; text-align: center; font-weight: 700; }
.spl-total { display: flex; justify-content: space-between; font-weight: 800;
  font-size: 1.05rem; padding: 12px 4px; }

/* Popup keyboard / numpad — dim overlay, field label + mirror on top */
#ez-osk-ov { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 10080; display: none; }
#ez-osk-ov.show { display: block; }
#ez-osk.osk-pop { position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(var(--osk-z, 1));
  right: auto; bottom: auto; width: 680px; max-width: 94vw; z-index: 10090; padding: 16px;
  border-radius: 14px; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
#ez-osk.osk-pop .osk-full { max-width: none; }
#ez-osk.osk-pop button { height: 54px; font-size: 1.15rem; border-radius: 10px; }
#ez-osk.osk-pop .osk-done { max-width: none; flex: 2.4; font-size: 1rem; }
#ez-osk.osk-pop .osk-space { max-width: none; flex: 5; }
#ez-osk.osk-pop-num { width: 400px; }
#ez-osk.osk-pop-num:has(.osk-grid.has-q) { width: 560px; }
/* The SAME grid serves every dock — only the width changes. */
#ez-osk.osk-float .osk-grid { grid-template-rows: repeat(4, 46px); gap: 6px; }
#ez-osk.osk-float { width: 300px; }
#ez-osk.osk-float:has(.osk-grid.has-q) { width: 420px; }
#ez-osk:not(.osk-pop):not(.osk-float) .osk-grid { max-width: 430px; margin: 0 auto;
  grid-template-rows: repeat(4, 48px); }
#ez-osk:not(.osk-pop):not(.osk-float) .osk-grid.has-q { max-width: 600px; }
#ez-osk .osk-grid { display: grid; grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 56px); gap: 8px; }
#ez-osk .osk-grid.has-q { grid-template-columns: repeat(4, 1fr) 1.1fr 1.1fr; }
#ez-osk .osk-grid button { height: auto; max-width: none; min-width: 0;
  font-size: 1.3rem; font-weight: 700; border-radius: 10px; }
#ez-osk .osk-grid .osk-fn { color: var(--text-dim); font-size: 1.05rem; }
#ez-osk .osk-grid .osk-done-tall { grid-row: span 2; background: var(--accent);
  border-color: var(--accent); color: #fff; font-size: 1rem; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
#ez-osk .osk-grid .osk-q { font-size: .92rem; font-weight: 800; background: #31427a;
  border: 1px solid #4f6ec0; color: #cfe0ff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  white-space: nowrap; overflow: hidden; }
#ez-osk .osk-grid .osk-qpad { visibility: hidden; }
#ez-osk .osk-flabel { display: flex; justify-content: space-between; align-items: baseline;
  font-size: .72rem; color: var(--yellow, #f5a623); text-transform: uppercase;
  letter-spacing: .6px; margin-bottom: 6px; }
#ez-osk .osk-flabel small { color: var(--text-faint); text-transform: none; letter-spacing: 0; }
#ez-osk .osk-mirror { background: var(--bg); border: 1px solid var(--accent); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; font-size: 1.15rem; color: var(--text);
  min-height: 50px; word-break: break-word; max-height: 110px; overflow-y: auto; }
#ez-osk .osk-mirror.osk-mirror-num { text-align: right; font-size: 1.5rem; font-weight: 800; }
#ez-osk .osk-mirror .osk-caret { display: inline-block; width: 2px; height: 1.05em;
  background: var(--accent); vertical-align: text-bottom; animation: oskblink 1s steps(1) infinite; }
@keyframes oskblink { 50% { opacity: 0; } }


/* Due cell struck-through full total + split chip */
.pm-was { font-size: .65rem; color: var(--text-faint); text-decoration: line-through; }
.pm-chip { display: inline-flex; align-items: center; gap: 8px; background: #2b2413;
  border: 1px solid var(--yellow, #f5a623); color: #ffe9b8; border-radius: 8px;
  padding: 5px 10px; font-size: .75rem; white-space: nowrap; }

/* Sale-complete: order chip, partial state, progress */
.sc-order-chip { display: inline-block; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px; font-size: .8rem; color: var(--text-dim); margin: 4px 0 8px; }
.sc-order-chip b { color: var(--text); }
.sc-order-chip i { color: var(--text-faint); font-style: normal; }
.sale-complete-title.sc-partial { color: var(--yellow, #f5a623); }
.sale-complete-check.sc-partial { background: none; color: inherit; font-size: 2.4rem; }
.sc-of { font-size: .95rem; color: var(--text-dim); font-weight: 500; }
.sc-progress { display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: .78rem; color: var(--text-dim); margin: 2px 0 10px; }
.sc-progress #sc-prog-left { color: var(--yellow, #f5a623); }
.sc-bar { width: 150px; height: 8px; border-radius: 6px; background: var(--surface2); overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--yellow, #f5a623); transition: width .3s; }
.sc-row.sc-remaining span:last-child { color: var(--yellow, #f5a623); font-weight: 700; }
.sc-pay-rest { width: 100%; background: var(--yellow, #f5a623); border: none; border-radius: 10px;
  padding: 14px; font-weight: 800; font-size: 1.05rem; color: #221800; cursor: pointer; margin-top: 10px; }
.sc-finish-later { width: 100%; background: none; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; color: var(--text-dim); font-size: .82rem; cursor: pointer; margin-top: 8px; }


/* ════════ SALE COMPLETE v2 (sc2-*) — payment-modal look ════════ */
.sc2-modal { width: 720px; max-width: 96vw; padding: 0; overflow: hidden; }
.sc2-head { display: flex; align-items: center; gap: 10px; height: 52px;
  padding: 0 14px; border-bottom: 1px solid var(--border); }
.sc2-ic { font-size: 1.4rem; }
.sc2-title { flex: 1; text-align: center; font-size: 1.05rem; font-weight: 700; }
.sc2-title #sc-ord b { color: var(--text); }
.sc2-title #sc-ord i { color: var(--text-faint); font-style: normal; font-weight: 500; }
.sc2-title #sc-title.sc-partial { color: var(--yellow, #f5a623); }
.sc2-title small { color: var(--text-dim); font-weight: 500; font-size: .8rem; margin-left: 6px; }
.sc2-body { padding: 14px; }
.sc2-band { height: 70px; flex: none; }
.sc2-band .pm-bv { font-size: 1.55rem; }
.sc2-pays { background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 2px 14px; margin: 10px 0 0; }
.sc2-pays .sc-row { display: flex; justify-content: space-between; padding: 8px 0;
  font-size: .9rem; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.sc2-pays .sc-row:last-child { border-bottom: none; }
.sc2-pays .sc-row span:last-child { color: var(--text); font-weight: 700; }
.sc2-pays .sc-row.sc-remaining span:last-child { color: var(--yellow, #f5a623); }
.sc2-rq { font-size: .8rem; color: var(--text-dim); margin: 12px 2px 8px; }
.sc2-rrow { display: flex; gap: 10px; margin-bottom: 10px; }
.sc2-rrow button { flex: 1; height: 46px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: .9rem; font-weight: 600; cursor: pointer; }
.sc2-rrow button:disabled { opacity: .4; cursor: not-allowed; }
.sc2-erow { display: flex; gap: 8px; margin-bottom: 14px; }
.sc2-erow input { flex: 1; height: 46px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; color: var(--text); font-size: .9rem; }
.sc2-erow button { width: 110px; background: none; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 10px; font-weight: 700; font-size: .9rem; cursor: pointer; }
.sc2-newsale { width: 100%; height: 52px; border-radius: 10px; font-size: 1.05rem; }
.sc2-two { display: flex; gap: 10px; }
.sc2-two .sc-finish-later { flex: 2; height: 52px; margin-top: 0; }
.sc2-two .sc-pay-rest { flex: 3; height: 52px; margin-top: 0; padding: 0; }

/* Keyboard v2: quick-phrase row + phone layout */
#ez-osk .osk-phrases button { background: #31427a; border: 1px solid #4f6ec0; color: #cfe0ff;
  font-size: .85rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ez-osk .osk-full .osk-fn { color: var(--text-dim); font-size: .95rem; }
#ez-osk .osk-phone .osk-inset { padding: 0 5%; }
#ez-osk.osk-pop .osk-phone button { height: 54px; }

/* Settings: 3-option segs need tighter buttons to fit their cell */
.ds-seg.ds-seg-tight button { padding-left: 6px; padding-right: 6px; font-size: .78rem; white-space: nowrap; }

/* Settings: stacked icon + tiny label seg buttons (Option C, v1.13.35) */
#modal-device-settings .ds-seg-ic button { display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; padding: 8px 2px; min-height: 52px; }
#modal-device-settings .ds-seg-ic .lb { font-size: .62rem; font-weight: 600; white-space: nowrap; line-height: 1; }
#modal-device-settings .ds-seg-ic svg { width: 22px; height: 16px; display: block; }
#modal-device-settings .ds-seg-ic svg * { stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#modal-device-settings .ds-seg-ic svg .fill { fill: currentColor; stroke: none; }
#modal-device-settings .ds-seg-ic svg .dim { opacity: .45; }

/* Inline email row reused outside the sale-complete modal (order sheet…) */
.ov-erow { display: flex; gap: 8px; }
.ov-erow input { flex: 1; height: 44px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 0 12px; color: var(--text); font-size: .9rem; }
.ov-erow button { width: 110px; background: none; border: 1px solid var(--accent);
  color: var(--accent); border-radius: 10px; font-weight: 700; font-size: .9rem; cursor: pointer; }

/* Numpad header (label + mirror) in the docked modes too */
#ez-osk.osk-float .osk-flabel,
#ez-osk:not(.osk-pop) .osk-flabel { margin-bottom: 4px; }
#ez-osk.osk-float .osk-mirror { padding: 8px 10px; font-size: 1.25rem; min-height: 40px; margin-bottom: 8px; }
#ez-osk:not(.osk-pop):not(.osk-float) .osk-flabel,
#ez-osk:not(.osk-pop):not(.osk-float) .osk-mirror { max-width: 430px; margin-left: auto; margin-right: auto; }
#ez-osk:not(.osk-pop):not(.osk-float) .osk-grid.has-q ~ .osk-mirror { max-width: 600px; }

/* Keyboard clear key */
#ez-osk .osk-clear { color: var(--red); font-weight: 800; flex: 0 0 auto; min-width: 56px; max-width: 72px; }


/* ── Cashier-typed add-ons in the product modal ─────────────────────────
   Deliberately set apart from the catalogue groups above it: this section
   creates something that is not on the menu, and the cashier should be in
   no doubt which of the two they are doing. */
.pc-custom-section { border-top: 1px dashed var(--border); padding-top: 12px; margin-top: 4px; }
.pc-custom-new { display: flex; gap: 8px; align-items: center; }
.pc-custom-new input { background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .9rem; padding: 9px 11px;
  outline: none; }
.pc-custom-new .pc-custom-name  { flex: 1; min-width: 0; }
.pc-custom-new .pc-custom-price { width: 96px; text-align: right; }
.pc-custom-new input:focus { border-color: var(--accent); }
.pc-custom-add { flex: 0 0 44px; height: 40px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); border-radius: var(--radius-sm);
  font-size: 1.25rem; cursor: pointer; line-height: 1; }
.pc-custom-add:active { background: var(--accent); color: #fff; }
.pc-custom-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--surface2); border-radius: var(--radius-sm); margin-bottom: 6px; }
.pc-custom-label { flex: 1; font-size: .88rem; }
.pc-custom-amt { font-weight: 700; color: var(--accent); font-size: .88rem; }
.pc-custom-del { background: none; border: none; color: var(--text-faint);
  cursor: pointer; font-size: .95rem; padding: 0 2px; }
.pc-custom-del:hover { color: var(--red); }

/* Prompt shown while required attributes are unchosen.
   Everything else is hidden behind it: per-size add-on prices read
   "varies" until a size is picked, so showing seventy-odd unanswerable
   buttons first is worse than showing none. */
.pc-gate { color: var(--text-dim); font-size: .9rem; text-align: center;
  padding: 22px 12px; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.pc-gate:empty { display: none; }

/* ══════════════════════════════════════════════════════════════════════
   ONE TEXT FIELD, EVERYWHERE

   These rules had drifted: eight near-identical blocks with different
   font sizes (.82 / .9 / 1.3rem), different padding (6px / 8px / 12px),
   and placeholder, focus-ring and transition set on some and not others.
   On a touch screen that reads as sloppiness and, worse, the smaller
   ones are genuinely harder to hit.

   The custom add-on field's proportions are the reference — roomy enough
   for a finger, not so large it dominates a modal. Listed explicitly
   rather than applied to a bare `input` selector so the deliberate
   exceptions below keep their own look.
   ══════════════════════════════════════════════════════════════════════ */
.product-search-bar input,
.cart-customer-row input,
.coupon-row input,
.split-row input,
.sale-complete-email-row input,
.card-ref-row input,
.ez-input,
.pc-custom-new input,
.modal-body input[type="text"],
.modal-body input[type="email"],
.modal-body input[type="tel"],
.modal-body input[type="search"],
.modal-body input[type="number"],
.modal-body input[type="password"],
.modal-body textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem;
  font-family: inherit;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.product-search-bar input:focus,
.cart-customer-row input:focus,
.coupon-row input:focus,
.split-row input:focus,
.sale-complete-email-row input:focus,
.card-ref-row input:focus,
.ez-input:focus,
.pc-custom-new input:focus,
.modal-body input:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
  /* A ring as well as a colour: on a bright counter screen the border
     alone is easy to miss, and a cashier needs to know where typing goes. */
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 28%, transparent);
}

.product-search-bar input::placeholder,
.cart-customer-row input::placeholder,
.coupon-row input::placeholder,
.split-row input::placeholder,
.sale-complete-email-row input::placeholder,
.card-ref-row input::placeholder,
.ez-input::placeholder,
.pc-custom-new input::placeholder,
.modal-body input::placeholder,
.modal-body textarea::placeholder { color: var(--text-faint); }

.modal-body textarea { min-height: 72px; resize: vertical; line-height: 1.45; }

/* Deliberate exceptions — these are big or borderless on purpose and
   must not be flattened into the shared look. */
.pay-input-row input { font-size: 1.3rem; font-weight: 700; padding: 12px 14px; }
.pm-tender input, .pm-chg input { background: none; border: none; box-shadow: none; padding: 0; }
.pc-custom-new .pc-custom-price { text-align: right; }

/* Email address row inside the payment modal — shown only when the Email
   toggle is on and no address is known. */
.pm-email-row { margin: 8px 0 2px; }
.pm-email-row input { width: 100%; }

/* ── Hold / pickup modal ─────────────────────────────────────────────── */
.hold-mode-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.hold-mode-seg button { padding: 12px 8px; font-size: .82rem; }
.hold-when-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 8px 0; }
.hold-hint { color: var(--text-dim); font-size: .78rem; line-height: 1.5; margin: 0 0 14px;
  min-height: 2.4em; }
/* Sending a second kitchen ticket for the same food is the one mistake this
   modal can make that costs money and a plate, so the hint stops being grey
   advice and starts being a warning. */
.hold-hint-warn { color: var(--amber, #e0a03c); font-weight: 500; }
.hold-error { color: var(--red); font-size: .8rem; min-height: 1.2em; margin: 8px 0 4px; }
#modal-park .modal-body input { width: 100%; margin-bottom: 10px; }

/* Held count in the sidebar: a plain number is easy to miss mid-service,
   and a till with three held sales behaves very differently from one with
   none. */
.parked-badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 6px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: .7rem;
  font-weight: 700; text-align: center; line-height: 1.5; }
.parked-badge.has-kitchen { background: var(--yellow); color: #000; }

/* Pickups waiting to be collected. Held carts live only on this device;
   pickups are real orders on the server, so the badge is a different
   colour — the two lists must never be confused at a glance. */
.pickup-badge { display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 6px;
  border-radius: 9px; background: var(--green, #2e9e5b); color: #fff; font-size: .7rem;
  font-weight: 700; text-align: center; line-height: 1.5; }

/* Attached-order banner: the cart is editing a real order right now. */
.cart-attached { display: flex; align-items: center; gap: 10px; margin: 6px 0 0;
  padding: 7px 10px; border-radius: 8px; background: rgba(46,158,91,.14);
  border: 1px solid var(--green, #2e9e5b); font-size: .8rem; }
.cart-attached[hidden] { display: none; }
.cart-attached-text { flex: 1; font-weight: 600; color: var(--green, #2e9e5b); }
.cart-attached-detach { background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 3px 10px; font-size: .74rem;
  cursor: pointer; }
.cart-attached-detach:hover { border-color: var(--accent); color: var(--accent); }

/*
 * An attached order with UNSAVED CHANGES.
 *
 * Amber rather than green, because green here means "attached and in step with
 * the server" and that is exactly what is no longer true. The cashier needs to
 * see the difference without reading the line.
 */
.cart-attached.has-changes { border-color: var(--warn, #f5a623); }
.cart-attached.has-changes .cart-attached-text { color: var(--warn, #f5a623); }

/* Update — the same shape as Detach so they read as one pair of choices, but
   filled, because it is the one that keeps the cashier's work. */
.cart-attached-btn {
  background: var(--warn, #f5a623); color: #1a1a1a; border: 1px solid var(--warn, #f5a623);
  font: inherit; font-weight: 700; padding: 4px 12px; border-radius: 6px; cursor: pointer;
}
.cart-attached-btn[hidden] { display: none; }
.cart-attached-btn:hover { filter: brightness(1.08); }
.cart-attached-btn:disabled { opacity: .6; cursor: default; }
.pickup-row-age { color: var(--yellow); font-weight: 600; }

/* A promised collection time, and the same time once it has passed. The late
   state earns colour because it is the one row on the list that needs acting
   on now; the left border makes it findable without reading, which matters on
   a list of twenty at seven o'clock. */
.pickup-row-due  { color: var(--text); font-weight: 600; }
.pickup-row-late { color: var(--red); font-weight: 700; }
.order-row.pickup-overdue { border-left: 3px solid var(--red); }

/* ============================================================
   TEST-MODE PRINT PREVIEW
   The ticket test mode held back, at the printer's real width.
   ============================================================ */
.ez-preview-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ez-preview-box {
  background: var(--surface); color: var(--text);
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.4);
  max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column;
}
.ez-preview-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.ez-preview-x {
  background: none; border: 0; color: var(--text-dim);
  font-size: 18px; cursor: pointer; padding: 4px 8px;
}
.ez-preview-meta {
  padding: 10px 16px; font-size: 13px; color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
/*
 * White paper on any theme, because that is what the ticket is. Dark-mode
 * paper would be a nice-looking lie: the point of this window is to show
 * what comes out of the printer.
 */
/*
 * One station's paper inside a multi-station preview.
 *
 * A kitchen ticket routed to three stations is three pieces of paper. Stacked
 * with a rule between, because side by side they stop being readable at 42
 * columns each on a till screen, and the cashier is comparing them to what the
 * kitchen will hold.
 */
.ez-preview-station + .ez-preview-station {
  border-top: 1px dashed #b9a86a; margin-top: 4px; padding-top: 4px;
}

.ez-preview-paper {
  background: #fff; color: #111;
  font-family: "DejaVu Sans Mono", Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.35;
  white-space: pre; overflow: auto;
  margin: 16px; padding: 14px 12px;
  border: 1px solid #ccd0d4; border-radius: 4px;
  max-width: calc(92vw - 32px); flex: 1 1 auto;
}
.ez-preview-foot {
  padding: 0 16px 16px; display: flex; justify-content: flex-end;
}


/* Held-cart list: the two groups must read as two groups, not one list with a
   label lost somewhere inside it. A cashier has to tell at a glance whether a
   ticket is resumable from the other screen or only from this one. */
.parked-group{
  display:flex; align-items:baseline; gap:10px;
  margin:18px 0 8px; padding-bottom:6px;
  border-bottom:1px solid var(--border, #24272d);
  font-size:.8rem; text-transform:uppercase; letter-spacing:.07em;
  color:var(--text-dim, #8b929c); font-weight:700;
}
.parked-group:first-child{ margin-top:4px; }
.parked-group-note{
  margin-left:auto; text-transform:none; letter-spacing:0;
  font-weight:500; font-size:.75rem; color:var(--text-faint, #6b7280);
}

/* ── LEGACY DOCKED OPTIONS PANEL ─────────────────────────────────────────
 * The options panel stops at the cart instead of covering it.
 *
 * A floating modal is fine when the cashier commits once at the end. It is
 * the wrong shape when every tap is already in the sale, because the thing
 * the cashier needs to watch — the line being built — is behind the panel.
 * So the overlay is inset to the width of the cart column, carries no
 * scrim and no blur, and the panel itself fills that space.
 *
 * The bare strip beside the panel still closes on a tap, which is why the
 * overlay keeps its pointer events: letting them through would leave the
 * product grid live under a half-built line.
 */
.modal-overlay.pc-dock {
  inset: 0 385px 0 0;
  background: transparent;
  backdrop-filter: none;
  justify-content: flex-start;
}
/* Lefty layout puts the cart on the left, so the panel stops on that side. */
body[data-hand="left"] .modal-overlay.pc-dock { inset: 0 0 0 385px; }

.modal-overlay.pc-dock .modal {
  width: min(460px, 72%);
  max-width: none;
  max-height: 100%;
  height: 100%;
  border-radius: 0;
  border-width: 0 1px 0 0;
  box-shadow: 14px 0 40px rgba(0,0,0,.45);
}
.modal-overlay.pc-dock.pc-dock-right { justify-content: flex-end; }
.modal-overlay.pc-dock.pc-dock-right .modal {
  border-width: 0 0 0 1px;
  box-shadow: -14px 0 40px rgba(0,0,0,.45);
}
/* Full width: every column the product grid had, which is what stops a
   nineteen-topping pizza needing a scroll. */
.modal-overlay.pc-dock.pc-dock-full .modal { width: 100%; box-shadow: none; }

/* The body scrolls, the header and the price/Done row stay put — on a
   docked panel there is no page behind them to scroll instead. */
.modal-overlay.pc-dock .modal-body { flex: 1; overflow-y: auto; }

@media (max-width: 900px) {
  /* Too narrow to dock beside anything: fall back to the floating modal
     rather than leaving the cashier a 90px strip of cart. */
  .modal-overlay.pc-dock { inset: 0; background: rgba(0,0,0,.7); backdrop-filter: blur(3px);
    justify-content: center; }
  .modal-overlay.pc-dock .modal { width: min(680px, 94vw); height: auto; max-height: 90vh;
    border-radius: 16px; border-width: 1px; box-shadow: var(--shadow); }
}

/* Option-group tabs. The bar WRAPS rather than scrolling sideways: a tab
   you have to swipe to find is a tab the cashier does not know exists,
   and a horizontal scroll inside a vertical panel is the worst gesture on
   a touchscreen. */
.pc-tabbar { display: flex; flex-wrap: wrap; gap: 4px;
  border-bottom: 1px solid var(--border); margin: 4px 0 12px; }
.pc-tabbar button { font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--text-dim); background: none; border: 0;
  border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0;
  padding: 11px 16px; min-height: 44px; cursor: pointer; white-space: nowrap; }
.pc-tabbar button:hover { color: var(--text); background: var(--surface2); }
.pc-tabbar button[aria-selected="true"] { color: var(--text);
  background: var(--surface2); border-bottom-color: var(--accent); }
.pc-tabbar button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Beats the inline display the attribute gate writes on every refresh. */
.pc-section.pc-tab-off { display: none !important; }

/* A line of explanation under a device setting. Sits tight against the row
   it belongs to, so a long tab of switches still reads as pairs. */
.ds-hint { font-size: .75rem; color: var(--text-dim); margin: -8px 0 16px; line-height: 1.45; }
.ds-hint:last-child { margin-bottom: 4px; }

/* ──────────────────────────────────────────────────────────────────────
   PER-ROW PLACEMENT  (portions.layout = "buttons")

   The alternative to the group-wide Whole / 1st / 2nd selector: every
   topping carries its own three, so any placement is one tap and no mode
   has to be set first. It costs roughly three times the row height, which
   is why the merchant chooses per group rather than the code choosing for
   everyone.

   The choice button keeps every style it has in the grid layout — these
   rules only change how it is laid out and what sits beside it.
   ────────────────────────────────────────────────────────────────────── */

/* One choice per row: the placement strip needs the width, and a wrapped
   3-button strip is unreadable at the speed a cashier works. */
.pc-grid.pc-opt-rows { grid-template-columns: 1fr; gap: 8px; }

.pc-choice-wrap { display: flex; align-items: stretch; gap: 8px; }

/* The choice takes the room left over; the strip is a fixed size so the
   buttons line up down the column and can be hit without looking. */
.pc-choice-wrap > button:not(.pc-place) { flex: 1 1 auto; text-align: left; }

.pc-place-seg { display: flex; gap: 4px; flex: 0 0 auto; }

.pc-grid.pc-opt-rows button.pc-place {
  min-height: 0;                 /* not a 56px choice button */
  width: 52px;
  padding: 4px 2px;
  font-size: .72rem;
  font-weight: 600;
  line-height: 1.1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, transparent);
  color: var(--text-dim);
  white-space: nowrap;
}

/* Each side keeps the colour it already has on the badge and the cart, so
   "the pink one" means the same thing everywhere in the app. */
.pc-grid.pc-opt-rows button.pc-place.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.pc-grid.pc-opt-rows button.pc-place[data-place="left"].active {
  background: var(--portion-l); border-color: var(--portion-l);
}
.pc-grid.pc-opt-rows button.pc-place[data-place="right"].active {
  background: var(--portion-r); border-color: var(--portion-r);
}

/* The badge is redundant when the lit button already says which side. */
.pc-grid.pc-opt-rows .pc-portion-badge { display: none; }

@media (max-width: 480px) {
  .pc-grid.pc-opt-rows button.pc-place { width: 44px; font-size: .68rem; }
}

/* A whole-only choice has one placement, but the strip keeps its width so
   the rows still line up down the column — a ragged right edge reads as a
   rendering fault rather than as a deliberate difference. */
.pc-grid.pc-opt-rows .pc-choice-wrap[data-wholeonly] .pc-place-seg { width: 164px; }
.pc-grid.pc-opt-rows .pc-choice-wrap[data-wholeonly] button.pc-place { width: 100%; }
@media (max-width: 480px) {
  .pc-grid.pc-opt-rows .pc-choice-wrap[data-wholeonly] .pc-place-seg { width: 140px; }
}

/* A topping on a half that still costs the whole price.

   Every other half-placed topping drops to its half price, so this one sitting
   at the full amount reads as a fault unless the button says otherwise. The
   delta carries the word; this just stops it being mistaken for a half price
   at a glance. */
.pc-grid.has-portions button.full-on-half .pc-delta {
  color: var(--warn, #d08700);
  font-weight: 700;
}

/* ── OPEN TICKETS VIEW (core) ────────────────────────────────
   Everything not paid yet, in one list, styled like the Orders list: a
   card per ticket, the number first, then who, how it leaves, the kitchen
   state, items, time and total. The list sits beside the detail on a wide
   screen and above it on a narrow one. */
#view-tickets .addon-view-header { gap: 12px; flex-wrap: wrap; }
#view-tickets .tk-tabs { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
#view-tickets .tk-tabs button { background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 20px; padding: 6px 14px; font-size: .85rem; cursor: pointer; }
#view-tickets .tk-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tk-split { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); }
.tk-list { overflow-y: auto; padding: 12px 16px; border-right: 1px solid var(--border); min-height: 0; }
.tk-detail { overflow-y: auto; padding: 16px 20px; background: var(--surface); min-height: 0; }
@media (max-width: 900px) {
  .tk-split { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .tk-list { border-right: 0; }
  .tk-detail { border-top: 1px solid var(--border); max-height: 55vh; }
}
.tk-row { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .12s, background .12s; }
.tk-row:hover { border-color: var(--accent); }
.tk-row.selected { border-color: var(--accent); background: var(--surface2); }
.tk-row.tk-k-kitchen { border-left-color: var(--green); }
.tk-row.tk-k-wait { border-left-color: var(--yellow); }
.tk-row.tk-late { border-left-color: var(--red); }
.tk-row-main { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; min-width: 0; }
.tk-num { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.tk-cust { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-label { color: var(--text-dim); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-ot { margin-left: auto; white-space: nowrap; font-size: .8rem; padding: 2px 10px; border-radius: 20px;
  background: var(--surface2); border: 1px solid var(--border); }
.tk-row-meta { display: flex; align-items: center; gap: 14px; font-size: .8rem; color: var(--text-dim); flex-wrap: wrap; }
.tk-row-meta strong { margin-left: auto; color: var(--text); font-size: .95rem; }
.tk-pill { padding: 2px 9px; border-radius: 20px; font-size: .72rem; font-weight: 600; background: var(--surface2); white-space: nowrap; }
.tk-pill-saved   { color: var(--text-dim); }
.tk-pill-kitchen { color: var(--green); }
.tk-pill-wait    { color: var(--yellow); }
.tk-pill-order   { color: var(--accent); }
.tk-note { background: rgba(245,166,35,.10); border: 1px solid rgba(245,166,35,.35); color: var(--yellow);
  border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; font-size: .85rem; }
.tk-detail-empty { color: var(--text-dim); text-align: center; padding: 48px 12px; }
.tk-detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tk-detail-head h3 { font-size: 1.25rem; font-weight: 800; }
.tk-detail-head strong { font-size: 1.2rem; }
.tk-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .85rem; margin: 0 0 14px; }
.tk-facts dt { color: var(--text-dim); }
.tk-facts dd { margin: 0; }
.tk-items-head { font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); margin: 12px 0 4px; }
.tk-item { padding: 8px 0; border-bottom: 1px solid var(--border); }
.tk-item-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.tk-item-opts { font-size: .8rem; color: var(--text-dim); margin: 4px 0 0 16px; line-height: 1.45; }
.tk-item-note { font-size: .8rem; color: var(--yellow); margin: 4px 0 0 16px; }
.tk-note-empty { color: var(--text-dim); font-size: .85rem; padding: 8px 0; }
.tk-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; position: sticky; bottom: -16px;
  background: var(--surface); padding: 10px 0; }
.tk-actions .tk-act { padding: 10px 14px; font-size: .9rem; }
.tk-actions .tk-primary { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.tk-actions .tk-primary:hover { filter: brightness(1.08); color: #fff; }
.tk-actions .tk-danger { color: var(--red); border-color: rgba(240,82,82,.45); margin-left: auto; }
/* A hidden cart button (the old Pickups button when none are left) must stay hidden. */
.cart-hold-btns .cart-act[hidden], #view-tickets .tk-tabs button[hidden] { display: none; }

/* ── SAVE ORDER SHEET — big, for fingers ─────────────────────
   Roughly double the old 460px card, with touch-sized controls: this is
   pressed at a busy counter, often with a customer waiting. */
.modal.save-sheet { width: min(760px, 96vw); max-height: 94vh; overflow-y: auto; }
.save-sheet .modal-header h2 { font-size: 1.4rem; }
.save-sheet .modal-body { padding: 18px 24px 22px; display: flex; flex-direction: column; gap: 14px; }
.save-sheet #save-type { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.save-sheet #save-type button { padding: 18px 12px; font-size: 1.1rem; font-weight: 700; border-radius: var(--radius); }
.save-sheet input[type=text], .save-sheet input[type=tel] { font-size: 1.1rem; padding: 14px 16px; min-height: 52px; }
.save-sheet #park-when { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save-sheet #park-when button { padding: 14px; font-size: 1.05rem; border-radius: var(--radius); }
.save-sheet #save-switches { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px !important; margin: 4px 0 !important; }
.save-sheet .save-sw { padding: 18px 16px !important; font-size: 1.05rem !important; min-height: 64px; border-radius: var(--radius) !important; }
.save-sheet .save-sw input[type=checkbox] { width: 28px !important; height: 28px !important; flex: 0 0 28px !important; }
.save-sheet .save-sw:has(input:checked) { border-color: var(--accent) !important; background: rgba(79,142,247,.10); }
.save-sheet #park-save { padding: 20px; font-size: 1.25rem; border-radius: var(--radius); }
@media (max-height: 700px) { .save-sheet #save-type button { padding: 12px; } .save-sheet .save-sw { min-height: 52px; padding: 12px !important; } }
.save-sheet .save-sw { display: flex !important; align-items: center; gap: 12px; }
.save-sheet .save-sw[hidden] { display: none !important; }
.save-sheet #park-hint:empty, .save-sheet #park-error:empty { display: none; }
/* Paying a saved order from Open Tickets: say which one. */
.pay-from-list { background: rgba(79,142,247,.12); border-bottom: 1px solid var(--border); color: var(--text);
  padding: 10px 18px; font-size: .9rem; font-weight: 600; }
.save-sheet .save-slot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; }
.save-sheet .save-slot[hidden], .save-sheet #save-address[hidden] { display: none; }
.save-sheet .save-slot input, .save-sheet .save-slot select { font-size: 1.05rem; padding: 12px 14px; min-height: 52px;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.save-sheet #save-address { font-size: 1.05rem; padding: 12px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); resize: vertical; }
