/* Colours from the old ordering app: forest-green header, sage buttons, pale green
   highlights, a beige band behind search. (--olive is the main accent everywhere.) */
:root {
  --olive: #3c4b3d;
  --olive-strong: #3c4b3d;
  --on-olive: #ffffff;
  --header: #3c4b3d;
  --on-header: #ffffff;
  --tint: #dde6dd;
  --tint-soft: #f6f8f5;
  --tint-border: #c9d5c9;
  --band: #f3efe6;
  --bg: #ffffff;
  --surface: #ffffff;
  --text: #1f2721;
  --muted: #6b716a;
  --border: #dcdfd9;
  --error: #b3261e;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --olive: #c3d6c3;
    --olive-strong: #c3d6c3;
    --on-olive: #172017;
    --header: #1f2a21;
    --on-header: #eef3ee;
    --tint: #2c3a2d;
    --tint-soft: #212a22;
    --tint-border: #3d4f3e;
    --band: #23261f;
    --bg: #171b18;
    --surface: #1f2420;
    --text: #e9eee9;
    --muted: #a3aaa3;
    --border: #353c36;
    --error: #f2b8b5;
  }
}

* { box-sizing: border-box; }

/* Text size for the whole hub (owner's iPhone preference): 13px, like iPhone's text size
   one step down (chosen on Ordering first, 2 Oct). Every rem follows; the fixed pixel
   sizes are trimmed to match further down ("Compact sizes"). Fields stay 16px, because
   iPhones zoom the whole page when a field's text is smaller. */
html { font-size: 13px; }
input:not([type="checkbox"]):not([type="radio"]):not(.stepper input), select, textarea { font-size: 16px !important; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}

main { max-width: 560px; margin: 0 auto; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); }

h1 { color: var(--olive-strong); font-size: 1.6rem; margin: 0.5rem 0; }
.muted { color: var(--muted); margin: 0.25rem 0 1rem; }
.center { text-align: center; }
.error { color: var(--error); min-height: 1.4em; margin: 0.5rem 0; font-weight: 500; }

/* PIN screen */
.pin-screen { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 3vh; }
/* The logo has a transparent background around a white building. */
.logo { width: auto; height: min(22vh, 220px); margin-bottom: 0.25rem; }
@media (prefers-color-scheme: dark) {
  /* Faint light outline so the black roof and ground line stay visible on the dark background. */
  .logo { filter: drop-shadow(0 0 1px rgb(255 255 255 / 0.7)) drop-shadow(0 0 6px rgb(255 255 255 / 0.15)); }
}
.pin-dots { display: flex; gap: 18px; margin: 0.5rem 0 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--olive); }
.pin-dots span.filled { background: var(--olive); }
.pin-dots.shake { animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Keys shrink on short screens (e.g. iPhone SE) so the whole keypad fits without scrolling. */
.keypad { --key: min(76px, 10.5vh); display: grid; grid-template-columns: repeat(3, var(--key)); gap: min(16px, 1.8vh) 16px; }
.keypad button {
  height: var(--key); border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 1.7rem; font-weight: 500;
  touch-action: manipulation; cursor: pointer;
}
.keypad button:active { background: var(--olive); color: var(--on-olive); }
.keypad button:disabled { opacity: 0.5; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.form input {
  font: inherit; font-size: 1.05rem; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form input:focus { outline: 2px solid var(--olive); outline-offset: 1px; }

button.primary, a.primary {
  font: inherit; font-weight: 600; font-size: 1.05rem; padding: 14px; border: 0; border-radius: var(--radius);
  background: var(--olive); color: var(--on-olive); cursor: pointer;
}
button.primary:disabled { opacity: 0.6; }
button.link { background: none; border: 0; color: var(--olive); font: inherit; font-weight: 500; padding: 8px; cursor: pointer; }

/* Shared */
/* Header band across the top of every screen (runs edge to edge over main's padding). */
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  background: var(--header); color: var(--on-header);
  margin: calc(-1 * max(16px, env(safe-area-inset-top))) -16px 16px;
  padding: max(18px, env(safe-area-inset-top)) 16px 18px;
}
.topbar-title { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; min-width: 0; }
.topbar-title .title { font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8rem; font-weight: 700; }
.topbar .eyebrow { opacity: 0.8; }
.topbar-right { display: flex; align-items: center; gap: 4px; flex: none; }
.topbar .link { color: var(--on-header); }
.to-order { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; font-size: 0.95rem; }
.to-order .bar { width: 130px; height: 6px; border-radius: 3px; background: rgb(255 255 255 / 0.25); overflow: hidden; }
.to-order .bar span { display: block; height: 100%; background: var(--on-header); }

/* "Signed in" card */
.card.signed-in { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 1rem; }
.signed-in .eyebrow { color: var(--muted); font-size: 0.75rem; }
.signed-in .who { font-size: 1.25rem; font-weight: 700; margin: 4px 0 2px; }
.signed-in .muted { margin: 0; }
button.outline, a.outline {
  font: inherit; font-weight: 600; font-size: 1.05rem; padding: 12px 20px; border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--olive-strong); border: 1.5px solid var(--olive-strong); flex: none;
}

h2 { font-size: 1.1rem; margin: 1.5rem 0 0.5rem; }
.small { font-size: 0.85rem; }
a.link, .back { color: var(--olive); font-weight: 500; text-decoration: none; }
.back { display: inline-block; padding: 8px 0; }
.notice { background: var(--surface); border-left: 4px solid var(--olive); padding: 8px 12px; border-radius: 6px; margin: 0.5rem 0; }

/* Day navigation */
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 0.5rem; }
.navbtn {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 1.6rem; text-decoration: none;
}
.daylabel { position: relative; flex: 1; text-align: center; font-size: 1.2rem; font-weight: 600; color: var(--olive); padding: 10px 0; }
.daylabel input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }

.stats { display: flex; gap: 8px; margin: 0.75rem 0 1rem; }
.stats div {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; text-align: center; display: flex; flex-direction: column;
}
.stats strong { font-size: 1.4rem; color: var(--olive); }
.stats span { font-size: 0.8rem; color: var(--muted); }

/* Booking cards */
.list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.card.booking { display: flex; gap: 14px; color: var(--text); text-decoration: none; }
.card.booking .time { font-size: 1.25rem; font-weight: 700; color: var(--olive); min-width: 3.4em; }
.card .name { font-weight: 600; font-size: 1.05rem; }
.card .notes { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }
.card.cancelled { opacity: 0.6; }
.card.cancelled .name { text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pill { font-size: 0.8rem; border-radius: 999px; padding: 2px 10px; background: var(--bg); border: 1px solid var(--border); }
.pill.outside { border-color: #4f8a8b; }
.pill.cancelled { color: var(--error); border-color: var(--error); }
.pill.override { color: #9a6700; border-color: #d4a72c; }
.empty { padding: 2rem 0; }
.cancelled-list { margin-top: 1rem; }
.cancelled-list summary { color: var(--muted); padding: 8px 0; cursor: pointer; }

.fab {
  position: sticky; bottom: max(16px, env(safe-area-inset-bottom)); display: block; margin: 1.25rem 0 0;
  text-align: center; background: var(--olive); color: var(--on-olive); font-weight: 600; font-size: 1.05rem;
  padding: 16px; border-radius: var(--radius); text-decoration: none; box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
}

/* Booking form */
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.form textarea {
  font: inherit; font-size: 1.05rem; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical;
}
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented button, .stepper button, .slot {
  font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; touch-action: manipulation;
}
.segmented button.selected, .slot.selected { background: var(--olive); color: var(--on-olive); border-color: var(--olive); font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 52px; height: 52px; font-size: 1.5rem; padding: 0; }
.stepper button:disabled { opacity: 0.4; }
.stepper output { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 600; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.slot { padding: 10px 4px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.slot small { font-size: 0.7rem; }
.slot.full { color: var(--muted); border-style: dashed; }
.slot.full.selected { color: var(--on-olive); border-style: solid; }
.slot:disabled { opacity: 0.45; cursor: not-allowed; }
button.secondary {
  font: inherit; font-weight: 600; padding: 12px; width: 100%; border-radius: var(--radius);
  background: none; border: 2px solid #d4a72c; color: var(--text); cursor: pointer;
}

/* Booking detail */
.detail h1 { margin: 0.25rem 0; color: var(--text); }
.detail-time { font-size: 1.4rem; font-weight: 700; color: var(--olive); }
.detail-time .muted { font-size: 1rem; font-weight: 400; }
.detail.cancelled h1 { text-decoration: line-through; }
.phone { display: inline-block; font-size: 1.1rem; color: var(--olive); font-weight: 600; text-decoration: none; padding: 8px 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1rem; }
a.button { text-decoration: none; display: flex; align-items: center; justify-content: center; }
button.danger {
  font: inherit; font-weight: 600; font-size: 1.05rem; padding: 14px; border-radius: var(--radius);
  background: none; border: 2px solid var(--error); color: var(--error); cursor: pointer;
}
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.history li { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }

/* Manager screens */
.topbar .link + .link, .topbar a.link { margin-left: 4px; }
.card.menu { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.card.menu .muted { margin: 0; font-size: 0.9rem; }
details.card summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card[open] summary { margin-bottom: 12px; }
details.card.add { margin-bottom: 12px; }
details.card.add summary { color: var(--olive); }
.card.staff.inactive strong { color: var(--muted); }
.form select, .hours-row select {
  font: inherit; font-size: 1.05rem; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form label.check { flex-direction: row; align-items: center; gap: 10px; }
.form label.check input { width: 22px; height: 22px; }
.form label .small { font-weight: 400; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card.closure { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.warn { color: #9a6700; font-weight: 500; margin-top: 4px; }
.danger-link { color: var(--error) !important; }
.hours-row { display: grid; grid-template-columns: 2.6em 1fr auto 1fr auto; align-items: center; gap: 6px; }
.hours-row select { padding: 10px 6px; min-width: 0; }
.hours-row select:disabled { opacity: 0.4; }
.hours-row label.check { font-weight: 400; gap: 6px; }
.hours-row label.check input { width: 20px; height: 20px; }
.form h2 { margin-bottom: 0; }

/* Hub dashboard */
.brand { color: var(--olive); font-weight: 700; text-decoration: none; margin-right: 6px; }
.team-notice {
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--olive);
  border-radius: var(--radius); padding: 12px 14px; margin: 0.5rem 0 1rem;
}
.team-notice .notice-text { white-space: pre-line; font-size: 1.05rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.team-notice .muted { margin: 0; }
details.card.notice-edit { margin-bottom: 1rem; }
details.card.notice-edit summary { color: var(--olive); }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.card.summary-item { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; }
.card.summary-item .muted { margin: 0; }
.card.summary-item strong { font-size: 1.2rem; color: var(--olive); }
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.card.tool { display: flex; flex-direction: column; gap: 4px; min-height: 120px; color: var(--text); text-decoration: none; }
.card.tool:active { border-color: var(--olive); }
.card.tool .tool-icon { font-size: 2rem; line-height: 1; }
.card.tool strong { font-size: 1.1rem; }
.card.tool .muted { margin: 0; }
.row.one { grid-template-columns: 1fr; }
details.card summary .muted { margin: 0; }

/* Ordering (laid out like the old ordering app) */
button.fab { width: 100%; border: 0; font-family: inherit; cursor: pointer; }
button.fab:disabled { opacity: 0.6; }
.search {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 14px 14px 14px 40px; border-radius: 12px;
  border: 1px solid var(--border); color: var(--text);
  background: var(--surface) no-repeat 14px center / 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236b716a' stroke-width='2'%3E%3Ccircle cx='9' cy='6' r='4.5'/%3E%3Cpath d='M6 9.5 2 14'/%3E%3C/svg%3E");
}
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 10px; margin-bottom: 0.25rem; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * {
  flex: none; font: inherit; font-weight: 600; font-size: 1.02rem; padding: 10px 16px; border-radius: 999px; white-space: nowrap;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--olive-strong); text-decoration: none; cursor: pointer;
}
.tabs > .selected { background: var(--olive); color: var(--on-olive); border-color: var(--olive); }

/* Search + supplier pills stay pinned while scrolling, on a beige band. */
.sticky-band {
  position: sticky; top: 0; z-index: 5; background: var(--band);
  margin: 0 -16px 12px; padding: 12px 16px 2px; border-bottom: 1px solid var(--border);
}
.sticky-band .tabs { padding-top: 12px; margin: 0; }

/* Collapsible groups: "▾ Aldi · 47 products" */
details.group { margin-bottom: 12px; }
details.group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: var(--tint); border: 1px solid var(--tint-border); border-radius: var(--radius); padding: 16px;
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: "▸"; font-size: 0.9rem; color: var(--olive-strong); }
details.group[open] > summary::before { content: "▾"; }
.group-title { flex: 1; font-size: 1.4rem; font-weight: 700; color: var(--olive-strong); }
.group-count { font-weight: 600; color: var(--muted); }
/* Supplier order days under the name: "Order days: Mon · Wed · Fri  [Order today]" */
.group-title .order-days { display: block; margin-top: 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.group-title .order-days.today { color: var(--olive); }
.today-pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--olive); color: var(--on-olive); font-size: 0.75rem; white-space: nowrap; }
.weekdays { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.weekdays .check-line { margin: 0; }
fieldset.weekdays-field { border: 0; padding: 0; margin: 0; }
fieldset.weekdays-field .hint { display: block; margin-top: 6px; }
.group-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
details.group > .list { margin-top: 10px; }
h3.tier { color: var(--olive); font-size: 0.85rem; margin: 18px 4px 10px; }

/* Product cards */
.card.product { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.card.product .name { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.card .sub { margin: 0; overflow-wrap: anywhere; }
.card.wanted { border: 1.5px solid var(--olive-strong); background: var(--tint-soft); }
/* Name on the left, the order unit boxed on the right; "Needed" level with − 0 + */
.product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.product-head .name { flex: 1; min-width: 0; }
.unit-tag {
  flex: none; padding: 3px 10px; border: 1px solid var(--border); border-radius: 8px;
  color: var(--muted); font-size: 0.9rem; font-weight: 600; white-space: nowrap;
}
.needed-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.needed { font-size: 1.15rem; color: var(--olive-strong); }
.status { font-weight: 700; color: var(--muted); margin-top: 4px; }
.wanted .status { color: var(--olive-strong); }
.card .notes { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* Joined − 0 + control */
.stepper.qty {
  display: flex; gap: 0; flex: none; border: 1px solid var(--tint-border); border-radius: 12px; overflow: hidden;
}
.stepper.qty button {
  width: 42px; height: 42px; font-size: 1.4rem; font-weight: 700; border: 0; border-radius: 0;
  background: var(--tint); color: var(--olive-strong);
}
.stepper.qty button[data-step="-1"] { background: var(--tint-soft); }
.stepper.qty button:disabled { opacity: 1; color: var(--tint-border); }
.stepper.qty input {
  width: 46px; text-align: center; font: inherit; font-size: 16px; font-weight: 600; padding: 0;
  border: 0; border-radius: 0; background: var(--surface); color: var(--text); -moz-appearance: textfield;
}
.stepper.qty input::-webkit-inner-spin-button, .stepper.qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Compact sizes: fixed pixel sizes trimmed to match the 13px text (see the top). The
   leading `html` makes these win over the shared `main …` rules further down. */
html .card.product { padding: 12px 14px; gap: 2px; }
html .card.product .needed-row { margin-top: 6px; }
html .stepper.qty button { width: 38px; height: 38px; }
html .stepper.qty input { width: 42px; }
html .search { padding-top: 10px; padding-bottom: 10px; }
html details.group > summary { padding: 12px 14px; }
html .card.signed-in { padding: 12px 14px; }
html .topbar { padding-bottom: 14px; }
html .fab { padding: 13px; }
html main button.primary { min-height: 44px; }
.item-note {
  font: inherit; font-size: 1.05rem; padding: 12px 14px; margin-top: 8px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}

/* Unlisted items, Request a product, notes */
.card.unlisted { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card.unlisted .muted { margin: 2px 0 0; }
#unlisted:not(:empty) { margin-bottom: 12px; }
details.card.fold { margin-bottom: 12px; padding: 0; }
details.card.fold > summary {
  list-style: none; cursor: pointer; padding: 18px 16px; font-size: 1.15rem; font-weight: 700; color: var(--olive-strong);
  display: flex; justify-content: space-between;
}
details.card.fold > summary::-webkit-details-marker { display: none; }
details.card.fold > summary::after { content: "⌄"; color: var(--muted); }
details.card.fold[open] > summary { border-bottom: 1px solid var(--border); margin: 0 16px; padding: 18px 0; }
details.card.fold > form { padding: 14px 16px 16px; }
details.card.fold .muted { margin: 0; }
.notes-label { display: flex; flex-direction: column; gap: 10px; color: var(--muted); }
.notes-label strong { color: var(--olive-strong); font-size: 1.1rem; }
.notes-label textarea, .card textarea {
  font: inherit; font-size: 1.05rem; padding: 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); resize: vertical;
}
.queue-main { display: flex; flex-direction: column; gap: 2px; }
.queue-main .muted { margin: 2px 0 0; }
button.small-btn { font-size: 0.95rem; padding: 8px 14px; }
.sent { padding-top: 10vh; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sent-tick {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--olive); color: var(--on-olive); font-size: 2.4rem; font-weight: 700;
}
.sent .button { margin-top: 1rem; padding: 14px 28px; }
.card.queue-line { display: flex; align-items: flex-start; gap: 12px; }
.queue-line .queue-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.queue-line .name { font-size: 1.1rem; font-weight: 700; }
.queue-line .tick { width: 24px; height: 24px; margin-top: 4px; flex: none; accent-color: var(--olive); }
.queue-line .notice-text { white-space: pre-line; }
.tabs.sections { gap: 8px; }
.tabs.sections > * { font-size: 0.95rem; padding: 9px 13px; }
.queue-pills > * { font-size: 0.9rem; padding: 8px 12px; }
.card .notice-text { white-space: pre-line; margin-top: 6px; }
.manage-items .row .primary { padding: 12px; }

/* Order Queue (supervisors), as in the old app */
.card.intro { margin-bottom: 14px; }
.intro .eyebrow { color: var(--olive); font-size: 0.8rem; }
.intro-title { font-size: 1.9rem; color: var(--olive-strong); margin: 4px 0 6px; }
.intro p.muted { font-size: 1.05rem; margin: 0 0 14px; }
.intro-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.intro-row strong { font-size: 1.15rem; color: var(--olive-strong); }
.bulk-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 12px 0; }
.select-all { white-space: nowrap; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--olive-strong); cursor: pointer; }
.select-all input, .queue-item .tick { width: 28px; height: 28px; accent-color: var(--olive); flex: none; }
button.complete { padding: 12px 18px; white-space: nowrap; }
button.primary:disabled { opacity: 0.55; cursor: default; }
.card.order-card { margin-bottom: 12px; }
.order-card .ref { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.1em; }
.order-card .who { font-size: 1.15rem; font-weight: 700; margin: 4px 0 2px; }
.order-card > .muted { margin: 0 0 4px; }
.queue-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); cursor: pointer; }
.queue-item:first-of-type { margin-top: 10px; }
.queue-item .queue-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.queue-item .name { font-size: 1.1rem; font-weight: 700; color: var(--olive-strong); }
.line-qty { font-size: 1.1rem; font-weight: 700; margin: 4px 0 2px; }
.queue-item .muted { margin: 0; }
a.group-link {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; text-decoration: none;
  background: var(--tint); border: 1px solid var(--tint-border); border-radius: var(--radius); padding: 16px;
}
a.group-link::before { content: "▸"; font-size: 0.9rem; color: var(--olive-strong); }
details.group.sub { margin: 10px 0 10px 12px; }
details.group.sub > summary { padding: 14px; }
details.group.sub .group-title { font-size: 1.2rem; }
.done-order { border-bottom: 1px solid var(--border); margin-left: 12px; }
.done-order > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 4px; }
.done-order > summary::-webkit-details-marker { display: none; }
.done-order > summary::before { content: "▸"; font-size: 0.8rem; color: var(--olive-strong); }
.done-order[open] > summary::before { content: "▾"; }
.done-ref { flex: 1; font-weight: 700; color: var(--olive-strong); overflow-wrap: anywhere; }
.done-order > summary .muted { margin: 0; text-align: right; font-weight: 600; }
.done-order > .muted { margin: 0 4px 6px; }
.done-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px dashed var(--border); }
.done-line .name { font-weight: 600; }
.done-line .muted { margin: 2px 0 0; }

/* Manage Items (inside the Orders page), as in the old app */
#manage-items-body { margin-top: 10px; }
.segmented.three { grid-template-columns: repeat(3, 1fr); }
.segmented.three button { white-space: nowrap; padding: 12px 4px; }
.form label .optional { color: var(--muted); font-weight: 400; }
.manage-card .segmented { margin-bottom: 12px; }
.manage-card .form label { color: var(--olive-strong); font-weight: 700; }
.manage-card p.muted { margin: 0 0 12px; }
.manage-status { color: var(--olive-strong); font-weight: 700; margin: 0 0 12px; }
.form small.hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.form input[readonly] { background: var(--tint-soft); color: var(--muted); }
.manage-card .done-order > form { padding: 4px 4px 14px; }
.manage-card .done-order { margin-left: 0; }

/* Ordering switch-over */
.card.switch-step { margin-bottom: 14px; }
.switch-step h2 { margin-top: 0; color: var(--olive-strong); }
.switch-step input[type=file] { font: inherit; margin: 6px 0 12px; max-width: 100%; }
.import-summary { padding-left: 1.2em; margin: 8px 0 14px; line-height: 1.6; }
.switch-step button.primary, .switch-step button.outline, .switch-step button.danger { width: 100%; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-weight: 500; }
.check-line input { width: 22px; height: 22px; flex: none; accent-color: var(--olive); }

/* HACCP fridge temps (laid out like the old haccp-refrigeration app) */
.haccp-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.haccp-title .outline { text-decoration: none; padding: 10px 16px; }
.card.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin: 12px 0; }
.meta-grid strong, .daily-status strong {
  display: block; font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 2px;
}
.haccp-form > .card, .haccp-form + .haccp-status, main > .card + .haccp-form { margin-bottom: 12px; }
main > .card { margin-bottom: 12px; }
.daily-status { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.daily-status > div { border: 1px solid var(--border); border-radius: 10px; padding: 10px; text-align: center; }
.daily-status span { font-weight: 800; }
.daily-status .complete { color: var(--olive-strong); }
.daily-status .missing { color: #9a3412; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.form .hint { margin-top: -8px; }
.form select { font: inherit; font-size: 1.05rem; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.units { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.unit { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.unit.outside { border-color: #d97706; background: #fff7ed; }
.unit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.unit-head strong { font-size: 1.1rem; }
.unit-head .band { color: var(--muted); font-size: 0.85rem; text-align: right; }
.step-entry { display: flex; gap: 8px; }
.step-entry input {
  flex: 1; min-width: 0; font: inherit; font-size: 1.25rem; text-align: center; padding: 12px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.step-entry button {
  flex: none; width: 52px; font: inherit; font-size: 1.5rem; font-weight: 700; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--tint-border); background: var(--tint-soft); color: var(--olive-strong); touch-action: manipulation;
}
.step-entry button:disabled, .step-entry input:disabled { opacity: 0.6; }
.exception { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #d97706; }
.exception > strong { color: #9a3412; }
.exception label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.exception textarea, .exception input { font-weight: 400; }
.exception textarea, .exception > label > input {
  font: inherit; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.exception .step-entry input { font-size: 1.05rem; text-align: left; }
.resolution { font-weight: 600; color: var(--olive-strong); }
.haccp-actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.haccp-actions button { width: 100%; }
button.confirm { border-color: var(--olive); color: var(--olive-strong); background: var(--surface); }
button.confirm.confirmed { background: var(--tint); }
button.confirm:disabled, .haccp-actions .primary:disabled { opacity: 0.5; }
.haccp-status { white-space: pre-line; padding: 12px; border-radius: 10px; background: var(--tint-soft); border: 1px solid var(--border); margin-bottom: 12px; }
.haccp-status.error { background: #fee2e2; color: #7f1d1d; border-color: #fca5a5; }
.haccp-status.success { background: var(--tint); color: var(--olive-strong); border-color: var(--tint-border); font-weight: 600; }
button.done-link { width: 100%; margin-bottom: 1rem; }
@media (prefers-color-scheme: dark) {
  .unit.outside { background: #3a2a1a; }
  .daily-status .missing, .exception > strong { color: #fdba74; }
  .haccp-status.error { background: #3b1d1d; color: #fecaca; border-color: #7f1d1d; }
}

/* Refrigeration reports: a table on wide screens, one card per round on phones. */
.report-filters { margin-top: 12px; }
.report-filters input[type=date] { min-height: 48px; width: 100%; }
.report-status { margin-top: 12px; padding: 12px; border-radius: 10px; background: var(--tint-soft); }
.report-status.error { background: #fee2e2; color: #7f1d1d; }
.report-scroll { overflow-x: auto; padding: 0; }
table.report { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.report th, .report td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report th { background: var(--tint-soft); }
.report td.outside { color: #9a3412; font-weight: 800; }
.report td.notes-cell { white-space: normal; min-width: 220px; }
@media (max-width: 700px) {
  .report-scroll { overflow: visible; border: 0; background: none; }
  table.report, .report tbody { display: block; }
  .report thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .report tbody { display: grid; gap: 12px; }
  .report tr {
    display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; padding: 6px 12px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  }
  .report td { display: flex; flex-direction: column; gap: 4px; padding: 9px 0; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
  .report td::before { content: attr(data-label); color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em; }
  .report td:first-child { grid-column: 1 / -1; font-size: 1.1rem; font-weight: 800; }
  .report td:nth-child(2), .report td:nth-child(3) { border-bottom: 1px solid var(--border); }
  .report td:nth-child(n+5) { font-size: 1rem; font-weight: 700; }
  .report td:nth-child(4), .report td.notes-cell { grid-column: 1 / -1; }
  .report td.notes-cell { font-weight: 500; font-size: 0.95rem; min-width: 0; }
  .report td.empty-notes { display: none; }
  .report td.outside { background: #fff7ed; border-radius: 8px; padding-left: 8px; }
}
@media (max-width: 700px) and (prefers-color-scheme: dark) {
  .report td.outside { background: #3a2a1a; color: #fdba74; }
}

/* Weekly sales → QuickBooks: "Check set-up" results */
.checklist { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.checklist li { padding: 6px 0 6px 1.6rem; border-top: 1px solid var(--border); position: relative; overflow-wrap: anywhere; }
.checklist li::before { position: absolute; left: 0.2rem; font-weight: 700; }
.checklist li.ok::before { content: "✓"; color: var(--olive); }
.checklist li.bad::before { content: "✗"; color: var(--error); }
.checklist li.warning::before { content: "!"; color: #9a6700; }
table.figures { width: 100%; border-collapse: collapse; margin: 0.25rem 0 0.75rem; }
.figures th, .figures td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--border); vertical-align: top; }
.figures th { font-weight: 600; width: 45%; }
table.journal { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.journal th, .journal td { text-align: left; padding: 6px 3px; border-bottom: 1px solid var(--border); vertical-align: top; }
.journal th { background: var(--tint-soft); white-space: nowrap; }
.journal .num { text-align: right; white-space: nowrap; }
.journal tr.zero td { color: var(--muted); }
.table-scroll { overflow-x: auto; }
details.card summary h2 { margin: 0; font-size: inherit; }
details.card .card { margin: 0.75rem 0 0; }
/* The shared look, carried over from Receipts (owner, 1 Oct 2026): soft background, white rounded
   cards, small grey labels above fields, one field per line, dark main button. Written with
   `main` in front so it beats each tool's older rules without touching their markup. */
body { background: var(--band); }
main h1 { color: var(--text); font-size: 1.75rem; line-height: 1.2; }
main .card { border-radius: 18px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.05); }
main .form { gap: 16px; }
main .form label { gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
main .form label small, main .form label .small, main .form label .optional { font-weight: 400; margin-left: 6px; }
main .form input:not([type="checkbox"]):not([type="radio"]), main .form select:not(.hours-row select), main .form textarea {
  width: 100%; min-width: 0; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; appearance: none; -webkit-appearance: none;
}
main .form input:not([type="checkbox"]):not([type="radio"]), main .form select:not(.hours-row select) { height: 46px; }
main .form textarea { padding: 12px 14px; min-height: 92px; line-height: 1.4; }
main .form select:not(.hours-row select) {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
main .form input[type="date"], main .form input[type="time"] { display: flex; align-items: center; text-align: left; line-height: normal; }
main .form input::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
main .form input::-webkit-datetime-edit { padding: 0; }
main .form input:focus, main .form select:focus, main .form textarea:focus { outline: 2px solid var(--olive); outline-offset: 1px; }
main .form .row { grid-template-columns: 1fr; gap: 16px; }
main .form label.check { font-size: 1rem; font-weight: 500; color: var(--text); gap: 12px; align-items: flex-start; }
main .form label.check input { margin: 1px 0 0; flex: none; accent-color: var(--olive); }
main button.primary, main a.primary {
  display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: 14px;
  background: var(--olive-strong); color: var(--on-olive); font-size: 1rem; font-weight: 600; text-decoration: none;
}
main button.secondary { min-height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 1rem; }
main button.outline, main a.outline { border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
main button.danger { border-radius: 14px; }
main button:disabled { opacity: 0.55; }
main .form legend { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
main .form fieldset label.small { margin-top: 14px; }
main .card.summary-item strong { font-size: 1rem; font-weight: 600; line-height: 1.35; }
main .card.summary-item .muted { font-size: 0.85rem; }

/* Receipts: clean, roomy screens (owner's reference design, 30 Sep 2026). One field per line,
   small grey labels above, white cards on a soft background, one dark main button. */
:root { --rc-amber: #fbf3dc; --rc-amber-text: #6b4f00; --rc-red: #fbe9e7; --rc-green: #e8f0e8; }
@media (prefers-color-scheme: dark) { :root { --rc-amber: #3a3320; --rc-amber-text: #f0d98a; --rc-red: #3d2422; --rc-green: #253026; } }
body:has(.rc) { background: var(--band); }

.rc { display: flex; flex-direction: column; gap: 16px; padding-bottom: 40px; }
.rc-stack { display: flex; flex-direction: column; gap: 12px; }
.rc h1 { margin: 4px 0 0; font-size: 1.75rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.rc h2 { margin: 0; font-size: 1.05rem; color: var(--text); }
.rc .card { border-radius: 18px; padding: 20px; margin: 0; box-shadow: 0 1px 3px rgb(0 0 0 / 0.05); }
.rc .muted { margin: 0; }
.rc small, .rc .small { font-size: 0.85rem; }
.rc .link.back { padding: 0; align-self: flex-start; }
.rc-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.rc-h { margin: 8px 0 -4px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.rc-foot { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 0.8rem; line-height: 1.6; }
.rc .warn { color: var(--rc-amber-text); }
.rc-ok { color: var(--olive); margin: 0; }

/* Fields: one per line */
.rc .form { gap: 16px; }
.rc .card .form, .rc-block .form { gap: 16px; }
.rc .form label, .rc label { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.rc label small, .rc label .small { font-weight: 400; margin-left: 6px; }
.rc input:not([type="checkbox"]):not([type="radio"]), .rc select, .rc textarea {
  width: 100%; min-width: 0; height: 46px; padding: 0 14px; font: inherit; font-size: 16px; font-weight: 400;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  appearance: none; -webkit-appearance: none;
}
.rc select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 20px, calc(100% - 15px) 20px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
/* iPhones draw the date in their own box, top-aligned and centred: pin it to the middle-left like the other fields. */
.rc input[type="date"] { display: flex; align-items: center; text-align: left; line-height: normal; }
.rc input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }
.rc input[type="date"]::-webkit-datetime-edit { padding: 0; }
.rc input:focus, .rc select:focus { outline: 2px solid var(--olive); outline-offset: 1px; }
.rc .row { grid-template-columns: 1fr; gap: 16px; }
.rc label.check { flex-direction: row; align-items: flex-start; gap: 12px; font-size: 1rem; font-weight: 500; color: var(--text); }
.rc label.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--olive); }
.rc label.check small { display: block; margin: 2px 0 0; color: var(--muted); }
.rc label.check span { display: flex; flex-direction: column; }

/* Bill / Expense as two tap targets */
.rc fieldset.choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.rc fieldset.choice legend { padding: 0; margin-bottom: 8px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.rc .choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc fieldset.choice label { position: relative; align-items: center; justify-content: center; gap: 2px; min-height: 58px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 600; text-align: center; cursor: pointer; }
.rc fieldset.choice label small { margin: 0; font-weight: 400; color: var(--muted); }
.rc fieldset.choice input { position: absolute; opacity: 0; width: 100%; height: 100%; inset: 0; margin: 0; cursor: pointer; }
.rc fieldset.choice label:has(input:checked) { background: var(--olive-strong); border-color: var(--olive-strong); color: var(--on-olive); }
.rc fieldset.choice label:has(input:checked) small { color: inherit; opacity: 0.8; }

/* Buttons: one dark main button; the rest quiet */
.rc button.primary, .rc a.primary {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; padding: 0; margin: 0;
  border-radius: 14px; background: var(--olive-strong); color: var(--on-olive); font-size: 1rem; font-weight: 600; text-decoration: none;
}
.rc button.secondary {
  width: 100%; height: 44px; padding: 0 16px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 600;
}
.rc button.small-btn { width: auto; min-width: 44px; height: 40px; padding: 0 14px; font-size: 0.95rem; }
.rc button.link { align-self: center; }
.rc button.danger-link { color: var(--error); }
.rc-actions { display: flex; flex-direction: column; gap: 4px; }
.rc button:disabled { opacity: 0.55; }

/* Receipts page */
.rc-hero { display: flex; flex-direction: column; gap: 4px; text-align: center; }
.rc-big { margin: 0; font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--olive-strong); }
.rc-cap { margin: 0 0 16px; font-size: 1.05rem; color: var(--muted); }
.rc-hero .rc-sub { margin-top: 12px; }
.rc-fold { padding: 0 !important; }
.rc-fold > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; font-weight: 600; font-size: 1.02rem; cursor: pointer; list-style: none; }
.rc-fold > summary::-webkit-details-marker { display: none; }
.rc-fold > summary::after { content: "›"; color: var(--muted); font-size: 1.4rem; transform: rotate(90deg); margin-left: 4px; }
.rc-fold[open] > summary::after { transform: rotate(-90deg); }
.rc-fold > summary .rc-pill { margin-left: auto; }
.rc-pill { min-width: 28px; padding: 2px 10px; border-radius: 999px; background: var(--tint); color: var(--olive-strong); font-size: 0.85rem; font-weight: 700; text-align: center; }
.rc-body { display: flex; flex-direction: column; gap: 14px; padding: 0 20px 20px; }
.rc-fold > .rc-item:first-of-type { border-top: 1px solid var(--border); }
.rc-body .rc-item { margin: 0 -20px; padding-left: 20px; padding-right: 20px; }
.rc-item { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.rc-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rc-main strong { font-weight: 600; overflow-wrap: anywhere; }
.rc-main small { color: var(--muted); }
.rc-why { line-height: 1.35; overflow-wrap: anywhere; }
.rc-finding { display: flex; flex-direction: column; gap: 12px; background: var(--rc-amber); border-color: transparent; }
.rc-finding p { margin: 0; color: var(--rc-amber-text); line-height: 1.4; }
/* A possible duplicate: this receipt next to what it looks like, field by field. */
.rc-compare { display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--rc-amber-text); }
.rc-compare h2 { margin: 0; }
.rc-compare p { margin: 0; line-height: 1.4; }
.rc-cmp { display: flex; flex-direction: column; }
.rc-cmp-row { display: grid; grid-template-columns: 5.5em 1fr 1fr 1.4em; gap: 8px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.rc-cmp-head { border-top: 0; padding-top: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rc-cmp-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.rc-cmp-row.off span[role="cell"] { color: var(--rc-amber-text); font-weight: 600; }
.rc-mark { text-align: center; font-weight: 700; }
.rc-mark.ok { color: var(--olive); }
.rc-mark.off { color: var(--rc-amber-text); }
.rc .error:empty { display: none; }
.rc-plain li .rc-item { border-top: 0; padding: 0; margin: 0; }
.rc [data-for="batch"] { display: flex; flex-direction: column; gap: 16px; }
.rc [data-for="batch"] small { display: block; line-height: 1.5; }
.rc-amt { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.rc-plain li { display: flex; flex-direction: column; gap: 3px; padding: 12px 0; border-top: 1px solid var(--border); }
.rc-plain li:first-child { border-top: 0; padding-top: 0; }
.rc-plain li:last-child { padding-bottom: 0; }
.rc-decision { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.rc-decision:first-child { border-top: 0; padding-top: 0; }
.rc-decision p { margin: 0; }
.rc-tools > summary { font-weight: 600; }
.rc-tools .rc-block { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-top: 1px solid var(--border); }
.rc-tools details.rc-block > summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; }
.rc-tools details.rc-block > summary::-webkit-details-marker { display: none; }
.rc-tools details.rc-block[open] > summary { margin-bottom: 12px; }
.rc-sub-fold > summary { cursor: pointer; list-style: none; margin-top: 4px; }
.rc-sub-fold > summary::-webkit-details-marker { display: none; }
.rc-sub-fold[open] > summary { margin-bottom: 12px; }
.rc-sub-fold > .muted { margin-bottom: 12px; }
.rc-tools .card { box-shadow: none; padding: 14px; }

/* Checks and notices */
.rc .checklist { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rc .checklist li { border: 0; border-radius: 12px; padding: 12px 14px 12px 38px; line-height: 1.4; }
.rc .checklist li::before { left: 14px; top: 12px; }
.rc .checklist li.warning { background: var(--rc-amber); color: var(--rc-amber-text); }
.rc .checklist li.warning::before { color: var(--rc-amber-text); }
.rc .checklist li.bad { background: var(--rc-red); }
.rc .checklist li.ok { background: var(--rc-green); }
.rc-tools .checklist li { background: none; padding-left: 26px; border-top: 1px solid var(--border); border-radius: 0; }
.rc-tools .checklist li::before { left: 4px; }
.rc .notice { margin: 0; padding: 12px 14px; border-radius: 12px; background: var(--rc-green); color: var(--olive-strong); font-weight: 500; }

/* Review screen */
.review-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.review-nav .link { padding: 6px 0; }
.review-step { display: flex; gap: 6px; }
.review-step .link { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font-size: 1.3rem; text-decoration: none; }
.review-step .link.off { opacity: 0.35; }
.pdf-view { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; background: #f4f4f4; -webkit-overflow-scrolling: touch; }
.pdf-view canvas { display: block; margin: 0 auto 6px; background: #fff; }
.pdf-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.rc .card > .small { margin: 12px 0 0; }
[data-form="review"] { gap: 16px; }
[data-form="review"] .card { display: flex; flex-direction: column; gap: 18px; }
.review-line { display: flex; flex-direction: column; gap: 16px; padding: 16px; margin-bottom: 14px; border-radius: 14px; background: var(--tint-soft); border: 1px solid var(--tint-border); }
.review-line input:not([type="checkbox"]), .review-line select { background: var(--surface); }
.rc-signed { display: flex; gap: 8px; align-items: center; }
.rc-signed input { flex: 1; min-width: 0; }
.rc-signed .small-btn { flex: none; width: 46px; height: 46px; padding: 0; font-size: 1.2rem; }
.rc-sums { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.rc-sums > div { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-sums .rc-total { padding-top: 8px; border-top: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 1.1rem; }
.rc-sums .rc-total.off { color: var(--rc-amber-text); }
.rc-sums p { margin: 4px 0 0; }
a.button-link { display: inline-block; text-decoration: none; text-align: center; margin: 0.5rem 0; }

/* Sold out: big one-tap tiles, green = available, red = sold out */
:root { --so-in: #e8f0e8; --so-in-border: #a9c4a9; --so-out: #b3261e; --so-out-text: #ffffff; --so-till: #fbe9e7; }
@media (prefers-color-scheme: dark) { :root { --so-in: #253026; --so-in-border: #3d5a3e; --so-out: #c4473f; --so-out-text: #ffffff; --so-till: #3d2422; } }
.so-section { margin-bottom: 1.25rem; }
.so-section h2 { font-size: 1.05rem; margin: 0 0 10px; }
.so-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.so-tile, .so-cat {
  display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 92px; padding: 12px;
  border-radius: 16px; border: 2px solid var(--so-in-border); background: var(--so-in); color: var(--text);
  font: inherit; text-align: left; text-decoration: none; cursor: pointer; overflow-wrap: anywhere;
}
.so-tile strong, .so-cat strong { font-size: 1.05rem; line-height: 1.25; }
.so-tile span, .so-cat span { font-size: 0.8rem; color: var(--muted); }
.so-tile.so-out { background: var(--so-out); border-color: var(--so-out); color: var(--so-out-text); }
.so-tile.so-out span { color: var(--so-out-text); font-weight: 700; }
.so-tile.so-square, .so-tile.so-missing { background: var(--so-till); border-color: var(--error); }
.so-tile.so-square span { color: var(--error); font-weight: 600; }
.so-tile:disabled { opacity: 0.6; }
.so-cat { background: var(--surface); border-color: var(--border); }
.so-cat.has-out { border-color: var(--so-out); }
.so-cat.has-out span { color: var(--so-out); font-weight: 700; }
.so-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.so-log ul { list-style: none; margin: 10px 0 0; padding: 0; }
.so-log li { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--border); }
.so-choose details.card summary, .so-cat-card details summary { cursor: pointer; }
.so-choose details.card label.check, .so-cat-card details label.check { margin-top: 12px; }
.so-cat-card details { margin: 10px 0 0 34px; }
.so-item { margin-top: 12px; }
.so-item label.check { margin-left: 12px; }
.so-undo {
  position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20;
  max-width: 528px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 14px; background: var(--header); color: var(--on-header); box-shadow: 0 4px 16px rgb(0 0 0 / 0.25);
}
.so-undo button { flex: none; font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--on-header); background: none; color: var(--on-header); cursor: pointer; }

/* "Updating the app" cover, shown for a moment before the app reloads itself. */
.updating { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--bg); color: var(--text); padding: 16px; text-align: center; }
.updating img { width: 160px; max-width: 50vw; height: auto; }
.updating p { margin: 0; font-size: 1.1rem; font-weight: 600; }

/* HACCP corrections (managers) */
.report .was { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.report tr.voided td:not(.notes-cell):not(.edit-cell) { color: var(--muted); }
.report tr.voided .notes-cell { font-weight: 700; }
.report td.edit-cell a { display: inline-block; text-decoration: none; padding: 8px 14px; font-size: 0.95rem; }
.void-card { margin: 12px 0; }
.void-card summary { cursor: pointer; }
ul.trail strong { color: var(--olive-strong); }
@media (max-width: 700px) {
  .report td.edit-cell { grid-column: 1 / -1; }
}

/* HACCP closed days and missed checks */
.daily-status .closed { color: #6b4f1d; }
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.report-actions a { text-decoration: none; padding: 10px 16px; }
.card.gaps ul { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; }
.card.gaps li { padding: 8px 0; border-top: 1px solid var(--border); }
.card.gaps .flag { color: #9a3412; font-weight: 700; margin-left: 4px; }
.card.gaps li a { margin-left: 8px; font-weight: 600; color: var(--olive); }

/* Dashboard cards with a state, e.g. Sold out: green = nothing out, red = something out (same colours as the board). */
main .card.summary-item.tone-good { background: var(--so-in); border-color: var(--so-in-border); }
main .card.summary-item.tone-bad { background: var(--so-out); border-color: var(--so-out); }
main .card.summary-item.tone-bad, main .card.summary-item.tone-bad strong, main .card.summary-item.tone-bad .muted { color: var(--so-out-text); }
