/* Till: a calm, rounded, Apple-like interface. Each shop picks one accent colour (Admin → Shop details);
   the server works out readable variants of it (app/colors.py) and sets the --accent-* values below.

   Rules of the system:
   - Neutral greys and white do the work; the accent marks the one main action, links and highlights.
   - Space and grouping instead of lines: cards and rounded groups, hairlines only inside lists and tables.
   - Every text colour passes WCAG AA (4.5:1) in light and dark, including any accent a shop picks.
   - Touch targets are at least 44px; most are 56px or more for a busy counter.
   - Inter is bundled in /static/fonts so nothing loads from the internet. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); }

:root {
  /* the shop's accent (overridden per shop in base.html) */
  --accent-base: #0A66D6;
  --accent-ink: #FFFFFF;
  --accent-text-light: #0A5BC0;
  --accent-text-dark: #6FA8F0;
  --accent-soft-light: #E1ECFA;
  --accent-soft-dark: #1C3554;

  /* light */
  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F5;       /* fills inside a card: inputs, list rows, keys */
  --surface-3: #E5E5EA;
  --fill: #E8E8ED;            /* controls sitting on the page background */
  --line: #E5E5EA;            /* hairlines in lists and tables only */
  --text: #1D1D1F;
  --text-2: #3A3A3C;
  --muted: #636368;          /* >= 4.7:1 on white, page grey and control grey */
  --good-ink: #17652F;       /* green text on a green tint */
  --accent: var(--accent-text-light);
  --accent-soft: var(--accent-soft-light);
  --primary-bg: var(--accent-base);
  --primary-ink: var(--accent-ink);
  --danger-bg: #C4231B;
  --danger-ink: #FFFFFF;
  --go-bg: #1E7A3C;
  --go-ink: #FFFFFF;
  --good: #1E7A3C;
  --bad: #C4231B;
  --warn: #9A5600;
  --warn-soft: #FFF2DE;
  /* a booking for a client with a health warning: amber with a red edge, unlike any shop's own colour */
  --alert-bg: #FFD24D; --alert-ink: #2B1D00; --alert-line: #C4231B;
  --prev: #D1D1D6;
  --scrim: rgba(0, 0, 0, 0.32);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .05);
  --lift: 0 1px 3px rgba(0, 0, 0, .12);
  --radius: 14px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --tap: 60px;
  --font: "Inter", -apple-system, "Segoe UI", Arial, sans-serif;
  --display: var(--font);
  color-scheme: light;
}

/* dark: chosen, or following this PC's setting */
[data-theme="dark"] {
  --bg: #111113; --surface: #1C1C1E; --surface-2: #2C2C2E; --surface-3: #3A3A3C; --fill: #2C2C2E; --line: #38383A;
  --text: #F5F5F7; --text-2: #D1D1D6; --muted: #A1A1A6;
  --accent: var(--accent-text-dark); --accent-soft: var(--accent-soft-dark);
  --good: #4CC273; --good-ink: #4CC273; --bad: #FF6B60; --warn: #FFB340; --warn-soft: #3A2A10; --prev: #48484A;
  --scrim: rgba(0, 0, 0, 0.6); --shadow: none; --lift: 0 1px 3px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #111113; --surface: #1C1C1E; --surface-2: #2C2C2E; --surface-3: #3A3A3C; --fill: #2C2C2E; --line: #38383A;
    --text: #F5F5F7; --text-2: #D1D1D6; --muted: #A1A1A6;
    --accent: var(--accent-text-dark); --accent-soft: var(--accent-soft-dark);
    --good: #4CC273; --good-ink: #4CC273; --bad: #FF6B60; --warn: #FFB340; --warn-soft: #3A2A10; --prev: #48484A;
    --scrim: rgba(0, 0, 0, 0.6); --shadow: none; --lift: 0 1px 3px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Pinch-zoom stays available (WCAG 1.4.4); a quick double tap on a busy counter doesn't zoom. */
html { touch-action: manipulation; }
html, body { height: 100%; margin: 0; }
/* The page itself never scrolls; only the content area does (app.js keeps it that way). */
html { overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* Keyboard users get a clear focus ring; touch users don't see it. */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* type */
h1, h2, h3 { margin: 0; font-family: var(--font); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.num, .tile .price, .sums .grand, .cash-due, .cash-change, .result .big, .stat .value, .big-num,
.card-amount, .pad-display, .receipt .receipt-strong, .key, .line-total, .qty {
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}

/* icons (Lucide sprite in templates/partials/icons.html) */
.i { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------- shell */
.app { display: flex; flex-direction: column; height: 100vh; }
.app > .main { flex: 1; min-height: 0; }
.app > .software-banner, .app > .setup-banner { flex: none; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 80px; flex: none; background: var(--bg); color: var(--text); }
.logo { width: 46px; height: 46px; border-radius: 13px; flex: none; object-fit: contain; background: var(--surface); }
.logo-lg { width: 104px; height: 104px; border-radius: 26px; margin: 0 auto 16px; display: block; box-shadow: var(--shadow); }
.brand { display: flex; flex-direction: column; line-height: 1.2; margin-right: 8px; min-width: 150px; }
.brand-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { font-size: 13px; color: var(--muted); }
.nav { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--fill); margin: 0 auto; overflow-x: auto; }
.nav a {
  display: flex; align-items: center; padding: 0 20px; min-height: 48px; border-radius: 999px;
  font-weight: 500; font-size: 16px; color: var(--text-2); white-space: nowrap;  /* muted grey on the grey bar was under 4.5:1 */
}
.nav a.on { color: var(--text); background: var(--surface); box-shadow: var(--lift); font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 19px; color: #1D1D1F; flex: none;
}
.main { overflow: auto; padding: 8px 28px 28px; }
.main.no-pad { padding: 0; overflow: hidden; }
.corner-actions { position: fixed; top: 16px; right: 16px; }
.theme-toggle { min-width: 56px; padding: 0 14px; }

/* ---------------------------------------------------------- buttons */
.btn {
  min-height: var(--tap); padding: 0 24px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--text); font-weight: 600; display: inline-flex; align-items: center;
  justify-content: center; gap: 10px; cursor: pointer; text-align: center; transition: background .12s, transform .08s, filter .12s;
}
.card .btn, .modal .btn, .basket .btn { background: var(--surface-2); }
.btn:active { transform: scale(.98); filter: brightness(.95); }
.btn-primary, .card .btn-primary, .modal .btn-primary, .basket .btn-primary { background: var(--primary-bg); color: var(--primary-ink); font-weight: 700; }
.btn-primary:active { background: var(--primary-bg); filter: brightness(.9); }
.btn-danger, .card .btn-danger, .modal .btn-danger { background: var(--danger-bg); color: var(--danger-ink); }
.btn-danger:active { background: var(--danger-bg); filter: brightness(.85); }
.btn-good, .card .btn-good, .modal .btn-good { background: var(--go-bg); color: var(--go-ink); }
.btn-ghost, .card .btn-ghost, .modal .btn-ghost { background: transparent; color: var(--accent); }
.btn-sm { min-height: 48px; padding: 0 18px; font-size: 16px; }
.btn-lg { min-height: 60px; font-size: 18px; }
.btn-xl { min-height: 72px; font-size: 20px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }  /* looks off, but a tap still says why */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--muted); font-weight: 600; cursor: pointer; font-size: 16px;
}
.chip.on { color: var(--text); background: var(--surface); box-shadow: var(--lift); }
.chip:active { filter: brightness(.95); }
.chip-danger { color: var(--bad); }

/* ---------------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; top: 92px; transform: translateX(-50%); z-index: 40; /* under pop-ups */
  padding: 14px 24px; border-radius: 999px; font-weight: 600; transition: opacity .4s, transform .3s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,.18); max-width: 80vw;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; /* tap or swipe it away */
}
.toast.dragging { transition: none; }
.toast.ok { background: var(--go-bg); color: var(--go-ink); }
.toast.err { background: var(--danger-bg); color: var(--danger-ink); }
.toast.hide { opacity: 0; pointer-events: none; }

/* ---------------------------------------------------------- login */
.login { height: 100%; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: center;
  justify-content: safe center; gap: 36px; padding: 24px; }
.login > * { flex: none; }  /* never squash a card to fit; scroll instead */
.login-brand { text-align: center; }
.login-brand .brand-name { font-size: 40px; font-weight: 700; letter-spacing: -0.03em; }
.login-brand .brand-sub { font-size: 17px; margin-top: 4px; }
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; width: min(900px, 100%); }
.staff-tile {
  background: var(--surface); border-radius: var(--radius-lg); padding: 24px 16px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 19px; font-weight: 600;
}
.staff-tile:active { box-shadow: 0 0 0 3px var(--accent-base); }
.staff-tile .avatar { width: 72px; height: 72px; font-size: 30px; }
.staff-tile .role { font-size: 14px; font-weight: 500; color: var(--muted); }
.pin-box { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; align-items: center; }
.pin-box h1 { font-size: 30px; }
.pin-dots { display: flex; gap: 16px; height: 28px; align-items: center; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.on { background: var(--text); border-color: var(--text); }
.pin-error { color: var(--bad); font-weight: 600; min-height: 24px; text-align: center; }
.pin-error.pin-hint { color: var(--text-2); font-weight: 400; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

/* ---------------------------------------------------------- numpad */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.key {
  min-height: 68px; border-radius: 18px; border: 0; background: var(--surface-2);
  font-size: 28px; font-weight: 500; cursor: pointer; display: grid; place-items: center;
}
.key:active { background: var(--surface-3); }
.key-muted { font-size: 17px; color: var(--text-2); background: transparent; }
.key-muted .i { width: 28px; height: 28px; }
.key-go { background: var(--primary-bg); color: var(--primary-ink); font-size: 20px; font-weight: 700; }
.key-go:active { background: var(--primary-bg); filter: brightness(.92); }
.sending .numpad { opacity: .6; pointer-events: none; }

/* ---------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed; inset: 0; background: var(--scrim); z-index: 50;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius-xl); padding: 26px;
  width: min(440px, 100%); max-height: 96vh; overflow: auto; display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.25); animation: sheet-in .18s ease-out;
}
@keyframes sheet-in { from { transform: translateY(12px) scale(.98); opacity: 0; } }
/* A page read in a pop-up without leaving the screen (data-read-in-place: setup's terms and privacy links) */
.modal.modal-read { width: min(820px, 100%); max-height: 90vh; padding: 22px 24px; gap: 14px; }
.modal-read-body { overflow: auto; min-height: 0; flex: 1; }
.modal-read-body .legal-page { max-width: none; margin: 0; padding: 0; }
.modal-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; text-align: center; line-height: 1.2; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pad-display, .osk-display {
  background: var(--surface-2); border-radius: 18px; min-height: 72px;
  display: flex; align-items: center; justify-content: flex-end; padding: 0 20px; font-size: 40px; font-weight: 700;
}
.osk-display { justify-content: flex-start; font-size: 26px; font-weight: 500; }
.caret { display: inline-block; width: 2px; height: 32px; background: var(--accent); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pad-presets { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.segmented button, [data-toggle-group] [data-value] {
  min-height: 48px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; cursor: pointer; color: var(--muted);
}
/* Selected: a raised white (or dark grey) pill, like iOS segmented controls. */
.segmented button.on, [data-toggle-group] [data-value].on { background: var(--surface); color: var(--text); box-shadow: var(--lift); }
[data-theme="dark"] .segmented button.on, [data-theme="dark"] [data-toggle-group] [data-value].on { background: var(--surface-3); }
.osk-modal { width: min(1000px, 100%); }
.osk { display: flex; flex-direction: column; gap: 8px; }
.osk-row { display: flex; gap: 8px; }
.osk-key { flex: 1; min-height: 60px; font-size: 22px; font-weight: 500; border-radius: 14px; background: var(--surface-2); }
.osk-wide { flex: 2; }
.osk-space { flex: 5; font-size: 18px; color: var(--text-2); }
.osk-key.on { color: var(--text); background: var(--surface-3); }
.confirm-modal .modal-title { padding: 12px 0; font-size: 20px; font-weight: 600; }

/* ---------------------------------------------------------- sell */
.sell { display: grid; grid-template-columns: 1fr 420px; gap: 20px; height: 100%; padding: 4px 24px 24px 28px; }
.sell-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; gap: 16px; }
/* Categories: one rounded segmented control. */
.tabs { display: flex; gap: 2px; padding: 4px; overflow-x: auto; flex: none; align-self: flex-start; max-width: 100%;
  background: var(--fill); border-radius: 999px; }
.tabs .chip { white-space: nowrap; min-height: 44px; padding: 0 18px; font-size: 15px; background: transparent; box-shadow: none; }
.tabs .chip.on { background: var(--surface); box-shadow: var(--lift); color: var(--text); }
[data-theme="dark"] .tabs .chip.on { background: var(--surface-3); }
.tiles {
  flex: 1; overflow: auto; padding: 2px 2px 8px; display: grid; gap: 14px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
}
.tile {
  position: relative; min-height: 124px; padding: 16px 18px; border-radius: 20px; border: 0; box-shadow: var(--shadow);
  background: var(--surface); color: var(--text); text-align: left; display: flex; flex-direction: column; justify-content: space-between;
  cursor: pointer; font-weight: 600; font-size: 16px; line-height: 1.25; gap: 10px; letter-spacing: -0.01em; transition: transform .08s;
}
.tile .price { font-size: 24px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.tile .stock-note { position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.tile .stock-note.low { color: var(--warn); }
.tile .stock-note.neg { color: var(--bad); }
.tile:active { transform: scale(.97); }
.tile.pulse { animation: pulse .28s; }
@keyframes pulse { 0%, 60% { box-shadow: 0 0 0 3px var(--accent-base); } }
.tag { font-size: 13px; color: var(--muted); }

.basket { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow);
  min-height: 0; height: 100%; overflow: hidden; }
.basket-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; min-height: 60px; }
.basket-lines { flex: 1; overflow: auto; padding: 4px 16px; display: flex; flex-direction: column; gap: 8px; }
.basket-empty { height: 100%; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 20px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.line-name { font-weight: 600; font-size: 16px; }
.line-total { font-size: 17px; font-weight: 700; text-align: right; }
.line-controls { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.qty-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.qty-btn .i { width: 20px; height: 20px; }
.qty { min-width: 28px; text-align: center; font-size: 18px; font-weight: 700; }
.line-unit { color: var(--muted); font-size: 15px; margin-right: auto; }
.remove-btn { height: 44px; padding: 0 12px; border-radius: 999px; border: 0; background: transparent; color: var(--bad); font-weight: 600; cursor: pointer; }
.line-warn { grid-column: 1 / -1; color: var(--warn); font-size: 15px; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }
.line-warn .i { margin-top: 2px; }
.basket-foot { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
/* Keep Discount/Tip well clear of the payment buttons to avoid mis-taps. */
.basket-foot .pay { margin-top: 6px; }
.sums { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-variant-numeric: tabular-nums; color: var(--muted); align-items: baseline; }
.sums .grand { font-size: 34px; color: var(--text); font-weight: 700; padding-top: 4px; line-height: 1; }
.adjusters { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adjusters .btn { min-height: 48px; }
.adjusters:has(.loyalty-btn) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pay { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.pay .btn-xl { font-size: 20px; font-weight: 700; min-height: 64px; }
.pay.pay-free { grid-template-columns: 1fr; }
.pay-free .btn-xl small { font-size: 14px; font-weight: 600; color: inherit; opacity: 1; }
.loyalty-note { margin-bottom: 14px; }
.card-btn { flex-direction: column; gap: 0; line-height: 1.1; }
.card-btn small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }
.notice { padding: 12px 16px; border-radius: 16px; background: var(--warn-soft); color: var(--text); font-size: 15px; }

.cash-modal { width: min(480px, 100%); gap: 10px; padding: 20px; }
.cash-modal .key { min-height: 60px; }
.cash-modal .pad-display { min-height: 60px; }
.cash-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cash-head > div { background: var(--surface-2); border-radius: 18px; padding: 12px 18px; }
.label { font-size: 13px; color: var(--muted); font-weight: 600; }
.cash-due, .cash-change { font-size: 32px; font-weight: 700; line-height: 1.1; }
/* Change, coloured so it's clear at a glance: still to pay (pale red), exactly right (green), change to give (orange). */
.cash-head > .cash-change-box { transition: background .15s, box-shadow .15s; }
.cash-change-box.is-left { background: color-mix(in srgb, var(--bad) 13%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--bad) 45%, transparent); }
.cash-change-box.is-left .cash-change, .cash-change-box.is-left .label { color: var(--bad); }
.cash-change-box.is-left .cash-change { font-size: 26px; }
.cash-change-box.is-exact { background: color-mix(in srgb, var(--good) 15%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--good) 45%, transparent); }
.cash-change-box.is-exact .cash-change, .cash-change-box.is-exact .label { color: var(--good); }
.cash-change-box.is-over { background: color-mix(in srgb, var(--warn) 16%, var(--surface)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--warn) 50%, transparent); }
.cash-change-box.is-over .cash-change, .cash-change-box.is-over .label { color: var(--warn); }

.result { text-align: center; align-items: center; }
.result h2 { font-size: 26px; }
.result .big { font-size: 56px; font-weight: 700; color: var(--good); line-height: 1; }
.result .tick { width: 72px; height: 72px; border-radius: 50%; background: var(--go-bg); color: var(--go-ink); display: grid; place-items: center; }
.result .tick .i { width: 40px; height: 40px; stroke-width: 2.5; }
.result .cross { background: var(--danger-bg); color: var(--danger-ink); }

/* ---------------------------------------------------------- generic content */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; }
.card { background: var(--surface); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow); }
.card > h3:first-child { margin-bottom: 6px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr 1fr; } }
.stat .value { font-size: 34px; font-weight: 700; margin-top: 4px; line-height: 1.1; letter-spacing: -0.03em; }
.stat .sub { color: var(--muted); font-size: 14px; }
.stat.accent .value { color: var(--text); }
.list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; min-height: 60px;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
a.row:active { background: var(--surface-2); }
.row .meta { color: var(--muted); font-size: 15px; }
.num { text-align: right; font-weight: 600; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-low { background: var(--warn-soft); color: var(--warn); }
.pill-out { background: var(--danger-bg); color: var(--danger-ink); }
.pill-ok { background: var(--surface-2); color: var(--good); }
.pill-muted { background: var(--surface-3); color: var(--text-2); }
.low-row td:first-child { font-weight: 600; }
.subnav { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--text-2); font-weight: 600; }
.input, select.input {
  min-height: 52px; border-radius: 14px; border: 0; background: var(--surface-2);
  padding: 0 16px; font-size: 17px; width: 100%; cursor: pointer; caret-color: transparent;
}
.input:focus-visible { outline: 3px solid var(--accent); outline-offset: 0; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
[data-toggle-group] { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.switch { display: flex; align-items: center; gap: 12px; min-height: var(--tap); cursor: pointer; }
.switch input { width: 30px; height: 30px; accent-color: var(--accent); }
.muted { color: var(--muted); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.big-num { font-size: 72px; font-weight: 700; line-height: 1; letter-spacing: -0.04em; }
.stepper { display: grid; grid-template-columns: 96px 1fr 96px; gap: 12px; align-items: center; }
.stepper .btn { min-height: 96px; }
.stepper .btn .i { width: 36px; height: 36px; }
.stepper .big-num { text-align: center; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; }
table.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th, .table td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.table th { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 0; padding-top: 4px; padding-bottom: 6px; }
.table td.r, .table th.r { text-align: right; }
.status-voided, .status-refunded { color: var(--muted); text-decoration: line-through; }

/* ---------------------------------------------------------- charts (one hue + neutral comparison) */
.bars { display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; min-width: 0; }
.bar { background: var(--accent-base); border-radius: 6px 6px 2px 2px; min-height: 0; }
.bar-col { cursor: pointer; }
.bar-col.open .bar { filter: brightness(1.2); }
.bar-col .tip {
  display: none; line-height: 1.4; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: nowrap; z-index: 2;
}
.bar-col.open .tip { display: block; }
.bars .bar-col:first-child .tip, .bars .bar-col:nth-child(2) .tip { left: 0; transform: none; }
.bars .bar-col:last-child .tip, .bars .bar-col:nth-last-child(2) .tip { left: auto; right: 0; transform: none; }
.bar-labels { display: flex; gap: 2px; padding-top: 8px; }
.bar-labels span { flex: 1; text-align: center; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; }
.bar-pair { display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.bar-pair .bar { flex: 1; }
.bar-prev { background: var(--prev); }
.legend { display: flex; gap: 18px; font-size: 15px; color: var(--text-2); margin: 4px 0 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.swatch-cur { background: var(--accent-base); }
.swatch-prev { background: var(--prev); }
.delta { font-size: 15px; font-weight: 600; margin-top: 2px; }
.delta-up { color: var(--good); }
.delta-down { color: var(--bad); }
.delta-flat { color: var(--text-2); }
.table-view { margin-top: 10px; }
.table-view summary { min-height: 48px; display: flex; align-items: center; color: var(--text-2); cursor: pointer; font-size: 15px; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.hbar { display: grid; grid-template-columns: 140px 1fr auto; gap: 12px; align-items: center; min-height: 56px; }
.hbar-track { height: 12px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--accent-base); border-radius: 999px; }
.rank { color: var(--muted); font-weight: 700; margin-right: 8px; }

/* ---------------------------------------------------------- sale result, change and stock warnings */
.receipt { display: grid; grid-template-columns: 1fr auto; gap: 4px 24px; width: 100%; max-width: 340px;
  font-size: 19px; font-variant-numeric: tabular-nums; text-align: left; }
.receipt span:nth-child(even) { text-align: right; font-weight: 600; }
.receipt .receipt-strong { font-size: 26px; font-weight: 700; color: var(--text); padding-top: 6px; line-height: 1.1; }
.change-question { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.change-question .label { text-align: center; }
.change-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.change-choice { min-height: 104px; flex-direction: column; gap: 4px; font-size: 21px; line-height: 1.15; }
.change-choice > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.change-choice small { font-size: 15px; font-weight: 400; opacity: .9; }
.choice-icon .i { width: 28px; height: 28px; }
.change-choice-tip, .modal .change-choice-tip { background: var(--primary-bg); color: var(--primary-ink); }
.change-choice-tip:active { background: var(--go-bg); filter: brightness(.9); }
.stock-alert { width: 100%; text-align: left; background: var(--warn-soft);
  border-radius: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.stock-alert-title { color: var(--warn); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.stock-alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stock-alert-note { color: var(--text-2); font-size: 15px; }

/* ---------------------------------------------------------- cash out */
.cash-out-modal { width: min(480px, 100%); gap: 10px; padding: 20px; }
.cash-out-modal .key { min-height: 58px; }
.cash-out-modal .pad-display { min-height: 60px; }
.reason-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reason-chip { padding: 0 8px; font-size: 16px; }
.reason-chip.on { background: var(--text); color: var(--bg); }

/* ---------------------------------------------------------- manual card payment */
.card-modal { width: min(480px, 100%); }
.card-amount { font-size: 72px; font-weight: 700; text-align: center; line-height: 1; }
.card-steps { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 8px; font-size: 19px; }
.card-note { color: var(--text-2); font-size: 15px; text-align: center; }
.card-declined { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.card-declined strong { color: var(--bad); }
.card-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card-choices .btn { min-height: 88px; font-size: 22px; }
.card-choices [data-card="approved"] { background: var(--go-bg); border-color: var(--go-bg); color: var(--go-ink); }

/* ---------------------------------------------------------- motion & print */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; overflow: visible; font-size: 12pt; }
  .app { display: block; height: auto; }
  .topbar, .no-print, .toast { display: none !important; }
  .main { overflow: visible; padding: 0; }
  .card { border: 1px solid #999; background: #fff; break-inside: avoid; }
  .print-only { display: block; }
  .muted, .stat .sub, .label { color: #444; }
  .table th, .table td { border-color: #bbb; }
}

/* ---------------------------------------------------------- note & coin count */
.count-modal { width: min(1060px, 100%); padding: 20px 22px; gap: 12px; }
.count-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.count-head .modal-title { text-align: left; }
.count-total { display: flex; align-items: baseline; gap: 12px; }
.count-sum { font-family: var(--display); font-size: 46px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.count-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.count-col { display: flex; flex-direction: column; gap: 6px; }
.count-col > .label { padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.count-row { display: grid; grid-template-columns: 52px 56px 1fr 56px 74px; gap: 6px; align-items: center; min-height: 60px; }
.count-label { font-family: var(--display); font-size: 26px; font-weight: 600; }
.count-n { height: 56px; border-radius: var(--radius); border: 0; background: var(--bg); cursor: pointer;
  font-family: var(--display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 16px; }
.count-row.has .count-value { color: var(--text); font-weight: 600; }
.count-row.has .count-n { border-color: var(--text-2); }
.count-foot { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.count-foot .btn-xl { min-height: 72px; font-size: 22px; }

/* ---------------------------------------------------------- shared bits */
.btn-danger-soft { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn-danger-soft:active { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.btn-wide { min-width: 220px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.help { display: block; color: var(--muted); font-size: 15px; font-weight: 400; margin-top: 2px; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }
.field-label { font-size: 15px; color: var(--text-2); font-weight: 600; }
.input-lg { font-size: 24px; min-height: 68px; }
.money-field { position: relative; max-width: 260px; }
.money-field > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-family: var(--display);
  font-size: 36px; font-weight: 600; color: var(--muted); pointer-events: none; }
.input-price { font-family: var(--display); font-size: 36px; font-weight: 600; min-height: 72px; padding-left: 40px; }

/* on-screen keyboard docked at the bottom (search): the list stays visible above */
.modal-backdrop.sheet { place-items: end center; background: transparent; padding: 0; pointer-events: none; }
.modal-backdrop.sheet > .modal { pointer-events: auto; }  /* taps above a docked keyboard reach the page or pop-up */
.modal-backdrop.sheet .modal { width: min(1100px, 100%); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -12px 40px rgba(0,0,0,.45); padding: 14px 18px 18px; gap: 10px; }
/* Docked at the bottom (search boxes): no title, but the text being typed stays in view on the keyboard itself,
   because the box it goes into may be under the keyboard (a search inside a pop-up). */
.modal-backdrop.sheet .modal-title { display: none; }
.modal-backdrop.sheet .osk-display { min-height: 52px; font-size: 22px; padding: 8px 16px; }
.osk-hint { color: var(--muted); font-weight: 400; }
.modal-backdrop.sheet .osk { gap: 6px; }
.modal-backdrop.sheet .osk-row { gap: 6px; }
.modal-backdrop.sheet .osk-key { min-height: 56px; font-size: 22px; }
.modal-backdrop.sheet .modal-actions .btn { min-height: 56px; }
/* room to scroll the search box to the top while the keyboard is docked */
body.osk-docked .main, body.osk-docked .login { padding-bottom: 440px; }
.cat-tools { scroll-margin-top: 8px; }

/* ---------------------------------------------------------- catalogue */
/* Section tabs (dashboard, catalogue): one segmented control. */
.section-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--fill); margin-bottom: 18px; max-width: 100%; overflow-x: auto; }
.section-tabs a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.section-tabs a span { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; }
.section-tabs a.on { color: var(--text); background: var(--surface); box-shadow: var(--lift); }
[data-theme="dark"] .section-tabs a.on { background: var(--surface-3); }
.cat-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 280px; display: block; }
.search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 22px; height: 22px; }
.search .input { padding-left: 50px; }
.filter-chips { display: flex; gap: 6px; }
.cat-list { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.cat-group { background: var(--surface); border-radius: var(--radius-lg); padding: 14px 16px 6px; box-shadow: var(--shadow); }
.cat-group h3 { padding: 2px 4px 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.cat-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto auto; gap: 14px; align-items: center;
  min-height: 72px; padding: 8px 4px; border-bottom: 1px solid var(--line); position: relative; }
.cat-row:last-child { border-bottom: 0; }
.cat-row.is-hidden .cat-thumb, .cat-row.is-hidden .cat-name, .cat-row.is-hidden .price-btn { opacity: .5; }
.cat-thumb { width: 56px; height: 56px; border-radius: var(--radius); background: var(--surface-2); overflow: hidden;
  display: grid; place-items: center; font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--muted); }
.cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cat-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-name strong { font-size: 19px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-name .meta { color: var(--muted); font-size: 15px; }
.price-btn { min-height: 48px; min-width: 110px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--surface-2); font-size: 18px; font-weight: 700;
  font-variant-numeric: tabular-nums; text-align: center; }
.price-btn:active, .price-btn:hover { background: var(--surface-3); }
.switch-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 56px; min-width: 132px; padding: 0 12px;
  border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; font-weight: 600; }
.switch-btn .knob, .toggle-ui { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--surface-3); flex: none; transition: background .15s; }
.switch-btn .knob::after, .toggle-ui .knob { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch-btn[aria-checked="true"] .knob { background: var(--go-bg); }
.switch-btn[aria-checked="true"] .knob::after { transform: translateX(18px); background: #fff; }
.switch-btn[aria-checked="false"] .switch-text { color: var(--muted); }
.row-flash { position: absolute; right: 4px; top: 4px; display: inline-flex; gap: 4px; align-items: center; font-size: 13px;
  font-weight: 700; color: var(--good); animation: fade 2.4s forwards; pointer-events: none; }
@keyframes fade { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }

.cat-categories { display: flex; flex-direction: column; max-width: 860px; }
.cat-cat-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  min-height: 72px; border-bottom: 1px solid var(--line); }
.cat-cat-row .move { display: flex; gap: 6px; }
.cat-cat-row .qty-btn[disabled] { opacity: .3; }
.cat-add { display: flex; gap: 10px; padding-top: 16px; }

/* ---------------------------------------------------------- item editor */
.item-editor { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; padding-bottom: 100px; }
.item-fields { display: flex; flex-direction: column; gap: 22px; padding: 22px 24px; }
.type-choice { grid-auto-columns: 1fr; }
.type-choice [data-value] { min-height: 76px; display: flex; flex-direction: column; justify-content: center; gap: 2px; text-align: left; padding: 0 18px; }
.type-choice strong { font-family: var(--display); font-size: 24px; font-weight: 600; }
.type-choice small { font-size: 14px; font-weight: 400; color: var(--text-2); }
[data-toggle-group].choice-wrap { display: flex; flex-wrap: wrap; gap: 8px; background: none; border: 0; padding: 0; }
.choice-wrap [data-value] { min-height: 56px; padding: 0 18px; border: 0; border-radius: var(--radius); color: var(--text-2); }
.toggle-row { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; min-height: var(--tap); cursor: pointer;
  padding-top: 18px; border-top: 1px solid var(--line); }
.toggle-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-row input:checked + .toggle-ui { background: var(--go-bg); }
.toggle-row input:checked + .toggle-ui .knob { transform: translateX(18px); background: #fff; }
.toggle-row input:focus-visible + .toggle-ui { outline: 3px solid var(--accent); outline-offset: 2px; }
.toggle-ui { width: 52px; height: 30px; border-radius: 15px; }
.toggle-ui .knob { width: 24px; height: 24px; }
.item-image { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 0; }
.image-frame { aspect-ratio: 1; border-radius: var(--radius); background: var(--bg); border: 2px dashed var(--surface-3); overflow: hidden; display: grid; place-items: center; }
.image-frame img { width: 100%; height: 100%; object-fit: cover; }
.image-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); }
.image-empty .i { width: 40px; height: 40px; }
.editor-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 12px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.editor-bar .spacer { flex: 1; }

/* ---------------------------------------------------------- sell tile image */
.tile-img { position: absolute; right: 12px; bottom: 12px; width: 52px; height: 52px; border-radius: 4px; object-fit: cover; }

/* ---------------------------------------------------------- dashboard: cash and card */
.pay-split-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pay-split-body { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.pay-figure { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.pay-figure-right { text-align: right; align-items: flex-end; }
.pay-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-2); }
.pay-amount { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pay-bar { display: flex; height: 18px; gap: 2px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.pay-bar-cash { background: var(--accent-base); }
.pay-bar-card { background: var(--card-c); }
.pay-bar-none { margin: auto; font-size: 13px; color: var(--muted); }
.swatch-cash { background: var(--accent-base); }
.swatch-card { background: var(--card-c); }
:root { --card-c: #B9BEC2; }
[data-theme="light"] { --card-c: #4A4F54; }

/* ---------------------------------------------------------- cash out quick add */
.quick-add { display: flex; gap: 8px; }
.quick-add .chip { flex: 1; font-family: var(--display); font-size: 22px; min-height: 52px; color: var(--text); }
.cash-out-modal .key { min-height: 52px; }
/* Clear on the cash-out pad: the same soft red as the basket's Clear */
.key.key-clear { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.key.key-clear:active { background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* ---------------------------------------------------------- first-run setup */
.setup { justify-content: flex-start; padding-top: 48px; padding-bottom: 48px; gap: 24px; }
.setup-card { width: min(640px, 100%); display: flex; flex-direction: column; gap: 18px; padding: 24px; }
.dash-page .setup-card { margin: 16px 0; }  /* on the Dashboard: a gap from the cards above (e.g. unpaid sales) */
.setup-error { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); color: var(--bad); font-weight: 600; }
.pin-mask { -webkit-text-security: disc; letter-spacing: .3em; }

/* ---------------------------------------------------------- updates & backups */
.update-card { display: flex; flex-direction: column; gap: 14px; }
.update-version { font-size: 40px; }
.release-notes { white-space: pre-wrap; background: var(--bg); border: 0; border-radius: var(--radius);
  padding: 12px 14px; max-height: 220px; overflow: auto; font-size: 16px; color: var(--text-2); }
.update-steps { margin: 0; padding-left: 22px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.update-ok { display: flex; gap: 14px; align-items: center; }
.update-ok > .i { width: 44px; height: 44px; color: var(--good); }
.offsite-ok { display: flex; gap: 8px; align-items: center; color: var(--good); font-weight: 600; font-size: 15px; }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--accent);
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------- demo till */
.demo-pill { align-self: center; padding: 6px 12px; border-radius: 999px; background: var(--warn-soft); color: var(--warn);
  font-weight: 600; font-size: 13px; white-space: nowrap; }
.demo-note { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); color: var(--text-2); }
.demo-card { border-style: dashed; }
.login:has(.demo-welcome) { gap: 22px; }
.demo-welcome { width: min(640px, 100%); display: grid; gap: 8px; padding: 18px 20px; }
.demo-welcome h2 { margin: 0; }
.demo-welcome p { margin: 0; }
.demo-pins { font-size: 1.15rem; font-weight: 600; }
.demo-welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.demo-end { border-color: var(--danger-bg); }

/* ---------------------------------------------------------- discount: whole order or chosen items */
.discount-modal { width: min(940px, 100%); padding: 20px 22px; gap: 12px; }
.disc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.disc-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.disc-whole { margin: 4px 0 0; }
.disc-items { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.disc-list { display: flex; flex-direction: column; gap: 6px; max-height: 330px; overflow: auto; }
.disc-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 58px;
  padding: 0 12px; border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; text-align: left; }
.disc-check { width: 28px; height: 28px; border-radius: 4px; border: 2px solid var(--muted); display: grid; place-items: center; color: transparent; }
.disc-check .i { width: 20px; height: 20px; stroke-width: 3; }
.disc-item.on { border-color: var(--text); background: var(--surface-2); }
.disc-item.on .disc-check { background: var(--text); border-color: var(--text); color: var(--bg); }
.disc-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc-price { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.discount-modal .key { min-height: 56px; }
.discount-modal .pad-display { min-height: 60px; }
.disc-preview { text-align: center; font-weight: 600; color: var(--text-2); min-height: 24px; }
.disc-actions { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; }
.line-discount { display: block; font-size: 14px; font-weight: 600; color: var(--good); }
.line-name .line-discount { display: inline; margin-left: 8px; }

/* three change choices: handed back / part tip / all as a tip */
.change-choices:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); }
.result .change-choice small { font-size: 14px; }
.modal.result:has(.change-choices > :nth-child(3)) { width: min(600px, 100%); }

/* cash: Exact / + £5 / + £10 / + £20, big and easy to hit */
.cash-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cash-quick .btn { min-height: 64px; padding: 0 6px; font-family: var(--display); font-size: 26px; font-weight: 700; }
.cash-quick [data-q] { font-family: var(--font); font-size: 18px; }

/* idle warning */
.idle-modal { width: min(420px, 100%); align-items: stretch; }
.idle-count { font-family: var(--display); font-size: 96px; font-weight: 700; line-height: 1; text-align: center;
  font-variant-numeric: tabular-nums; color: var(--accent); }

/* pop-ups take focus so keys go to them; the pop-up itself needs no focus ring */
.modal:focus-visible { outline: none; }

/* receipt preview */
.receipt-modal { width: min(400px, 100%); padding: 16px; gap: 10px; }
.receipt-frame-wrap { background: #fff; border-radius: var(--radius); overflow: hidden; }
.receipt-modal iframe { display: block; width: 100%; height: min(560px, 64vh); border: 0; background: #fff; }
.receipt-status { text-align: center; min-height: 20px; font-size: 15px; }

/* ---------------------------------------------------------- dashboards */
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.dash-bar .section-tabs { margin-bottom: 0; }
.dash-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-period { display: flex; gap: 6px; align-items: center; }
.ctl-label { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip-icon { min-width: 48px; justify-content: center; padding: 0 10px; }
.menu-pop { position: relative; }
.menu-pop summary { list-style: none; cursor: pointer; }
.menu-pop summary::-webkit-details-marker { display: none; }
.menu-chip { gap: 8px; color: var(--text); background: var(--surface); box-shadow: var(--lift); }
.menu-chip span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-chip .i { width: 17px; height: 17px; flex: none; }
.menu-chip .i:last-child { opacity: .6; transition: transform .15s; }
.menu-pop[open] .menu-chip .i:last-child { transform: rotate(180deg); }
.menu-pop-body { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 240px; display: grid; gap: 16px; padding: 10px;
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.18), 0 0 0 1px var(--line); }
.menu-pop-body:has(form) { min-width: 420px; padding: 10px 16px 16px; }
.menu-pop-right, .dash-controls .menu-pop-body { left: auto; right: 0; }
.menu-list { display: grid; gap: 2px; margin: 0 -6px; }
.menu-list a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 12px;
  border-radius: 12px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--fill); }
.menu-list a.on { font-weight: 600; color: var(--accent); }
.menu-list a .i { width: 18px; height: 18px; }
.staff-picker { display: inline-block; }
.date-pop-form { display: grid; gap: 6px; }
.date-pop-row { display: flex; gap: 8px; align-items: center; }
.date-pop-row .input { width: auto; min-width: 150px; }
.dash-alert { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.sales-tools { display: flex; flex-direction: column; gap: 12px; }
.receipt-search { display: flex; gap: 10px; align-items: center; }
.receipt-search .search { max-width: 420px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 18px; }
.filter-row .filter-chips { align-items: center; }
.filter-row .label { margin-right: 4px; }
.sales-table td { vertical-align: middle; }
.items-cell { color: var(--text-2); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-no { font-family: var(--display); font-size: 20px; font-weight: 600; }
.nowrap { white-space: nowrap; }
.sales-table .btn-sm .i { width: 20px; height: 20px; }

/* ---------------------------------------------------------- unpaid (owed) sales */
.owed-alert { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--danger-bg); color: var(--danger-ink); font-size: 17px; }
.owed-alert .i { width: 26px; height: 26px; flex: none; }
.owed-panel { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; padding: 16px; border-radius: var(--radius-lg);
  border: 1px solid var(--danger-bg); border-left-width: 6px; background: var(--surface); }
.owed-panel.written-off { flex-direction: row; gap: 10px; align-items: baseline; }
.owed-head { display: flex; gap: 10px; align-items: flex-start; }
.owed-head > .i { width: 28px; height: 28px; color: var(--bad); margin-top: 2px; }
.owed-head strong { font-size: 20px; }
.owed-text { color: var(--bad) !important; }
.owed-box { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.result .tick.tick-owed { background: var(--danger-bg); color: var(--danger-ink); }

/* ---------------------------------------------------------- donut charts
   3 categorical slots, validated (dataviz validator, all pairs) on the slate card in dark
   and on white in light; anything past 3 folds into a grey "Others". Light slot 3 is
   under 3:1 on white, so every slice is also named in the legend with its value. */
:root { --slot-1: #3987e5; --slot-2: #d95926; --slot-3: #199e70; --slot-0: #6b7075; }
[data-theme="light"] { --slot-1: #2a78d6; --slot-2: #eb6834; --slot-3: #1baf7a; --slot-0: #a9adb1; }
.donut { display: grid; grid-template-columns: minmax(180px, 220px) 1fr; gap: 18px; align-items: center; }
.donut-figure { position: relative; container-type: inline-size; }
.donut svg { width: 100%; height: auto; display: block; overflow: visible; }
.donut-slice { stroke: var(--surface); stroke-width: 2px; cursor: pointer; transition: opacity .12s; outline: none; }
.donut-slice:focus-visible { stroke: var(--text); stroke-width: 3px; }
.donut-slice.dim { opacity: .35; }
.slot-1 { fill: var(--slot-1); background: var(--slot-1); }
.slot-2 { fill: var(--slot-2); background: var(--slot-2); }
.slot-3 { fill: var(--slot-3); background: var(--slot-3); }
.slot-0 { fill: var(--slot-0); background: var(--slot-0); }
.donut-centre { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
/* The total fits the hole (58% of the chart's width): 26px for most, smaller for a long one like £12,966.60. */
.donut-total { font-family: var(--display); font-size: min(26px, calc(95cqi / var(--chars, 8))); font-weight: 700;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.donut-caption { font-size: 13px; color: var(--muted); }
.donut-tip { position: absolute; left: 100%; top: 50%; transform: translate(6px, -50%); z-index: 3; white-space: nowrap;
  background: var(--surface-3); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.donut-tip .tip-link { margin-top: 8px; display: inline-flex; }
.donut-slice.on { stroke: var(--text); stroke-width: 2px; }
.donut-tip .tip-title { font-weight: 700; font-size: 16px; }
.donut-tip .tip-main { font-family: var(--display); font-size: 20px; font-weight: 600; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.donut-legend li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 44px; gap: 10px; align-items: center; min-height: 32px; }
.donut-legend .swatch { width: 14px; height: 14px; border-radius: 3px; }
.donut-legend .donut-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend .muted { text-align: right; }
/* In a narrow card the legend goes under the chart, so names aren't cut short. */
.grid-3 .donut { grid-template-columns: 1fr; }
.grid-3 .donut-figure { width: 180px; justify-self: center; }

/* ---------------------------------------------------------- the safe */
.safe-pending { margin-bottom: 16px; }
.safe-putaway { display: grid; grid-template-columns: 1fr 240px auto; gap: 16px; align-items: end; }
.safe-putaway .field { margin: 0; }
@media (max-width: 1000px) { .safe-putaway { grid-template-columns: 1fr; } }
.safe-fix { display: inline-block; margin-right: 6px; text-align: left; }
.safe-fix summary { list-style: none; }
.safe-fix summary::-webkit-details-marker { display: none; }
.safe-fix[open] { display: block; margin-bottom: 6px; }
[data-toggle-group] button[disabled] { opacity: .4; cursor: not-allowed; }

/* Settings: one Save button for the whole page, always in reach. */
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  margin: 18px -28px -28px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px); }

/* Which version this till is running: shown on the login screen so an update is easy to confirm. */
.login-version { text-align: center; font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------- staff breakdown */
.staff-picker { flex-wrap: wrap; }
.person-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.person-head .avatar { width: 56px; height: 56px; font-size: 26px; }
.most-list { display: flex; flex-direction: column; }
.most-row { display: grid; grid-template-columns: 40px minmax(110px, 1fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 20px; gap: 12px; align-items: center;
  padding: 12px 4px; min-height: 64px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.most-row:last-child { border-bottom: 0; }
.most-row:active { background: var(--surface-2); }
.most-name, .most-item { display: flex; flex-direction: column; min-width: 0; }
.most-item { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.most-item > span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.most-item .label { font-size: 12px; }
.avatar-sm { width: 40px; height: 40px; font-size: 18px; }
#find { scroll-margin-top: 90px; }
.attention-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; min-height: 52px;
  padding: 8px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.attention-row:last-of-type { border-bottom: 0; }
.btn-back { min-height: 52px; padding: 0 20px; font-size: 18px; gap: 8px; }
.btn-row-gap { width: 12px; }

/* ---------------------------------------------------------- busy buttons and update progress */
.spinner-sm { width: 20px; height: 20px; border-width: 3px; display: inline-block; vertical-align: middle; }
.btn.busy { opacity: 1; gap: 10px; }
.restart-card { width: min(560px, 100%); }
.progress { width: 100%; height: 18px; border-radius: 9px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent-base); border-radius: 9px; transition: width .4s ease; }
.progress-pct { margin: 0; font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- updates (kept simple for the owner) */
.update-simple { max-width: 640px; }
.update-new .i { color: var(--accent); }
.update-more { max-width: 640px; margin-top: 14px; }
.update-more summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }

/* ---------------------------------------------------------- top bar: person menu */
.who-menu { position: relative; }
.who-chip { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 52px;
  padding: 4px 10px 4px 4px; border-radius: var(--radius); border: 1px solid transparent; color: var(--text); }
.who-chip::-webkit-details-marker { display: none; }
.who-chip .i { width: 18px; height: 18px; opacity: .8; transition: transform .15s; }
.who-menu[open] .who-chip { border-color: #4A5056; background: #2C3034; color: #fff; }
.who-menu[open] .who-chip .i { transform: rotate(180deg); }
.who-name { font-weight: 600; font-size: 18px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 260px; display: grid; gap: 8px; padding: 10px;
  background: #2C3034; border: 1px solid #4A5056; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.45); }
.who-pop .btn { justify-content: flex-start; min-height: 52px; font-size: 17px; gap: 10px; white-space: nowrap; }
.update-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 14px;
  background: var(--primary-bg); color: var(--primary-ink); text-decoration: none; white-space: nowrap; }
.update-pill .i { width: 16px; height: 16px; }
.subnav .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-base); margin-left: 6px; }
.page-intro { margin: -6px 0 16px; max-width: 820px; }

/* ---------------------------------------------------------- sell: till closed */
.till-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 14px;
  padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 0; }
.till-hero-icon { width: 56px; height: 56px; border-radius: var(--radius); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.till-hero-icon .i { width: 30px; height: 30px; }
.till-hero h2 { margin: 0 0 4px; }
.till-hero p { margin: 0; color: var(--text-2); }
@media (max-width: 1100px) { .till-hero { grid-template-columns: auto 1fr; } .till-hero form { grid-column: 1 / -1; } }

/* ---------------------------------------------------------- stock: add a new item */
.new-item-modal { width: min(820px, 96vw); display: grid; gap: 16px; }
.new-item-form { display: grid; gap: 16px; }
.new-item-grid { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.new-item-image { display: grid; gap: 10px; }
.new-item-image .image-frame { aspect-ratio: 1; }
.new-item-fields { display: grid; gap: 12px; }
.new-item-modal [data-toggle-group] button { min-height: 56px; font-size: 18px; gap: 8px; }
@media (max-width: 760px) { .new-item-grid { grid-template-columns: 1fr; } }

/* Row buttons (print + open) sit level with each other. */
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; vertical-align: middle; }
.row-actions .btn { margin: 0; }
.btn-icon { padding: 0; width: 48px; justify-content: center; }
.sales-list > .card + .card { margin-top: 14px; }

/* Daily summary: previous / pick a date / next / today */
.day-picker { display: flex; align-items: center; gap: 8px; }
.day-picker .btn { min-height: 52px; min-width: 52px; justify-content: center; }
.day-form .input { min-height: 52px; font-size: 18px; width: 200px; }
.btn-today-on { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------- sell tiles with a condition */
.tile-name { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.tile-flag { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.2;
  background: var(--surface-2); color: var(--text-2); }
.tile.addon .tile-flag { background: var(--accent-soft); color: var(--accent); }
.tile.off-day { opacity: .82; border-style: dashed; border-color: var(--line); }
.tile.off-day .tile-flag { background: transparent; border: 0; }
.day-choice { display: flex; gap: 8px; flex-wrap: wrap; }
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; inset: 0; }
.day-chip span { display: grid; place-items: center; min-width: 64px; min-height: 52px; padding: 0 12px; border-radius: var(--radius);
  border: 0; background: var(--surface-2); font-weight: 600; cursor: pointer; }
.day-chip input:checked + span { background: var(--text); color: var(--bg); }
.day-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------- end of day: take the takings */
.take-close { display: grid; gap: 14px; margin-bottom: 16px; text-align: left; }
.take-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: stretch; }
.take-box { display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 12px 14px;
  border-radius: var(--radius); background: var(--surface-2); }
.take-box .value { font-family: var(--display); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.take-box .input { font-size: 22px; }
.take-result { background: var(--accent-soft); }
.take-result .value { color: var(--accent); }
@media (max-width: 900px) { .take-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- needs attention: coloured cards with one action */
.attention { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 16px; }
.attn { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 16px 18px; min-height: 84px;
  border-radius: var(--radius-lg); text-decoration: none; color: var(--text); border: 0; }
.attn-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.attn-icon .i { width: 24px; height: 24px; }
.attn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attn-text strong { font-size: 19px; }
.attn-text span { color: var(--text-2); font-size: 15px; }
.attn-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; min-height: 44px; padding: 0 18px; border-radius: 999px; }
.attn-cta .i { width: 18px; height: 18px; }
.attn-bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.attn-bad .attn-icon, .attn-bad .attn-cta { background: color-mix(in srgb, var(--bad) 25%, transparent); color: var(--bad); }
.attn-warn { background: var(--warn-soft); }
.attn-warn .attn-icon, .attn-warn .attn-cta { background: color-mix(in srgb, var(--warn) 25%, transparent); color: var(--warn); }
.attn-warn .attn-cta, .attn-bad .attn-cta { color: var(--text); }
.attn-info { background: color-mix(in srgb, var(--accent-base) 14%, var(--surface)); }
.attn-info .attn-icon, .attn-info .attn-cta { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.attn:active { filter: brightness(1.1); }

/* Rows you can tap to open (sales). */
tr.row-link { cursor: pointer; }
tr.row-link:hover td, tr.row-link:active td { background: var(--surface-2); }
.row-go { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--muted); }
.row-go .i { width: 20px; height: 20px; }
tr.row-link:hover .row-go { color: var(--text); }

/* ---------------------------------------------------------- till: one tile per job */
.till-top { display: grid; grid-template-columns: minmax(320px, 1fr) 2fr; gap: 16px; align-items: start; }
.till-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.till-tile-form { display: contents; }
.till-tile-form.till-tile-wide { display: block; grid-column: 1 / -1; }
.till-tile { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; text-align: left; width: 100%;
  min-height: 108px; padding: 16px 18px; border-radius: var(--radius); border: 0; background: var(--surface);
  color: var(--text); cursor: pointer; font: inherit; }
.till-tile strong { display: block; font-size: 20px; margin-bottom: 4px; }
.till-tile span span { color: var(--text-2); font-size: 15px; line-height: 1.35; }
.till-tile-icon { width: 52px; height: 52px; border-radius: var(--radius); display: grid; place-items: center; background: var(--surface-2); }
.till-tile-icon .i { width: 26px; height: 26px; }
.till-tile:active { filter: brightness(1.1); }
.till-tile-primary { background: var(--primary-bg); color: var(--primary-ink); }
.till-tile-primary span span { color: var(--primary-ink); opacity: .85; }
.till-tile-primary .till-tile-icon { background: rgba(0,0,0,.12); }
@media (max-width: 1100px) { .till-top { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- stock at a glance */
.stock-glance { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.glance { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 16px; border-radius: var(--radius);
  border: 0; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.glance-n { font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.glance.on { box-shadow: 0 0 0 3px var(--accent-base); }
.glance-warn { background: var(--warn-soft); }
.glance-warn .glance-n { color: var(--warn); }
.glance-bad { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.glance-bad .glance-n { color: var(--bad); }
.glance-muted { color: var(--muted); }
.stock-search { display: flex; margin-bottom: 8px; }

/* ---------------------------------------------------------- admin: side menu */
.admin-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 40px; align-items: start; max-width: 1100px; margin: 0 auto; }
.admin-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 4px; }
.admin-link { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--radius); color: var(--text); text-decoration: none; }
.admin-link strong { font-size: 16px; font-weight: 600; }
.admin-link > span { font-size: 13px; color: var(--muted); }
.admin-link:active { background: var(--surface-2); }
.admin-link.on { background: var(--surface); box-shadow: var(--shadow); }
.admin-link.on strong { color: var(--accent); font-weight: 700; }
.admin-main { min-width: 0; }
.admin-narrow { max-width: 760px; }
@media (max-width: 1000px) { .admin-layout { grid-template-columns: 1fr; gap: 20px; } .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-link { padding: 10px 14px; } .admin-link > span { display: none; } }

/* Long tables scroll inside their card, headings stay put, and neighbouring cards keep their size. */
.table-scroll { max-height: 460px; overflow: auto; overscroll-behavior: contain; }
.table-scroll thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
.count-expected { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 10px 14px; margin-bottom: 10px;
  border-radius: var(--radius); background: var(--surface-2); font-size: 17px; }
.count-expected strong { font-family: var(--display); font-size: 22px; }
.count-diff { font-weight: 700; font-size: 18px; }
.count-exp-note { flex-basis: 100%; font-size: 13px; }
.pad-quick { grid-template-columns: repeat(3, 1fr); margin-bottom: 4px; }

/* ---------------------------------------------------------- licence (Admin → Updates) */
.licence-card { display: grid; gap: 12px; }
.licence-card h3 { margin: 0; }
.licence-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.licence-facts dt { color: var(--text-2); }
.licence-facts dd { margin: 0; font-weight: 600; }
.licence-software { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--text-2); }
.licence-software.is-bad { color: var(--danger-bg); font-weight: 600; }
.licence-upload { display: grid; gap: 8px; }
.software-banner { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--danger-bg); color: var(--danger-ink); font-weight: 600; }
.software-banner a { color: inherit; }

/* ---------------------------------------------------------- shop details: logo picker */
.logo-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 88px; height: 88px; object-fit: contain; border-radius: 16px; background: var(--surface-2, var(--surface)); }

/* ---------------------------------------------------------- setup wizard */
.setup-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--text-2); }
.setup-steps li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.setup-steps .n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line, var(--text-2)); font-size: 14px; }
.setup-steps li.on { color: var(--text); }
.setup-steps li.on .n { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-ink); }
.setup-steps li.done .n { border-color: var(--accent); color: var(--accent); }
.setup-nav { display: flex; justify-content: space-between; gap: 12px; }
.setup-more summary { cursor: pointer; font-weight: 600; }
.kit-list { display: grid; gap: 10px; }
.kit { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line, var(--surface)); border-radius: var(--radius); cursor: pointer; }
.kit:has(input:checked) { border-color: var(--accent-base); background: var(--accent-soft); }
.kit input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); }
.kit strong { display: block; font-size: 1.1rem; }
.licence-ok { display: flex; gap: 8px; align-items: center; margin: 0; }

/* ---------------------------------------------------------- appearance menu and accent picker */
.appearance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.appearance a { min-height: 44px; display: grid; place-items: center; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); }
.appearance a.on { background: var(--surface); color: var(--text); box-shadow: var(--lift); }
.theme-toggle span { font-size: 14px; }
.accent-field { border: 0; margin: 0; padding: 0; }
.accent-field legend { font-size: 14px; color: var(--text-2); font-weight: 600; padding: 0; margin-bottom: 8px; }
.accent-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.accent-swatch { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px;
  border-radius: 16px; background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-2); }
.accent-swatch input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.accent-swatch .dot { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.accent-swatch .dot-custom { padding: 0; border: 0; background: none; cursor: pointer; }
.accent-swatch .dot-custom::-webkit-color-swatch-wrapper { padding: 0; }
.accent-swatch .dot-custom::-webkit-color-swatch { border: 0; border-radius: 50%; }
.accent-swatch:has(input[type="radio"]:checked) { box-shadow: 0 0 0 3px var(--accent-base); color: var(--text); }
.accent-swatch:has(input[type="radio"]:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
/* PIN keys sit on the page background, not in a card: raised white (or dark grey) keys. */
.pin-box .key { background: var(--surface); box-shadow: var(--shadow); }
.pin-box .key-muted { background: transparent; box-shadow: none; }
.pin-box .key-go { background: var(--primary-bg); }
.setup-banner { display: flex; gap: 10px; align-items: center; margin: 0 28px 8px; padding: 12px 18px; border-radius: 16px;
  background: var(--accent-soft); color: var(--text); font-size: 15px; }
/* On a screen opened from Get set up: which step this is, and the way back to the checklist. */
.setup-return { display: flex; gap: 12px; align-items: center; margin: 0 28px 8px; padding: 10px 12px 10px 16px;
  border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); }
.app > .setup-return { flex: none; }
.setup-return > span:nth-child(2) { flex: 1; min-width: 0; }
.setup-return-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--good); color: var(--surface); }
.setup-return-mark.is-todo { background: var(--accent-soft); color: var(--accent); }
.setup-return .btn { flex: none; }
@media (max-width: 640px) { .setup-return { flex-wrap: wrap; margin: 0 12px 8px; } .setup-return .btn { width: 100%; } }
.setup-banner strong { margin-left: auto; color: var(--accent); white-space: nowrap; }

/* ---------------------------------------------------------- overview: at a glance */
.hello { margin: 2px 0 14px; }
.hello-greeting { font-size: 28px; letter-spacing: -0.03em; }
.hello-line { margin: 4px 0 0; font-size: 19px; color: var(--text-2); }
.hello-line .delta-up, .hello-line .delta-down { font-weight: 600; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.quick-actions .btn { min-height: 52px; font-size: 16px; }
.top-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.top-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: baseline; }
.top-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-qty { font-size: 14px; font-variant-numeric: tabular-nums; }
.top-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.top-bar { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.top-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent-base); }
.month-total { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }
.month-facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 14px 0 0; font-size: 15px; }
.month-facts dt { color: var(--muted); }
.month-facts dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-bar-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pay-bar-owed { background: var(--bad); }
.swatch-owed { background: var(--bad); }
.pay-owed { align-self: center; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 10px;
  padding: 6px 14px; border-radius: 999px; background: var(--danger-bg); color: var(--danger-ink); font-size: 14px; text-decoration: none; }
.pay-owed .pay-name { font-weight: 600; color: inherit; }
.pay-owed strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.pay-owed .i { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------------------------------------------------------- dashboard layout: one comfortable column,
   related figures grouped under a small label, room to breathe between groups */
.dash-page { max-width: 1120px; margin: 0 auto; }
.dash-intro { display: flex; flex-direction: column; gap: 20px; }
.dash-intro .hello, .dash-intro .quick-actions, .dash-intro .attention { margin: 0; }
.dash-group { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.dash-group-first { margin-top: 4px; }
.group-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dash-page .grid { gap: 16px; }
.dash-page .card { padding: 24px 26px; border-radius: 24px; }
.stat-row .stat, .money-row .stat { display: flex; flex-direction: column; gap: 4px; }
.stat .stat-link { margin-top: auto; padding-top: 12px; font-size: 15px; font-weight: 600; color: var(--accent); }
/* A figure card that opens something gets an arrow in its corner, so it reads as a button and not just a number. */
a.card.stat, a.help-card { position: relative; color: inherit; text-decoration: none; transition: background-color .12s, transform .08s; }
a.card.stat::after, a.help-card::after { content: ""; position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; background: currentColor;
  color: var(--muted); -webkit-mask: var(--go-arrow) center / contain no-repeat; mask: var(--go-arrow) center / contain no-repeat; }
a.card.stat:hover { background: var(--surface-2); }
a.card.stat:hover::after, a.card.stat:focus-visible::after, a.help-card:hover::after, a.help-card:focus-visible::after { color: var(--accent); }
a.card.stat:active { transform: scale(.98); }
a.card.stat .label, a.help-card > :first-child { padding-right: 26px; }  /* a long label never runs under the arrow */
@media print { a.card.stat::after, a.help-card::after { display: none; } }
:root { --go-arrow: 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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7h10v10'/%3E%3Cpath d='M7 17 17 7'/%3E%3C/svg%3E"); }
.money-row { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.trends-row { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.pay-split { display: flex; flex-direction: column; gap: 18px; }
.pay-split .pay-split-head { margin-bottom: 0; }
.pay-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.pay-figures .pay-figure { min-width: 0; }
.pay-figures .pay-amount { font-size: 30px; }
.pay-figure.pay-owed { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; align-self: start; gap: 2px;
  padding: 0; border-radius: 0; background: none; color: inherit; font-size: inherit; text-decoration: none; }
.pay-figure.pay-owed .pay-name { color: var(--text-2); }
.pay-figure.pay-owed .pay-amount, .pay-figure.pay-owed .sub { color: var(--bad); }
.sales-list .sales-tools { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.sales-list .filter-chips { flex-wrap: wrap; align-items: center; }
.sales-list .receipt-search .search { width: 240px; }
.list-hint { margin: 0; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .money-row, .trends-row { grid-template-columns: 1fr; } }
.grid-3 .donut-figure { width: 200px; }
.grid-3 .donut-total { font-size: 21px; }

/* ---------------------------------------------------------- money: breakdown, tips, refunds, VAT */
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-5 { grid-template-columns: repeat(3, 1fr); } }
.grid-5 .stat .value { font-size: 28px; }
.stat .value.bad { color: var(--bad); }
.side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.money-breakdown { display: flex; flex-direction: column; }
.mb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 22px; gap: 12px; align-items: center; min-height: 60px;
  color: inherit; text-decoration: none; border-radius: 12px; }
a.mb-row:hover { background: var(--fill); }
.mb-label { display: flex; flex-direction: column; gap: 2px; font-size: 17px; font-weight: 500; }
.mb-note { font-size: 13px; font-weight: 400; color: var(--muted); }
.mb-value { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.mb-go { color: var(--muted); display: grid; place-items: center; }
.mb-go .i { width: 18px; height: 18px; }
.mb-minus .mb-value { color: var(--bad); }
.mb-big, .mb-total, .mb-sep { border-top: 1px solid var(--line); }
.mb-big .mb-label, .mb-big .mb-value, .mb-total .mb-label, .mb-total .mb-value { font-size: 20px; font-weight: 700; }
.mb-sub { min-height: 46px; padding-left: 20px; }
.mb-sub .mb-label, .mb-sub .mb-value { font-size: 15px; color: var(--text-2); font-weight: 500; }
.tip-owed-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; border-top: 1px solid var(--line); }
.tip-owed-row .swatch { margin-right: 6px; }
.tip-card { display: flex; flex-direction: column; gap: 6px; }
.tip-card .value { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; }
.tip-card .sub { color: var(--muted); font-size: 14px; }
.tip-who { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.tip-pay { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.items-cell .items-text { display: block; overflow: hidden; text-overflow: ellipsis; }
.row-note { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-note.bad { color: var(--bad); font-weight: 600; }
.kind { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.kind-service { background: #E8F1FB; color: #0B3A75; }
.kind-product { background: #EAF6EE; color: #1B4D2A; }
.kind-mixed { background: #F3ECFA; color: #4B2470; }
[data-theme="dark"] .kind-service { background: #16314F; color: #CFE0F7; }
[data-theme="dark"] .kind-product { background: #183A24; color: #CDEBD6; }
[data-theme="dark"] .kind-mixed { background: #35214A; color: #E7D6F5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kind-service { background: #16314F; color: #CFE0F7; }
  :root:not([data-theme="light"]) .kind-product { background: #183A24; color: #CDEBD6; }
  :root:not([data-theme="light"]) .kind-mixed { background: #35214A; color: #E7D6F5; }
}
.line-refunded { font-size: 13px; color: var(--bad); font-weight: 600; }
.refund-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--bad); font-weight: 600; }
.refund-note .i { width: 18px; height: 18px; flex: none; }
.refund-part > summary { list-style: none; cursor: pointer; }
.refund-part > summary::-webkit-details-marker { display: none; }
.refund-part[open] > summary { margin-bottom: 12px; }
.refund-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px; gap: 12px; align-items: center; }
.segmented label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 14px;
  border-radius: 999px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: var(--lift); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.vat-card .segmented { max-width: 440px; }
.table-x { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.sales-table .items-cell { max-width: 300px; }

/* ---------------------------------------------------------- licence key: five boxes of four */
.key-boxes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-box { flex: 1 1 0; min-width: 84px; max-width: 120px; width: 100%; height: 62px; padding: 0 4px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface-2); color: var(--text); text-align: center; text-transform: uppercase;
  font: 700 24px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.key-box:focus { outline: none; border-color: var(--accent-base); background: var(--surface); }
.key-boxes.complete .key-box { border-color: var(--good, #1B7F3B); }
.key-dash { color: var(--muted); font-weight: 700; }
.key-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.key-osk-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Landing on a section from a card or a breakdown line: a little room above it, and a brief glow so
   it's obvious what just changed. */
.dash-group { scroll-margin-top: 16px; }
.dash-group:target > .card, .dash-group:target > .grid > .card:first-child { animation: landed 1.6s ease-out; }
@keyframes landed { 0%, 30% { box-shadow: 0 0 0 4px var(--accent-base); } 100% { box-shadow: var(--shadow); } }

/* Sell screen: leave room on the right of a product's name for its stock count. */
.tile:has(.stock-note) .tile-name, .tile:has(.stock-note) > .name { padding-right: 64px; }

/* Every sale: dropdown filters that combine. */
.sale-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-pick { gap: 6px; }
.filter-pick .filter-label { color: var(--muted); font-weight: 500; }
.filter-pick .filter-value { font-weight: 700; }
.filter-pick.on { background: var(--surface); box-shadow: 0 0 0 2px var(--accent-base); }
.filter-pick .i { width: 15px; height: 15px; opacity: .6; }

/* ---------------------------------------------------------- calm pages: Till, Stock, a stock item
   One narrow column, one job at a time: the figure that matters is the hero, one big action under it,
   smaller actions in a row, then plain rounded lists with hairlines between rows. */
.calm { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; padding-bottom: 48px; }
.calm-wide { max-width: 880px; gap: 20px; }
.calm-title { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.calm-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.calm-hero { display: flex; flex-direction: column; gap: 18px; }
.calm-label { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.calm-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.calm-section { display: flex; flex-direction: column; gap: 12px; }
.calm-main { width: 100%; min-height: 72px; border-radius: var(--radius-lg); font-size: 20px; font-weight: 700; gap: 10px; }
.calm-main .i { width: 24px; height: 24px; }
.calm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.calm-actions-2 { grid-template-columns: 1fr 1fr; }
.calm-action-form { display: contents; }
/* An action tile is a button, not a figure: a border and a firmer shadow set it apart from the flat metric cards,
   it lifts under the pointer and presses in when tapped. */
.calm-action { display: flex; flex-direction: column; gap: 4px; min-height: 92px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .10);
  transition: box-shadow .12s, transform .08s, border-color .12s; }
.calm-action:hover { border-color: var(--muted); box-shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 6px 14px rgba(0, 0, 0, .14); transform: translateY(-1px); }
.calm-action:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.calm-action strong { font-size: 17px; }
.calm-action span { font-size: 14px; color: var(--muted); line-height: 1.35; }
.calm-action:active { filter: brightness(.97); transform: translateY(0); box-shadow: 0 1px 2px rgba(0, 0, 0, .10); }
.calm-list { background: var(--surface); border-radius: var(--radius-lg); padding: 6px 22px; box-shadow: var(--shadow); }
.calm-row { display: grid; gap: 14px; align-items: center; min-height: 60px; padding: 8px 0; border-bottom: 1px solid var(--line);
  color: var(--text); text-decoration: none; }
.calm-row:last-child, .calm-row:has(+ .calm-pager), .calm-row:has(+ .calm-day) { border-bottom: 0; }
a.calm-row:active { opacity: .7; }
.calm-row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calm-row-main small { font-size: 13px; color: var(--muted); }
.calm-row-3 { grid-template-columns: 56px 1fr auto; }
.calm-row-past { grid-template-columns: 1fr auto auto 24px; min-height: 66px; }
.calm-row-num { font-variant-numeric: tabular-nums; }
.calm-row .row-go { width: 24px; height: auto; font-size: 22px; }
.calm-row-hist { grid-template-columns: 1fr auto; min-height: 50px; }
.calm-row-hist a { color: var(--accent); text-decoration: none; }
.calm-day { padding: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.calm-empty { margin: 0; padding: 18px 0; }
.calm-foot { margin: 0; text-align: center; }
.calm-pager { padding: 12px 0 8px; }
.pill-short { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }

/* till */
.status-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-on { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.status-off { background: var(--fill); color: var(--text-2); }
.drawer { display: flex; flex-direction: column; gap: 4px; }
.drawer-label { margin: 0; font-size: 17px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.drawer-amount { font-size: 72px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.drawer-sums summary { cursor: pointer; list-style: none; font-weight: 600; color: var(--accent); padding: 6px 0; }
.drawer-sums summary::-webkit-details-marker { display: none; }
.drawer-sums .sums { max-width: 360px; margin: 4px 0 8px; color: var(--text-2); gap: 6px 24px; }

/* stock list */
.calm-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-radius: 999px; background: var(--fill); }
.seg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; }
.seg-btn.on { background: var(--surface); box-shadow: var(--lift); }
.seg-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 13px; text-align: center; }
.seg-n-warn { background: var(--warn-soft); color: var(--warn); }
.calm-search { flex: 0 1 300px; min-width: 240px; }
.calm-search .input { border-radius: 999px; background: var(--surface); min-height: 48px; }
.stock-row { grid-template-columns: 1fr auto 24px; min-height: 74px; }
.stock-row-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stock-row-name strong { font-size: 17px; }
.stock-row-qty { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

/* a stock item */
.calm-crumb { display: flex; flex-direction: column; gap: 6px; }
.calm-back { align-self: flex-start; font-weight: 600; color: var(--accent); text-decoration: none; }
.calm-name { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.calm-count { background: var(--surface); border-radius: var(--radius-xl); padding: 26px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.calm-count-form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.calm-warn { margin: 0; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn); }
.count-stepper { display: flex; align-items: center; gap: 40px; }
.count-step { width: 76px; height: 76px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; }
.count-step .i { width: 30px; height: 30px; }
.count-step:active { filter: brightness(.94); }
.count-num { font-size: 96px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; min-width: 120px; font-variant-numeric: tabular-nums; }
.calm-settings { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow); }
.calm-settings summary { cursor: pointer; list-style: none; font-size: 17px; }
.calm-settings summary::-webkit-details-marker { display: none; }

@media (max-width: 620px) {
  .calm-title { font-size: 28px; }
  .drawer-amount { font-size: 56px; }
  .count-stepper { gap: 20px; }
  .count-num { font-size: 72px; min-width: 90px; }
  .calm-actions-2 { grid-template-columns: 1fr; }
  .calm-row-past { grid-template-columns: 1fr auto 24px; }
  .calm-row-past .calm-row-num { display: none; }
  .calm-search { flex: 1 1 100%; }
}

/* ---------------------------------------------------------- admin pages: one narrow column, plain questions */
.admin-page { max-width: 720px; display: flex; flex-direction: column; gap: 28px; padding-bottom: 48px; }
.admin-page .calm-title { margin: 0; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.admin-head > div { display: flex; flex-direction: column; gap: 6px; }
.admin-head p { margin: 0; color: var(--muted); font-size: 16px; }
.admin-card { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 22px; box-shadow: var(--shadow); }
.admin-note { margin: 0; font-size: 14px; color: var(--muted); }
.setting { display: flex; flex-direction: column; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.setting:last-child { border-bottom: 0; }
.setting-q { display: flex; flex-direction: column; gap: 4px; }
.setting-q strong { font-size: 17px; }
.setting-q span { font-size: 14px; color: var(--muted); }
[data-toggle-group].pills { display: inline-flex; flex-wrap: wrap; justify-self: start; align-self: flex-start; }
[data-toggle-group].pills [data-value] { min-height: 44px; padding: 0 18px; }
[data-toggle-group].cards { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; background: none; padding: 0; border-radius: 0; }
[data-toggle-group].cards [data-value] { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 84px; padding: 14px;
  border-radius: var(--radius); border: 2px solid var(--surface-2); background: var(--surface); color: var(--text); text-align: left; box-shadow: none; }
[data-toggle-group].cards [data-value] small { font-size: 13px; font-weight: 500; color: var(--muted); }
[data-toggle-group].cards [data-value].on { border-color: var(--primary-bg); background: var(--accent-soft); }
.sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 17px; }
.sentence select { min-height: 44px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; }
.money-field { width: 160px; font-size: 20px; font-weight: 700; }
.save-state { min-height: 20px; font-size: 14px; font-weight: 600; color: var(--muted); }
.save-state.ok { color: var(--good); }
.save-state.bad { color: var(--bad); }
.status-card { background: var(--surface); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; }
.status-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good-ink); }
.status-icon .i { width: 26px; height: 26px; }
.status-icon.warn { background: var(--warn-soft); color: var(--warn); }
.status-icon.new { background: var(--accent-soft); color: var(--accent); }
.status-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.status-text strong { font-size: 22px; }
.status-text span { font-size: 15px; color: var(--muted); }
.facts { display: grid; grid-template-columns: 180px 1fr; }
.facts dt, .facts dd { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts dd { font-weight: 600; }
.facts dt:last-of-type, .facts dd:last-of-type { border-bottom: 0; }
.fact-good { color: var(--good); }
.fact-bad { color: var(--bad); }
.admin-fold { background: var(--surface); border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow); }
.admin-fold > summary { cursor: pointer; list-style: none; font-size: 17px; font-weight: 600; }
.admin-fold > summary::-webkit-details-marker { display: none; }
.admin-fold[open] > summary { margin-bottom: 14px; }
.person { border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; min-height: 72px; padding: 10px 0;
  cursor: pointer; list-style: none; }
.person-row::-webkit-details-marker { display: none; }
.person-row .avatar { width: 44px; height: 44px; }
.person-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.person-name strong { font-size: 17px; }
.person-name > span { font-size: 13px; color: var(--muted); }
.person-toggle { font-weight: 600; color: var(--accent); }
.person[open] .person-toggle .closed, .person:not([open]) .person-toggle .opened { display: none; }
.person-actions { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 16px 58px; }
.person-actions form { display: contents; }
.person.is-off { opacity: .6; }
.item-row { display: grid; grid-template-columns: 1fr auto 24px; gap: 16px; align-items: center; min-height: 68px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-row.is-hidden .item-name, .item-row.is-hidden .price-btn { opacity: .55; }
.item-name { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; min-width: 0; }
.item-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.item-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.item-text strong { font-size: 17px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.item-text > span { font-size: 13px; color: var(--muted); }
.item-row .row-go { width: 24px; height: auto; font-size: 22px; text-decoration: none; }
.item-row .cat-thumb { display: none; }
.danger-link { background: transparent !important; color: var(--bad) !important; }
@media (max-width: 620px) {
  [data-toggle-group].cards { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; } .facts dt { border-bottom: 0; padding-bottom: 0; }
  .status-card { grid-template-columns: 44px 1fr; } .status-card > form, .status-card > .btn { grid-column: 1 / -1; }
  .person-actions { padding-left: 0; }
}
.admin-page .cat-group { background: none; border-radius: 0; padding: 0; box-shadow: none; }
.admin-head:has(> h1:only-child), .admin-head:has(> h1 + .btn) { align-items: center; }
.admin-page .btn-danger-soft { background: color-mix(in srgb, var(--bad) 10%, transparent); }

/* Links inside a line of text are underlined, not told apart by colour alone (WCAG 1.4.1). */
.calm-row-hist a, .notice a, p a { text-decoration: underline; text-underline-offset: 2px; }

/* Updates: what's new in the waiting update (from its release notes) */
.whats-new { padding: 18px 22px; display: grid; gap: 8px; }
.whats-new h3 { margin: 0; font-size: 18px; }
.release-history { display: grid; gap: 8px; margin-top: 4px; }
.release-history h3 { margin: 6px 0 2px; }
.release-note { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.release-note > summary { list-style: none; cursor: pointer; min-height: 56px; padding: 10px 18px; display: flex; align-items: center;
  gap: 12px; }
.release-note > summary::-webkit-details-marker { display: none; }
.release-note > summary > span:first-child { flex: 1; }
.release-note-chev { display: inline-flex; color: var(--muted); transition: transform .15s; }
.release-note[open] .release-note-chev { transform: rotate(180deg); }
.release-note ul { margin: 0; padding: 0 22px 16px 38px; display: grid; gap: 6px; line-height: 1.5; }
.whats-new ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; line-height: 1.5; }

/* Choosing a folder on the till's PC (Backups): drives and places, then the folder's folders */
.modal.folder-modal { width: min(680px, 100%); gap: 14px; }
.folder-places { display: flex; flex-wrap: wrap; gap: 8px; }
.folder-here { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.folder-path { flex: 1; font-size: 15px; color: var(--text-2); word-break: break-all; }
.folder-list { display: grid; gap: 2px; max-height: 44vh; overflow-y: auto; overscroll-behavior: contain; background: var(--surface-2);
  border-radius: var(--radius); padding: 4px; min-height: 120px; align-content: start; }
.folder-row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; border: 0; border-radius: 10px;
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.folder-row:hover, .folder-row:focus-visible { background: var(--surface-3); }
.folder-row > span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-row .i { color: var(--muted); }
.folder-ico { width: 22px; height: 22px; flex: none; background: var(--accent); -webkit-mask: var(--folder-ico) center / contain no-repeat;
  mask: var(--folder-ico) center / contain no-repeat; }
:root { --folder-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='M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z'/%3E%3C/svg%3E"); }
.folder-none { margin: 16px 14px; }
.folder-error { margin: 0; color: var(--bad); }
.folder-new { display: flex; gap: 10px; }
.folder-new .input { flex: 1; }
.folder-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.folder-spacer { flex: 1; }
.backup-move { margin-top: 4px; }
.backup-move-hint { margin: 0; font-size: 14px; }

/* Email: Connect to Outlook / Gmail */
.connect-btns { display: flex; flex-wrap: wrap; gap: 12px; }
.connect-btn { gap: 12px; min-width: 250px; justify-content: flex-start; }
.connect-btn:disabled { opacity: .55; cursor: not-allowed; }
.connect-logo { width: 22px; height: 22px; flex: none; }
.email-password { margin-top: 4px; }

/* ---------------------------------------------------------- legal and privacy pages */
/* Read without signing in: the page itself never scrolls (html, body), so this does; the text stays centred (.calm). */
.public-page { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 32px 16px 64px; }
.legal-page { gap: 20px; }
.legal-page > p { margin: 0; line-height: 1.55; }
.legal-text { white-space: pre-wrap; font: 15px/1.6 var(--font); background: var(--surface); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow); margin: 0; max-height: 60vh; overflow: auto; }
.legal-list { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; line-height: 1.5; }
.agree-row { border-top: 1px solid var(--line); padding-top: 14px; }
.agree-row .help a, .login-version a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.privacy-table { width: 100%; border-collapse: collapse; }
.privacy-table th, .privacy-table td { text-align: left; padding: 12px 8px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15px; }
.privacy-table th { color: var(--muted); font-weight: 600; font-size: 13px; }
.privacy-table tr:last-child td { border-bottom: 0; }
.setting:has(+ noscript) { border-bottom: 0; }
.save-state:empty { min-height: 0; margin: 0; }

/* ---------------------------------------------------------- add-on: loyalty (stamp cards), in the shop's own colour */
.loyalty-card { background: var(--accent-soft); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.loyalty-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.loyalty-card-head > span { display: flex; flex-direction: column; gap: 2px; }
.loyalty-sub { font-size: 13px; color: var(--text-2); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, 28px); gap: 10px; }
.stamp { width: 28px; height: 28px; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--text) 30%, transparent); }
.stamp.on { border: 0; background: var(--primary-bg); position: relative; }
.stamp.on::after { content: "✓"; color: var(--primary-ink); position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.stamp.next { border-style: solid; border-color: var(--primary-bg); }
.loyalty-reward .btn { width: 100%; }
.loyalty-btn { color: var(--accent); }
/* The loyalty pop-up: one calm column. Find (search or scan) first; registering a new customer is the link at the foot. */
.loyalty-modal { width: min(560px, 100%); gap: 22px; padding: 28px; }
.loyalty-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.loyalty-modal-head h2 { margin: 0; font-size: 26px; letter-spacing: -0.025em; }
.loyalty-close { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 2px; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: 18px; font-weight: 500; cursor: pointer; }
.loyalty-close .i { width: 20px; height: 20px; }
.loyalty-close:active { opacity: .6; }
.loyalty-pane { display: grid; gap: 16px; }
.loyalty-intro h3 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: -0.03em; }
.loyalty-intro p { margin: 6px 0 0; color: var(--muted); font-size: 17px; }
.loyalty-search { position: relative; }
.loyalty-search > .i { position: absolute; left: 22px; top: 50%; width: 24px; height: 24px; transform: translateY(-50%);
  color: var(--muted); pointer-events: none; }
.loyalty-search .input { padding-left: 60px; border-radius: var(--radius-lg); font-size: 20px; }
.loyalty-search .input::placeholder { color: var(--muted); }
.loyalty-results:empty { display: none; }
.loyalty-or { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 13px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; }
.loyalty-or::before, .loyalty-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.modal .loyalty-scan-btn { width: 100%; background: transparent; box-shadow: inset 0 0 0 1.5px var(--surface-3); border-radius: var(--radius-lg); }
.loyalty-scan-btn .i { color: var(--accent); width: 24px; height: 24px; }
.loyalty-foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 17px; }
.loyalty-link, .loyalty-back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0; border: 0; background: none;
  color: var(--accent); font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; }
.loyalty-link .i { width: 20px; height: 20px; stroke-width: 2.5; }
.loyalty-link:active, .loyalty-back:active { opacity: .6; }
.loyalty-back { min-height: 40px; margin-bottom: 8px; font-size: 16px; font-weight: 600; }
.loyalty-back .i { width: 18px; height: 18px; }
.loyalty-results { display: flex; flex-direction: column; gap: 8px; min-height: 8px; }
.loyalty-result { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; text-align: left; padding: 14px 16px; border: 0; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.loyalty-result .loyalty-count { grid-row: span 2; align-self: center; font-weight: 700; color: var(--accent); }
.loyalty-new summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
.loyalty-new[open] summary { margin-bottom: 10px; }
.loyalty-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.loyalty-stats .admin-card { padding: 16px 18px; display: flex; flex-direction: column; }
.loyalty-stats span { font-size: 13px; color: var(--muted); }
.loyalty-stats strong { font-size: 30px; }
.slip-loyalty { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed currentColor; text-align: center; font-size: 13px; }

.level { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); vertical-align: middle; }
.level-sends { background: var(--accent-soft); color: var(--accent); }
.level-online { background: var(--warn-soft); color: var(--warn); }

/* ---------------------------------------------------------- add-on: bookings diary */
.diary-page { display: flex; flex-direction: column; gap: 18px; padding-bottom: 40px; }
.diary-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.diary-head > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.diary-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.diary-tools .input { min-height: 48px; width: auto; }
.diary { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(170px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.diary-times { position: relative; height: var(--rows); margin-top: 56px; }
.diary-times span { position: absolute; right: 0; transform: translateY(-50%); font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.diary-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.diary-who { margin: 0; height: 48px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.diary-who .avatar { width: 36px; height: 36px; font-size: 15px; }
.diary-track { position: relative; height: var(--rows); background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.diary-hour { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.diary-off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--bg) 8px 16px); }
.diary-slot { position: absolute; left: 0; right: 0; height: 24px; }
.diary-slot:hover, .diary-slot:focus-visible { background: var(--accent-soft); outline-offset: -3px; }
/* A booking: the same padding at every size, and only as many lines as fit (lines-1/2/3, chosen by its length),
   so text is never cut through. The time is bold and comes first, to read at a glance. */
.diary-booking { position: absolute; left: 4px; right: 4px; border-radius: 10px; padding: 7px 10px; overflow: hidden;
  background: var(--primary-bg); color: var(--primary-ink); text-decoration: none; display: flex; flex-direction: column; gap: 2px;
  font-size: 14px; line-height: 18px; z-index: 1; }
.diary-booking .bk-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.diary-booking .bk-time { flex: none; font-weight: 800; font-variant-numeric: tabular-nums; }
.diary-booking strong { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.diary-booking .bk-more { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }  /* full strength: the ink is chosen to read on the shop's colour */
.diary-booking em { font-style: normal; font-weight: 700; font-size: 13px; }
.diary-booking .bk-sub { white-space: nowrap; }
.diary-booking .bk-dur { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }  /* how long it's booked for */
.diary-booking.lines-1 { justify-content: center; padding-top: 0; padding-bottom: 0; }
.diary-booking.lines-1 .bk-more { flex: 1 1 auto; }
.diary-booking.lines-1 .bk-more::before { content: "· "; }
.diary-booking.is-arrived { box-shadow: inset 0 0 0 3px var(--primary-ink); }
.diary-booking.is-done { background: var(--accent-soft); color: var(--text); }
.diary-booking.is-no_show { background: var(--surface-3); color: var(--text-2); text-decoration: line-through; }
.diary-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.hours-grid { display: grid; grid-template-columns: 110px minmax(0, 160px) minmax(0, 160px); gap: 8px 10px; align-items: center; margin-top: 12px; }
.hours-grid .input { min-height: 44px; }
.booking-strip { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 14px; font-size: 14px;
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.diary-who-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }  /* not the avatar: its letter stays centred */
.diary-load { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.diary-load.is-full { color: var(--bad); font-weight: 600; }
/* New booking: day chips and free times */
.bk-days, .bk-times { border: 0; margin: 0; padding: 0; min-width: 0; }
#booking-form > *, #bk-picker { min-width: 0; }
#booking-form .form-grid > .field { min-width: 0; }
.bk-days legend, .bk-times legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.bk-day-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.bk-day { flex: none; scroll-snap-align: start; }
.bk-day input, .bk-time input { position: absolute; opacity: 0; pointer-events: none; }
.bk-day span { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 84px; padding: 10px 8px; border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; text-align: center; }
.bk-day small { font-size: 13px; color: var(--text-2); }
.bk-day em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--good-ink); }
.bk-day.is-full em { color: var(--muted); }
.bk-day input:checked + span, .bk-time input:checked + span { background: var(--primary-bg); color: var(--primary-ink); }
.bk-day input:checked + span small, .bk-day input:checked + span em, .bk-time input:checked + span small { color: inherit; }
.bk-day input:focus-visible + span, .bk-time input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.bk-time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.bk-part { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.bk-time span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; font-weight: 600; font-variant-numeric: tabular-nums; }
.bk-time small { font-size: 12px; font-weight: 500; color: var(--text-2); }
.bk-more summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.bk-more[open] summary { margin-bottom: 8px; }
.bk-more .field { margin-top: 10px; }
/* Admin: what can be booked */
.bk-list { padding: 6px 22px; }
.bk-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bk-item:last-child { border-bottom: 0; }
.bk-item-name { display: flex; flex-direction: column; min-width: 0; }
.bk-item .input { width: auto; min-width: 104px; min-height: 44px; }
.bk-add { padding: 14px 22px; }
.bk-add summary { cursor: pointer; padding: 4px 0; }
.bk-add[open] summary { margin-bottom: 12px; }
.bk-add-group { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 16px; }
.bk-add-group legend { font-size: 13px; font-weight: 600; color: var(--text-2); padding: 0; margin-bottom: 4px; }
.bk-add-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; min-height: 44px; }
.bk-add-item input { width: 22px; height: 22px; accent-color: var(--primary-bg); }
.email-help .notice ol { margin: 6px 0; padding-left: 20px; }
.email-help .notice { display: block; }
@media (max-width: 620px) { .bk-item { grid-template-columns: 1fr auto; } .bk-item .btn { grid-column: 1 / -1; justify-self: start; } }
@media (max-width: 620px) { .hours-grid { grid-template-columns: 1fr 1fr; } .hours-day { grid-column: 1 / -1; font-weight: 600; } }

.backup-where { padding: 16px 22px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.backup-path { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 14px; color: var(--text); word-break: break-all; }
.loyalty-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.loyalty-choices .btn { background: var(--surface); }
.loyalty-applied { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--radius); padding: 8px 8px 8px 14px; }
.reward-items { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.reward-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; }
.reward-item input { width: 22px; height: 22px; accent-color: var(--primary-bg); }
.field-error { margin: 0; color: var(--bad); font-weight: 600; }

/* Bookings: the week at a glance, above the diary */
.bk-overview { display: grid; gap: 12px; margin-bottom: 14px; }
.bk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.bk-stat { padding: 14px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-stat .label, .bk-week-people .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.bk-stat strong { font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bk-stat .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-week { display: grid; grid-template-columns: minmax(0, 3fr) minmax(220px, 2fr); gap: 18px; padding: 14px 18px; }
.bk-week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; }
.bk-week-day { display: grid; grid-template-rows: auto 64px auto; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius);
  text-decoration: none; color: var(--text); min-height: 44px; }
.bk-week-day span { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.bk-week-day strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.bk-week-bar { width: 22px; height: 64px; border-radius: 8px; background: var(--surface-2); position: relative; overflow: hidden; }
.bk-week-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--h); background: var(--primary-bg); border-radius: 8px; }
.bk-week-day:hover { background: var(--surface-2); }
.bk-week-day.on { background: var(--accent-soft); }
.bk-week-day.is-today span { color: var(--text); font-weight: 700; }
.bk-week-people { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-people-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.bk-everyone { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px 12px; border-radius: 999px; }
.bk-everyone.on { background: var(--accent-soft); color: var(--text); }
.bk-person { display: grid; grid-template-columns: minmax(60px, auto) 1fr auto; gap: 10px; align-items: center; font-size: 15px;
  color: var(--text); text-decoration: none; padding: 6px 10px; margin: 0 -10px; border-radius: 12px; min-height: 40px; }
.bk-person:hover { background: var(--surface-2); }
.bk-person.on { background: var(--accent-soft); font-weight: 700; }
.bk-person i { height: 10px; border-radius: 6px; background: var(--surface-2); position: relative; overflow: hidden; }
.bk-person i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--primary-bg); border-radius: 6px; }
.bk-person strong { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .bk-week { grid-template-columns: 1fr; } }

/* The till's own date picker: a button showing the day, and a big calendar to tap */
.date-btn { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; text-align: left;
  min-height: 48px; min-width: 190px; font: inherit; color: var(--text); }
.date-btn-icon { display: inline-flex; color: var(--text-2); }
.date-modal { width: min(460px, 100%); display: grid; gap: 10px; }
.cal-head { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 8px; }
.cal-title { margin: 0; text-align: center; font-size: 21px; }
.cal-nav { min-height: 52px; font-size: 26px; padding: 0; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-week span { text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cal-day { position: relative; min-height: 54px; border: 0; border-radius: var(--radius); background: var(--surface-2); color: var(--text);
  font: inherit; font-size: 18px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  font-variant-numeric: tabular-nums; }
.cal-day small { font-size: 11px; font-weight: 700; line-height: 1; padding: 2px 6px; border-radius: 999px; background: var(--accent-soft); color: var(--text); }
.cal-day.out { background: transparent; color: var(--muted); font-weight: 500; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--primary-bg); }
.cal-day.on { background: var(--primary-bg); color: var(--primary-ink); }
.cal-day.on small { background: var(--primary-ink); color: var(--primary-bg); }
.cal-day:disabled { opacity: .35; cursor: not-allowed; }
.cal-day:not(:disabled):hover { filter: brightness(.96); }
.cal-day:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cal-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 4px; }
.cal-foot .btn { min-width: 120px; }
.date-btn-text { white-space: nowrap; }
.date-pop-row .date-btn { min-width: 0; padding-left: 12px; padding-right: 12px; gap: 8px; }
.loyalty-id { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; font-size: 14px; }
.loyalty-id strong { letter-spacing: .04em; }
.loyalty-id .btn { background: var(--surface); }
input.tag-read { box-shadow: inset 0 0 0 2px var(--good); }
/* Loyalty in the basket: one line to find the member, then their progress and reward */
.loyalty-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 4px 0; border-top: 1px solid var(--line); }
.loyalty-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.loyalty-who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.loyalty-who strong { font-size: 16px; }
.loyalty-count { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loyalty-reward { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px;
  background: var(--surface); border-radius: var(--radius); padding: 10px 12px; }
.loyalty-reward strong { display: block; font-size: 15px; }
.loyalty-reward.is-applied { box-shadow: inset 0 0 0 2px var(--primary-bg); }
.loyalty-camera { display: grid; gap: 6px; justify-items: center; }
.loyalty-camera video { width: 100%; max-height: 260px; border-radius: var(--radius); background: #000; object-fit: cover; }
.loyalty-camera video { pointer-events: none; }  /* no browser video buttons (picture-in-picture etc.) over the camera */
.loyalty-camera [data-qr-status] { text-align: center; }
/* A search inside a pop-up with the keyboard docked: the pop-up moves up into the space above the keyboard and
   scrolls, with the search box at its top, so the results can be seen and tapped while typing. */
body.osk-docked .modal-backdrop:not(.sheet) { place-items: start center; padding-top: 8px; }
body.osk-docked .modal-backdrop:not(.sheet) > .modal { max-height: max(220px, calc(100vh - 530px)); }
body.osk-docked .modal [data-hide-while-typing] { display: none; }

/* Wallet cards: "Add to phone" on a loyalty card, and the QR code the customer scans with their own phone.
   The code is always dark on white, whatever the theme, so every phone camera can read it. */
.wallet-line { display: flex; }
.wallet-modal { width: min(440px, 100%); gap: 14px; }
.wallet-modal .modal-title { text-align: center; }
.wallet-qr { background: #fff; border-radius: var(--radius-lg); padding: 10px; width: min(300px, 100%); aspect-ratio: 1; margin: 0 auto;
             display: grid; place-items: center; color: #1d1d1f; font-size: 14px; text-align: center; }
.wallet-qr svg { width: 100%; height: 100%; display: block; }
.wallet-steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* Bookings: search, and the one-person filter */
.bk-search { position: relative; margin: 4px 0 16px; }
.bk-search-box { position: relative; display: block; max-width: 560px; }
.bk-search-box > .i { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.bk-search-box .input { padding-left: 50px; background: var(--surface); box-shadow: var(--shadow); }
.bk-results { display: grid; gap: 6px; margin-top: 10px; max-width: 760px; }
.bk-result { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.bk-result:hover { background: var(--surface-2); }
.bk-result.is-cancelled { opacity: .6; }
.bk-result-when { display: flex; flex-direction: column; line-height: 1.25; }
.bk-result-when b { font-size: 17px; font-variant-numeric: tabular-nums; }
.bk-result-when span, .bk-result-who span { font-size: 14px; }
.bk-result-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.bk-result-who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-results-empty { margin: 10px 0 0; }
.bk-filter { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 10px 10px 16px;
  border-radius: var(--radius); background: var(--accent-soft); }
.bk-filter .btn { margin-left: auto; }
@media (max-width: 640px) { .bk-result { grid-template-columns: 1fr auto; } .bk-result-when { flex-direction: row; gap: 8px; align-items: baseline; } .bk-result-who { grid-column: 1 / -1; grid-row: 2; } }

/* Updates & licence: entering a key or loading a licence file, inside the Licence card */
.licence-entry { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.licence-entry > summary { cursor: pointer; font-weight: 600; color: var(--accent); list-style: none; min-height: 40px; display: flex; align-items: center; }
.licence-entry > summary::-webkit-details-marker { display: none; }
.licence-entry > summary::after { content: "›"; margin-left: 6px; transition: transform .15s; }
.licence-entry[open] > summary::after { transform: rotate(90deg); }
.licence-entry .licence-upload { margin-top: 8px; }
.pill-on { background: var(--accent-soft); color: var(--text); }

/* The QR code's place while the card is being made (the pop-up opens at once) */
.wallet-body { display: grid; gap: 14px; }
.wallet-qr-wait { background: var(--surface-2); color: var(--muted); animation: wallet-wait 1.2s ease-in-out infinite alternate; }
@keyframes wallet-wait { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .wallet-qr-wait { animation: none; } }

/* Cash: what the amount handed over is made of, when it's more than one thing ("£10 + £4.50") */
.cash-breakdown { min-height: 20px; margin-top: -6px; text-align: right; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Money pads: a point key, and Clear beside the amount (the pad's bottom row is . 0 delete) */
.key-point { font-size: 48px; font-weight: 800; line-height: 1; padding-bottom: 14px; }
.pad-clear-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: -4px; }
.pad-modal .pad-clear-row { justify-content: flex-end; }
.pad-clear { border: 0; background: none; color: var(--accent); font: inherit; font-size: 16px; font-weight: 600; min-height: 40px;
  padding: 0 4px; cursor: pointer; }
.pad-clear:active { opacity: .6; }

/* Client records: centred on the screen, like a booking */
.clients-page, .client-page { width: 100%; margin: 0 auto; }
.clients-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.client-search { position: relative; display: block; max-width: 620px; }
.client-search > .i { position: absolute; left: 20px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.client-search .input { padding-left: 56px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.client-rows { display: grid; gap: 8px; }
.client-row { display: grid; grid-template-columns: 1fr auto 20px; gap: 12px; align-items: center; padding: 14px 18px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.client-row:hover { background: var(--surface-2); }
.client-row-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.client-row-name .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-flag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 13px;
  font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.client-alert-banner { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 14px 18px; border-radius: var(--radius);
  background: var(--warn-soft); color: var(--warn); }
.client-alert-banner strong { font-size: 17px; }
.client-alert-banner span { color: var(--text-2); }
.client-alert { display: block; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--warn);
  text-decoration: none; font-size: 15px; }
.client-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.client-stats .admin-card { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.client-stats span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.client-stats strong { font-size: 24px; letter-spacing: -0.02em; }
.client-form { padding: 18px 22px; gap: 14px; }
.client-notes { min-height: 84px; padding: 12px 16px; line-height: 1.4; resize: vertical; cursor: text; }
.client-consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.client-consent input { width: 24px; height: 24px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.client-consent > span { display: flex; flex-direction: column; gap: 2px; }
.client-status { font-weight: 600; } .client-status.bad { color: var(--bad); }
.client-add > summary { cursor: pointer; font-weight: 600; color: var(--accent); min-height: 40px; display: flex; align-items: center; }
.client-add[open] > summary { margin-bottom: 8px; }
.client-colour { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.client-link { color: var(--text); text-decoration: none; }
.client-booking { display: grid; gap: 10px; padding: 14px 18px; }
.client-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--accent-soft); }
.client-chosen > span { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.client-chosen .btn { margin-left: auto; }
.client-suggest { display: grid; gap: 6px; }
.client-suggest:empty { display: none; }
.client-pick { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; text-align: left; padding: 12px 14px; border: 0; border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.client-pick:hover { background: var(--surface-3); }
.diary-booking .bk-flag { flex: none; font-weight: 800; color: #fff; background: var(--alert-line); border-radius: 6px; padding: 0 5px; font-size: 12px; }
.diary-booking.is-flagged, .diary-booking.is-flagged.is-done { background: var(--alert-bg); color: var(--alert-ink); box-shadow: inset 6px 0 0 var(--alert-line); padding-left: 14px; }
.diary-booking.is-flagged.is-no_show { opacity: .7; }
@media (max-width: 640px) { .client-row { grid-template-columns: 1fr 20px; } .client-row .client-flag { grid-column: 1; } }

/* Sell: the search box beside the category tabs */
.sell-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; flex: none; }
.sell-tools .tabs { flex: 0 1 auto; min-width: 0; }
.tile-search { position: relative; flex: 0 1 300px; min-width: 220px; }
.tile-search > .i { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tile-search .input { min-height: 52px; padding-left: 46px; padding-right: 46px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow);
  text-overflow: ellipsis; }
.tile-search .input:placeholder-shown { padding-right: 16px; }  /* room for the clear button only once something's typed */
.tile-search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; cursor: pointer; }
.tile-search-clear .i { width: 18px; height: 18px; }
.sell.is-searching .tabs .chip.on { background: transparent; box-shadow: none; color: var(--text-2); }
.tile-none { margin: 0; }

/* Bookings: the No-shows figure opens the week's list */
.bk-stat-link { text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; }
.bk-stat-link:hover { background: var(--surface-2); }
.bk-stat-link u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.bk-missed { display: grid; gap: 8px; padding: 16px 18px; margin-top: 12px; }
.bk-missed-head { display: flex; justify-content: space-between; align-items: center; }
.bk-missed .bk-result { box-shadow: none; background: var(--surface-2); }

/* ---------------------------------------------------------- self-employed (add-on) */
.se-page { max-width: 980px; margin: 0 auto; width: 100%; }
.se-week { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.se-week strong { font-size: 18px; }
.se-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.se-stats .admin-card { padding: 16px 20px; display: flex; flex-direction: column; gap: 4px; }
.se-stats .admin-card > span { color: var(--muted); font-size: 14px; font-weight: 600; }
.se-stats .admin-card > strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.se-stats .se-due { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); }
.se-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.se-person { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; color: inherit; text-decoration: none; }
.se-person:active { opacity: .8; }
.se-person-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.se-person-head .avatar { background: var(--c); }
.se-person-head small { display: block; font-size: 13px; }
.se-sums { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-variant-numeric: tabular-nums; }
.se-sums dt { color: var(--muted); }
.se-sums dd { margin: 0; text-align: right; font-weight: 600; }
.se-take { border-radius: 12px; padding: 10px 14px; background: var(--accent-soft, var(--surface-2)); font-weight: 600; }
.se-take strong { font-size: 18px; }
.se-take.is-done { background: var(--go-bg); color: var(--go-ink); }
.se-bill { padding: 14px 22px; display: grid; gap: 2px; font-variant-numeric: tabular-nums; }
.se-bill > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; border-bottom: 1px solid var(--line); }
.se-bill-total { font-weight: 700; font-size: 17px; }
.se-bill-total.se-due strong { color: var(--accent); }
.se-paid { display: inline-flex; align-items: center; gap: 4px; }
.se-pay { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding-top: 14px; }
.se-pay .field { width: 160px; }
.se-terms { padding: 18px 22px; }
.se-prices { padding: 6px 22px 12px; margin-bottom: 12px; }
.se-prices-title { font-size: 15px; margin: 12px 0 4px; }
.se-price-row { display: grid; grid-template-columns: 1fr 130px auto auto; gap: 12px; align-items: center; min-height: 56px;
  border-bottom: 1px solid var(--line); }
.se-price-row:last-of-type { border-bottom: 0; }
.se-price-name { display: flex; flex-direction: column; min-width: 0; }
.se-price-name small { font-size: 13px; }
.se-price-input { min-height: 44px; text-align: right; }
.se-price-fixed { text-align: right; font-weight: 600; padding-right: 12px; }
.se-offer { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
@media (max-width: 640px) { .se-price-row { grid-template-columns: 1fr 110px; } }
.se-summary { font-size: 18px; margin: 4px 0 0; }
.se-took { font-variant-numeric: tabular-nums; }
.se-took strong { font-size: 20px; }
.se-hint { margin: 0 4px 10px; }
.se-sales > summary { font-weight: 600; }
.se-sales .calm-list { margin-top: 10px; }
.se-terms { padding: 18px 22px; display: grid; gap: 16px; }
.se-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.se-kind { display: block; cursor: pointer; }
.se-kind input { position: absolute; opacity: 0; pointer-events: none; }
.se-kind > span { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border-radius: 14px;
  background: var(--surface-2); border: 2px solid transparent; }
.se-kind > span small { color: var(--muted); font-size: 13px; }
.se-kind input:checked + span { border-color: var(--accent); background: var(--surface); box-shadow: var(--lift); }
.se-kind input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.se-terms .se-if-share, .se-terms .se-if-rent { display: none; }
.se-terms:has(input[name=kind][value=self_employed]:checked) .se-if-share,
.se-terms:has(input[name=kind][value=self_employed]:checked) .se-if-rent,
.se-terms:has(input[name=kind][value=chair]:checked) .se-if-rent,
.se-terms:has(input[name=kind][value=room]:checked) .se-if-rent { display: grid; }
.se-terms:has(input[name=kind][value=self_employed]:checked) .se-if-rent label::after { content: " (optional)"; color: var(--muted); font-weight: 400; }
.se-terms:has(input[name=kind][value=self_employed]:checked) .se-if-rent .help { display: none; }
.se-inline { display: flex; align-items: center; gap: 8px; max-width: 160px; }
.se-terms .field { max-width: 420px; }
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.email-receipt-modal { width: min(460px, 92vw); display: grid; gap: 14px; }
.split-note { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; }
.pay-staff-modal { width: min(560px, 94vw); display: grid; gap: 14px; }
.pay-staff-list { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.pay-staff-row { display: grid; grid-template-columns: 1fr auto 150px; gap: 12px; align-items: center; min-height: 56px; border-bottom: 1px solid var(--line); }
.pay-staff-tips { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }

/* The top bar on a till-sized screen: every tab fits (Admin was cut off with Bookings and Clients on) */
@media (max-width: 1400px) {
  .topbar { gap: 10px; padding: 0 16px; }
  .nav a { padding: 0 14px; }
  .brand { min-width: 0; }
}
@media (max-width: 1240px) {
  .who-chip .who-name, .brand-sub { display: none; }  /* the avatar letter still says who's in */
}
.split-note > span { flex: 1; }
.paid-list { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.paid-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.paid-row { display: grid; grid-template-columns: 1fr auto 32px; align-items: center; gap: 8px; min-height: 34px; }
.paid-row > span { display: inline-flex; align-items: center; gap: 6px; }
.paid-row .i { color: var(--good, #1f8a4c); }
.paid-left { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; font-weight: 700; grid-template-columns: 1fr auto 32px; }
.paid-left.bad { color: var(--bad); }
.paid-undo { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: none; border: 0; color: var(--muted); cursor: pointer; }
.paid-undo:hover { background: var(--fill); }
.pay .btn small { display: block; }
/* freelancers: room to breathe between each part */
.se-stack { display: grid; gap: 22px; }
.se-stack > .calm-section { margin: 0; }
.se-stack .calm-label { margin: 0 4px 10px; }
.se-stack .se-summary { margin: 0; }
.se-stack .calm-crumb { margin-bottom: 0; }
.se-pay { align-items: flex-end; padding: 18px 22px; }
.se-bill > div:last-child { border-bottom: 0; }
.se-login { padding: 16px 22px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.se-login form { margin: 0; }
.se-row { grid-template-columns: 44px 1fr 24px; }
.se-row .avatar { color: #fff; }
.se-new { width: min(640px, 94vw); display: grid; gap: 14px; }
.se-new .se-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.se-rule { margin: 0; }
.admin-page.se-page { gap: 22px; }
.pay .btn { white-space: nowrap; }
.pay .card-btn { line-height: 1.15; }
.paid-row .i { color: inherit; }
.paid-row > span .i { color: var(--good, #1f8a4c); }
/* Card payment: the amount, the pad and what's left each get their own space */
.card-step-amount { display: grid; gap: 12px; }
.card-step-amount .label { margin: 0; }
.card-step-amount .card-charge { margin: 0 0 4px; }
.card-step-amount .card-left { text-align: center; margin: 4px 0 2px; }
.card-step-amount .modal-actions { margin-top: 4px; }
/* Record what a freelancer paid: the amount, how, and the button on one line, all the same height */
.se-pay { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; }
.se-pay .field { width: 180px; margin: 0; gap: 6px; }
.se-pay .input { min-height: 52px; }
.se-pay [data-toggle-group].pills { align-self: flex-end; }
.se-pay [data-toggle-group].pills [data-value] { min-height: 44px; }
.se-pay .btn { min-height: 52px; }
/* Blocked time on the diary: a break, lunch... striped, so it reads as "not bookable" */
.diary-block { position: absolute; left: 4px; right: 4px; margin: 0; z-index: 2; }
.diary-block button { width: 100%; height: 100%; border: 0; border-radius: 10px; padding: 6px 10px; text-align: left;
  font: inherit; font-size: 13px; color: var(--text-2); cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--fill) 8px 16px); box-shadow: inset 0 0 0 1px var(--line); }
.diary-block button b { color: var(--text); margin-right: 4px; }
.diary-block button:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.client-owners { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.client-owners .chip b { margin-left: 4px; color: var(--muted); font-weight: 600; }
.client-owner { color: var(--text); }
/* patch tests: products ticked, each with its result; the client's signature */
.patch-products { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.patch-product { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.patch-product label { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.patch-product input[type=checkbox] { width: 22px; height: 22px; }
.patch-result [data-value] { min-height: 36px; padding: 0 14px; }
.signature-pad { width: 100%; max-width: 560px; height: 160px; border-radius: 14px; background: #fff; touch-action: none;
  box-shadow: inset 0 0 0 2px var(--line); cursor: crosshair; }
.signature-field .btn { justify-self: start; }
.patch-signed { display: inline-block; margin-left: 6px; }
.patch-signed summary { color: var(--good, #1f8a4c); cursor: pointer; font-weight: 600; }
.patch-signed img { display: block; margin-top: 6px; background: #fff; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--line); }
/* bookings and blocked time sit inside their column with a little room all round: one at the very top of the
   day no longer touches (and gets clipped by) the column's rounded corner */
.diary-booking, .diary-block { left: 6px; right: 6px; margin-top: 3px; }
/* New booking, in order: who's coming, what and who with, when */
.bk-step { display: flex; align-items: center; gap: 10px; margin: 6px 0 0; font-size: 17px; }
.bk-step > span { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
  background: var(--accent); color: var(--accent-ink, #fff); }
.bk-step:first-of-type { margin-top: 0; }
/* Email reminder: the customer's choice; their email is asked for only once they say yes */
.bk-remind { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; min-width: 0; }
.bk-remind legend { padding: 0; margin-bottom: 8px; }
.bk-remind-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.bk-remind-choice { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: 12px; font-weight: 600; cursor: pointer; }
.bk-remind-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.bk-remind-choice input { width: 20px; height: 20px; accent-color: var(--accent); }
.bk-remind:not(:has(input[value="yes"]:checked)) .bk-remind-email { display: none; }
.bk-last { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px;
  border-radius: 14px; background: var(--surface-2); }
.bk-last:empty { display: none; }
#bk-last:empty { display: none; }
/* an online booking request, waiting for the salon to confirm it: dashed, so it reads as "not booked yet" */
.diary-booking.is-requested { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); border: 0;
  background-image: repeating-linear-gradient(135deg, transparent 0 10px, var(--accent-soft, rgba(0,0,0,.04)) 10px 20px); }
.ob-notice { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 18px;
  border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent), var(--shadow); margin-bottom: 14px; }
.ob-notice strong { font-size: 17px; }
.ob-req { display: grid; gap: 10px; padding: 16px 20px; }
.ob-req-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.ob-req-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ob-req-actions form { margin: 0; }
.ob-decline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ob-decline select { max-width: 320px; }
.ob-link { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 18px 22px; }
.ob-link .ob-url { font-size: 18px; font-weight: 600; word-break: break-all; }
.ob-qr { width: 132px; height: 132px; background: #fff; border-radius: 12px; padding: 8px; }
.ob-qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 640px) { .ob-link { grid-template-columns: 1fr; } }
/* A client's record: the quick actions under their name */
.client-quick { margin-bottom: 4px; }
.client-quick .calm-action strong { display: flex; align-items: center; gap: 8px; }
.client-quick .calm-action .i { width: 18px; height: 18px; flex: none; }
.client-quick .calm-action.is-warn { border-color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn), 0 1px 0 rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .10); }
.client-owner-pick { justify-content: space-between; }
.client-owner-pick label { cursor: pointer; }
.client-owner-pick .input { min-height: 44px; margin-top: 4px; }

/* The selected option, everywhere a row of choices sits on a grey track (option pills like "What for", tabs,
   Sell's categories, section tabs, the top menu, light/dark): a slight gradient in the shop's colour and a fine
   outline in it, so the choice stands out on a light background as well as a dark one. */
:root { --on-bg: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 25%, var(--surface)) 0%,
                                         color-mix(in srgb, var(--accent-soft) 95%, var(--surface)) 100%);
        --on-ring: inset 0 0 0 1.5px color-mix(in srgb, var(--accent-base) 60%, transparent); }
.segmented button.on, [data-toggle-group] [data-value].on, .seg-btn.on, .chip.on, .tabs .chip.on, .section-tabs a.on,
.appearance a.on, .nav a.on,
[data-theme="dark"] .segmented button.on, [data-theme="dark"] [data-toggle-group] [data-value].on,
[data-theme="dark"] .tabs .chip.on, [data-theme="dark"] .section-tabs a.on {
  background: var(--on-bg); box-shadow: var(--lift), var(--on-ring); color: var(--text); font-weight: 600;
}
[data-toggle-group].cards [data-value].on { background: var(--on-bg); box-shadow: var(--on-ring); }
.sell.is-searching .tabs .chip.on { background: transparent; box-shadow: none; font-weight: inherit; }
/* Diary: the period being dragged out on a column */
.diary-track { touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; }
.diary-track a { -webkit-user-drag: none; }
.diary-drag { position: absolute; left: 4px; right: 4px; z-index: 3; border-radius: 10px; pointer-events: none;
  background: color-mix(in srgb, var(--accent-base) 22%, transparent); box-shadow: inset 0 0 0 2px var(--accent-base);
  display: flex; align-items: flex-start; padding: 4px 8px; }
.diary-drag span { font-size: 13px; font-weight: 700; color: var(--text); background: var(--surface); border-radius: 6px; padding: 1px 6px;
  white-space: nowrap; }
.diary-choose { width: min(520px, 100%); }
.diary-choose .calm-action strong { display: flex; align-items: center; gap: 8px; }
.diary-choose .calm-action .i { width: 18px; height: 18px; }
/* Admin, Other devices */
.device-add { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; justify-content: space-between; }
.device-steps { flex: 1 1 320px; }
.device-steps ol { margin: 8px 0 14px; padding-left: 22px; color: var(--text-2); } .device-steps li { margin: 6px 0; }
.device-for { margin: 0; }
.device-url { color: var(--text); word-break: break-all; }
.device-code { font-size: 44px; font-weight: 800; letter-spacing: .12em; font-variant-numeric: tabular-nums; margin: 4px 0 14px; }
.device-qr { width: 180px; height: 180px; flex: none; }
.device-name-form { display: grid; gap: 10px; width: 100%; }
.device-name-form .btn-row { flex-wrap: nowrap; } .device-name-form .input { flex: 1; min-width: 0; }
.device-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.device-rename[open] summary { display: none; }
.device-rename summary { list-style: none; } .device-rename summary::-webkit-details-marker { display: none; }
.device-safe p { margin: 0 0 10px; color: var(--text-2); } .device-safe p:last-child { margin: 0; }
.device-fp { font-family: ui-monospace, Menlo, Consolas, monospace; word-spacing: 4px; }
.device-pair-card { max-width: 440px; width: 100%; display: grid; gap: 14px; }
.device-pair-card h1 { margin: 0; font-size: 22px; } .device-pair-card p { margin: 0; color: var(--text-2); }
.device-code-input { font-size: 32px; text-align: center; letter-spacing: .2em; font-variant-numeric: tabular-nums; }
/* ---------------------------------------------------------- iPads and tablets (staff on the shop's network)
 * Portrait (768-834 wide): every tab still fits in the top bar, and two columns of tiles beside the basket.
 * Landscape (about 768-820 tall): the basket keeps room for its lines, and the panel scrolls rather than squash them. */
@media (max-width: 900px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar > .brand { display: none; }  /* the logo stays */
  .nav a { padding: 0 11px; font-size: 15px; }
  .who-chip > .i { display: none; }
  .sell { grid-template-columns: minmax(0, 1fr) minmax(330px, 380px); gap: 14px; padding: 4px 12px 12px 14px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .tile { min-height: 112px; padding: 14px; }
  .tile .price { font-size: 21px; }
}
@media (max-width: 1180px) {  /* a narrower basket: big totals still fit on the payment buttons */
  .pay { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .pay .btn-xl { font-size: 18px; padding-inline: 10px; }
}
@media (max-height: 860px) and (min-width: 700px) {
  .topbar { height: 68px; }
  .basket { overflow-y: auto; overscroll-behavior: contain; }
  .basket-lines { flex: 1 1 0; min-height: 190px; }  /* about two lines, always */
  .basket-head { padding-top: 12px; min-height: 52px; }
  .line { padding: 8px 12px; }
  .basket-foot { gap: 10px; padding-top: 10px; }
  .loyalty-card { gap: 6px; padding: 10px 14px; }
  .stamps { grid-template-columns: repeat(auto-fill, 24px); gap: 6px; }
  .stamp { width: 24px; height: 24px; }
  .loyalty-card .stamps { display: none; }  /* "8 / 8 stamps" says it: the payment buttons stay in view */
  .loyalty-reward .btn { min-height: 48px; }
  .basket-lines { min-height: 170px; }
}
.device-homescreen { font-size: 15px; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.device-warn { display: grid; gap: 8px; padding: 18px 22px; box-shadow: inset 0 0 0 2px var(--warn); }
.device-warn > strong { display: flex; align-items: center; gap: 8px; }
.device-warn p, .device-warn ol { margin: 0; color: var(--text-2); } .device-warn ol { padding-left: 22px; } .device-warn li { margin: 4px 0; }
.device-warn code { display: block; margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text);
  font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: all; }
.device-warn .btn-row { margin-top: 4px; }
.device-other-address { display: grid; gap: 8px; margin: 0 0 14px; color: var(--text-2); font-size: 15px; }
.device-ports { margin: -8px 4px 0; color: var(--text-2); font-size: 15px; } .device-ports strong { color: var(--text); word-break: break-all; }
.device-note { margin: -8px 4px 0; color: var(--text-2); font-size: 15px; }
.device-seen { display: flex; gap: 8px; align-items: flex-start; } .device-seen .i { color: var(--good, #1f8a4c); flex: none; margin-top: 2px; }
.device-warn ul { margin: 0; padding-left: 22px; color: var(--text-2); } .device-warn li { margin: 4px 0; }
.device-fix { display: grid; gap: 10px; margin-top: 4px; } .device-fix p { margin: 0; font-size: 14px; }
.device-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.device-check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--primary-bg); }
.device-help summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.device-help { padding: 8px 22px; } .device-help ol { margin: 4px 0 14px; padding-left: 22px; color: var(--text-2); }
.device-help li { margin: 8px 0; } .device-fix-again { margin-top: 8px; align-items: center; }
.device-seen-card { padding: 16px 22px; display: grid; gap: 12px; }
.device-selftest { margin: 0 0 10px; display: grid; gap: 6px; font-size: 15px; }
.device-selftest span { display: flex; gap: 8px; align-items: flex-start; } .device-selftest .i { flex: none; margin-top: 2px; }
.device-selftest .ok .i, .device-seen-table .ok { color: var(--good, #1f8a4c); } .device-selftest .bad, .device-seen-table .bad { color: var(--bad); }
.device-seen-table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.device-seen-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 8px 6px 0; }
.device-seen-table td { padding: 8px 8px 8px 0; border-top: 1px solid var(--line); }
.device-phone-note { margin: 0 0 12px; font-size: 14px; color: var(--text-2); background: var(--surface-2); border-radius: 12px; padding: 10px 14px; }
.device-log { padding: 8px 22px; }
.device-log summary { cursor: pointer; min-height: 48px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 8px 0; }
.device-log summary span { font-size: 14px; } .device-log[open] summary { margin-bottom: 8px; }
.device-log .device-seen-list { padding-bottom: 12px; overflow-x: auto; }
.device-selftest-bad { display: flex; gap: 8px; align-items: flex-start; color: var(--bad); } .device-selftest-bad .i { flex: none; margin-top: 2px; }
.device-selftest-bad span { color: var(--text-2); }
/* Admin menu: its own scroll (a long list never drags the page), headed groups; grouped pages have pills on top. */
.admin-nav { max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 6px 12px 2px; scrollbar-width: thin; }
.admin-nav-head { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  padding: 14px 16px 4px; }
.admin-nav-head:first-child { padding-top: 4px; }
.admin-pills { display: flex; width: max-content; max-width: 100%; margin: 0 0 20px; }
.admin-pills a { white-space: nowrap; }
@media (max-width: 1000px) { .admin-nav { max-height: none; overflow: visible; padding: 0; } .admin-nav-head { display: none; } }
.licence-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.licence-modal { width: min(760px, 100%); max-height: min(86vh, 900px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; }
.licence-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.licence-modal-head h2 { margin: 0; font-size: 22px; }
.licence-text { margin: 0; overflow: auto; font-size: 15px; line-height: 1.55; color: var(--text-2);
  background: var(--surface-2); border-radius: 12px; padding: 16px 18px; }
/* ---------------------------------------------------------- tablets (768-1000 wide): room to breathe, nothing spills
 * Two cards side by side become one above the other, attention cards each get the width, tables drop the columns
 * that matter least (a sale's type and discount are on its receipt), and short diary bookings show the whole name. */
@media (max-width: 1000px) {
  .col-wide { display: none; }
  .sales-table .items-cell { max-width: 220px; }
  .table th, .table td { padding: 11px 8px; }
  .diary-booking.lines-1 .bk-more { display: none; }  /* tap it for the service */
  .diary-booking { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 900px) {
  .main { padding: 8px 18px 22px; }
  .attention { grid-template-columns: 1fr; }
  .dash-group .grid-2 { grid-template-columns: 1fr; }
  .calm-title { font-size: 28px; }
  .table { font-size: 15px; }
  .admin-layout { gap: 14px; }
}
/* The day and time chips' radio buttons are hidden by position: keep them inside their chip, or a long row of days
   stretches the whole page sideways (they'd escape the row's own scrolling). */
.bk-day, .bk-time { position: relative; }
.licence-text p { margin: 0 0 12px; } .licence-text p:last-child { margin: 0; }

/* ================================================================ Help: the Help Centre, the Help panel, ? pop-ups,
   guided tours (Driver.js, restyled to match) and Get set up */
.btn-help { min-height: 52px; padding: 0 16px; gap: 8px; }
.help-page { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding-bottom: 56px; }
.help-hero { display: flex; flex-direction: column; gap: 10px; }
.help-hero p { margin: 0; font-size: 17px; }
.help-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 6px 6px 6px 20px; box-shadow: var(--shadow); }
.help-search > .i { width: 22px; height: 22px; color: var(--muted); flex: none; }
.help-search .input { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; font-size: 18px; min-height: 52px; padding: 0 4px; }
.help-search .input:focus-visible { outline: none; }
.help-search:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.help-search .btn { flex: none; }
.help-search-sm { margin-top: 8px; }
.help-list { background: var(--surface); border-radius: var(--radius-lg); padding: 4px 20px; box-shadow: var(--shadow); }
.help-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 64px; padding: 10px 0;
  border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.help-row:last-child { border-bottom: 0; }
.help-row:active { opacity: .7; }
.help-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.help-row-main strong { font-size: 17px; }
.help-row-main small { font-size: 14px; color: var(--muted); line-height: 1.4; }
.help-row-main em { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.help-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; min-height: 112px; }
.help-card strong { font-size: 17px; }
.help-card span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.help-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.help-cat { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.help-cat > span:last-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.help-cat small { color: var(--muted); font-size: 14px; line-height: 1.35; }
.help-cat em { font-style: normal; font-size: 13px; color: var(--accent); font-weight: 600; }
.help-cat-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); flex: none; }
.help-cat-icon .i { width: 22px; height: 22px; }
.help-two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.help-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.help-none { margin: 0; padding: 18px 0; }
.help-tour-btn { gap: 8px; align-self: flex-start; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* an article */
.help-article { display: flex; flex-direction: column; gap: 14px; }
.help-lead { margin: 0; font-size: 19px; color: var(--text-2); line-height: 1.5; }
.help-body { font-size: 17px; line-height: 1.6; max-width: 68ch; }
.help-body > * { margin: 0 0 16px; }
.help-body h2 { font-size: 22px; margin-top: 26px; letter-spacing: -0.01em; }
.help-body ol, .help-body ul { padding: 0 0 0 26px; background: none; box-shadow: none; border-radius: 0; }
.help-body li { margin: 6px 0; padding-left: 4px; }
.help-body ol.help-steps { list-style: none; counter-reset: step; padding-left: 0; }
.help-body ol.help-steps > li { counter-increment: step; position: relative; padding-left: 44px; min-height: 32px; }
.help-body ol.help-steps > li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 15px; }
.help-body a { color: var(--accent); }
.help-fig { margin: 8px 0 20px; }
.help-fig img { display: block; width: 100%; height: auto; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line), var(--shadow); background: var(--surface); }
.help-fig-s { max-width: 320px; } .help-fig-m { max-width: 560px; } .help-fig-l { max-width: 100%; }
.help-fig figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.help-note { display: flex; gap: 12px; align-items: baseline; padding: 14px 18px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); }
.help-note strong { flex: none; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.help-note-warn { background: var(--warn-soft); }
.help-note-warn strong { color: var(--warn); }
.help-note span { min-width: 0; }  /* (not .help-tip: that's the ? icon) */
.help-owner { margin: 0; font-size: 14px; }

/* the Help panel: beside the screen, no backdrop, so a sale in progress stays usable */
.help-panel { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(420px, calc(100vw - 24px)); z-index: 45; display: flex;  /* under pop-ups and the on-screen keyboard (50) */
  flex-direction: column; background: var(--surface); border-radius: var(--radius-xl); box-shadow: 0 8px 40px rgba(0, 0, 0, .18), 0 0 0 1px var(--line); }
.help-panel[hidden] { display: none; }
.help-panel-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.help-panel-head h2 { margin: 0; flex: 1; font-size: 20px; }
.help-panel-head button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.help-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; outline: none; overscroll-behavior: contain; }
.help-panel-home, .help-panel-body > .help-list { display: flex; flex-direction: column; gap: 12px; }
.help-panel-body .help-list { box-shadow: none; padding: 0; background: none; }
.help-panel-body .help-search { box-shadow: 0 0 0 1px var(--line); }
.help-panel-h { margin: 14px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.help-panel-tours { display: flex; flex-direction: column; gap: 8px; }
.help-panel-tours .btn { justify-content: flex-start; }
.help-panel-foot { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.help-article-panel h2 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.help-article-panel .help-lead { font-size: 17px; }
.help-article-panel .help-body { font-size: 16px; }
.help-article-panel .help-fig-s, .help-article-panel .help-fig-m { max-width: 100%; }
.help-panel-body .setup-card { box-shadow: 0 0 0 1px var(--line); }
@media (max-width: 640px) {
  .help-panel { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; }
  .help-two { grid-template-columns: 1fr; }
  .btn-help span { display: none; }
}

/* the ? next to a figure or setting */
.help-tip { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; border-radius: 50%; vertical-align: middle;
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; flex: none;
  box-shadow: inset 0 0 0 1px var(--line); text-transform: none; letter-spacing: 0; }
.help-tip:hover, .help-tip:focus-visible { background: var(--accent-soft); color: var(--accent); outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.help-tip::after { content: ""; position: absolute; inset: -11px; }   /* a bigger target for a finger */
.help-tip { position: relative; }
.help-pop { position: fixed; z-index: 48; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .2), 0 0 0 1px var(--line); font-size: 15px; line-height: 1.45; }
.help-pop[hidden] { display: none; }
.help-pop strong { display: block; margin-bottom: 4px; font-size: 16px; }
.help-pop p { margin: 0 0 8px; }
.help-pop a { color: var(--accent); font-weight: 600; }

/* guided tours: Driver.js in the till's own look */
.driver-popover.till-tour { background: var(--surface); color: var(--text); border-radius: var(--radius-lg); padding: 20px 22px 16px; max-width: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .25); font-family: var(--font); }
.driver-popover.till-tour .driver-popover-title { font-size: 19px; font-weight: 700; font-family: var(--font); }
.driver-popover.till-tour .driver-popover-description { font-size: 16px; line-height: 1.5; color: var(--text-2); margin-top: 6px; }
.driver-popover.till-tour .driver-popover-progress-text { color: var(--muted); font-size: 14px; }
.driver-popover.till-tour .driver-popover-footer { margin-top: 16px; gap: 8px; flex-wrap: wrap; align-items: center; }
.driver-popover.till-tour .driver-popover-navigation-btns { gap: 8px; }
.driver-popover.till-tour button { min-height: 44px; padding: 0 16px; border-radius: 999px; font: 600 15px var(--font); text-shadow: none; border: 0;
  background: var(--fill); color: var(--text); }
.driver-popover.till-tour .driver-popover-next-btn { background: var(--primary-bg); color: var(--primary-ink); }
.driver-popover.till-tour .driver-popover-close-btn { min-height: 0; width: 36px; height: 36px; padding: 0; background: transparent; color: var(--muted); }
.driver-popover.till-tour .till-tour-skip { background: transparent; color: var(--muted); padding: 0 6px; margin-right: auto; }
.driver-popover.till-tour .driver-popover-arrow-side-left.driver-popover-arrow { border-left-color: var(--surface); }
.driver-popover.till-tour .driver-popover-arrow-side-right.driver-popover-arrow { border-right-color: var(--surface); }
.driver-popover.till-tour .driver-popover-arrow-side-top.driver-popover-arrow { border-top-color: var(--surface); }
.driver-popover.till-tour .driver-popover-arrow-side-bottom.driver-popover-arrow { border-bottom-color: var(--surface); }
.tour-offer { position: fixed; left: 16px; bottom: 16px; z-index: 42; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  max-width: min(520px, calc(100vw - 32px)); padding: 12px 14px 12px 18px; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .18), 0 0 0 1px var(--line); font-size: 15px; }
.tour-offer > span:first-child { display: flex; gap: 10px; align-items: center; }
.tour-offer > span:first-child .i { color: var(--accent); width: 20px; height: 20px; flex: none; }
.tour-offer-btns { display: flex; gap: 6px; margin-left: auto; }

/* Admin, Help Centre */
.help-filter .tile-search { flex: 1 1 220px; }
.help-filter select.input { width: auto; flex: 0 1 220px; }
.help-admin-row { grid-template-columns: minmax(0, 1fr) auto 24px; }
.help-newcat { display: flex; gap: 10px; flex-wrap: wrap; }
.help-newcat .input { flex: 1 1 260px; }
.help-sync { padding: 16px 22px; display: flex; flex-direction: column; gap: 10px; }
.help-sync p { margin: 0; }
.help-edit-page { max-width: 820px; }
.help-edit { display: flex; flex-direction: column; gap: 22px; }
.help-meta { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }
.help-check { display: flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.help-check input { width: 22px; height: 22px; }
.help-more summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.help-more[open] { display: flex; flex-direction: column; gap: 14px; }
.help-blocks { display: flex; flex-direction: column; gap: 12px; }
.hb { background: var(--surface); border-radius: var(--radius-lg); padding: 10px 16px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.hb-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hb-kind { display: inline-flex; align-items: center; gap: 6px; flex: 1; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.hb-kind .i { width: 16px; height: 16px; }
.hb-bar .qty-btn { width: 40px; height: 40px; background: var(--surface-2); }
.hb-bar .qty-btn[disabled] { opacity: .3; }
.hb-add { width: auto; min-height: 40px; padding: 0 10px; font-size: 14px; border-radius: 999px; background: var(--surface-2); border: 0; color: var(--text); }
.hb textarea.input { resize: vertical; line-height: 1.5; font: 16px/1.5 var(--font); padding-top: 12px; padding-bottom: 12px; }
.hb-t-tip { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.hb-t-warn { box-shadow: inset 4px 0 0 var(--warn), var(--shadow); }
.hb-t-h .input { font-weight: 700; }
.hb-img { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 14px; align-items: start; }
.hb-img img { width: 100%; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.hb-img-fields { display: flex; flex-direction: column; gap: 8px; }
.help-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.help-add .chip .i { width: 16px; height: 16px; }
.help-edit.dropping .help-blocks { outline: 3px dashed var(--accent); outline-offset: 6px; border-radius: var(--radius-lg); }
.help-edit-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 12px 14px; margin: 0 -14px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--bg);
  box-shadow: 0 -8px 20px -12px rgba(0, 0, 0, .25); }
.help-edit-more { justify-content: flex-start; }
@media (max-width: 640px) { .hb-img { grid-template-columns: 1fr; } .help-edit-actions .btn { flex: 1; } }

/* Get set up */
.setup-card { display: flex; flex-direction: column; gap: 12px; padding: 18px 22px; border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow), inset 0 0 0 2px var(--accent-soft); margin-bottom: 18px; }
.setup-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setup-card-top > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.setup-card-top strong { font-size: 18px; }
.setup-card-top span { color: var(--muted); font-size: 15px; }
.setup-ring { --pct: 0; width: 56px; height: 56px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--primary-bg) calc(var(--pct) * 1%), var(--surface-3) 0); }
.setup-ring span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); font-size: 13px; font-weight: 700; }
.setup-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.setup-bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary-bg); transition: width .4s ease; }
.setup-bar-lg { height: 10px; }
.setup-page .kicker { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.setup-hero { display: flex; flex-direction: column; gap: 12px; }
.setup-hero p { margin: 0; font-size: 17px; max-width: 62ch; }
.setup-count { font-size: 16px !important; }
.gs-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.gs-step { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px 20px; border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow); scroll-margin-top: 90px; }
.gs-step h2 { margin: 0; font-size: 19px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gs-step p { margin: 6px 0 0; color: var(--text-2); line-height: 1.5; }
.gs-step .setup-how { color: var(--muted); }
.gs-step .btn-row { margin-top: 12px; align-items: center; }
.gs-step .btn .i { width: 18px; height: 18px; }
.setup-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); font-weight: 700; color: var(--muted); }
.gs-step.is-done .setup-mark { background: var(--go-bg); color: var(--go-ink); }
.gs-step.is-done, .gs-step.is-skipped { background: var(--surface); opacity: .82; }
.gs-step.is-done p:not(.setup-how), .gs-step.is-skipped p { color: var(--muted); }
.gs-step.is-next { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent); }
.gs-step.is-next .setup-mark { background: var(--accent-soft); color: var(--accent); }
.setup-state { font-weight: 600; }
.block-warn { padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow), inset 0 0 0 2px var(--warn); background: var(--warn-soft); }
.block-warn p { margin: 0; line-height: 1.5; }
.block-warn .btn-row form { margin: 0; }
@media (max-width: 640px) {
  .help-edit-actions { position: static; background: none; }        /* a phone: at the end of the form, not over the fields */
  .help-admin .cat-cat-row { grid-template-columns: auto minmax(0, 1fr); }
  .help-admin .cat-cat-row > .btn-row { grid-column: 1 / -1; justify-content: flex-end; }
  .help-admin .cat-name .meta { white-space: normal; }
}
@media (max-width: 480px) {
  .admin-page form > .form-grid { grid-template-columns: 1fr; }     /* two fields side by side don't fit a phone */
}
.restore-card { padding: 18px 22px; display: grid; gap: 14px; }
.restore-table td { vertical-align: middle; }
.restore-file { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.restore-file .btn-row { flex-wrap: wrap; align-items: center; }
.setup-restore { margin-top: 18px; }

/* About ShopSide and legal documents (app/legal.py) */
.about-facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.about-facts dt { color: var(--muted); font-weight: 600; }
.about-facts dd { margin: 0; }
.legal-doc { padding: 22px 26px; }
.legal-doc h1 { margin-top: 0; }
.legal-doc h2, .legal-doc h3 { margin-top: 1.4em; }
.legal-plain { white-space: pre-wrap; font: inherit; margin: 0; }
.plain-list { margin: 0; padding-left: 1.2em; }
@media print { .topbar, .admin-nav, .admin-pills, .no-print, .toast { display: none !important; } .legal-doc { box-shadow: none; padding: 0; } }
.about-card { padding: 16px 22px; }
.legal-docs td:not(:first-child), .acc-table td:not(:first-child) { white-space: nowrap; }
.legal-docs .btn-row, .acc-table .btn-row { flex-wrap: nowrap; }
.legal-docs td:first-child, .acc-table td:first-child { min-width: 14em; }

/* ---------------------------------------------------------- time clock: the dot on your name, the menu, the question */
.who-chip .avatar { position: relative; }
.clock-dot { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--bg, #1D1D1F); }
.clock-dot.is-in { background: #3FB971; }
.clock-dot.is-break { background: #E0A43A; }
.clock-menu { display: grid; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #4A5056; }
.clock-menu form { margin: 0; }
.clock-state { margin: 2px 4px; font-weight: 600; color: #D5D9DD; }  /* the menu is always dark */
.clock-box h1 { margin: 0; }
.clock-lede { margin: 0; font-size: 20px; color: var(--text-2); text-align: center; max-width: 30ch; }
.clock-actions { width: 100%; display: grid; gap: 12px; margin-top: 8px; }
.who-in { display: grid; gap: 8px; margin-top: 6px; }
.who-in-row { display: flex; gap: 10px; align-items: center; }
.who-in-row .avatar { position: relative; }
.avatar-sm .clock-dot { width: 11px; height: 11px; }
.not-in { margin-top: 10px; font-size: 15px; }
.hours-table .has-flag td { border-bottom: 0; }
.flag-row td { padding-top: 0; }
.flag { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; color: var(--warn, #E0A43A); font-weight: 600; }
.flag .i { width: 16px; height: 16px; }
.flag-actions { margin-top: 8px; }
.flag-actions form { margin: 0; }
.shift-card { display: grid; gap: 12px; padding: 16px 22px; margin-bottom: 14px; }
.add-pay summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.still-in { display: grid; gap: 10px; }
.still-in-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.still-in-row form { margin: 0; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 300px; display: grid; gap: 6px; padding: 8px;
  background: var(--surface, #2C3034); border: 1px solid #4A5056; border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.export-pop .btn { justify-content: flex-start; gap: 8px; white-space: nowrap; }
.export-label { padding: 6px 8px 0; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6e6e73); }
.set-break { display: inline-flex; gap: 6px; align-items: center; }
.set-break .input-sm { min-height: 40px; padding: 0 10px; }
/* A sale's history: made, paid, receipts emailed (where to), refunds */
.sale-history { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.sale-history h3 { margin: 0 0 8px; font-size: 15px; }
.sale-history ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sale-history .muted { display: inline-block; min-width: 128px; }
/* Start fresh: what to wipe, one tick each */
.wipe-choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.wipe-choice { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.wipe-choice:has(input:checked) { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, transparent); }
.wipe-choice input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.wipe-choice small { display: block; color: var(--text-2); margin-top: 2px; }
.wipe-choice small a { text-decoration: underline; font-weight: 600; }
/* Receipt printer settings: tick boxes on their own lines; "Looking on the network…" only while it looks */
#printer .check { display: flex; align-items: center; gap: 10px; min-height: 40px; }
#printer .check input { width: 20px; height: 20px; }
#printer .htmx-indicator { display: none; }
#printer .htmx-request.htmx-indicator, #printer .htmx-request .htmx-indicator { display: inline; }
.chip-drawer { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
/* Admin, Customer screen: the pictures in the order they show */
.cs-slides { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-slide { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px; border: 1px solid var(--line);
  border-radius: 12px; scroll-margin-top: 90px; }  /* a long file name wraps; the buttons stay inside the card */
.cs-slide .cs-name { overflow-wrap: anywhere; min-width: 0; }
#showing, #pictures { scroll-margin-top: 90px; }
.cs-slide img { width: 160px; height: 90px; object-fit: contain; background: #000; border-radius: 8px; }
.cs-slide .btn-row { flex-wrap: nowrap; }
/* Gift vouchers (the vouchers add-on): in the basket, and the finished sale */
.pay-voucher { margin-top: 8px; }
.voucher-using { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; background: var(--surface-2); }
.voucher-done { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; text-align: left; }
.line-voucher .line-name { display: flex; align-items: center; gap: 6px; }
.voucher-note { display: grid; gap: 6px; margin-bottom: 14px; }
.wipe-backup { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.wipe-backup input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.wipe-backup small { display: block; color: var(--text-2); margin-top: 2px; }
