/* GSC staff app. The shop's own look: warm paper, ink, and a colour for each job, like shelf tags.
   Orders are pink, stock and requests teal, buying yellow, the office blue. Light and dark. */
@font-face {
  font-family: 'GSOpenSans';
  src: url('/img/os.woff2') format('woff2');
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: 'GSMontserrat';
  src: url('/img/ms.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F3F1EE;
  --paper: #FFFFFF;
  --soft: #F3F1EE;
  --raise: #EDE9E3;
  --line: #E6E1DA;
  --line2: #CFC6BA;
  --ink: #1D1A16;
  --ink2: #3A352F;
  --on-ink: #FFFFFF;
  --mute: #6B635A;
  --mute2: #8E857C;
  --accent: #FA4362;
  --accent-ink: #C21E3C;
  --accent-soft: #FFE4E9;
  --accent-line: #F7C3CD;
  --orders: #C21E3C; --orders-ink: #C21E3C; --orders-soft: #FFE4E9; --on-orders: #FFFFFF;
  --stock: #0E7A72; --stock-ink: #0A5F59; --stock-soft: #D9F0EC; --on-stock: #FFFFFF;
  --buying: #F2D129; --buying-ink: #7A5A00; --buying-soft: #FFF4C2; --on-buying: #1D1A16;
  --office: #2F55C9; --office-ink: #2F55C9; --office-soft: #E3E9FA; --on-office: #FFFFFF;
  --chart-now: #2F55C9; --chart-ly: #C2761B;   /* sales this year / last year (checked for colour blindness) */
  --ok: #1F7A4C;
  --ok-soft: #E6F3EC;
  --warn: #9A5B00;
  --warn-soft: #FFF2DB;
  --bad: #B3261E;
  --bad-soft: #FCE8E6;
  --info: #2C3E73;
  --info-soft: #EEF1F8;
  --info-line: #D5DCEE;
  --wa: #1DA851;
  --veil: rgba(22, 19, 15, 0.62);
  --scrim: rgba(22, 19, 15, 0.45);
  --radius: 18px;
  --tab-h: 78px;
  --head-h: 64px;
  --head-font: 'GSMontserrat', 'GSOpenSans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
  font-family: 'GSOpenSans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 100%;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* Dark: the same shop after hours. Tags keep their colour and get dark writing. */
:root[data-theme="dark"] {
  --bg: #16130F;
  --paper: #211D18;
  --soft: #2C2721;
  --raise: #3A342C;
  --line: #3A342C;
  --line2: #4A433A;
  --ink: #F6F1EA;
  --ink2: #E9DFD2;
  --on-ink: #16130F;
  --mute: #B8AEA2;
  --mute2: #8E857C;
  --accent: #FA4362;
  --accent-ink: #FF7088;
  --accent-soft: #2A1C1F;
  --accent-line: #4A2830;
  --orders: #FA4362; --orders-ink: #FF7088; --orders-soft: #2A1C1F; --on-orders: #16130F;
  --stock: #3CC4B4; --stock-ink: #5FD3C5; --stock-soft: #173230; --on-stock: #16130F;
  --buying: #F2D129; --buying-ink: #F2D129; --buying-soft: #2B2716; --on-buying: #16130F;
  --office: #7C9BFF; --office-ink: #9DB3FF; --office-soft: #1C2235; --on-office: #16130F;
  --chart-now: #5B7FE6; --chart-ly: #C2761B;
  --ok: #5CC98E;
  --ok-soft: #16301F;
  --warn: #F2B544;
  --warn-soft: #2E2412;
  --bad: #FF8A80;
  --bad-soft: #3A1D1B;
  --info: #A9B8E8;
  --info-soft: #1E2333;
  --info-line: #2E3A5E;
  --scrim: rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { min-height: 100dvh; background: var(--bg); }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; font-family: var(--head-font); }
h1 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 800; }
h3 { font-size: 0.95rem; font-weight: 800; }
p { margin: 0; }
a { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute; clip-path: inset(50%); overflow: hidden; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0; white-space: nowrap;
}

/* The logo: ink on light, cream on dark. */
.logo-light { display: none; }
:root[data-theme="dark"] .logo-ink { display: none; }
:root[data-theme="dark"] .logo-light { display: block; }

/* ---------- app shell ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  height: calc(var(--head-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0 16px;
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.top .brand { flex: none; display: block; }
.top .brand img { height: 26px; width: auto; }
.top .spacer { flex: 1; }
.testflag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 3px 7px; flex: none;
}
.top-shop { min-width: 0; display: flex; }
.shoppill {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; height: 44px; padding: 0 12px 0 14px; border-radius: 999px; border: 0;
  background: var(--soft); color: var(--ink); font-weight: 700; font-size: 0.875rem; cursor: pointer;
}
.shoppill .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shoppill svg { width: 16px; height: 16px; flex: none; }
.shoppill.static { cursor: default; padding: 0 14px; }
.iconbtn {
  min-width: 44px; min-height: 44px; border: 0; background: transparent; border-radius: 12px; color: var(--ink);
  display: inline-grid; place-items: center; cursor: pointer;
}
.iconbtn:hover { background: var(--soft); }
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn.round { border-radius: 999px; background: var(--soft); flex: none; }
.iconbtn.round:hover { background: var(--raise); }
.iconbtn.round svg { width: 20px; height: 20px; }
.top .me {
  flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; text-decoration: none; font: 800 1rem var(--head-font);
}
.top .me[aria-current="page"] { outline: 3px solid var(--accent); outline-offset: 2px; }

main {
  max-width: 760px; margin: 0 auto;
  padding: 16px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 28px);
}
main.bare { padding-bottom: 40px; }
#view:focus { outline: none; }

/* Bottom bar: Today, your three buttons, and Scan (or Find) in the middle. */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 5;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: var(--paper); border-top: 1px solid var(--line);
}
.tabs ul { list-style: none; margin: 0 auto; padding: 0 0 8px; max-width: 560px; height: var(--tab-h); display: flex; align-items: center; justify-content: space-around; }
.tabs li { flex: 1; display: flex; justify-content: center; min-width: 0; }
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 76px; padding-top: 6px;
  text-decoration: none; color: var(--ink); font-size: 0.6875rem; font-weight: 700;
}
.tabs a .ico { width: 52px; height: 30px; border-radius: 999px; display: grid; place-items: center; color: var(--mute); }
.tabs a.job-orders .ico { color: var(--orders-ink); }
.tabs a.job-stock .ico { color: var(--stock-ink); }
.tabs a.job-buying .ico { color: var(--buying-ink); }
.tabs a.job-office .ico { color: var(--office-ink); }
.tabs a.job-ink .ico { color: var(--ink); }
.tabs a svg { width: 22px; height: 22px; }
.tabs a .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabs a[aria-current="page"] { font-weight: 800; }
.tabs a[aria-current="page"] .ico { background: var(--raise); }
.tabs .count {
  position: absolute; top: 0; left: calc(50% + 8px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 4px; background: var(--ink); color: var(--on-ink); font: 800 0.6875rem/18px var(--head-font); text-align: center;
}
.tabs .job-orders .count { background: var(--orders); color: var(--on-orders); }
.tabs .job-stock .count { background: var(--stock); color: var(--on-stock); }
.tabs .job-buying .count { background: var(--buying); color: var(--on-buying); }
.tabs .job-office .count { background: var(--office); color: var(--on-office); }
.tabs li.centre { flex: 0 0 auto; padding: 0 2px; }
.centre-btn {
  position: relative; top: -12px; width: 60px; height: 60px; border-radius: 999px; border: 4px solid var(--bg);
  background: var(--ink); color: var(--on-ink); display: grid; place-items: center; cursor: pointer; flex: none;
  box-shadow: 0 6px 16px rgba(22, 19, 15, 0.22);
}
.centre-btn svg { width: 26px; height: 26px; }
.centre-btn:active { transform: scale(0.96); }

/* ---------- building blocks ---------- */
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--mute); }
.small { font-size: 0.85rem; }
.tiny { font-size: 0.75rem; }
.pagehead { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.pagehead h1 { flex: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--mute); text-decoration: none; min-height: 44px; }

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: block;
}
a.card { color: inherit; text-decoration: none; }
a.card:hover { border-color: var(--mute2); }
.card.flat { padding: 0; overflow: hidden; }
.card h2 + * { margin-top: 6px; }
.card.alert { border-color: var(--accent-line); background: var(--accent-soft); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li + li { border-top: 1px solid var(--line); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; color: inherit; text-decoration: none; min-height: 56px; }
a.item:hover { background: var(--soft); }
.item .main { flex: 1; min-width: 0; }
.item .title { font-weight: 700; }
.item .sub { font-size: 0.85rem; color: var(--mute); }
.chev { color: var(--mute2); flex: none; width: 20px; height: 20px; }
.item svg:not(.chev) { width: 22px; height: 22px; }

.section-title { font-family: var(--head-font); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); margin: 22px 2px 8px; }
.section-title:first-child { margin-top: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 9px;
  font-size: 0.75rem; font-weight: 700; white-space: nowrap; background: var(--soft); color: var(--mute); border: 1px solid var(--line);
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.pink { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

.shot {
  width: 48px; height: 56px; flex: none; border-radius: 8px; background: #fff; border: 1px solid var(--line);
  object-fit: contain; padding: 2px;
}
.shot.big { width: 64px; height: 78px; }
.shot.none { display: grid; place-items: center; color: var(--mute2); }

/* Today tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: inherit; text-decoration: none; display: grid; gap: 4px; min-height: 116px; align-content: start; }
.tile:hover { border-color: var(--mute2); }
.tile .big { font-size: 2rem; font-weight: 800; line-height: 1; }
.tile .label { font-weight: 700; }
.tile .note { font-size: 0.82rem; color: var(--mute); }
.tile.hot { border-color: var(--accent-line); background: var(--accent-soft); }
.tile.hot .big { color: var(--accent-ink); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid var(--line2);
  background: var(--paper); color: var(--ink); font-family: var(--head-font); font-weight: 800; font-size: 0.9rem; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: var(--ink2); border-color: var(--ink2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.wa { background: #1DA851; border-color: #1DA851; color: #fff; }
.btn.wa:hover { background: #168a42; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--mute); }
.btn.small { min-height: 40px; padding: 6px 12px; font-size: 0.9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
.actions.two { grid-template-columns: 1fr 1fr; }

.sticky-actions {
  position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); z-index: 3;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); padding: 10px 0 2px; margin-top: 16px;
  display: grid; gap: 10px;
}

/* Segmented control */
.seg { display: flex; background: var(--raise); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.seg a, .seg button {
  flex: 1; min-height: 40px; display: grid; place-items: center; border-radius: 9px; border: 0; background: transparent;
  font-weight: 700; color: var(--mute); text-decoration: none; white-space: nowrap; padding: 0 8px; cursor: pointer; font-size: 0.88rem;
}
.seg [aria-current="page"], .seg [aria-pressed="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 19, 15, 0.12); }

/* Steppers */
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); flex: none; }
.stepper button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.35rem; font-weight: 700; cursor: pointer; border-radius: 10px; touch-action: manipulation; }
.stepper button:hover { background: var(--soft); }
.stepper output, .stepper input { min-width: 44px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.stepper input { width: 52px; border: 0; background: transparent; padding: 0; height: 44px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.of { font-size: 0.85rem; color: var(--mute); white-space: nowrap; }
.done-line { background: var(--ok-soft); }
.done-line .title::after { content: ' ✓'; color: var(--ok); }

/* Forms */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field > label, .field > .label { font-weight: 700; font-size: 0.92rem; }
.hint { font-size: 0.82rem; color: var(--mute); }
input[type="text"], input[type="password"], input[type="search"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line2); border-radius: 12px; background: var(--paper); font-size: 1rem;
}
textarea { min-height: 84px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--ink); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: 0.92rem; padding: 0; margin-bottom: 6px; }
.choices { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: grid; place-items: center; text-align: center; min-height: 48px; padding: 8px 10px; border: 1.5px solid var(--line2); border-radius: 12px; background: var(--paper); font-weight: 700;
}
.choice input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding-top: 10px; }
.check input { width: 22px; height: 22px; accent-color: var(--ink); margin: 0; flex: none; }

/* Search results */
.results { margin-top: 8px; max-height: 50vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.results:empty { display: none; }
.results button { width: 100%; text-align: left; border: 0; background: transparent; display: flex; gap: 10px; align-items: center; padding: 8px 10px; min-height: 52px; cursor: pointer; }
.results button + button { border-top: 1px solid var(--line); }
.results button:hover, .results button:focus-visible { background: var(--soft); }

/* Status steps */
.steps { display: flex; gap: 4px; margin: 10px 0 2px; }
.steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps span.on { background: var(--ink); }
.steps span.now { background: var(--accent); }
.steplabels { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--mute); }

/* History */
.history { list-style: none; padding: 0; margin: 0; font-size: 0.85rem; }
.history li { padding: 6px 0 6px 16px; border-left: 2px solid var(--line); position: relative; }
.history li::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--mute2); }

pre.message {
  white-space: pre-wrap; font: inherit; font-size: 0.92rem; background: var(--ok-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0;
}

.empty { text-align: center; padding: 28px 16px; color: var(--mute); }
.empty strong { display: block; color: var(--ink); font-size: 1.05rem; margin-bottom: 4px; }

/* ---------- sign-in ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 28px 18px 40px; }
.auth .logo { width: min(280px, 80%); margin: 6px auto 22px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.people button {
  min-height: 72px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper);
  font-weight: 800; font-size: 1.05rem; cursor: pointer; display: grid; place-items: center; gap: 2px; padding: 8px;
}
.people button small { font-weight: 600; color: var(--mute); font-size: 0.75rem; }
.people button:hover { border-color: var(--ink); }
.pindots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 8px; }
.pindots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); }
.pindots span.on { background: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; margin: 14px auto 0; }
.keypad button {
  height: 64px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--paper); font-size: 1.5rem; font-weight: 800; cursor: pointer; touch-action: manipulation;
}
.keypad button:active { background: var(--soft); }
.keypad .del { font-size: 1rem; }
.pinerr { min-height: 1.5em; text-align: center; color: var(--bad); font-weight: 700; }

/* ---------- dialogs ---------- */
dialog {
  border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  background: var(--paper); color: var(--ink); box-shadow: 0 20px 60px rgba(22, 19, 15, 0.3);
}
dialog::backdrop { background: rgba(22, 19, 15, 0.45); }
dialog .dhead { display: flex; align-items: center; gap: 8px; padding: 14px 14px 6px 18px; }
dialog .dhead h2 { flex: 1; font-size: 1.15rem; }
dialog .dbody { padding: 6px 18px 18px; overflow: auto; max-height: calc(100dvh - 120px); }
@media (max-width: 600px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; padding-bottom: env(safe-area-inset-bottom); }
  dialog .dbody { max-height: calc(92dvh - 70px); }
}
dialog.scanner { background: #000; color: #fff; }
dialog.scanner .dhead h2 { color: #fff; }
dialog.scanner .iconbtn { color: #fff; }
.viewfinder { position: relative; aspect-ratio: 4 / 3; background: #111; border-radius: 14px; overflow: hidden; }
.viewfinder video { width: 100%; height: 100%; object-fit: cover; }
.viewfinder::after { content: ''; position: absolute; left: 10%; right: 10%; top: 38%; bottom: 38%; border: 3px solid var(--accent); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25); }
.scanlast { min-height: 3em; margin-top: 10px; font-weight: 700; }
dialog.scanner input { background: #1d1d1d; color: #fff; border-color: #444; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); z-index: 50; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; max-width: 520px; width: fit-content; margin: 0 auto; border: 0; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--on-ink); font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex; gap: 12px; align-items: center;
}
.toast.bad { background: var(--bad); }
.toast.ok { background: var(--ok); }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 800; min-height: 32px; cursor: pointer; }
/* As a manual popover the toast sits in the top layer, above any open dialog. */
.toast[popover] { position: fixed; inset: auto 12px calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); margin: 0 auto; }
.toast[popover]:is(:popover-open, .\:popover-open) { display: flex; }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

@media (min-width: 900px) {
  main { padding-top: 24px; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
}
.center { text-align: center; }
.item.diff { background: var(--accent-soft); }
button.btnitem { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; }
button.btnitem:hover { background: var(--soft); }
details > summary { cursor: pointer; min-height: 32px; list-style-position: inside; }
details[open] > summary { margin-bottom: 8px; }
.card ul { margin: 6px 0 0; padding-left: 18px; }
.card ul.list { padding-left: 0; margin: 0; }
.back svg { width: 20px; height: 20px; }
.actions-area { display: grid; gap: 10px; margin-top: 16px; }
.invite-code { font-size: 2.2rem; font-weight: 800; letter-spacing: 0.12em; text-align: center; margin: 8px 0 14px; }

/* ---------- sidebar (computers) ----------
   Every area this person may open, grouped by job in the job's colour. The light/dark switch and
   the person sit at the bottom. Phones keep the bottom bar. */
:root { --side-w: 248px; }
.side { display: none; }
@media (min-width: 1000px) {
  body.signed-in .side:not([hidden]) {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 6;
    background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px 16px;
  }
  body.signed-in .top, body.signed-in main, body.signed-in .toasts { margin-left: var(--side-w); }
  body.signed-in .tabs { display: none; }
  body.signed-in { --tab-h: 0px; }
  body.signed-in .top .brand, body.signed-in .top .top-shop, body.signed-in .top .top-theme, body.signed-in .top .me { display: none; }
  body.signed-in .top { height: 56px; background: transparent; border-bottom: 0; position: absolute; right: 0; left: 0; padding-right: 24px; }
  body.signed-in main { padding-bottom: 48px; }
  body.signed-in .toast[popover] { inset: auto 12px 18px calc(var(--side-w) + 12px); }
}
.side-brand { display: block; padding: 2px 6px 16px; }
.side-brand img { height: 30px; width: auto; }
.side-shop { display: grid; margin-bottom: 10px; }
.side-shop .shoppill { justify-content: space-between; width: 100%; }
.side nav { display: flex; flex-direction: column; gap: 2px; overflow: auto; flex: 1; min-height: 0; }
.side-group {
  font: 800 0.6875rem var(--head-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--mute);
  margin: 12px 12px 3px;
}
.side-group.job-orders { color: var(--orders-ink); }
.side-group.job-stock { color: var(--stock-ink); }
.side-group.job-buying { color: var(--buying-ink); }
.side-group.job-office { color: var(--office-ink); }
.side nav a {
  display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: 12px; flex: none;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem; position: relative;
}
.side nav a svg { width: 22px; height: 22px; flex: none; }
.side nav a:hover { background: var(--soft); }
.side nav a[aria-current="page"] { background: var(--raise); font-weight: 800; }
.side nav a .label { flex: 1; }
.side nav a.soon { color: var(--mute); }
.soon-tag {
  font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute);
  border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 2px;
}
.side nav .count, .hubnav .count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 4px; background: var(--ink); color: var(--on-ink);
  font: 800 0.75rem/22px var(--head-font); text-align: center;
}
.side nav .job-orders .count { background: var(--orders); color: var(--on-orders); }
.side nav .job-stock .count { background: var(--stock); color: var(--on-stock); }
.side nav .job-buying .count { background: var(--buying); color: var(--on-buying); }
.side nav .job-office .count { background: var(--office); color: var(--on-office); }
.side-theme {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; margin: 10px 0 8px; border-radius: 12px; border: 0;
  background: var(--soft); color: var(--ink); font-weight: 600; font-size: 0.875rem; cursor: pointer; text-align: left;
}
.side-theme svg { width: 18px; height: 18px; flex: none; }
:root[data-theme="dark"] .side-theme svg { color: var(--buying); }
.side-foot { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding: 12px 6px 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font: 800 0.95rem var(--head-font); flex: none; }
.side-foot .who { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.side-foot .who strong { font-size: 0.875rem; }
.side-foot .who span { font-size: 0.75rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .iconbtn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
.side-foot .iconbtn[aria-current="page"] { background: var(--raise); }


main.wide { max-width: 1280px; }
@media (min-width: 1000px) { main.wide { padding-left: 28px; padding-right: 28px; } }

/* ---------- dashboard pieces (Prices) ---------- */
.dash-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 14px; }
.dash-head .titles { flex: 1; min-width: 220px; }
.dash-head h1 { font-size: 1.5rem; }
.dash-head .subtitle { color: var(--mute); margin-top: 4px; font-size: 0.92rem; }
.dash-head .tools { display: flex; flex-wrap: wrap; gap: 8px; }

.statusrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 11px; font-size: 0.8rem; font-weight: 700;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink); white-space: nowrap;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute2); flex: none; }
.pill.ok .dot { background: var(--ok); }
.pill.warn .dot { background: var(--warn); }
.pill.bad .dot { background: var(--bad); }
.pill .when { color: var(--mute); font-weight: 600; }

.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.stat {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 6px;
  color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(22, 19, 15, 0.04);
}
a.stat:hover { border-color: var(--mute2); }
.stat .lbl { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.stat .val { font-size: 1.9rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat .val small { font-size: 0.95rem; font-weight: 700; color: var(--mute); }
.stat .sub { font-size: 0.82rem; color: var(--mute); }
.stat.hot .val { color: var(--accent-ink); }

.delta {
  display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 2px 8px; font-size: 0.74rem; font-weight: 800;
  white-space: nowrap; font-variant-numeric: tabular-nums; width: fit-content;
}
.delta.down { background: var(--bad-soft); color: var(--bad); }     /* a shop is cheaper / their price dropped */
.delta.up { background: var(--ok-soft); color: var(--ok); }         /* we are cheaper / their price went up */
.delta.flat { background: var(--soft); color: var(--mute); border: 1px solid var(--line); }

.cols { display: grid; gap: 16px; margin-bottom: 16px; }
@media (min-width: 1000px) { .cols.two { grid-template-columns: 1.15fr 1fr; align-items: stretch; } }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.panel + .panel { margin-top: 0; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 1rem; flex: 1; }
.panel-head .badge { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 0.78rem; font-weight: 800; display: grid; place-items: center; }
.panel-head .note { font-size: 0.8rem; color: var(--mute); }
.panel-body { padding: 12px 16px; }
.panel.attn .panel-head { background: var(--accent-soft); }
.panel .seg { margin: 10px 16px 0; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.prow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: inherit; text-decoration: none; min-height: 58px; }
a.prow:hover, button.prow:hover { background: var(--soft); }
button.prow { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.prow .main { flex: 1; min-width: 0; }
.prow .title { font-weight: 700; }
.prow .sub { font-size: 0.84rem; color: var(--mute); }
.prow .right { display: grid; justify-items: end; gap: 3px; text-align: right; flex: none; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--mute2); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 0.8rem; color: var(--mute); margin: 8px 2px 0; }

/* Data tables */
.tablewrap { overflow: auto; max-height: min(72vh, 900px); border-top: 1px solid var(--line); }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.88rem; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; z-index: 2; background: var(--soft); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--mute);
}
table.data tbody tr:hover > * { background: var(--soft); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.linkbtn { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left; }
.linkbtn:hover { color: var(--accent-ink); text-decoration: underline; }
table.data tbody th { font-weight: 700; }
.item .right { display: grid; justify-items: end; gap: 2px; text-align: right; flex: none; }
.item.muted .money { color: var(--mute2); }
/* The page area takes focus after each move (for screen readers); it needs no ring of its own. */
main:focus { outline: none; }
/* On a computer the page sits centred in the space beside the sidebar. */
@media (min-width: 1000px) {
  body.signed-in main {
    --content: 860px; max-width: none; margin: 0 0 0 var(--side-w);
    padding-left: max(28px, calc((100vw - var(--side-w) - var(--content)) / 2));
    padding-right: max(28px, calc((100vw - var(--side-w) - var(--content)) / 2));
  }
  body.signed-in main.wide { --content: 1280px; }
}

/* ---------- Prices: all wines ---------- */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 10px; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.filters select { min-height: 44px; }
.ptable-wrap { container-type: inline-size; }
.ptable { display: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.pcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@container (min-width: 820px) { .ptable { display: block; } .pcards { display: none; } }
/* Shop names wrap onto two lines ("Norman / Goodfellows") so each column is only as wide as its prices. */
table.compare thead th.num { white-space: normal; width: 1%; min-width: 64px; line-height: 1.3; vertical-align: bottom; }
table.compare th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--paper); min-width: 220px; max-width: 300px; white-space: normal; }
table.compare thead th:first-child { left: 0; z-index: 3; }
table.compare .rowsub { display: block; font-weight: 600; }
table.compare td.pcell a { color: inherit; text-decoration: none; display: inline-block; padding: 2px 6px; border-radius: 6px; }
table.compare td.pcell a:hover { text-decoration: underline; }
table.compare td.cheaper { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
table.compare td.dearer { color: var(--ok); }
table.compare td.stale { color: var(--mute2); }
table.compare tbody tr:hover > td.cheaper { background: var(--accent-line); }
.pcard-head { display: flex; gap: 10px; align-items: baseline; color: inherit; text-decoration: none; margin-bottom: 6px; }
.pcard-head .title { font-weight: 800; }
.shopchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shopchip {
  display: inline-flex; align-items: center; border-radius: 8px; padding: 3px 8px; font-size: 0.8rem; font-weight: 700;
  background: var(--soft); border: 1px solid var(--line); color: var(--ink); text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums;
}
a.shopchip:hover { border-color: var(--mute2); }
.shopchip.cheaper { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-ink); }
.shopchip.stale { color: var(--mute2); }
.panel-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.88rem; font-weight: 700; }
.panel-foot a { color: var(--accent-ink); }

/* ---------- Prices: one wine ---------- */
.stat .val-chip { font-size: 1rem; }
.stat .val-chip .delta { font-size: 0.9rem; padding: 4px 10px; }
.prow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: none; }
li.prow { flex-wrap: wrap; }
@media (max-width: 600px) { li.prow .acts { width: 100%; justify-content: flex-start; } }
.prow.faded .title, .prow.faded .money { color: var(--mute2); }
svg.chart { width: 100%; height: auto; display: block; }
.chart-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 10px 0 0; font-size: 0.82rem; }
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 4px; border-radius: 2px; background: var(--mute2); display: inline-block; }
.swatch.ours { background: repeating-linear-gradient(90deg, #FA4362 0 6px, transparent 6px 10px); }
.swatch[data-c="0"] { background: #C21E3C; } .swatch[data-c="1"] { background: var(--ink); } .swatch[data-c="2"] { background: #1F7A4C; }
.swatch[data-c="3"] { background: #B26B00; } .swatch[data-c="4"] { background: #2C4FA3; } .swatch[data-c="5"] { background: #7A3FA0; }
.swatch[data-c="6"] { background: #0E7C86; } .swatch[data-c="7"] { background: #8E857C; } .swatch[data-c="8"] { background: #D4571C; }

/* Case prices: under the bottle price, pink when a bottle in the case is cheaper */
.casep { display: block; font-size: 0.72rem; font-weight: 600; color: var(--mute); white-space: nowrap; }
.casep.deal { color: var(--accent-ink); font-weight: 800; }
.prow .right .casep { text-align: right; line-height: 1.25; }

/* Prices from a PDF: tick the wines to save */
.importrow { cursor: pointer; align-items: flex-start; }
.importrow input[type="checkbox"] { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }
.importrow .right { display: grid; justify-items: end; gap: 2px; text-align: right; flex: none; }
input[type="file"] { font-size: 0.95rem; max-width: 100%; }
input[type="url"] { width: 100%; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--line2); border-radius: 12px; background: var(--paper); font-size: 1rem; }

/* Wine details in the wine editor */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; font-size: 0.875rem; }
dl.facts dt { color: var(--mute); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 8px 10px; }

/* ---------- Leave (admin office) ----------
   Each person keeps one highlighter colour, like the paper calendar it replaces. Waiting
   requests are striped. Everything prints in greyscale: every bar carries the person's name. */
.pc0 { --c: #F8C3CF; } .pc1 { --c: #BCE0F4; } .pc2 { --c: #C9EDBF; } .pc3 { --c: #DCC6F1; } .pc4 { --c: #F9CFAE; }
.pc5 { --c: #F5EE7E; } .pc6 { --c: #B2E6DE; } .pc7 { --c: #D9D3CB; } .pc8 { --c: #F3B0A8; } .pc9 { --c: #DDEE9F; }
.pdot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--line)); border: 1px solid rgba(22, 19, 15, 0.25); flex: none; display: inline-block; }
.item .pdot { width: 14px; height: 14px; }
.pagehead .pdot { width: 18px; height: 18px; align-self: center; }
.wait-swatch { background: repeating-linear-gradient(135deg, #CFC6BA 0 3px, #fff 3px 6px); }
.hol-swatch { background: #E3E8F5; border-color: #C3CCE4; }
.lwait-note { padding: 0 14px 8px 40px; }
.lwait-acts { padding: 0 14px 12px 40px; }
.lform > * + * { margin-top: 14px; }
.lform .field + .field, .lform .ldates { margin-top: 14px; }
.lform .ldates .field + .field { margin-top: 0; }
h1.withdot { display: flex; align-items: center; gap: 10px; }
.lwaitline { margin-top: 10px; }
.info-card { background: var(--info-soft); border-color: #D5DCEE; margin-bottom: 4px; }
.lfoot { margin-top: 14px; }
.bad-text { color: var(--bad); font-weight: 700; }
.good-text { color: var(--ok); font-weight: 700; }
.lsum { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 14px; display: grid; gap: 4px; }
.ldates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.ldates .field + .field { margin-top: 0; }
.lkinds { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.lhead { margin-bottom: 8px; }
.card.alert h2 + * { margin-top: 6px; }

/* the month calendar */
.monthbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.monthbar h2 { font-size: 1.15rem; min-width: 9.5em; text-align: center; }
.llegend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0; margin: 0 0 10px; font-size: 0.82rem; font-weight: 700; }
.llegend li { display: inline-flex; align-items: center; gap: 6px; }
.lcal { --lane-h: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lcal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--soft); border-bottom: 1px solid var(--line); }
.lcal-head div { padding: 6px 4px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); text-align: center; }
.lweek { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 3px; min-height: 66px; border-bottom: 1px solid var(--line); }
.lweek:last-child { border-bottom: 0; }
.lday { grid-row: 1 / -1; border-left: 1px solid var(--line); padding: 2px 3px; display: flex; flex-direction: column; min-width: 0; }
.lday:first-child { border-left: 0; }
.lday.sun { background: #FBF9F6; }
.lday.out { background: #F5F1EB; }
.lday.out .lnum { color: var(--mute2); }
.lday.hol { background: #E9EDF7; }
.lnum {
  align-self: flex-start; border: 0; background: transparent; font: inherit; font-weight: 800; font-size: 0.8rem;
  min-width: 26px; height: 26px; border-radius: 13px; cursor: pointer; padding: 0 5px;
}
.lnum:hover { background: var(--soft); }
.lday.today .lnum { background: var(--accent); color: #fff; }
.lhol { font-size: 0.62rem; color: #2C3E73; font-weight: 700; line-height: 1.1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding: 0 2px; }
.lbar {
  position: relative; z-index: 1; margin: 0 2px; min-width: 0; height: var(--lane-h); border: 0; border-radius: 6px;
  background: var(--c); color: var(--ink); font: inherit; font-size: 0.72rem; font-weight: 700; text-align: left; padding: 0 6px;
  cursor: pointer; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(22, 19, 15, 0.12);
}
.lbar span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.lbar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.lbar.wait { background: repeating-linear-gradient(135deg, var(--c) 0 6px, rgba(255, 255, 255, 0.8) 6px 11px); box-shadow: inset 0 0 0 1.5px rgba(22, 19, 15, 0.4); }
.lbar:hover { filter: brightness(0.95); }
@media (max-width: 600px) {
  .lcal { --lane-h: 20px; }
  .lbar { font-size: 0.64rem; padding: 0 3px; margin: 0 1px; }
  .lcal-head div { font-size: 0.6rem; letter-spacing: 0; padding: 6px 1px; }
  .lhol { font-size: 0.56rem; }
  .monthbar h2 { min-width: 0; flex: 1; }
}

/* people and balances */
.lpeople { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .lpeople { grid-template-columns: 1fr 1fr; } }
.lperson { display: grid; gap: 7px; height: 100%; }
.lperson.faded { opacity: 0.65; }
.lbal { display: grid; grid-template-columns: 4.4em 1fr; align-items: center; gap: 2px 8px; font-size: 0.86rem; }
.lbal-k { font-weight: 700; color: var(--mute); grid-row: span 2; }
.lbal-v { font-weight: 800; }
.lbal-v .muted { font-weight: 600; }
.lmeter { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; display: block; }
.lmeter span { display: block; height: 100%; background: var(--ink); border-radius: 3px; }
.lbal.over .lbal-v { color: var(--bad); }
.lbal.over .lmeter span { background: var(--bad); }
.lwd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.lwd .choice span { min-height: 44px; padding: 4px 2px; font-size: 0.85rem; }
.lallow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.lallow .field + .field { margin-top: 0; }
.lallow .field > label { font-size: 0.82rem; }
.lcolours { display: flex; flex-wrap: wrap; gap: 8px; }
.lcolour { position: relative; }
.lcolour input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.lcolour span { display: block; width: 38px; height: 38px; border-radius: 50%; background: var(--c); border: 2px solid rgba(22, 19, 15, 0.15); }
.lcolour input:checked + span { border: 3px solid var(--ink); }
.lcolour input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the admin office's Today card */
.lofftoday { margin-bottom: 14px; }
.lofftoday .row h2 { flex: 1; }
.card ul.loff { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.loff li { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; flex-wrap: wrap; }

.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root, body { background: #fff !important; }
  .side, .top, .tabs, .toasts, .toast, .seg, .pagehead, .monthbar, .no-print, .back, dialog { display: none !important; }
  body.signed-in .top, body.signed-in main, main, body.signed-in main.wide { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .print-only { display: block; }
  .lprint-title { font-weight: 800; font-size: 14pt; margin-bottom: 6px; }
  .lcal { border-color: #000; --lane-h: 18px; border-radius: 0; }
  .lweek { min-height: 72px; border-color: #888; break-inside: avoid; }
  .lday { border-color: #888; }
  .lbar, .pdot, .lday.hol { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lbar { box-shadow: none; border: 1px solid #000; }
  .lbar.wait span::after { content: ' (waiting)'; }
  .lday.today .lnum { background: none; color: inherit; text-decoration: underline; }
  .card { border-color: #888; }
  .list > li { break-inside: avoid; }
  .item .chev { display: none; }
}

/* sign-in page */
.pwrow { position: relative; }
.pwrow input { padding-right: 76px; width: 100%; }
.pwshow { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); min-height: 40px; }
.auth .card h1 { font-size: 1.5rem; }
.auth > .btn.ghost { color: var(--accent-ink); }

/* Sign out sits in the top bar on every screen */
.top .signout { min-height: 40px; padding: 6px 12px; gap: 6px; border-color: var(--line); font-size: 0.88rem; }
.top .signout svg { width: 18px; height: 18px; }
@media (max-width: 360px) { .top .signout { padding: 6px 8px; } }

/* =====================================================================
   The new look (5 Oct 2026): header, Today, section pills, Requests,
   Wines, Find, Office and My buttons. Job colours: orders pink, stock
   and requests teal, buying yellow, office blue.
   ===================================================================== */

/* header on phones: logo, shop, light/dark, sign out, your initial */
.top .signout {
  width: 44px; min-height: 44px; height: 44px; padding: 0; gap: 6px; border-radius: 999px; border: 0;
  background: var(--soft); color: var(--ink); flex: none; font-family: inherit; font-weight: 700;
}
.top .signout svg { width: 20px; height: 20px; }
.top .signout .lbl { display: none; }
/* Light/dark sits in the header when there is room; it is always under Menu too. */
@media (max-width: 459px) { .top .top-theme { display: none; } }
@media (max-width: 459px) { .top { gap: 6px; } .top .brand img { height: 22px; } .testflag { padding: 3px 5px; font-size: 0.625rem; } }
@media (max-width: 379px) {
  .top { gap: 6px; padding-left: 12px; padding-right: 10px; }
  .top .brand img { height: 22px; }
}
@media (min-width: 1000px) {
  body.signed-in .top { position: sticky; height: 56px; background: var(--bg); border-bottom: 0; padding: 0 28px; }
  body.signed-in main { padding-top: 4px; }
  .top .signout { width: auto; padding: 0 14px; border: 1px solid var(--line); background: var(--paper); font-size: 0.875rem; }
  .top .signout .lbl { display: inline; }
}
.wide-only { display: none; }
@media (min-width: 1000px) { .wide-only { display: inline; } div.wide-only { display: grid; } }

/* pills above a section's lists */
.hubnav { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 16px; padding: 2px 0; scrollbar-width: none; }
.hubnav::-webkit-scrollbar { display: none; }
.hubnav a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px; flex: none;
  background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.875rem; white-space: nowrap;
}
.hubnav a:hover { border-color: var(--line2); }
.hubnav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.hubnav a[aria-current="page"] .count { background: var(--on-ink); color: var(--ink); }

/* Today */
.today { display: flex; flex-direction: column; gap: 14px; }
.today > .hero { order: 1; }
.today > .findbar { order: 2; }
.today > * { order: 3; }
@media (min-width: 1000px) { .today { gap: 20px; } .today > .findbar { order: 0; } }
.findbar { display: flex; gap: 10px; align-items: center; }
.findbar.inpage { margin-bottom: 12px; }
.searchpill {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line); color: var(--mute); text-decoration: none; font-size: 0.9375rem; cursor: text;
}
.searchpill:hover { border-color: var(--line2); }
.searchpill svg { width: 20px; height: 20px; flex: none; }
.searchpill > span:not(.visually-hidden) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchpill input[type="search"] { flex: 1; min-width: 0; min-height: 0; height: 100%; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 1rem; }
.searchpill input[type="search"]:focus-visible { outline: none; }
.searchpill:focus-within { outline: 3px solid var(--accent); outline-offset: 1px; }
.scanbtn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; min-width: 50px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--on-ink); font: 800 0.875rem var(--head-font); cursor: pointer;
}
.scanbtn svg { width: 20px; height: 20px; }
@media (max-width: 999px) {
  .today .scanbtn { padding: 0; width: 50px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
  .today .scanbtn .lbl { display: none; }
}

.hero {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 18px; min-height: 124px; padding: 14px 18px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; color: #fff;
  background: #2C2721 url('/img/shelf.webp') center 38% / cover no-repeat;
}
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: var(--veil); }
.hero .eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #E9DFD2; }
.hero h1 { font-size: 1.7rem; line-height: 1.1; color: #fff; }
.hero-sub { font-weight: 600; font-size: 0.875rem; color: #F2D129; }
@media (min-width: 1000px) {
  .hero { min-height: 150px; padding: 22px 28px; gap: 6px; border-radius: 20px; }
  .hero h1 { font-size: 2.125rem; }
  .hero .eyebrow { font-size: 0.75rem; }
  .hero-sub { font-size: 0.95rem; }
}

.tiles2 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile2 {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 18px; border: 1px solid transparent;
  background: var(--soft); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.875rem; line-height: 1.3;
}
.tile2 b { flex: none; width: 46px; height: 46px; border-radius: 6px; display: grid; place-items: center; font: 800 1.25rem var(--head-font); background: var(--ink); color: var(--on-ink); }
.tile2:hover { border-color: var(--line2); }
.tile2.job-orders { background: var(--orders-soft); } .tile2.job-orders b { background: var(--orders); color: var(--on-orders); }
.tile2.job-stock { background: var(--stock-soft); } .tile2.job-stock b { background: var(--stock); color: var(--on-stock); }
.tile2.job-buying { background: var(--buying-soft); } .tile2.job-buying b { background: var(--buying); color: var(--on-buying); }
.tile2.job-office { background: var(--office-soft); } .tile2.job-office b { background: var(--office); color: var(--on-office); }
:root[data-theme="dark"] .tile2.job-orders { border-color: #4A2830; }
:root[data-theme="dark"] .tile2.job-stock { border-color: #23504B; }
:root[data-theme="dark"] .tile2.job-buying { border-color: #4A4220; }
:root[data-theme="dark"] .tile2.job-office { border-color: #2E3A5E; }

.todaycols { display: grid; gap: 18px; }
.col-side { display: none; }
@media (min-width: 1000px) {
  .todaycols { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 24px; align-items: start; }
  .col-side { display: grid; gap: 8px; }
}
.sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 2px 10px; }
.sechead h2 { font-size: 1rem; }
.sechead .n { font-weight: 600; font-size: 0.8125rem; color: var(--mute); }
.col-main > .sechead ~ .sechead, .jobs + .sechead, .card + .sechead { margin-top: 22px; }

/* to-do cards with a shelf tag */
.jobs { display: grid; gap: 8px; }
.job {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 10px 14px 10px 10px; border-radius: 18px;
  background: var(--paper); color: var(--ink); text-decoration: none; border: 1px solid transparent;
}
:root[data-theme="dark"] .job { border-color: var(--line); }
.job:hover { border-color: var(--line2); }
.jtext { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.jt { font-weight: 700; font-size: 0.9375rem; line-height: 1.3; }
.js { font-size: 0.8125rem; color: var(--mute); }
.jact { flex: none; font: 800 0.8125rem var(--head-font); color: var(--ink); }
.job-orders .jact { color: var(--orders-ink); }
.job-stock .jact { color: var(--stock-ink); }
.job-buying .jact { color: var(--buying-ink); }
.job-office .jact { color: var(--office-ink); }
@media (min-width: 1000px) {
  .job { gap: 14px; }
  .jt { font-size: 1rem; }
  .js { font-size: 0.875rem; }
  .jact { height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line2); display: grid; place-items: center; font-family: inherit; font-weight: 700; font-size: 0.875rem; color: var(--ink); }
  .jobs:not(.quiet) > .job:first-child .jact { border-color: transparent; font-family: var(--head-font); font-weight: 800; background: var(--ink); color: var(--on-ink); }
  .jobs:not(.quiet) > .job-orders:first-child .jact { background: var(--orders); color: var(--on-orders); }
  .jobs:not(.quiet) > .job-stock:first-child .jact { background: var(--stock); color: var(--on-stock); }
  .jobs:not(.quiet) > .job-buying:first-child .jact { background: var(--buying); color: var(--on-buying); }
  .jobs:not(.quiet) > .job-office:first-child .jact { background: var(--office); color: var(--on-office); }
}
.stag {
  flex: none; width: 52px; height: 52px; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: var(--ink); color: var(--on-ink);
}
.stag b { font: 800 1.3rem var(--head-font); }
.stag small { font-size: 0.625rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.stag.job-orders { background: var(--orders); color: var(--on-orders); }
.stag.job-stock { background: var(--stock); color: var(--on-stock); }
.stag.job-buying { background: var(--buying); color: var(--on-buying); }
.stag.job-office { background: var(--office); color: var(--on-office); }
/* waiting on others: the same tag, hollow */
.jobs.quiet .stag { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px currentColor; }
.jobs.quiet .stag.job-orders { color: var(--orders-ink); }
.jobs.quiet .stag.job-stock { color: var(--stock-ink); }
.jobs.quiet .stag.job-buying { color: var(--buying-ink); }
.jobs.quiet .stag.job-office { color: var(--office-ink); }
.jobs.quiet .jact { color: var(--mute); }

/* how far along a request is */
.dots { display: flex; gap: 4px; margin-top: 6px; max-width: 360px; }
.dots > span { flex: 1; display: grid; gap: 3px; min-width: 0; }
.dots i { display: block; height: 5px; border-radius: 3px; background: var(--line); }
.dots .done i { background: var(--stock); }
.dots .now i { background: var(--ink); }
.dots em { font-style: normal; font-size: 0.625rem; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots .now em { color: var(--ink); font-weight: 700; }
@media (max-width: 599px) { .dots em { visibility: hidden; } .dots .now em { visibility: visible; overflow: visible; } }

/* At the shop today (computer) */
.sidecard { padding: 16px 18px; }
.sidecard + .sidecard { margin-top: 4px; }
.sidecard h3 { font-size: 0.95rem; margin-bottom: 2px; }
.card ul.plain, ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li + li { border-top: 1px solid var(--line); }
ul.plain a { display: grid; gap: 2px; padding: 10px 0; color: inherit; text-decoration: none; }
ul.plain a:hover .nm { text-decoration: underline; }
ul.plain .nm { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 0.9375rem; }
ul.plain .sub { font-size: 0.8125rem; color: var(--mute); }
.npill { font-size: 0.75rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--ink); color: var(--on-ink); white-space: nowrap; }
.npill.job-orders { background: var(--orders); color: var(--on-orders); }
.npill.job-stock { background: var(--stock); color: var(--on-stock); }
.npill.job-buying { background: var(--buying); color: var(--on-buying); }

/* Requests */
.askrow { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 22px; }
.ask { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ask:hover { border-color: var(--line2); }
.ask svg { width: 22px; height: 22px; padding: 11px; box-sizing: content-box; border-radius: 12px; flex: none; }
.ask.job-stock svg { background: var(--stock-soft); color: var(--stock-ink); }
.ask.job-buying svg { background: var(--buying-soft); color: var(--buying-ink); }
.ask > span { display: grid; gap: 2px; min-width: 0; }
.ask small { color: var(--mute); font-size: 0.8125rem; }

/* a wine's page */
.winehead { display: flex; gap: 16px; align-items: flex-start; margin: 4px 0 16px; }
.winehead h1 { font-size: 1.4rem; margin-bottom: 4px; }
.wineacts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.wineacts .btn { flex: 1 1 auto; }
.item .money { flex: none; }

/* Office */
.officecard { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
a.officecard:hover { border-color: var(--line2); }
.officecard .oico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--office-soft); color: var(--office-ink); flex: none; }
.officecard .oico svg { width: 24px; height: 24px; }
.officecard strong { display: block; font-family: var(--head-font); font-size: 1.05rem; }
.officecard .sub { display: block; color: var(--mute); font-size: 0.875rem; margin-top: 2px; }
.officecard.soon { background: transparent; border-style: dashed; border-color: var(--line2); align-items: flex-start; }
.officecard.soon .oico { background: var(--soft); color: var(--mute); }
.nextgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-bottom: 12px; }
.count-pill { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 4px; background: var(--office); color: var(--on-office); font: 800 0.8rem/26px var(--head-font); text-align: center; flex: none; }

/* My buttons */
.barpreview {
  list-style: none; margin: 0 0 4px; padding: 16px 6px 12px; display: flex; align-items: flex-end; justify-content: space-around;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
}
.barpreview li { display: grid; justify-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 700; flex: 1; min-width: 0; }
.barpreview .ico { width: 52px; height: 30px; display: grid; place-items: center; border-radius: 999px; }
.barpreview .ico svg { width: 22px; height: 22px; }
.barpreview li.empty { color: var(--mute2); }
.barpreview li.empty .ico { border: 1.5px dashed var(--line2); }
.barpreview li.job-orders .ico { color: var(--orders-ink); }
.barpreview li.job-stock .ico { color: var(--stock-ink); }
.barpreview li.job-buying .ico { color: var(--buying-ink); }
.barpreview li.job-office .ico { color: var(--office-ink); }
.barpreview li.centre { flex: none; }
.barpreview .centre-btn { top: -4px; cursor: default; border-color: var(--paper); }
.btnopts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-bottom: 8px; }
.btnopt {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--paper); color: var(--ink); text-align: left; cursor: pointer;
}
.btnopt .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); flex: none; }
.btnopt .ico svg { width: 22px; height: 22px; }
.btnopt strong { display: block; }
.btnopt small { display: block; color: var(--mute); font-size: 0.8125rem; }
.btnopt .pos { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; flex: none; font: 800 0.85rem var(--head-font); border: 1.5px solid var(--line2); color: var(--mute); }
.btnopt.on { border-color: var(--ink); }
.btnopt.on .pos { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btnopt.job-orders .ico { background: var(--orders-soft); color: var(--orders-ink); }
.btnopt.job-stock .ico { background: var(--stock-soft); color: var(--stock-ink); }
.btnopt.job-buying .ico { background: var(--buying-soft); color: var(--buying-ink); }
.btnopt.job-office .ico { background: var(--office-soft); color: var(--office-ink); }
.btnopt.on.job-orders { border-color: var(--orders); } .btnopt.on.job-stock { border-color: var(--stock); }
.btnopt.on.job-buying { border-color: var(--buying); } .btnopt.on.job-office { border-color: var(--office); }
.btnopt[disabled] { opacity: 0.45; cursor: not-allowed; }

/* The sign-in page logo, and the bits drawn before the dark look existed */
:root[data-theme="dark"] .auth .logo { filter: invert(0.94); }
:root[data-theme="dark"] .lbar { color: #16130F; }
:root[data-theme="dark"] .lday.sun { background: #1C1915; }
:root[data-theme="dark"] .lday.out { background: #1A1713; }
:root[data-theme="dark"] .lday.hol, :root[data-theme="dark"] .hol-swatch { background: var(--info-soft); border-color: var(--info-line); }
:root[data-theme="dark"] .lhol { color: var(--info); }
:root[data-theme="dark"] .info-card { border-color: var(--info-line); }
:root[data-theme="dark"] .wait-swatch { background: repeating-linear-gradient(135deg, var(--line2) 0 3px, var(--paper) 3px 6px); }
:root[data-theme="dark"] .pdot { border-color: rgba(255, 255, 255, 0.3); }
:root[data-theme="dark"] svg.chart text { fill: var(--mute); }
:root[data-theme="dark"] svg.chart line[stroke="#E7E0D6"] { stroke: var(--line); }
:root[data-theme="dark"] svg.chart [stroke="#16130F"] { stroke: var(--ink); }
:root[data-theme="dark"] .shot { border-color: transparent; }
:root[data-theme="dark"] .card.alert, :root[data-theme="dark"] .tile.hot { border-color: var(--accent-line); }
:root[data-theme="dark"] dialog { border: 1px solid var(--line); }

/* Paper is always light, even from dark mode. */
@media print {
  :root[data-theme="dark"] {
    --bg: #FFFFFF; --paper: #FFFFFF; --soft: #F3F1EE; --raise: #EDE9E3; --line: #E6E1DA; --line2: #CFC6BA;
    --ink: #1D1A16; --on-ink: #FFFFFF; --mute: #6B635A; --mute2: #8E857C; --info-soft: #EEF1F8; --info: #2C3E73;
    color-scheme: light;
  }
  :root[data-theme="dark"] .lbar { color: #16130F; }
  .hubnav { display: none !important; }
}

/* ---------- From the IQ link: stock, sales, revenue to purchase ---------- */
.stockchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.stockchip {
  display: inline-flex; align-items: center; border-radius: 6px; padding: 2px 7px; font-size: 0.78rem; font-weight: 700; white-space: nowrap;
  font-variant-numeric: tabular-nums; background: var(--soft); border: 1px solid var(--line); color: var(--ink2);
}
.stockchips.compact .stockchip { font-size: 0.72rem; padding: 1px 6px; }
.stockchip.has { background: var(--stock-soft); border-color: transparent; color: var(--stock-ink); }
.stockchip.low { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.stockchip.zero { color: var(--mute2); }
.stockchip.neg { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.stockchip.here { outline: 2px solid var(--stock); outline-offset: 0; }
.stockline { display: block; margin-top: 2px; }
.stocklist .item { align-items: center; }
.stocklist .rowlink { display: flex; gap: 12px; align-items: flex-start; color: inherit; text-decoration: none; min-width: 0; }
.stocklist .rowlink .main { min-width: 0; }
.item a.title { display: block; color: inherit; text-decoration: none; }
.item a.title:hover { text-decoration: underline; }
table.stocktable { margin-top: 4px; }
table.stocktable tr.here th { color: var(--stock-ink); }
table.data td.neg, table.data td.under { color: var(--bad); font-weight: 700; }
table.data tfoot th, table.data tfoot td { font-weight: 800; border-top: 2px solid var(--line2); border-bottom: 0; background: var(--paper); position: sticky; bottom: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 8px; }
.rangeform { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 0 0 12px; }
.rangeform label { display: grid; gap: 4px; font-size: 0.82rem; font-weight: 700; color: var(--mute); }
.rangeform input, .rangeform select { min-height: 40px; }
.rangeform select { min-width: 11.5em; }
.chartwrap { position: relative; }
.salesbars rect[data-i]:focus { outline: none; }
.salesbars rect[data-i]:focus-visible { stroke: var(--ink); stroke-width: 1; }
.charttip {
  position: absolute; top: 4px; transform: translateX(-50%); pointer-events: none; z-index: 2;
  display: grid; gap: 2px; padding: 8px 10px; border-radius: 10px; font-size: 0.8rem; white-space: nowrap;
  background: var(--paper); border: 1px solid var(--line2); box-shadow: 0 4px 14px rgba(22, 19, 15, 0.14); color: var(--ink);
}
.charttip span { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.swatch.now { background: var(--chart-now); width: 10px; height: 10px; border-radius: 3px; }
.swatch.ly { background: var(--chart-ly); }
.daytable { margin-top: 12px; }
.daytable summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.daytable table { margin-top: 8px; }
.r2pdetail > summary { cursor: pointer; font-weight: 700; font-size: 0.92rem; padding: 14px 16px; }
.r2pdetail[open] > summary { border-bottom: 1px solid var(--line); }
tr.notyet td { font-style: italic; }
.r2p { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.r2p .bar { position: relative; width: 56px; height: 6px; border-radius: 3px; background: var(--raise); }
.r2p .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--stock); }
.r2p.over .bar i { background: var(--bad); }
.r2p .bar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.r2p.over { color: var(--bad); font-weight: 800; }
.stat .val .delta { font-size: 0.95rem; }
dd.bad { color: var(--bad); }
svg.salesbars .grid { stroke: var(--line); stroke-width: 1; }
svg.salesbars .tick { fill: var(--mute); font-size: 11px; }
svg.salesbars .bar { fill: var(--chart-now); }
svg.salesbars .lyline { fill: none; stroke: var(--chart-ly); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
svg.salesbars .hit { fill: transparent; }
svg.salesbars .hit:hover { fill: rgba(127, 127, 127, 0.08); }
@media (max-width: 600px) {
  .stats.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats.compact .stat { padding: 12px; }
  .stats.compact .stat .val { font-size: 1.35rem; }
  .stats.compact .stat .val-chip .delta { font-size: 0.78rem; padding: 3px 7px; }
  .stats.compact .stat .sub { font-size: 0.75rem; }
}
dl.facts.stack { grid-template-columns: 1fr; gap: 0; }
dl.facts.stack dt { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; margin-top: 8px; }
table.stocktable { table-layout: fixed; }
table.stocktable th, table.stocktable td { white-space: normal; padding: 8px 6px; }
table.stocktable thead th { line-height: 1.25; vertical-align: bottom; }
table.stocktable th:first-child, table.stocktable td:first-child { width: 34%; }

/* A GP % to compare with, and this period's difference from it (Sales and GP tables). */
.gpbeside { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.gpbeside .delta { font-size: 0.8em; }
.panel-note { padding: 8px 16px 12px; margin: 0; }
/* GP % month by month: the shop names stay put while the months scroll on a phone. */
table.trend tbody th, table.trend tfoot th { position: sticky; left: 0; z-index: 1; background: var(--paper); }
table.trend thead th:first-child { left: 0; z-index: 3; }

/* Clocking in and out (#/clock). Big tiles, so a name is easy to hit on a shop tablet. */
.clockgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 6px 0 14px; }
.clocktile { display: flex; align-items: center; gap: 12px; padding: 14px 14px; min-height: 64px; text-align: left; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.clocktile:hover { background: var(--soft); }
.clocktile strong { display: block; }
.clocktile .sub { display: block; font-size: 0.85rem; color: var(--mute); }
.clockdot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--line2); }
.clockdot.in { background: var(--ok); }
.clockdot.break { background: var(--warn); }
.clockme h2 { margin: 0; }
input.pin { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; max-width: 9em; }
.hero .clocklink { margin-top: 12px; display: inline-flex; width: auto; }
table.data.mini { margin: 6px 0 4px; font-size: 0.85rem; }
table.data.mini td { padding: 4px 8px; }
.clockdays summary { cursor: pointer; }
input.dayinput { width: auto; max-width: 12em; }
table.data th .rowsub { display: block; font-weight: 600; }

/* Clocking › Month: everyone down the side, the days across. */
table.month th.mh { text-align: center; padding: 6px 2px; min-width: 2.6em; line-height: 1.1; }
table.month th.mh span { display: block; font-size: 0.8rem; color: var(--ink); }
table.month th.mh small { display: block; font-size: 0.65rem; }
table.month th.mh.now span { color: var(--accent-ink); }
table.month td.mc { padding: 0; text-align: center; border-left: 1px solid var(--line); }
table.month td.mc button { width: 100%; min-height: 40px; padding: 4px 2px; border: 0; background: transparent; color: inherit; font: inherit;
  font-size: 0.8rem; font-variant-numeric: tabular-nums; cursor: pointer; position: relative; }
table.month td.mc button:hover { background: var(--soft); }
table.month .wkend { background: var(--raise); }
table.month td.work { color: var(--ink); }
table.month td.inow { color: var(--ok); font-weight: 700; }
table.month td.noout, .mk.noout { color: var(--bad); font-weight: 800; }
table.month td.miss, .mk.miss { color: var(--bad); }
table.month td.leave, .mk.leave { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
table.month td.hol, table.month th.hol, .mk.hol { background: var(--info-soft); color: var(--info); font-weight: 700; }
table.month td.future button { cursor: default; }
.mdot { position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: inline-block; }
.monthlegend .mk { display: inline-block; min-width: 1.8em; padding: 0 4px; text-align: center; border-radius: 4px; position: relative; }
.monthlegend .mk .mdot { position: static; vertical-align: middle; }
.monthname { font-size: 1.05rem; }
