/* Till Order, a page inside the dashboard (was the standalone /till-order page).
   Every rule is under #page-till-order so nothing leaks into the rest of the app. */

#page-till-order {
  --radius: 10px;
  --radius-lg: 14px;
  --till-tint: rgba(79,140,255,0.12);
  --font-cond: 'Barlow Condensed', var(--font, sans-serif);
  --ring: 0 0 0 3px var(--accent-soft);
  color: var(--text);
}
[data-theme="dark"] #page-till-order { --till-tint: rgba(79,140,255,0.22); }
#page-till-order *, #page-till-order *::before, #page-till-order *::after { box-sizing: border-box; }
#page-till-order .hidden { display: none !important; }
#page-till-order input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
#page-till-order input[type="number"]::-webkit-outer-spin-button, #page-till-order input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

#page-till-order .header{display:flex;align-items:center;gap:12px;padding:16px 20px 12px}
#page-till-order .header h1{font-family:var(--font-cond);font-weight:700;font-size:1.4rem;letter-spacing:0.04em;flex:1;color:var(--text-strong)}
#page-till-order .header > a, #page-till-order .header > button{font-size:0.82rem;text-decoration:none;color:var(--text-muted);background:none;border:none;cursor:pointer;font-family:inherit}
#page-till-order .header .back{font-size:1.3rem}

#page-till-order .wrap{padding:4px 16px 24px;display:flex;flex-direction:column;gap:14px;max-width:560px;margin:0 auto}
#page-till-order .section-label{font-size:0.72rem;font-weight:700;text-transform:uppercase;letter-spacing:0.08em;color:var(--text-muted);margin-bottom:6px}

#page-till-order input, #page-till-order textarea{
  width:100%;font:inherit;font-size:1rem;color:var(--text);
  background:var(--bg-input);border:1px solid var(--border);border-radius:var(--radius);
  padding:12px 14px;transition:border-color 0.12s, box-shadow 0.12s;
}
#page-till-order input::placeholder, #page-till-order textarea::placeholder{color:var(--text-muted);opacity:0.8}
#page-till-order input:focus, #page-till-order textarea:focus{outline:none;border-color:var(--accent);box-shadow:var(--ring)}

/* The shop you sell from: a segmented switch, the live shop filled in. */
#page-till-order .loc-toggle{display:inline-flex;gap:2px;padding:3px;background:var(--bg-input);border-radius:999px}
#page-till-order .loc-btn{
  flex:1;padding:7px 16px;font:inherit;font-weight:600;border-radius:999px;
  border:1px solid transparent;background:transparent;color:var(--text-muted);cursor:pointer;
  transition:background-color 0.12s, color 0.12s;
}
#page-till-order .loc-btn:hover{color:var(--text)}
#page-till-order .loc-btn.active{background:var(--accent);border-color:var(--accent);color:#fff}
#page-till-order .shop-label{margin:0;font-weight:600}

#page-till-order .results, #page-till-order .basket{display:flex;flex-direction:column;gap:6px}
#page-till-order .result{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);
  padding:10px;font:inherit;color:var(--text);cursor:pointer;
  transition:background-color 0.12s, border-color 0.12s;
}
#page-till-order .result:hover{background:var(--bg-hover);border-color:var(--text-muted)}
#page-till-order .result:active{transform:scale(0.99)}
#page-till-order .thumb{width:44px;height:44px;border-radius:6px;object-fit:cover;background:var(--bg-input);flex-shrink:0}
#page-till-order .r-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
#page-till-order .r-title{font-weight:600;font-size:0.95rem;line-height:1.2;overflow:hidden;text-overflow:ellipsis}
#page-till-order .r-meta{font-size:0.78rem;color:var(--text-muted)}
#page-till-order .r-meta .out{color:var(--danger);font-weight:600}
#page-till-order .r-price{font-family:var(--font-cond);font-weight:700;font-size:1.1rem;white-space:nowrap}
#page-till-order .hint{font-size:0.85rem;color:var(--text-muted);padding:4px}

#page-till-order .line{
  display:flex;align-items:center;gap:10px;
  background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);padding:10px;
}
/* The quantity: one pill, − and + at its ends, the count between. */
#page-till-order .qty{display:inline-flex;align-items:center;gap:2px;padding:2px;background:var(--bg-input);border-radius:999px}
#page-till-order .qty button{
  width:32px;height:32px;border-radius:50%;border:none;
  background:transparent;color:var(--text);font-size:1.15rem;line-height:1;cursor:pointer;
  transition:background-color 0.12s;
}
#page-till-order .qty button:hover{background:var(--bg-card)}
#page-till-order .qty span{min-width:24px;text-align:center;font-weight:700}

#page-till-order .link-btn{background:none;border:none;color:var(--accent);font:inherit;font-weight:600;cursor:pointer;padding:6px 0;text-align:left}
#page-till-order .link-btn:hover{text-decoration:underline}

/* Price first, then the name, then its VAT (#3833). */
#page-till-order .custom{display:grid;grid-template-columns:110px 1fr;gap:8px}
#page-till-order .custom .actions, #page-till-order .custom .seg, #page-till-order .custom .hint{grid-column:1 / -1}
#page-till-order .custom .actions{display:flex;gap:8px}
#page-till-order .cust-new{display:flex;flex-direction:column;gap:8px}
#page-till-order .cust-new .actions{display:flex;gap:8px}

#page-till-order .chip{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  background:var(--till-tint);border-radius:var(--radius);padding:10px 12px;font-weight:600;
}
#page-till-order .chip button{background:none;border:none;color:var(--text-muted);font-size:1.1rem;cursor:pointer}

#page-till-order .btn{
  padding:12px 16px;border-radius:var(--radius);border:1px solid var(--border);
  background:var(--bg-card);color:var(--text);font:inherit;font-weight:600;cursor:pointer;
  transition:background-color 0.12s, border-color 0.12s, box-shadow 0.12s;
}
#page-till-order .btn:hover:not(:disabled){background:var(--bg-hover);border-color:var(--text-muted)}
#page-till-order .btn:active:not(:disabled){transform:scale(0.98)}
#page-till-order .btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
#page-till-order .btn.primary:hover:not(:disabled){background:var(--accent-hover);border-color:var(--accent-hover)}
#page-till-order .btn:focus-visible{outline:none;box-shadow:var(--ring)}

#page-till-order .footer-bar{
  /* Sticky, not fixed: it stays inside the content area, so it never runs under the
     sidebar, however wide or folded that is. */
  position:sticky;bottom:0;z-index:5;margin-top:8px;
  background:var(--bg-card);border-top:1px solid var(--border);
  padding:12px 16px calc(12px + env(safe-area-inset-bottom));
}
#page-till-order .footer-inner{max-width:560px;margin:0 auto;display:flex;align-items:center;gap:12px}
#page-till-order .total{flex:1;font-family:var(--font-cond);font-weight:700;font-size:2rem;line-height:1;color:var(--text-strong)}
#page-till-order .total small{display:block;font-family:inherit;font-weight:500;font-size:0.72rem;color:var(--text-muted);margin-top:4px;line-height:1.2}
#page-till-order #send-btn{padding:14px 22px;font-size:1.05rem}
#page-till-order #send-btn:disabled{opacity:0.5}

#page-till-order .error{color:var(--danger);font-size:0.9rem;display:none}
#page-till-order .footer-bar #send-error{max-width:560px;margin:0 auto 8px;font-weight:600}

#page-till-order .login-card{max-width:380px;margin:40px auto;padding:0 16px;display:flex;flex-direction:column;gap:14px}
#page-till-order .login-card label{font-size:0.8rem;color:var(--text-muted)}

/* Sent and Paid: one card in the middle of the page, the tick and the big sum first. */
#page-till-order #success-screen{
  text-align:center;padding:48px 24px 36px;display:flex;flex-direction:column;align-items:center;gap:14px;
  max-width:520px;margin:24px auto;background:var(--bg-card);border:1px solid var(--border);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);
}
#page-till-order .tick{width:88px;height:88px;border-radius:50%;background:var(--success-soft);color:var(--success);display:flex;align-items:center;justify-content:center}
#page-till-order .tick svg{width:44px;height:44px}
#page-till-order #success-lead{font-size:1.05rem;color:var(--text-muted)}
#page-till-order .big-name{font-family:var(--font-cond);font-weight:700;font-size:2.8rem;letter-spacing:0.02em;line-height:1;color:var(--text-strong)}
#page-till-order #success-detail{color:var(--text-muted);max-width:340px;line-height:1.4}
/* Paying in the app (#3539): three tenders, then one question before anything is recorded. */
#page-till-order #pay-panel{display:flex;flex-direction:column;gap:10px;width:100%;max-width:360px}
/* Wraps: five tenders (with Deposit) do not fit across a phone (#3800). */
#page-till-order .pay-row{display:flex;flex-wrap:wrap;gap:8px}
#page-till-order .pay-row .btn{flex:1 1 auto}
#page-till-order #pay-question{line-height:1.4}
#page-till-order .pay-amount{font-family:var(--font-cond);font-weight:700;font-size:2.4rem;line-height:1.1;color:var(--text-strong);margin-bottom:6px}
#page-till-order .pay-amount.hidden{display:none}
#page-till-order .big-name.small{font-size:1.6rem}
/* Waiting to pay, Change and Cancel (#3548, #3554). */
#page-till-order .r-meta .owed{color:var(--accent);font-weight:600}
#page-till-order #order-actions, #page-till-order #cancel-ask{width:100%;max-width:360px}
#page-till-order #cancel-ask{display:flex;flex-direction:column;gap:10px}
#page-till-order #cancel-ask.hidden{display:none}
#page-till-order #cancel-question{line-height:1.4}
#page-till-order #open-lines{color:var(--text-muted);font-size:0.9rem;max-width:360px;line-height:1.4}
#page-till-order #again-btn{min-width:200px;padding:14px 22px;font-size:1.05rem}
/* Selling a gift card (#3597). The code is shown big, in fours, to copy onto the card. */
#page-till-order #gift-screen .pay-row .btn{flex:1}
#page-till-order #gift-pay, #page-till-order #gift-ask{display:flex;flex-direction:column;gap:10px}
#page-till-order #gift-ask.hidden, #page-till-order #gift-pay.hidden{display:none}
#page-till-order .gift-code{font-family:var(--font-cond);font-weight:700;font-size:2rem;letter-spacing:0.08em;word-spacing:0.25em;text-align:center;
  background:var(--bg-card);border:1px dashed var(--border);border-radius:var(--radius);padding:14px 8px;overflow-wrap:anywhere}
#page-till-order #gift-done{text-align:center;padding:40px 20px;display:flex;flex-direction:column;align-items:center;gap:14px}
#page-till-order #gift-done .gift-code{width:100%;max-width:420px}
#page-till-order #gift-done-detail{color:var(--text-muted);max-width:360px;line-height:1.4}
/* ── The POS layout (#3609): find on the left, the sale on the right ─────────── */
#page-till-order .pos-head{flex-wrap:wrap;gap:8px 10px;padding:14px 16px 12px;margin-bottom:4px;border-bottom:1px solid var(--border)}
#page-till-order .pos-head h1{flex:0 0 auto;margin-right:auto}
/* A phone's top bar (layout.css, 768 and under) already says POS, so the page's own
   title and its "?" stay off there; the shop, the chips and the buttons remain (#3821). */
@media (max-width: 768px){
  #page-till-order .pos-head h1{display:none}
}
#page-till-order #branch-field{display:flex;align-items:center;gap:8px}
#page-till-order #branch-field.hidden{display:none}
#page-till-order .pos-head .loc-btn{flex:0 0 auto;padding:6px 14px}
/* Under .pos-head, so it outranks the generic `.header > button` above. */
#page-till-order .pos-head .head-chip, #page-till-order .pos-head .head-btn{
  font:inherit;font-size:0.85rem;font-weight:600;padding:7px 14px;border-radius:999px;cursor:pointer;
  border:1px solid var(--border);background:var(--bg-card);color:var(--text);
  transition:background-color 0.12s, border-color 0.12s;
}
#page-till-order .pos-head .head-btn:hover{background:var(--bg-hover);border-color:var(--text-muted)}
#page-till-order .pos-head .head-chip{background:var(--till-tint);border-color:transparent;color:var(--accent);font-weight:700}
#page-till-order .pos-head .head-chip:hover{background:var(--accent);color:#fff}
/* IOUs out is money owed to the drawer, so it reads amber, not blue. */
#page-till-order .pos-head #iou-chip{background:var(--warning-soft);color:var(--warning)}
#page-till-order .pos-head #iou-chip:hover{background:var(--warning);color:#fff}
/* An icon on each header pill (Lucide, as the sprite in index.html): drawn by a mask
   filled with the pill's own text colour, so it follows the theme and the hover. */
#page-till-order .pos-head .head-chip, #page-till-order .pos-head .head-btn{display:inline-flex;align-items:center;gap:6px}
#page-till-order .pos-head .head-chip::before, #page-till-order .pos-head .head-btn::before{
  content:'';width:16px;height:16px;flex-shrink:0;background-color:currentColor;
  -webkit-mask:var(--ico) center / contain no-repeat;mask:var(--ico) center / contain no-repeat;
}
#page-till-order .pos-head #waiting-chip{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E")} /* clock */
#page-till-order .pos-head #gift-open{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='18' height='4' rx='1'/%3E%3Cpath d='M12 8v13'/%3E%3Cpath d='M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7'/%3E%3Cpath d='M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5'/%3E%3C/svg%3E")} /* gift */
#page-till-order .pos-head #cards-open{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='14' x='2' y='5' rx='2'/%3E%3Cline x1='2' x2='22' y1='10' y2='10'/%3E%3C/svg%3E")} /* credit-card: Gift cards (#3939) */
#page-till-order .pos-head #iou-chip{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17'/%3E%3Cpath d='m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9'/%3E%3Cpath d='m2 16 6 6'/%3E%3Ccircle cx='16' cy='9' r='2.9'/%3E%3Ccircle cx='6' cy='5' r='3'/%3E%3C/svg%3E")} /* hand-coins */
#page-till-order .pos-head #drawer-open{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='12' x='2' y='6' rx='2'/%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Cpath d='M6 12h.01M18 12h.01'/%3E%3C/svg%3E")} /* banknote */
#page-till-order .pos-head #refund-open{--ico:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")} /* search: Find an order (#3937) */
#page-till-order .pos-drop{margin:0 16px 10px;padding:12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-card);box-shadow:var(--shadow-md)}
#page-till-order .pos-drop input{margin-bottom:8px}
#page-till-order #waiting-error, #page-till-order #changing{margin:0 16px 10px}

#page-till-order .pos{display:flex;flex-direction:column;gap:14px;padding:0 16px 16px}
#page-till-order .pos-find{display:flex;flex-direction:column;gap:12px;min-width:0}
#page-till-order .find-row{display:flex;gap:8px}
/* A magnifier drawn into the box, in a grey that reads on both themes. */
#page-till-order .find-row input{
  flex:1;font-size:1.1rem;padding:13px 14px 13px 44px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8580' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:14px center;background-size:20px 20px;
}
#page-till-order .scan-btn{padding:0 15px;display:flex;align-items:center;border-radius:var(--radius)}
#page-till-order .scan-btn svg{width:24px;height:24px}
#page-till-order .pos-tabs{display:inline-flex;align-self:flex-start;gap:2px;padding:3px;background:var(--bg-input);border-radius:999px}
#page-till-order .pos-tabs button{
  font:inherit;font-size:0.85rem;font-weight:600;padding:6px 14px;border-radius:999px;cursor:pointer;
  border:1px solid transparent;background:none;color:var(--text-muted);
  transition:background-color 0.12s, color 0.12s;
}
#page-till-order .pos-tabs button:hover{color:var(--text)}
#page-till-order .pos-tabs button.active{background:var(--bg-card);color:var(--text-strong);box-shadow:var(--shadow-sm)}

/* Tiles: at least 76px (about 2 cm) high, the tablet target. The photo sits along
   the top, the name under it and the price at the foot, so nothing runs under the picture. */
#page-till-order .tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:10px}
#page-till-order .tile{
  position:relative;display:flex;flex-direction:column;align-items:stretch;gap:3px;min-height:124px;
  padding:8px 10px 10px;text-align:left;font:inherit;color:var(--text);cursor:pointer;overflow:hidden;
  background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-sm);
  transition:border-color 0.12s, box-shadow 0.12s, transform 0.08s;
}
#page-till-order .tile:hover{border-color:var(--accent);box-shadow:var(--shadow-md)}
#page-till-order .tile:active{transform:scale(0.97)}
#page-till-order .tile:focus-visible{outline:none;border-color:var(--accent);box-shadow:var(--ring)}
/* Pinned on Settings › POS: an accent bar along the top, so staff can tell them from this week's best sellers. */
#page-till-order .tile.pinned{border-color:var(--accent);box-shadow:inset 0 3px 0 var(--accent)}
/* How many of this item are in the sale (#3831), top right like Shopify POS. */
#page-till-order .tile-count{position:absolute;top:6px;right:6px;min-width:22px;height:22px;padding:0 6px;box-sizing:border-box;
  border-radius:11px;background:var(--accent);color:#fff;font-weight:700;font-size:0.8rem;line-height:22px;text-align:center}
#page-till-order .tile-count[hidden]{display:none}
/* Low or no stock at the selling shop (#3832). */
#page-till-order .tile-stock{font-size:0.75rem}
#page-till-order .tile-stock[hidden]{display:none}
#page-till-order .tile-stock.out{color:var(--danger);font-weight:600}
#page-till-order .tile-img{
  position:static;display:block;width:100%;height:60px;border-radius:7px;object-fit:cover;
  background:#fff;margin:0 0 4px;
}
#page-till-order .tile-title{font-weight:600;font-size:0.9rem;line-height:1.2;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#page-till-order .tile-sub{font-size:0.75rem;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page-till-order .tile-price{margin-top:auto;padding-top:4px;font-family:var(--font-cond);font-weight:700;font-size:1.15rem;line-height:1;color:var(--text-strong)}
/* Empty states: a dashed box with the hint in the middle. */
#page-till-order #tiles-empty, #page-till-order #basket-empty{
  text-align:center;padding:22px 16px;border:1px dashed var(--border);border-radius:var(--radius);line-height:1.4;
}

/* The sale: lines, a tap opens one; the total and the buttons at the foot. */
#page-till-order .pos-sale{
  display:flex;flex-direction:column;min-width:0;overflow:hidden;
  background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);
}
#page-till-order .sale-scroll{display:flex;flex-direction:column;gap:8px;padding:14px;overflow-y:auto;flex:1}
#page-till-order .sale-customer{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
#page-till-order .sheet-head{display:none}
/* Lines as a list with a rule between them, not a stack of boxes. */
#page-till-order .pos-sale .basket{gap:0}
#page-till-order .pos-sale .line{flex-wrap:wrap;background:transparent;border:none;border-bottom:1px solid var(--border);border-radius:0;padding:10px 2px}
#page-till-order .pos-sale .line:last-child{border-bottom:none}
#page-till-order .pos-sale .line .r-body{cursor:pointer}
#page-till-order .pos-sale .line .r-title{font-size:1rem}
#page-till-order .line-total{font-family:var(--font-cond);font-weight:700;font-size:1.15rem;white-space:nowrap;min-width:64px;text-align:right}
#page-till-order .r-meta .off{color:var(--accent);font-weight:600}
#page-till-order .line.editing{background:var(--till-tint);border-radius:var(--radius);padding:10px;border-bottom-color:transparent}
#page-till-order .line-edit{flex-basis:100%;display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;padding-top:6px}
#page-till-order .line-edit label{display:flex;flex-direction:column;gap:3px;font-size:0.75rem;color:var(--text-muted);flex:1;min-width:100px}
#page-till-order .line-edit input{padding:8px 10px;background:var(--bg-card)}
#page-till-order .seg{display:flex}
/* Under the lines: the club discount and money off the whole sale (#3547). */
#page-till-order .sale-off{display:flex;flex-direction:column;gap:2px;padding:6px 0}
#page-till-order .sale-off:empty{display:none}
/* Clear sale / Set aside / N set aside, above the lines (#4436). */
#page-till-order .sale-acts{display:flex;flex-wrap:wrap;gap:4px 18px}
#page-till-order .sale-acts .link-btn{min-height:36px}
#page-till-order #clear-ask{flex-wrap:wrap;justify-content:flex-start}
#page-till-order #clear-ask span{flex:1 1 100%}
#page-till-order #clear-ask button.btn{font-size:0.95rem;color:var(--text);padding:10px 16px;background:var(--bg-card);border:1px solid var(--border)}
#page-till-order #clear-ask button.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}
#page-till-order .parked{display:flex;flex-direction:column;gap:6px;padding:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--bg-card)}
#page-till-order .parked-row{display:flex;align-items:center;gap:8px}
#page-till-order .parked-row .result{flex:1;min-width:0}
#page-till-order .off-row{display:flex;align-items:center;gap:10px;font-size:0.85rem;color:var(--text-muted)}
#page-till-order .off-row .off-what{flex:1;min-width:0}
#page-till-order .off-row .off{color:var(--accent);font-weight:600}
#page-till-order .seg button{font:inherit;font-weight:700;padding:8px 12px;border:1px solid var(--border);background:var(--bg-card);color:var(--text);cursor:pointer}
#page-till-order .seg button:first-child{border-radius:var(--radius) 0 0 var(--radius)}
#page-till-order .seg button:last-child{border-radius:0 var(--radius) var(--radius) 0}
#page-till-order .seg button.active{background:var(--accent);border-color:var(--accent);color:#fff}
#page-till-order .edit-acts{display:flex;gap:6px;margin-left:auto}
#page-till-order .edit-acts .btn{padding:8px 12px}
#page-till-order .sale-note summary{cursor:pointer;font-size:0.85rem;color:var(--text-muted);padding:4px 0}
#page-till-order .pos-sale .footer-bar{position:static;margin-top:0;border-radius:0;padding:14px}
#page-till-order .pos-sale .footer-inner{max-width:none;flex-wrap:wrap}

/* Tenders beside Send to till (#3559): big, one press each. Cash is the green outline
   and Card the blue, the same two as Paid cash / Paid card on a repair (tokens.css, #2007). */
#page-till-order .tenders{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-top:12px}
#page-till-order .tenders.hidden{display:none}
#page-till-order .tenders .btn{min-height:58px;padding:12px;font-size:1.05rem;text-transform:uppercase;letter-spacing:0.03em;border-width:2px}
#page-till-order #tender-cash, #page-till-order #tender-card{background:transparent}
#page-till-order #tender-cash{border-color:var(--pay-cash-line);color:var(--pay-cash-text)}
#page-till-order #tender-card{border-color:var(--pay-card-line);color:var(--pay-card-text)}
#page-till-order #tender-cash:hover:not(:disabled){background:color-mix(in srgb, var(--pay-cash-line) 16%, transparent);border-color:var(--pay-cash-line)}
#page-till-order #tender-card:hover:not(:disabled){background:color-mix(in srgb, var(--pay-card-line) 16%, transparent);border-color:var(--pay-card-line)}
#page-till-order #tender-more{border-color:var(--border);color:var(--text);text-transform:none;letter-spacing:0}
#page-till-order .tenders kbd, #page-till-order #again-btn kbd{
  font:inherit;font-size:0.68rem;font-weight:700;margin-left:6px;padding:2px 6px;border-radius:6px;
  background:color-mix(in srgb, currentColor 14%, transparent);opacity:1;letter-spacing:0;
}
#page-till-order #send-btn.secondary{background:var(--bg-card);border-color:var(--border);color:var(--text)}
/* Six choices (#4438): two across, so they don't push the sale out of sight. */
#page-till-order .more-menu{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
#page-till-order .more-menu.hidden{display:none}
/* The cash pad and the change (#3559). */
#page-till-order #cash-pad{display:flex;flex-direction:column;gap:10px}
#page-till-order #cash-pad.hidden{display:none}
#page-till-order #deposit-pad{display:flex;flex-direction:column;gap:10px}
#page-till-order #deposit-pad.hidden{display:none}
#page-till-order .deposit-hand{display:flex;align-items:center;gap:8px}
#page-till-order #cash-due{font-weight:700;font-size:1.1rem;margin:0}
#page-till-order .cash-quick{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#page-till-order .cash-quick .btn{padding:16px 10px;font-size:1.1rem}
#page-till-order #cash-change{font-family:var(--font-cond);font-weight:700;font-size:1.5rem;margin:0;min-height:1.6em}
#page-till-order #cash-change.short{color:var(--danger)}
#page-till-order .change-big{font-family:var(--font-cond);font-weight:700;font-size:4.2rem;letter-spacing:0.02em;color:var(--accent)}
#page-till-order .change-big.hidden{display:none}
#page-till-order .price-changed{max-width:420px;margin:8px auto;padding:10px 12px;border:1px solid var(--warning, #b45309);border-radius:var(--radius);color:var(--text-strong);font-weight:600;line-height:1.35}
#page-till-order .price-changed.hidden{display:none}

/* Phone and narrow tablet: one column; the sale is a sheet over the tiles. */
#page-till-order .sale-bar{
  position:sticky;bottom:0;z-index:5;display:flex;align-items:center;gap:12px;
  background:var(--bg-card);border-top:1px solid var(--border);box-shadow:0 -4px 16px rgba(0,0,0,0.08);
  padding:10px 16px calc(10px + env(safe-area-inset-bottom));
  flex-wrap:wrap;min-height:64px;cursor:pointer;
}
/* One pill, the width of the strip, as Shopify POS's "4 items · €185.00" (#3830): the
   count and the total sit inside the button, so there is one thing to press. */
#page-till-order .sale-bar .btn{
  flex:1 1 100%;display:flex;align-items:center;justify-content:space-between;gap:10px;
  min-height:48px;min-width:44px;padding:10px 20px;border-radius:999px;
}
#page-till-order .bar-sum{
  flex:1;min-width:0;display:flex;align-items:baseline;gap:8px;overflow:hidden;
  font-family:var(--font-cond);font-weight:700;font-size:1.35rem;line-height:1;color:inherit;
}
/* Both figures are large bold text (19px+), which reads on the accent at 3:1 (WCAG AA for large text). */
/* Each figure stays on one line; a long count is cut with an ellipsis before the total gives way (#3850). */
#page-till-order .bar-sum small{font-family:inherit;font-weight:700;font-size:1.2rem;color:inherit;opacity:0.92;flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#page-till-order #bar-total{flex:none;white-space:nowrap}
#page-till-order .bar-dot{opacity:0.7}
#page-till-order .bar-go{font-size:1.7rem;line-height:1;margin-top:-3px}
@media (max-width: 899px){
  #page-till-order .pos-sale{display:none}
  #page-till-order .pos-sale.sheet-open{
    /* Above the phone bar (z-index 100, layout.css): at 60 it sat under it and hid Back to items (#3800). */
    display:flex;position:fixed;inset:0;z-index:110;border-radius:0;border:none;box-shadow:none;
    padding-top:env(safe-area-inset-top);
  }
  #page-till-order .pos-sale.sheet-open .sheet-head{display:block;padding:10px 12px 0}
  /* Thumb-sized ways back: the sheet's, the payment's and the gift card's (#3800). */
  #page-till-order #sheet-close, #page-till-order #pay-back, #page-till-order #gift-back{min-height:44px;min-width:44px;padding:10px 12px}
}
#page-till-order #pay-back{align-self:flex-start;margin:-24px 0 -6px -12px}

/* Phone (#3829): the search box first, under the app's bar, and it stays there while
   the tiles scroll; then one header line with the counters, More and the shop; then the
   tabs and tiles. The markup is unchanged: .pos and .pos-find give up their boxes
   (display:contents), so every piece is a flex item of #main-screen and `order` puts
   the search row above the header. The three actions fold behind More. */
#page-till-order .pos-head .head-more{display:none}
@media (max-width: 768px), (min-width: 769px) and (max-width: 899px) and (pointer: coarse){
  #page-till-order #main-screen:not(.hidden){display:flex;flex-direction:column;gap:8px}
  #page-till-order .pos, #page-till-order .pos-find{display:contents}
  #page-till-order .pos-tabs, #page-till-order #tiles, #page-till-order #tiles-empty, #page-till-order #results,
  #page-till-order #custom-open, #page-till-order #custom-form{margin:0 16px}
  /* The three tabs stay one line each; a wide face scrolls the row rather than stacking a label. */
  #page-till-order .pos-tabs{max-width:calc(100% - 32px);overflow-x:auto}
  #page-till-order .pos-tabs button{white-space:nowrap}
  #page-till-order #custom-form{margin-bottom:16px}
  /* An empty error line still took its margin and a gap above the tiles. */
  #page-till-order #waiting-error:empty{display:none}
  /* Sticky under the phone bar (3.25rem, layout.css); its own background hides the tiles passing under. */
  #page-till-order .find-row{
    order:-2;position:sticky;top:3.25rem;z-index:6;margin:0;padding:6px 16px;background:var(--bg);
  }
  /* A grid, so the chip line never wraps (it scrolls sideways on a very narrow phone,
     as Shopify's filter chips do), the shop sits on a small line under it, and the three
     actions, when More is open, each take a full row. */
  #page-till-order .pos-head{
    order:-1;display:grid;grid-template-columns:auto auto auto minmax(0,1fr);grid-auto-rows:auto;
    align-items:center;gap:6px 8px;margin:0;padding:2px 16px 8px;border-bottom:none;overflow-x:auto;
  }
  #page-till-order .pos-head .head-chip, #page-till-order .pos-head .head-btn{min-height:44px;padding:8px 11px;font-size:0.8rem;white-space:nowrap}
  #page-till-order .pos-head #waiting-chip{grid-row:1;grid-column:1}
  #page-till-order .pos-head #iou-chip{grid-row:1;grid-column:2}
  #page-till-order .pos-head .head-more{display:inline-flex;grid-row:1;grid-column:3}
  #page-till-order .pos-head #head-more::before{display:none}
  #page-till-order .pos-head #branch-field{grid-row:2;grid-column:1 / -1;min-width:0}
  #page-till-order .pos-head .shop-label{font-size:0.8rem;font-weight:600;color:var(--text-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  /* The Sligo / Boyle toggle is empty for anyone with a shop; empty, its padded pill drew a dot. */
  #page-till-order .pos-head .loc-toggle:empty{display:none}
  #page-till-order .pos-head #gift-open, #page-till-order .pos-head #cards-open, #page-till-order .pos-head #refund-open, #page-till-order .pos-head #drawer-open{display:none}
  #page-till-order .pos-head.more-open #gift-open, #page-till-order .pos-head.more-open #cards-open, #page-till-order .pos-head.more-open #refund-open,
  #page-till-order .pos-head.more-open #drawer-open{
    display:flex;grid-column:1 / -1;justify-content:flex-start;border-radius:var(--radius);font-size:0.95rem;
  }
  #page-till-order .pos-head.more-open .head-more{background:var(--bg-hover)}
}
/* An upright iPad (810 wide, a finger, #4126) keeps its sidebar and has no phone bar, so the search box
   sticks to the top of the screen, not 3.25rem down. */
@media (min-width: 769px) and (max-width: 899px) and (pointer: coarse){
  #page-till-order .find-row{top:0}
  #page-till-order .pos-head h1{display:none}
  /* A short sale list leaves the pill at the foot of the screen, not floating under the tiles. */
  #page-till-order #main-screen:not(.hidden){min-height:calc(100dvh - 4rem)}
  #page-till-order .sale-bar{margin-top:auto}
}
/* PC and tablet landscape: two panes, the sale kept in sight while the tiles scroll. */
@media (min-width: 900px){
  #page-till-order .pos{display:grid;grid-template-columns:minmax(0,1fr) minmax(340px,420px);align-items:start;gap:16px}
  #page-till-order .pos-sale{position:sticky;top:12px;max-height:calc(100vh - 110px)}
  #page-till-order .sale-bar{display:none}
}
/* Two panes under a finger, a tablet held sideways (#4434): the tiles were one
   column wide at 1024. The menu is its icon rail on POS (App._fitTillRail, same
   query) and the page keeps 12px of its 32px at each side: 3 tiles across at
   1024 wide and 4 at 1180. The height keeps a phone held sideways out. */
@media (min-width: 900px) and (min-height: 500px) and (pointer: coarse){
  #page-till-order{margin:0 -20px}
}
/* Two panes on a short screen, a small laptop (#4429): the customer box took
   the top of the sale and More opened as three stacked rows, so a line or two
   of the sale showed, and none with More open. The customer search and
   "+ New customer" share a row, and More's choices sit side by side. */
@media (min-width: 900px) and (max-height: 760px){
  #page-till-order .sale-scroll{padding:10px 14px;gap:6px}
  #page-till-order .sale-customer{flex-direction:row;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-bottom:2px}
  #page-till-order .sale-customer > .section-label{display:none}
  #page-till-order .sale-customer > #customer-search{flex:1 1 180px;min-width:0}
  #page-till-order .sale-customer > .chip{flex:1 1 180px}
  #page-till-order .sale-customer > .results, #page-till-order .sale-customer > .cust-new{flex:1 1 100%}
  #page-till-order .sale-customer > .results:empty{display:none}
  #page-till-order .pos-sale .footer-bar{padding:10px 14px}
  #page-till-order .more-menu{grid-template-columns:repeat(3,minmax(0,1fr))}
  #page-till-order .more-menu .btn{min-height:44px;padding:8px 6px;font-size:0.85rem;line-height:1.15}
}

@media print{
  body:has(#page-till-order #gift-done:not(.hidden)) *{visibility:hidden}
  #page-till-order #gift-print, #page-till-order #gift-print *{visibility:visible}
  #page-till-order #gift-print{position:absolute;left:0;top:0;width:100%;text-align:center;padding:20px}
  #page-till-order .no-print{display:none !important}
}
