/* Browser leaf stylesheet (B01).
 *
 * Tenant palette and fonts arrive as custom properties declared by the rendered page
 * (BrowserConfig.theme_tokens) and are consumed here only through var(); no tenant colour
 * is written in this file. The allergy safety swatches below are platform colours, not
 * tenant theme. They are provisional (palette approval is OPEN) and must stay pairwise
 * distinct. Ticket classes come from static/allergen-map.mjs.
 */

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

:root {
  /* Platform validation colour; tenant themes have no error token. */
  --field-error: #b00020;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: var(--theme-paper, Canvas);
  color: CanvasText;
  font-family: var(--theme-font-body, system-ui, sans-serif);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  font-family: var(--theme-font-display, serif);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

h1 {
  color: var(--theme-accent-strong, CanvasText);
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
}

h2 {
  font-size: 1.35rem;
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 0.5rem;
}

a {
  color: var(--theme-accent-strong, LinkText);
  text-underline-offset: 0.15em;
}

:focus-visible {
  outline: 3px solid var(--theme-highlight, Highlight);
  outline-offset: 2px;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  overflow-wrap: anywhere;
}

/* --- page frame ----------------------------------------------------------------------- */

/* A practice restaurant says so on every page: a small tag at the top right, in the page's own
   flow so it can never sit on top of a link or a button. */
.test-mode-tag {
  margin: 0;
  padding: 4px 16px 0;
  text-align: right;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.06em;
  /* The page's own text colour, never a theme accent: it must stay readable on any theme. */
  color: CanvasText;
  user-select: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 12px 16px;
  border-bottom: 3px solid var(--theme-accent, CanvasText);
  font-weight: 600;
}

.site-nav a {
  padding: 6px 0;
  color: var(--theme-accent-strong, LinkText);
  text-decoration: none;
}

.site-nav a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px;
}

.page-head {
  margin-bottom: 16px;
}

/* Freshness: one quiet line while live; loud (tinted, with its sentence) when not live. */
.freshness {
  --freshness-padding-block: 6px;
  padding: var(--freshness-padding-block) 12px;
  border-left: 6px solid var(--theme-highlight, Highlight);
  background-color: color-mix(in srgb, var(--theme-highlight, Highlight) 12%, transparent);
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
}

#app[data-freshness="fresh"] .freshness {
  --freshness-padding-block: 2px;
  border-left-color: #1b5e20;
  background-color: transparent;
}

#app[data-freshness="fresh"] .freshness-note {
  display: none;
}

.freshness-state {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

#app[data-freshness="fresh"] .freshness-state {
  color: #1b5e20;
}

.freshness p {
  margin: 0;
}

.freshness-note,
.instant-raw {
  color: color-mix(in srgb, CanvasText 72%, transparent);
}

.instant-raw {
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

/* The full record id, kept reachable under the short spoken code. */
.reference {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: color-mix(in srgb, CanvasText 60%, transparent);
  overflow-wrap: anywhere;
}

.order-id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* A spoken code (order, run) wherever it heads a card: body face, heavy, spaced, so "D3DE5"
 * reads at a glance and across a room. The word "Order"/"Run" before it stays small. */
.ticket-title,
.handoff-code,
.order-title,
.run-title,
.review-title {
  margin: 0;
  font-family: var(--theme-font-body, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
}

.ticket-title .order-id,
.handoff-code .order-id,
.order-title .order-id,
.run-title .order-id,
.review-title .order-id {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.08em;
  vertical-align: -0.08em;
}

/* On a ticket the code is what staff call out: the largest text on the card. */
.ticket-title .order-id {
  font-size: 2.25rem;
}

.order-title .order-id,
.run-title .order-id,
.review-title .order-id {
  font-size: 1.6rem;
}

/* Small uppercase labels for "what this is" over the value that matters. */
.handoff-kicker,
.ticket-label,
.handoff-where dt,
.handoff-names dt,
.proof-label,
.meal-tags-label,
.run-where-label,
.run-times dt,
.allergy-note-label {
  margin: 0;
  font-family: var(--theme-font-body, system-ui, sans-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}

.lede {
  margin: 0 0 12px;
  font-size: 1.05rem;
  text-wrap: pretty;
}

.footnote {
  margin: 16px 0 0;
  font-size: 0.85rem;
  color: color-mix(in srgb, CanvasText 65%, transparent);
  text-wrap: pretty;
}

/* One folded place for record ids, codes and evidence: reachable, never in the way. */
.details-fold {
  margin-top: 12px;
}

details.panel.details-fold {
  padding-block: 4px;
}

.details-fold > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: color-mix(in srgb, CanvasText 70%, transparent);
}

.details-fold > summary::-webkit-details-marker {
  display: none;
}

.details-fold > summary::before {
  content: "▸";
  width: 1.2em;
  flex: none;
}

.details-fold[open] > summary::before {
  content: "▾";
}

.details-fold[open] > summary {
  margin-bottom: 4px;
}

details.panel.details-fold[open] {
  padding-bottom: 12px;
}

/* Inside a fold, label over value: long ids and nested records stop squeezing into a
 * narrow right-hand column on a phone. */
.details-fold .fields {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  font-size: 0.9rem;
}

.details-fold .fields dt {
  color: #555555;
}

.details-fold .fields dd {
  margin-bottom: 6px;
}

.details-fold .fields .fields {
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, #111111 15%, transparent);
}

.details-fold[open] {
  padding-bottom: 12px;
}

.panel {
  margin-block: 16px;
  padding: 16px;
  background-color: #ffffff;
  color: #111111;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 12px;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  max-width: 64rem;
  margin: 1rem auto;
  padding: 0 1rem;
}

.site-footer a,
.sms-choice {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.phone-consent {
  min-width: 0;
}

.phone-consent .note,
.public-document p {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.public-document {
  max-width: 44rem;
}

.public-document section + section {
  margin-top: 1.5rem;
}

.public-document .phone-consent {
  margin-top: 1rem;
}

.panel h2 {
  color: inherit;
}

.note,
.declaration-note,
.paper-limit {
  font-size: 0.95rem;
}

.stack {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  max-width: 28rem;
}

.field {
  display: grid;
  gap: 4px;
  font-weight: 600;
}

.field input,
.field textarea {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  min-height: 44px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
}

#profile-email[readonly] {
  background-color: var(--theme-paper, Canvas);
  color: color-mix(in srgb, #111111 72%, var(--theme-paper, Canvas));
  cursor: default;
}

.required {
  font-weight: 400;
}

.profile-name input[aria-invalid="true"] {
  border-color: var(--field-error);
}

.control-invalid {
  outline: 2px solid var(--field-error);
  outline-offset: 0;
}

.profile-name-error,
.field-error {
  margin: 0;
  color: var(--field-error);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 16px;
  border: 2px solid currentColor;
  border-radius: 10px;
  background-color: #ffffff;
  color: #111111;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--theme-accent-strong, ButtonText);
  border-color: var(--theme-accent-strong, ButtonText);
  color: #ffffff;
}

.btn-quiet {
  border-style: dotted;
  font-weight: 600;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  border-style: dashed;
}

.fields {
  display: grid;
  grid-template-columns: fit-content(45%) minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0 0 8px;
}

.fields dt {
  font-weight: 600;
}

.fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.fields .fields {
  grid-template-columns: 1fr;
}

.values {
  margin: 0;
  padding-left: 1.2rem;
}

.kitchen-contact {
  margin-block: 16px;
  padding: 12px 16px;
  border: 2px solid var(--theme-accent, CanvasText);
  border-radius: 12px;
  background-color: #ffffff;
  color: #111111;
}

.kitchen-contact p {
  margin: 0;
}

/* --- pickup proof and friend pages ------------------------------------------------------ */

/* The handoff card: where to be, then what the courier checks. */
.handoff-card {
  border: 2px solid #111111;
}

.handoff-where {
  display: grid;
  gap: 2px;
  margin: 0 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, #111111 25%, transparent);
}

.handoff-where > div,
.handoff-names > div,
.run-times > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
}

.handoff-where dt {
  min-width: 6.5em;
  color: #555555;
}

.handoff-where dd,
.handoff-names dd,
.run-times dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.handoff-kicker {
  color: var(--theme-accent-strong, #111111);
}

.handoff-code .order-id {
  display: block;
  margin-top: 2px;
  font-size: 3rem;
  line-height: 1.05;
}

.handoff-names {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 24px;
  margin: 8px 0 12px;
}

.handoff-names dt {
  color: #555555;
}

/* The name the customer shows the courier is big (Exhibit A item 18: "big Name & Order #");
 * the order number above it stays the largest text on the card. */
.handoff-names dd {
  font-size: 2rem;
  line-height: 1.1;
}
/* A long unbroken name must fit the courier's phone-width run card. */
.ticket-head .member-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.live-proof,
.proof-waiting {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background-color: #f1f1f1;
}

.proof-waiting {
  font-weight: 600;
}

.proof-label {
  color: #444444;
}

.proof-help {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: #555555;
  text-wrap: pretty;
}

.link-note {
  margin: 12px 0 0;
  font-weight: 700;
}

.handoff-note {
  margin: 12px 0 0;
  font-size: 0.95rem;
}

/* Meal card (Jason, 2026-11-21): Meal at title size over a thick rule; the sub-sections
 * (kitchen contact first, then items) at subtitle size, each closed by a thinner rule.
 * The contact is a tinted band with an alert mark so the urgent call is seen first. */
.meal-title {
  margin: 0;
  padding-bottom: 8px;
  font-size: 1.6rem;
  border-bottom: 4px solid #111111;
}

.meal-part {
  padding-block: 14px;
  border-bottom: 2px solid color-mix(in srgb, #111111 22%, transparent);
}

.meal-part:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.meal-part h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.meal-part > :last-child {
  margin-bottom: 0;
}

.meal-contact {
  margin-inline: -16px;
  padding-inline: 10px 16px;
  border-left: 6px solid var(--theme-accent-strong, #111111);
  background-color: color-mix(in srgb, var(--theme-accent, #111111) 9%, #ffffff);
}

/* The one kitchen-contact block (Meal card, order page). */
.safety-contact {
  display: grid;
  gap: 8px;
}

.safety-contact > * {
  margin: 0;
}

.safety-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--theme-accent-strong, #111111);
}

.safety-contact h3.safety-head {
  margin: 0;
  font-size: 1.2rem;
}

.safety-icon,
.safety-call-icon {
  flex: none;
  width: 1.2em;
  height: 1.2em;
  fill: currentColor;
}

.safety-instruction {
  font-weight: 700;
  text-wrap: pretty;
}

.safety-call {
  flex-wrap: wrap;
  gap: 4px 10px;
  width: 100%;
  transition: transform 120ms ease-out;
}

.safety-call:active {
  transform: scale(0.97);
}

.safety-phone {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.safety-phone-text,
.safety-phone-missing {
  font-weight: 700;
}

.safety-concern {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed color-mix(in srgb, #111111 35%, transparent);
}

.safety-concern p {
  margin: 0;
}

.safety-concern-text {
  font-size: 0.9rem;
  color: #444444;
  text-wrap: pretty;
}

.safety-concern .btn {
  justify-self: start;
}

.meal-items {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meal-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
}

.meal-qty,
.meal-item-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.meal-qty {
  min-width: 2.5ch;
  color: var(--theme-accent-strong, inherit);
  font-variant-numeric: tabular-nums;
}

.meal-item-options,
.meal-item-note {
  margin: 2px 0 0;
  font-size: 0.95rem;
  color: #444444;
  text-wrap: pretty;
}

.meal-item-unconfirmed {
  color: #111111;
  font-weight: 700;
}

.meal-item-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 6px;
}

.meal-tags-label {
  color: #444444;
}

.meal-chips {
  gap: 6px;
}

.meal-chips .allergen-chip {
  padding: 2px 10px;
  border-width: 2px;
  border-radius: 8px;
  font-size: 0.95rem;
}

.meal-chips .allergen-chip[data-unrecognized-code] {
  border-style: dashed;
}

/* --- customer order page --------------------------------------------------------------- */

.order-head {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 4px solid #111111;
}

.order-head .order-live {
  margin: 6px 0 0;
  font-family: var(--theme-font-display, serif);
  font-size: 1.75rem;
  line-height: 1.15;
  text-wrap: balance;
}

.order-money {
  margin: 0 0 12px;
}

.payment-state {
  font-weight: 700;
}

.order-part {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px solid color-mix(in srgb, #111111 22%, transparent);
}

.order-part h3 {
  font-size: 1.2rem;
}

.order-part > :last-child {
  margin-bottom: 0;
}

.allergy-mode {
  font-weight: 600;
}

.allergy-note {
  padding: 8px 10px;
  border-left: 4px solid #111111;
  background-color: #f1f1f1;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.allergy-note-label {
  display: block;
  white-space: normal;
}

.allergy-missing,
.allergy-for {
  font-weight: 700;
}

/* Order history rows. */
.order-summary .order-title a {
  color: inherit;
  text-decoration-thickness: 2px;
}

.summary-status {
  margin: 6px 0 2px;
  font-family: var(--theme-font-display, serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--theme-accent-strong, #111111);
}

.summary-money,
.summary-when {
  margin: 0;
}

.summary-when {
  font-size: 0.9rem;
  color: #555555;
}

.safety-block {
  border-left: 6px solid var(--theme-accent-strong, #111111);
  background-color: color-mix(in srgb, var(--theme-accent, #111111) 9%, #ffffff);
}

.safe-error,
.unavailable {
  border: 3px solid #111111;
}

/* Pay follows the customer order page's existing panel, type and button treatment. */
body.view-pay .actions {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 8px;
}

body.view-pay .actions > .btn {
  flex: 1 1 9rem;
}

body.view-pay .btn {
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform 120ms ease-out;
}

body.view-pay .btn:active:not(:disabled) {
  transform: scale(0.96);
}

@media (prefers-reduced-motion: reduce) {
  body.view-pay .btn {
    transition: none;
  }
}

body.view-pay .pay-lines {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

body.view-pay .pay-lines > li {
  padding-block: 8px;
  overflow-wrap: anywhere;
}

body.view-pay .line-options {
  display: block;
  margin: 4px 0 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: #555555;
}

body.view-pay .pay-total strong {
  display: block;
  font-size: 1.75rem;
}

body.view-pay .pay-breakdown .fields {
  grid-template-columns: minmax(0, 1fr) max-content;
}

body.view-pay .pay-breakdown dt {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

body.view-pay .pay-breakdown dd {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

body.view-pay :is(.pay-total, [data-pay-remaining]) {
  font-variant-numeric: tabular-nums;
}

body.view-pay :is(.pay-hold, .pay-status) {
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

body.view-pay [data-wording-pending] {
  background-color: color-mix(in srgb, var(--theme-accent, #111111) 12%, #ffffff);
  outline: 1px dashed currentColor;
  outline-offset: 2px;
}

/* --- menu ------------------------------------------------------------------------------ */

.menu-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.menu-item {
  padding: 16px;
  background-color: #ffffff;
  color: #111111;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 12px;
}

.view-menu_edit [data-menu-editor] {
  min-width: 0;
}

.price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tags-unconfirmed {
  display: inline-block;
  padding: 2px 8px;
  border: 2px dashed currentColor;
  border-radius: 6px;
  font-weight: 700;
}

.tag {
  font-weight: 700;
}

.portion-note,
.order-minimum {
  font-variant-numeric: tabular-nums;
}

.portion-note {
  margin: 4px 0 8px;
  font-weight: 600;
}

/* --- tickets (kitchen board and courier run sheet) ------------------------------------- */

.ticket-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  align-items: start;
}

.ticket {
  position: relative;
  margin: 0;
  padding: 16px;
  border: 3px solid #000000;
  border-radius: 14px;
  min-height: 100%;
  background-color: #ffffff;
  color: #111111;
}

.ticket-inner {
  display: grid;
  gap: 12px;
}

/* Head: the spoken code left, dish count and payment in the corner. */
.ticket-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ticket-title {
  overflow-wrap: anywhere;
  font-size: 0.85rem;
}

.ticket-title .order-id {
  font-size: clamp(1.375rem, 2.5vw, 1.875rem);
  letter-spacing: 0.04em;
}

/* Finished courier cards keep their safety treatment, with status first in the header. */
.ticket-head .courier-finished {
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.courier-finished time {
  font-variant-numeric: tabular-nums;
}

.ticket-label {
  margin-bottom: 6px;
}

.ticket-items {
  margin: 0;
  padding: 10px 0 0;
  list-style: none;
  font-size: 1.25rem;
  line-height: 1.3;
  border-top: 2px solid currentColor;
}

.ticket-items li + li {
  margin-top: 8px;
}

.qty {
  display: inline-block;
  min-width: 2.5ch;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.item-label {
  font-weight: 700;
}

.item-options {
  display: block;
  padding-left: 2.5ch;
  font-size: 1.05rem;
}

.ticket-money {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.ticket-money p {
  margin: 0;
}

.dish-count {
  font-size: 0.85rem;
  font-weight: 700;
}

.payment-badge {
  padding: 2px 4px;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background-color: #1b5e20;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Never quieter than the paid badge: payment not confirmed stays loud. */
.payment-badge.payment-unconfirmed {
  background-color: #ffffff;
  border-color: #000000;
  color: #000000;
  font-size: 1rem;
}

.ticket-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The next thing to tap looks like it: an enabled kitchen/courier action is solid. */
.ticket-actions .btn:not(:disabled):not(.btn-quiet) {
  background-color: #111111;
  border-color: #111111;
  color: #ffffff;
}

.ticket-actions .btn-quiet {
  margin-left: auto;
}

/* A finished step reads as done, not as unavailable. */
.btn[data-done],
.btn[data-done]:disabled {
  opacity: 1;
  border-style: solid;
  border-color: currentColor;
  background-color: transparent;
  color: inherit;
  cursor: default;
}

.lock-reasons {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.95rem;
  font-weight: 700;
}

.ticket-ready {
  width: 100%;
  min-height: 88px;
  flex-direction: column;
  gap: 4px;
  background-color: #111111;
  color: #ffffff;
  border-color: #111111;
  text-wrap: nowrap;
  transition: transform 120ms ease-out;
}

.ticket-ready > span:first-child {
  white-space: nowrap;
}

.ready-help {
  font-size: 0.9rem;
  font-weight: 500;
}

.ticket .ticket-ready:disabled {
  opacity: 1;
  background-color: #e4e4e4;
  border-color: #777777;
  border-style: dashed;
  color: #444444;
  cursor: not-allowed;
}

.ticket .ticket-ready[data-done] {
  min-height: 44px;
  width: auto;
  justify-self: start;
}

.kitchen-ticket-actions {
  display: grid;
  justify-items: start;
  gap: 24px;
  padding-top: 8px;
}

.kitchen-ticket-actions .btn-quiet {
  justify-self: end;
  margin-left: 0;
  margin-top: 8px;
}

.ticket-ready:active:not(:disabled),
.kitchen-ticket-actions .btn:active:not(:disabled),
.view-switch .btn:active:not(:disabled) {
  transform: scale(0.96);
}

.live-note {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

/* --- courier pages: ready list, handover confirmations, not collected --- */
#app[data-freshness="fresh"] .live-note {
  display: none;
}

.ready-list,
.ready-group,
.ticket-actions .handover-confirm {
  min-width: 0;
  max-width: 100%;
}

[data-ready-groups] {
  display: grid;
  gap: 16px;
}

.ready-group {
  margin: 0;
  padding: 12px;
  border: 1px solid color-mix(in srgb, CanvasText 30%, transparent);
  border-radius: 10px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ready-group legend {
  max-width: 100%;
  padding: 0 4px;
  font-weight: 700;
}

[data-ready-list] .ready-group > legend {
  float: left;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  text-wrap: balance;
}

[data-ready-list] .ready-group > legend + * {
  clear: both;
}

[data-ready-list] .ready-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

[data-ready-list] .ready-heading > :first-child {
  flex: 1;
  min-width: 0;
  text-wrap: balance;
}

[data-ready-count] {
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ticket-actions .handover-confirm,
.ticket-actions .handover-unavailable {
  flex: 1 1 100%;
}

.ticket-actions .handover-confirm {
  width: 100%;
  min-height: 48px;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  white-space: normal;
  text-wrap: pretty;
}

.handover-words {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ticket-actions .btn.handover-confirm[aria-pressed="false"] {
  background-color: #ffffff;
  border-color: #111111;
  color: #111111;
}

.ticket-actions .btn.handover-confirm[aria-pressed="true"] {
  background-color: #111111;
  border-color: #111111;
  color: #ffffff;
}

.handover-tick {
  flex: none;
  visibility: hidden;
}

.handover-confirm[aria-pressed="true"] .handover-tick {
  visibility: visible;
}

.ticket-actions .handover-confirm:active:not(:disabled) {
  transform: scale(0.96);
}

/* The order's five-character support code, folded at the card's foot (the order number is
 * the heading). It keeps the card's own ink so it reads on every allergen swatch. */
.ticket-details {
  margin-top: 0;
}

.ticket-details > summary,
.ticket-details .fields dt {
  color: inherit;
}

.ticket-details .fields dd {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.allergen-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.allergen-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 3px solid #000000;
  border-radius: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.allergen-symbol {
  flex: none;
  width: 1.6em;
  height: 1.6em;
  fill: currentColor;
  stroke: #000000;
  stroke-width: 1.5;
  stroke-linejoin: round;
  paint-order: stroke;
}

.flag {
  padding: 10px 12px;
  border: 3px solid currentColor;
  border-radius: 10px;
}

.flag-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 4px;
}

.flag-head strong {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.note-text {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Whole-ticket warnings override white filling: unknown recipient > allergy note > hold.
 * Selected allergens colour only their small cards, which come first inside the ticket. */
.whole-ticket-hold {
  background-color: #212121;
  color: #ffffff;
}

.whole-ticket-hold .ticket-actions .btn:not(:disabled):not(.btn-quiet) {
  border-color: #ffffff;
}

.allergen-allergy_note {
  background-color: #b388ff;
  color: #000000;
}

.allergen-unknown_recipient {
  background-color: #ffc400;
  color: #000000;
}

.safety-full-card.allergen-unknown_recipient {
  border: 6px dashed #000000;
}

.safety-full-card.whole-ticket-hold {
  box-shadow:
    inset 0 0 0 6px #000000,
    inset 0 0 0 12px #ffffff;
}

/* Chips carry their allergen's swatch so every allergen stays visible on any card. */
.allergen-chip[data-allergen-code="shellfish"] {
  background-color: #ff00ff;
  color: #000000;
}

.allergen-chip[data-allergen-code="peanut"] {
  background-color: #00ffff;
  color: #000000;
}

.allergen-chip[data-allergen-code="tree_nut"] {
  background-color: #ff8000;
  color: #000000;
}

.allergen-chip[data-allergen-code="wheat"] {
  background-color: #ffff00;
  color: #000000;
}

.allergen-chip[data-allergen-code="milk"] {
  background-color: #a6ff00;
  color: #000000;
}

.allergen-chip[data-allergen-code="egg"] {
  background-color: #ff1744;
  color: #000000;
}

.allergen-chip[data-allergen-code="fish"] {
  background-color: #2962ff;
  color: #ffffff;
}

.allergen-chip[data-allergen-code="soy"] {
  background-color: #aa00ff;
  color: #ffffff;
}

.allergen-chip[data-allergen-code="sesame"] {
  background-color: #00e676;
  color: #000000;
}

.allergen-chip .allergen-symbol {
  stroke: currentColor;
  stroke-width: 0;
}

/* --- run sheet, review, receipts, paper ------------------------------------------------ */

/* Run head: the run's code and its status in words over a thick rule; then where to go. */
.run-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 4px solid #111111;
}

.run-status {
  margin: 0;
  font-family: var(--theme-font-display, serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--theme-accent-strong, #111111);
}

.run-where {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.run-where-label {
  display: block;
  color: #555555;
}

.run-times {
  display: grid;
  gap: 2px;
  margin: 0 0 8px;
}

.run-times dt {
  min-width: 8em;
  color: #555555;
}

.run-actions {
  display: grid;
  gap: 8px;
  max-width: 32rem;
  margin-block: 12px 0;
}

/* One-handed, walking: the run buttons are the biggest targets on the page. */
.run-actions .btn {
  min-height: 56px;
  font-size: 1.1rem;
}

.parked-prompt {
  margin: 0;
  padding: 10px 12px;
  border-left: 6px solid var(--theme-highlight, Highlight);
  font-weight: 700;
}

.member-ack {
  margin: 0;
  font-weight: 700;
}

.review-reasons {
  margin: 10px 0 8px;
  padding: 0;
  list-style: none;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.review-reasons li + li {
  margin-top: 6px;
}

.review-sub {
  margin: 12px 0 4px;
  font-size: 1rem;
}

.active-holds {
  margin: 0;
  padding-left: 1.2rem;
  font-weight: 700;
}

.evidence-limit,
.paper-limit {
  font-weight: 700;
}

.paper-label {
  border: 3px solid #000000;
}

/* Full-viewport offline disclaimer (rendered by the client from the loaded sheet). */
[data-disclaimer-overlay] {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background-color: #ffffff;
  color: #000000;
  font-size: 1.25rem;
}

.declaration .allergen-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 2px solid color-mix(in srgb, CanvasText 30%, transparent);
  border-radius: 10px;
}

.choice,
.acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
}

.choice input,
.acknowledgement input {
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.1rem;
  flex: none;
}

@media (min-width: 900px) {
  .page {
    padding: 24px 32px;
  }
}

@media print {
  body {
    background-color: #ffffff;
    color: #000000;
  }

  .site-nav,
  .ticket-actions,
  .ticket-ready,
  .ticket-details,
  .lock-reasons,
  .run-actions button,
  .kitchen-contact a::after {
    display: none;
  }

  .ticket {
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .allergen-label,
  .flag-head strong {
    font-weight: 900;
    text-transform: uppercase;
  }
}

/* --- host controls (app.mjs): sign-in, allergy gate, order builder, run controls --- */

.notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 4px solid var(--theme-highlight, CanvasText);
  background-color: #ffffff;
  font-weight: 600;
}

.notice[data-kind="error"] {
  border-left-color: var(--theme-accent-strong, CanvasText);
  color: var(--theme-accent-strong, CanvasText);
}

.field select {
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
  min-height: 44px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
  max-width: 100%;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 6px 0;
}

.choice input,
.acknowledgement input {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 2px;
  accent-color: var(--theme-accent-strong, AccentColor);
}

.acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-weight: 600;
}

.allergen-choices,
.option-group {
  border: 2px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 10px;
  padding: 8px 14px;
  margin: 0 0 12px;
}

.allergen-choices legend,
.option-group legend {
  font-weight: 700;
  padding: 0 6px;
}

.option-group [data-group-status] {
  margin-top: 6px;
}

.add-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid color-mix(in srgb, CanvasText 15%, transparent);
}

/* One option label with an inline allergen bracket; it wraps naturally beside the radio. */
.option-group .choice {
  column-gap: 6px;
}

.option-group .choice input {
  margin-right: 4px;
}

.option-label {
  flex: 1;
  min-width: 0;
  text-wrap: pretty;
}

.cart {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.cart li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.quote,
.handoff {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 2px solid var(--theme-accent, CanvasText);
}

.cent-breakdown .total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card-element {
  border: 2px dashed var(--theme-highlight, CanvasText);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 12px;
}

.order-live {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--theme-accent-strong, CanvasText);
}

/* Keep the live region mounted; the current step already prints these words on the path. */
body.view-order .order-progress .progress-announcement {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The live proof token in groups of four (host/order.mjs proofGroups): inline boxes, nothing
 * between them, so the text and a copy stay the exact token. */
.proof-code {
  margin: 6px 0 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
  user-select: all;
}

.proof-code:empty {
  display: none;
}

.proof-group {
  display: inline-block;
  margin-right: 0.5em;
}

.btn-danger {
  border-style: solid;
  border-color: var(--theme-accent-strong, CanvasText);
  color: var(--theme-accent-strong, CanvasText);
}

.window-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.window-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.window-summary {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.window-cutoffs {
  margin: 4px 0 0;
  font-variant-numeric: tabular-nums;
}

.window-cancel .window-cancel-confirm {
  flex-basis: 100%;
  min-width: 0;
  max-width: 100%;
  text-wrap: pretty;
}

.window-cancel .window-cancel-phrase {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  overflow-wrap: anywhere;
  user-select: text;
}

.window-cancel input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
}

.window-cancel .btn {
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.window-cancel .btn:disabled {
  background-color: #e5e5e5;
  border-color: #737373;
  color: #525252;
  opacity: 1;
}

/* --- owner orders and refunds --- */
.paid-order,
.refund-form,
.refund-confirm,
.order-find {
  min-width: 0;
  overflow-wrap: anywhere;
}

.paid-order {
  max-width: 40rem;
}

.refund-figures {
  grid-template-columns: minmax(0, 1fr);
  font-variant-numeric: tabular-nums;
}

.refund-figures dd {
  margin-bottom: 8px;
}

.refund-list {
  margin: 0;
  padding-left: 20px;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

.refund-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.refund-form .field input,
.order-find .field input {
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.refund-form .btn,
.order-find .btn {
  white-space: normal;
}

.refund-form .btn:active:not(:disabled),
.order-find .btn:active:not(:disabled) {
  transform: scale(0.96);
}

/* --- owner review decisions --- */
.review-decide,
.review-confirm {
  min-width: 0;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  gap: 12px;
}

.review-decide {
  margin-block: 16px;
}

.review-confirm {
  margin-bottom: 0;
}

.review-decide .btn,
.review-confirm .field textarea {
  min-width: 0;
  width: 100%;
  white-space: normal;
}

.review-decide .btn:active:not(:disabled) {
  transform: scale(0.96);
}

/* --- owner screens: add an event, portions today, order settings, allergens --- */
.event-form fieldset {
  min-width: 0;
  margin-inline: 0;
}

.event-form .field input,
[data-minimum-form] .field input,
[data-delivery-charge-form] .field input {
  min-width: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}

.portions-today {
  min-width: 0;
}

.portions-today table {
  width: 100%;
  max-width: 40rem;
  table-layout: fixed;
  border-collapse: collapse;
}

.portions-today th,
.portions-today td {
  padding: 8px 2px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.portions-today td {
  vertical-align: middle;
}

.portions-today th {
  text-align: left;
}

.portions-today thead th {
  font-size: 0.875rem;
  text-wrap: balance;
  overflow-wrap: normal;
}

.portions-today thead th:nth-child(2) { width: clamp(48px, 10vw, 96px); }
.portions-today thead th:nth-child(3) { width: clamp(36px, 8vw, 72px); }
.portions-today thead th:nth-child(4) { width: clamp(76px, 14vw, 136px); }
.portions-today thead th:nth-child(5) { width: clamp(48px, 8vw, 72px); }

.portions-today td,
.portions-today thead th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.portions-today tbody tr {
  border-top: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.portions-today form {
  min-width: 0;
  margin: 0;
}

.portions-today input,
.portions-today .btn {
  min-width: 0;
  width: 100%;
  min-height: 44px;
}

.portions-today input {
  padding: 6px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.portions-today .btn {
  padding: 6px 0;
  font-size: 0.875rem;
}

.portions-today .btn:active:not(:disabled) {
  transform: scale(0.96);
}

.portions-today [data-portion-result] {
  font-size: 0.875rem;
  font-weight: 400;
}

.portions-today [data-portion-result]:not(:empty) {
  margin-top: 4px;
}

.portions-today .portion-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.form-status,
#cutoff-hint,
[data-events-added-list] {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.form-status {
  margin: 0;
}

[data-events-added-list] li {
  display: block;
}

[data-allergen-picker] {
  position: relative;
  min-width: 0;
  margin-block: 12px 8px;
}

[data-allergen-picker] summary {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 14%), 0 2px 4px rgb(0 0 0 / 4%);
  cursor: pointer;
  overflow-wrap: anywhere;
}

[data-allergen-picker] fieldset {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 4px 12px;
  min-width: 0;
  max-height: var(--allergen-room);
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background-color: var(--theme-paper, Canvas);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 14%), 0 4px 8px rgb(0 0 0 / 8%), 0 12px 24px rgb(0 0 0 / 12%);
  overflow-y: auto;
  overscroll-behavior: contain;
}

[data-allergen-picker][data-allergen-place="above"] fieldset {
  top: auto;
  bottom: calc(100% + 8px);
}

[data-allergen-picker] legend {
  float: left;
  grid-column: 1 / -1;
  padding: 0;
}

[data-allergen-picker] .choice {
  min-width: 0;
  min-height: 44px;
  overflow-wrap: anywhere;
}

[data-allergen-confirm-none] {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

[data-allergen-result]:not(:empty) {
  margin-top: 8px;
}

.windows-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.windows-head h2 {
  flex: 1 1 auto;
}

.view-switch {
  display: flex;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.view-switch .btn {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border: 0;
  transition: transform 120ms ease-out, background-color 120ms ease-out;
}

.view-switch [aria-pressed="true"] {
  background-color: var(--theme-accent-strong, ButtonText);
  color: #ffffff;
}

.calendar-month {
  margin-top: 16px;
}

.window-calendar {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.window-calendar caption {
  padding: 0 0 12px;
  text-align: left;
  font-weight: 700;
  font-size: 1.1rem;
}

.window-calendar th {
  padding: 8px 0;
  font-size: 0.75rem;
}

.window-calendar td {
  height: 84px;
  padding: 4px 2px;
  vertical-align: top;
  border: 1px solid color-mix(in srgb, CanvasText 14%, transparent);
  font-size: 0.75rem;
}

.calendar-day {
  display: block;
  font-weight: 700;
}

.calendar-window {
  display: block;
  margin-top: 6px;
  line-height: 1.25;
  white-space: nowrap;
}

.calendar-date {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 4px 0;
  border: 0;
  border-radius: 4px;
  background-color: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.calendar-date[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px var(--theme-accent-strong, CanvasText);
}

.window-labels {
  padding-left: 1.2rem;
}

.calendar-details {
  margin-top: 16px;
}

@media (max-width: 600px) {
  .windows-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .windows-head h2 {
    font-size: 1.25rem;
    white-space: nowrap;
  }

  .view-switch {
    justify-self: end;
  }

  .window-calendar td {
    padding: 0;
  }
}

.staff-links {
  font-size: 0.95rem;
}

.site-nav a,
.page a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.site-nav a {
  min-width: 44px;
}

.staff-links a {
  padding-inline: 4px;
}

.resolve-hold select {
  padding-inline: 6px;
  font-size: 0.9rem;
}

.field {
  grid-template-columns: minmax(0, 1fr);
}

.field select {
  width: 100%;
  min-width: 0;
}

[data-kitchen-board] .ticket-grid:empty::before {
  content: "No tickets on the board.";
  font-weight: 600;
}

[data-run-sheet] .ticket-grid:empty::before {
  content: "No orders on this run.";
  font-weight: 600;
}

/* G16/G17 table line and prep panels */
.ticket-table {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.kitchen-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.prep-totals {
  min-width: 0;
  margin-block: 0 16px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

.prep-time {
  margin-block: 20px 8px;
  font-size: 1rem;
  text-wrap: balance;
}

.prep-items {
  font-size: 1.125rem;
}

@media (min-width: 1024px) {
  .kitchen-layout {
    grid-template-columns: 18rem minmax(0, 1fr);
  }

  .kitchen-layout .prep-totals {
    position: sticky;
    top: 16px;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
}

.pause {
  border: 3px solid var(--theme-accent-strong, CanvasText);
}

.pause-message {
  font-weight: 700;
  font-size: 1.1rem;
}

.delivered {
  border: 3px solid var(--theme-highlight, CanvasText);
}

.resolve-hold {
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background-color: #ffffff;
  color: #111111;
}

.hold-status {
  font-weight: 700;
}

.hold-status:empty {
  display: none;
}

/* Customer action rows share the card's inner edges. Staff rules above stay unchanged. */
body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) :is(.actions, .stack, .view-switch) {
  width: 100%;
  max-width: none;
  min-width: 0;
  gap: 8px;
}

body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) .actions > .btn {
  flex: 1 1 9rem;
}

body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) :is(.stack, .safety-concern, .panel) > .btn {
  width: 100%;
  justify-self: stretch;
}

body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) .btn {
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  transition: transform 120ms ease-out;
}

body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) .btn:active:not(:disabled) {
  transform: scale(0.96);
}

body.view-menu [data-service-windows] .windows-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

body.view-menu [data-service-windows] .windows-head h2 {
  white-space: normal;
}

body.view-menu [data-service-windows] .view-switch {
  padding: 0;
  margin: 0;
  box-shadow: none;
}

body.view-menu [data-service-windows] .view-switch .btn {
  flex: 1;
  min-height: 48px;
}

body.view-menu [data-service-windows] .window-labels {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 8px;
}

body.view-menu [data-service-windows] .window-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

body.view-menu [data-service-windows] .window-details {
  font-weight: 400;
}

body.view-menu [data-service-windows] .calendar-date {
  min-width: 40px;
}

body:is(.view-menu, .view-cart) .ordering-time {
  min-width: 0;
  overflow-wrap: anywhere;
}

.menu-filter > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.menu-filter > summary::-webkit-details-marker {
  display: none;
}

.menu-filter > summary h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.menu-filter > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin: 0 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.menu-filter[open] > summary::after {
  transform: rotate(225deg);
}

.menu-filter[open] > summary {
  margin-bottom: 12px;
}

.menu-filter-applied {
  display: block;
  font-family: var(--theme-font-body, system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.menu-filter[open] .menu-filter-applied {
  display: none;
}

body.view-menu .page {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}

body.view-menu .order-bar {
  position: fixed;
  z-index: 10;
  inset: auto 0 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--theme-paper, Canvas);
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
}

body.view-menu .order-bar .btn {
  display: flex;
  width: 100%;
  max-width: 1248px;
  margin-inline: auto;
  font-variant-numeric: tabular-nums;
}

body:is(.view-menu, .view-cart) .allergen-note,
body.view-cart .line-options {
  display: block;
  margin: 4px 0 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: #555555;
}

body:is(.view-menu, .view-cart) :is(.option-group, .option-label, .customize-item, .field) {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.view-cart .cart > li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  align-items: start;
  gap: 12px;
  padding-block: 16px;
}

body.view-cart .handoff {
  border-top: 0;
}

body.view-cart .cart-line-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

body.view-cart .line-price {
  display: grid;
  max-width: 9rem;
  text-align: right;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

body.view-cart .quantity-controls {
  display: flex;
  flex: 1 1 9rem;
  align-items: center;
  gap: 8px;
}

body.view-cart .quantity-controls .btn {
  flex: 1;
  min-width: 40px;
}

body.view-cart .quantity {
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  body.view-cart .cart-line-actions [data-cart-sold-out] {
    min-width: max-content;
    white-space: nowrap;
  }
}

body.view-order .progress-line {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 12px 0;
  list-style: none;
}

body.view-order .progress-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 10px;
  border: 2px solid transparent;
  border-radius: 10px;
}

body.view-order .progress-step[aria-current="step"] {
  border-color: var(--theme-accent-strong, CanvasText);
  background: color-mix(in srgb, var(--theme-accent, CanvasText) 8%, #ffffff);
}

body.view-order .step-marker {
  display: grid;
  place-items: center;
  min-height: 32px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px currentColor;
  font-variant-numeric: tabular-nums;
}

body.view-order .step-now {
  display: block;
  margin-bottom: 4px;
  font-size: 0.85rem;
}

body.view-order .order-head .status-headline {
  display: block;
  margin: 0;
  font-size: 1.15rem;
}

@media (prefers-reduced-motion: reduce) {
  body:is(.view-home, .view-windows, .view-menu, .view-cart, .view-profile, .view-history, .view-order, .view-proof, .view-packages, .view-catering) .btn {
    transition: none;
  }
}

/* Courier sheet: table form details */
.member-details { grid-column: 1 / -1; margin: 0; }

/* --- order messages (job G32 part A) --- */
.order-thread {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-thread textarea {
  width: 100%;
  min-width: 0;
}

.thread {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thread li {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.thread-from {
  font-weight: 600;
}

.thread-body {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Courier pickup duration: inherit the card's safety contrast, without a new surface. */
.pickup-countdown {
  margin: 0;
  min-inline-size: 0;
  max-inline-size: 100%;
  font-family: var(--theme-font-body, system-ui, sans-serif);
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

/* --- order messages on the run sheet and Orders page (job G32 part B) --- */
.run-messages {
  gap: 24px;
  min-width: 0;
  max-width: 40rem;
  overflow-wrap: anywhere;
}

.run-messages > .order-thread,
.paid-order > .order-thread {
  max-width: 100%;
  margin-bottom: 0;
}

/* --- I moved tables (job G33) --- */
.moved-tables {
  min-width: 0;
  max-width: 100%;
}

.moved-tables input {
  width: 100%;
  min-width: 0;
}

.moved-tables [data-current-table] {
  font-variant-numeric: tabular-nums;
}

.moved-tables .btn:active:not(:disabled) {
  transform: scale(0.96);
}


/* --- owner QR codes (job G26) --- */
.qr-source {
  min-width: 0;
  max-width: 40rem;
  overflow-wrap: anywhere;
}

.qr-code {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

.qr-url,
.qr-counts {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Pickup proofs keep their full white quiet zone, including on a narrow phone. */
.live-proof [data-proof-qr] {
  display: block;
  width: 256px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 12px 0 0;
  background-color: #ffffff;
  object-fit: contain;
  border-radius: 0;
  outline: 1px solid rgba(0, 0, 0, 0.1);
}

[data-run-sheet] .ticket-actions .scan-pickup,
[data-run-sheet] .scan-status {
  min-width: 0;
  max-width: 100%;
  flex: 1 1 100%;
  overflow-wrap: anywhere;
  font-family: var(--theme-font-body, system-ui, sans-serif);
}

[data-run-sheet] .ticket-actions .scan-pickup {
  min-height: 44px;
  white-space: normal;
  text-wrap: pretty;
}

[data-run-sheet] .ticket-actions .scan-pickup:not(:disabled) {
  background-color: var(--theme-accent-strong, CanvasText);
  border-color: var(--theme-accent-strong, CanvasText);
  color: var(--theme-paper, Canvas);
}

[data-run-sheet] .scan-status {
  margin: 0;
  text-wrap: pretty;
}

[data-run-sheet] .scan-pickup:active:not(:disabled) {
  transform: scale(0.96);
}

@media (max-width: 480px) {
  [data-run-sheet] .ticket-actions > .btn {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 44px;
    max-width: 100%;
    margin-left: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* --- Owner menu editor (/owner/menu/edit): the list of dishes and one dish at a time. Phone first:
   the list or the open dish fills the page; from 960px the list stays at the left. Tenant tokens only. --- */
.menu-editor {
  display: grid;
  gap: 16px;
  align-items: start;
}

.menu-editor .btn-quiet:not(:disabled):not(.is-disabled) {
  border-style: solid;
}

.menu-editor[data-mode="dish"] .me-list,
.menu-editor[data-mode="list"] .me-dish {
  display: none;
}

.me-list {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.me-add {
  width: 100%;
}

.me-add[aria-current="true"] {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-accent-strong, CanvasText) 30%, transparent);
}

.me-search {
  font: inherit;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
}

.me-count {
  margin: 0;
  padding-inline: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.me-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.me-filter {
  min-height: 44px;
  padding: 6px 16px;
  border: 2px solid color-mix(in srgb, CanvasText 25%, transparent);
  border-radius: 999px;
  background-color: #ffffff;
  color: #111111;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  touch-action: manipulation;
}

.me-filter[aria-pressed="true"] {
  border-color: var(--theme-accent-strong, CanvasText);
  background-color: var(--theme-accent-strong, CanvasText);
  color: #ffffff;
}

.me-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.me-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 64px;
  padding: 8px 12px;
  text-align: left;
  font: inherit;
  color: #111111;
  background-color: #ffffff;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 12px;
  cursor: pointer;
  touch-action: manipulation;
  transition-property: border-color, box-shadow;
  transition-duration: 120ms;
}

.me-row:hover {
  border-color: color-mix(in srgb, CanvasText 40%, transparent);
}

.me-row[aria-current="true"] {
  border-color: var(--theme-accent-strong, CanvasText);
  box-shadow: inset 0 0 0 1px var(--theme-accent-strong, CanvasText);
}

/* Photo boxes keep their size when a picture cannot be read (the public read serves confirmed
   dishes only), so the words inside show through and rows never shift. */
.me-thumb,
.me-photo-box {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  overflow: hidden;
  border-radius: 8px;
  background-color: var(--theme-paper, Canvas);
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
}

.me-thumb {
  width: 48px;
  height: 48px;
}

.me-photo-box {
  width: 96px;
  height: 96px;
  padding: 8px;
  box-sizing: border-box;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.me-thumb img,
.me-photo-box img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.me-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.me-row-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.me-row-sub {
  font-size: 0.9rem;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.me-status p,
.me-save-status,
.me-photo-status {
  text-wrap: pretty;
}

.me-row-sub[data-warn] {
  color: var(--theme-accent-strong, CanvasText);
  font-weight: 600;
}

.me-row-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.me-unsaved,
.me-flag {
  justify-self: start;
  padding: 0 8px;
  border: 2px dashed var(--theme-highlight, CanvasText);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.me-empty {
  padding: 8px 4px;
}

.me-rules summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
}

.me-load-error {
  grid-column: 1 / -1;
  max-width: 100%;
}

.me-dish {
  min-width: 0;
  padding: 12px;
  background-color: #ffffff;
  color: #111111;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 12px;
}

.me-hint {
  margin: 8px 4px;
}

.me-head {
  display: grid;
  gap: 8px;
}

.me-head-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.me-head h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.me-head h2:focus {
  outline: none;
}

.me-back {
  justify-self: start;
}

.me-status {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 14px;
  border-left: 4px solid var(--theme-highlight, CanvasText);
  border-radius: 8px;
  background-color: color-mix(in srgb, var(--theme-highlight, CanvasText) 10%, #ffffff);
}

.me-status p {
  margin: 0;
}

.me-confirm {
  justify-self: start;
  margin-top: 4px;
}

.me-switch,
.me-photo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.me-switch-state {
  flex: 1 1 auto;
  font-weight: 700;
}

.me-switch-state[data-on="false"] {
  color: var(--theme-accent-strong, CanvasText);
}

.me-window-switches {
  display: grid;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.me-win-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
}

.me-win-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.me-win-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.me-win-label {
  flex: 1 1 12rem;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.me-win-state {
  font-weight: 700;
  font-size: 0.9rem;
}

.me-win-state[data-on="false"] {
  color: var(--theme-accent-strong, CanvasText);
}

.me-win-btn {
  min-height: 40px;
}

.me-later-windows summary {
  cursor: pointer;
  font-weight: 600;
  padding: 6px 0;
  min-height: 40px;
}

.me-photo {
  align-items: flex-start;
}

.me-photo-box[data-no-photo] {
  outline: 2px dashed color-mix(in srgb, CanvasText 25%, transparent);
  outline-offset: -2px;
  font-weight: 400;
}

.me-photo-side {
  display: grid;
  gap: 6px;
  flex: 1 1 12rem;
  min-width: 0;
}

.me-photo-side .note {
  margin: 0;
}

.me-file {
  position: relative;
  justify-self: start;
}

.me-file input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.me-file:focus-within {
  outline: 3px solid var(--theme-highlight, Highlight);
  outline-offset: 2px;
}

.me-file.is-disabled {
  opacity: 0.55;
  border-style: dashed;
}

[data-kind="error"].me-photo-status,
[data-kind="error"].me-save-status {
  color: var(--field-error);
  font-weight: 600;
}

.me-form {
  display: grid;
  gap: 12px;
}

.me-form > .me-fields {
  padding-top: 4px;
}

.me-fields {
  display: grid;
  gap: 12px;
}

.me-fields .field input,
.me-fields .field textarea {
  width: 100%;
  box-sizing: border-box;
}

.me-fields .field textarea {
  resize: vertical;
}

.me-field-warn {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: color-mix(in srgb, CanvasText 75%, transparent);
}

.me-fields [data-f="price"],
.me-maximum input {
  font-variant-numeric: tabular-nums;
}

.me-main {
  align-self: end;
}

.me-choices {
  display: grid;
  gap: 12px;
}

.me-choices h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.25;
  text-wrap: balance;
}

.me-group {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 2px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 10px;
}

.me-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.me-group-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.me-tool-btn {
  min-height: 40px;
  min-width: 40px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.me-move {
  min-width: 40px;
  min-height: 40px;
  padding: 6px 8px;
  border: 2px solid color-mix(in srgb, CanvasText 22%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
  font: inherit;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.me-move:disabled {
  opacity: 0.35;
  cursor: default;
}

.me-group-head h4 {
  margin: 0;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.me-group-name {
  flex: 1 1 14rem;
}

.me-group-name input {
  width: 100%;
  box-sizing: border-box;
}

.me-rule {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: 8px 12px;
  margin: 0;
}

.me-rule .field {
  flex: 1 1 12rem;
  min-width: 0;
}

.me-rule select,
.me-copy select {
  font: inherit;
  font-weight: 400;
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
}

.me-rule select,
.me-rule input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.me-rule .me-maximum {
  flex: 0 1 12rem;
}

.me-opt-head,
.me-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(6rem, auto);
  gap: 8px;
  align-items: center;
}

.me-opt-head span:last-child {
  justify-self: start;
}

.me-opt-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.me-opt-head {
  font-size: 0.85rem;
  font-weight: 600;
}

.me-opts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.me-opt input:where(:not([type="checkbox"])) {
  font: inherit;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 44px;
  padding: 8px 10px;
  border: 2px solid color-mix(in srgb, CanvasText 40%, transparent);
  border-radius: 8px;
  background-color: #ffffff;
  color: #111111;
}

.me-extra-cell {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.me-extra {
  position: relative;
  display: block;
  width: 6rem;
  flex: none;
}

.me-opt-total {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: color-mix(in srgb, CanvasText 75%, transparent);
}

.me-extra-sign {
  position: absolute;
  left: 10px;
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.me-extra input {
  padding-left: 2rem;
  font-variant-numeric: tabular-nums;
}

.me-remove {
  width: 44px;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 8px;
  background-color: transparent;
  color: #111111;
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.me-remove:hover {
  border-color: color-mix(in srgb, CanvasText 25%, transparent);
}

.me-opt .me-flag,
.me-opt .field-error {
  grid-column: 1 / -1;
}

.me-allergens {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 12%, transparent);
}

.me-allergens-label {
  font-size: 0.95rem;
  font-weight: 700;
}

.me-allergens [data-allergen-picker] {
  margin-block: 0;
}

.me-allergens [data-allergen-confirm-none],
.me-allergens .tags-unconfirmed {
  justify-self: start;
  margin: 0;
}

.me-allergens [data-allergen-result] {
  margin: 0;
}

.me-allergens [data-allergen-result]:empty,
.me-opt-allergens [data-allergen-result]:empty {
  display: none;
}

.me-opt-allergens {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.me-opt-allergens [data-allergen-picker] {
  flex: 1 1 13rem;
  min-width: 0;
  margin-block: 0;
}

.me-opt-allergens [data-allergen-picker] summary {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.me-opt-allergen-kicker {
  font-weight: 600;
}

.me-opt-allergens [data-allergen-confirm-none] {
  min-height: 40px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.me-opt-allergens .tags-unconfirmed {
  margin: 0;
  font-size: 0.82rem;
}

.me-opt-allergens [data-allergen-result] {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.85rem;
}

.me-add-opt {
  justify-self: start;
}

.me-choice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.me-copy {
  flex: 1 1 14rem;
}

.me-copy select {
  width: 100%;
}

.me-savebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 -12px -12px;
  padding: 12px;
  background-color: #ffffff;
  border-top: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 0 0 11px 11px;
}

/* Unsaved changes, or the answer to the last save, keep the bar in view while the owner scrolls. */
.me-savebar[data-dirty],
.me-savebar[data-said] {
  position: sticky;
  bottom: 0;
  z-index: 1;
  box-shadow: 0 -8px 16px -8px rgba(0, 0, 0, 0.18);
}

.me-save-status {
  flex: 1 1 12rem;
  margin: 0;
  font-weight: 600;
}

.me-save-actions {
  display: flex;
  flex: 1 1 16rem;
  flex-wrap: wrap;
  gap: 8px;
}

.me-save-actions .btn {
  flex: 1 1 8rem;
}

.me-row-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.me-row-item.has-move {
  grid-template-columns: minmax(0, 1fr) auto;
}

.me-row-move,
.me-section-tools {
  display: flex;
  gap: 4px;
}

.me-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 2px;
  margin-top: 6px;
  border-bottom: 1px solid color-mix(in srgb, CanvasText 14%, transparent);
}

.me-section-name {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--theme-accent-strong, CanvasText);
  overflow-wrap: anywhere;
}

.menu-section {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.menu-section-heading {
  margin: 0;
  font-size: 1.3rem;
}

.me-default-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, CanvasText 18%, transparent);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.me-default-toggle input {
  width: 1.15rem;
  height: 1.15rem;
}

.me-shared-note {
  margin: 0 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.me-row-retired .me-row-name {
  text-decoration: line-through;
  opacity: 0.72;
}

.me-win-cap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.me-win-cap-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.me-win-cap-input {
  width: 6rem;
  min-height: 36px;
}

.me-win-cap-meta {
  font-size: 0.85rem;
  opacity: 0.85;
}

@media (min-width: 640px) {
  .me-dish {
    padding: 16px;
  }

  .me-savebar {
    margin: 0 -16px -16px;
    padding: 12px 16px;
  }

  .me-fields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .me-fields .me-wide {
    grid-column: 1 / -1;
  }

  .me-opt-head,
  .me-opt {
    grid-template-columns: minmax(0, 1fr) minmax(8rem, auto) auto;
  }

  .me-opt-actions {
    grid-column: auto;
  }

  .me-extra {
    width: 7.5rem;
  }
}

@media (min-width: 960px) {
  .menu-editor {
    grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  }

  .menu-editor[data-mode] .me-list,
  .menu-editor[data-mode] .me-dish {
    display: grid;
  }

  .menu-editor[data-mode] .me-dish {
    display: block;
  }

  .me-list {
    position: sticky;
    top: 16px;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    padding: 2px;
  }

  .me-back {
    display: none;
  }
}

/* The proof page reserves icon/light space through every check state. */
[data-refresh-status]:has([data-refresh-icon]) { position: relative; padding-inline-start: 52px; }
[data-refresh-icon] { position: absolute; inset-inline-start: 12px; top: calc(var(--freshness-padding-block) + .5lh); translate: 0 -50%; }
[data-refresh-light] { position: absolute; inset-inline-start: 35px; top: calc(var(--freshness-padding-block) + .5lh); translate: 0 -50%; width: 9px; height: 9px; }
[data-refresh-light="amber"] { background: #a8741a; border: 2px solid currentColor; border-radius: 1px; }
[data-refresh-light="green"] { background: #1b5e20; border: 2px solid transparent; border-radius: 50%; }
.freshness:has(p > [data-refresh-light]) { --freshness-padding-block: 2px; }
p > [data-refresh-light] { position: static; display: inline-block; margin-inline-end: 8px; translate: none; }
[data-refresh-state="checking"] [data-refresh-icon] { animation: refresh-turn 1s linear infinite; }
[data-refresh-status]:has([data-refresh-icon]) [data-refresh-confirmed-at] { font-variant-numeric: tabular-nums; }
.refresh-announcement { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@keyframes refresh-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  [data-refresh-state="checking"] [data-refresh-icon] { animation: none; }
}

/* --- HK1: the first page is the hook. Brand bar on the customer pages; on the Menu the food
 * comes first: one picture, the time beside or under it, then the dishes. Tenant colours and
 * fonts only through the theme tokens; the white card and black outline values are platform. */

.brand-bar,
.brand-bar + .site-nav {
  width: min(100% - 32px, 1248px);
  margin-inline: auto;
  padding-inline: 0;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--theme-accent-strong, CanvasText);
  font-family: var(--theme-font-display, serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.brand img {
  display: block;
  width: auto;
  height: 44px;
}

.brand-sign-in {
  font-weight: 600;
}

/* Signed in, the same place holds Sign out (app.mjs): a button drawn as the link it replaces. */
button.brand-sign-in {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--theme-accent-strong, LinkText);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.brand-bar + .site-nav {
  padding-block: 0;
  border-bottom: 0;
  box-shadow: inset 0 -1px 0 color-mix(in srgb, CanvasText 14%, transparent);
}

.site-nav a[aria-current="page"] {
  color: CanvasText;
  box-shadow: inset 0 -3px 0 var(--theme-accent, CanvasText);
}

/* The page title stays for screen readers; the brand, the picture and the time speak first. */
body.view-menu .page-head {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.menu-intro {
  display: grid;
  gap: 12px;
}

.menu-hero {
  position: relative;
  display: grid;
  place-items: center;
  height: 104px;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background-color: color-mix(in srgb, var(--theme-accent, CanvasText) 12%, #ffffff);
  color: var(--theme-accent-strong, CanvasText);
  font-family: var(--theme-font-display, serif);
  font-size: 1.75rem;
  font-weight: 600;
}

:is(.menu-hero, .dish-thumb) img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  outline: 1px solid rgba(0, 0, 0, 0.1);
  outline-offset: -1px;
  border-radius: inherit;
  transition: opacity 240ms cubic-bezier(0.2, 0, 0, 1);
}

:is(.menu-hero, .dish-thumb) img:not([src]) {
  opacity: 0;
}

body.view-menu .menu-intro .ordering-time {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title change" "details details";
  align-items: center;
  gap: 2px 12px;
  margin: 0;
  padding: 12px 12px 12px 16px;
  border: 0;
  border-radius: 16px;
  background-color: color-mix(in srgb, var(--theme-accent, CanvasText) 16%, #ffffff);
}

body.view-menu .ordering-time h2 {
  grid-area: title;
  margin: 0;
  font-size: 1.15rem;
}

body.view-menu .ordering-time > .btn[data-choose-new-time] {
  grid-area: change;
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 4px 12px;
  border-width: 1.5px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
}

body.view-menu .ordering-time-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0 6px;
  grid-area: details;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

body.view-menu .ordering-time-details span + span::before {
  content: "· ";
}

/* One column on a phone, two on a tablet, three in the 1120 px desktop content width. */
body.view-menu .menu-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.menu-item.dish {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

.dish-face {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

/* 20px card radius minus 12px padding: the picture's corners sit concentric with the card's. */
.dish-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  background-color: color-mix(in srgb, var(--theme-highlight, CanvasText) 10%, var(--theme-paper, Canvas));
  color: var(--theme-highlight, CanvasText);
  font-family: var(--theme-font-display, serif);
  font-size: 2.5rem;
  line-height: 1;
}

.dish-text :is(h3, p) {
  margin: 0 0 2px;
}

.dish-text h3 {
  font-size: 1.2rem;
}

.dish-text .description {
  color: #555555;
  font-size: 0.95rem;
  text-wrap: pretty;
}

body .dish-text .allergen-note[data-dish-allergens] {
  margin: 2px 0;
  color: var(--theme-accent-strong, CanvasText);
  font-size: 0.8rem;
  text-transform: lowercase;
  line-height: 1.35;
}

.dish-text .price {
  margin-top: 4px;
  font-size: 1.05rem;
}

/* The choices follow the dish; Add sits at the card's foot, level across a row of cards. */
.dish .add-item {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.dish .add-item > .btn {
  width: 100%;
  margin-top: auto;
  border-radius: 8px;
}

/* Sold out keeps the server's words (render.py _portion_note); the strong colour marks it. */
.dish [data-portion-state="sold_out"] {
  color: var(--theme-accent-strong, CanvasText);
}

.dish .option-group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.dish .option-group legend {
  float: left;
  order: -3;
  padding: 0;
  font-size: 0.95rem;
}

/* The group's rule ("Choose 1.") shares the name's line; the choices start on the next. */
.dish .option-group > .note {
  order: -2;
  margin: 0;
  color: #555555;
  font-size: 0.875rem;
}

.dish .option-group::before {
  content: "";
  flex-basis: 100%;
  height: 0;
  order: -1;
}

.dish .option-group [data-group-status] {
  flex-basis: 100%;
  margin: 8px 0 0;
}

/* Each choice is the existing radio or checkbox label, drawn as a pill; the input stays the control. */
.dish .option-group .choice {
  position: relative;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background-color: #ffffff;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, CanvasText 18%, transparent);
  cursor: pointer;
  transition: background-color 150ms ease-out, box-shadow 150ms ease-out;
}

.dish .option-group .choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.dish .option-group .choice:has(input:checked) {
  background-color: color-mix(in srgb, var(--theme-accent, CanvasText) 22%, #ffffff);
  box-shadow: inset 0 0 0 2px var(--theme-accent-strong, CanvasText);
}

.dish .option-group .choice:has(input:focus-visible) {
  outline: 3px solid var(--theme-highlight, Highlight);
  outline-offset: 2px;
}

.dish .option-group .choice:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

.dish .option-label {
  display: block;
}

.dish .option-label .allergen-note {
  margin: 0;
  font-size: 0.8rem;
  text-transform: lowercase;
}

body.view-menu .dish .add-item > .btn-primary:disabled {
  border-style: solid;
}

@media (prefers-reduced-motion: reduce) {
  :is(.menu-hero, .dish-thumb) img,
  .dish .option-group .choice {
    transition: none;
  }
}

@media (min-width: 900px) {
  .brand-bar,
  .brand-bar + .site-nav {
    width: min(100% - 64px, 1216px);
  }

  body.view-menu :is(.brand-bar, .brand-bar + .site-nav) {
    width: min(100% - 64px, 1120px);
  }

  body.view-menu .page {
    max-width: 1184px;
  }

  body.view-menu .order-bar .btn {
    max-width: 1120px;
  }

  .menu-intro.has-hero {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  }

  .menu-hero {
    height: 220px;
  }

  body.view-menu .menu-intro .ordering-time {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "details" "change";
    align-content: center;
    gap: 4px;
    padding: 20px 24px;
  }

  body.view-menu .ordering-time h2 {
    font-size: 1.6rem;
  }

  body.view-menu .ordering-time > .btn[data-choose-new-time] {
    justify-self: start;
    margin-top: 10px;
  }

  .menu-section {
    margin-top: 16px;
  }

  .dish-face {
    grid-template-columns: minmax(0, 1fr);
  }

  .dish-thumb {
    aspect-ratio: 16 / 9;
    font-size: 3.5rem;
  }
}

/* --- UI1: the sign-in page wears the first page's look (Option A). One narrow column under the
 * Menu's brand bar; the title in the display face and ink; the form as a white card with the dish
 * card's soft outline and shadow. Words, forms and controls are unchanged; scoped to this view. */

body.view-home .page {
  max-width: calc(28rem + 32px);
  padding-top: 28px;
}

body.view-home .page-head {
  margin-bottom: 20px;
}

body.view-home .page-head h1 {
  margin: 0;
  color: CanvasText;
  font-size: clamp(2.125rem, 1.8rem + 1.4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.01em;
}

body.view-home :is(.sign-in, .signed-in) {
  margin-block: 0 16px;
  padding: 20px 16px;
  border: 0;
  border-radius: 20px;
  box-shadow:
    0 0 0 1px color-mix(in srgb, CanvasText 6%, transparent),
    0 1px 2px color-mix(in srgb, CanvasText 6%, transparent),
    0 4px 12px color-mix(in srgb, CanvasText 4%, transparent);
}

body.view-home .sign-in .stack {
  gap: 12px;
  margin-bottom: 0;
}

/* After a code is asked for, the code form follows the email form in the same card. */
body.view-home .sign-in .stack + .stack {
  margin-top: 20px;
}

body.view-home .sign-in .field input {
  border-radius: 10px;
}

@media (min-width: 900px) {
  body.view-home :is(.brand-bar, .brand-bar + .site-nav) {
    width: min(100% - 64px, 1120px);
  }

  body.view-home .page {
    padding-top: 56px;
  }

  body.view-home :is(.sign-in, .signed-in) {
    padding: 24px;
  }
}
