/* Shared pieces: card, money tag, badge, row, table, dialog, notice, toast, empty state, page and section heads. */

/* Card: white with an edge you can see and a solid lip. */
.card {
  background: var(--color-card);
  border: 1px solid var(--color-edge);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
}
@media (min-width: 641px) { .card { padding: var(--space-5); } }
/* Tappable card: the whole card is one button or link; it lifts on hover and sinks onto its lip when pressed. */
.card--tap {
  cursor: pointer; font-family: inherit; color: inherit; text-align: left;
  transition: transform var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast);
}
@media (hover: hover) {
  .card--tap:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
}
.card--tap:active { transform: translateY(var(--lip)); box-shadow: none; }
.card--tap:focus-visible { outline-offset: 2px; border-radius: var(--radius-card); }
/* An invitation, not a ghost: a dashed field-blue outline on the paper, its words in frame blue. */
.card--add { background: transparent; border: 2px dashed var(--color-field-line); box-shadow: none; }
/* The one framed thing on a screen: a 2px frame border, padding one pixel less so the content does not move. */
.card--current { border: 2px solid var(--color-frame); padding: calc(var(--space-4) - 1px); }
@media (min-width: 641px) { .card--current { padding: calc(var(--space-5) - 1px); } }
/* The Pad: a list you work down. A 10px blue gum strip across the top; the content sits in .card__body. */
.card--pad { padding: 0; overflow: hidden; }
.card--pad::before { content: ''; display: block; height: 10px; background: var(--color-frame); }
.card--pad > .card__body { padding: var(--space-4); }
@media (min-width: 641px) { .card--pad > .card__body { padding: var(--space-5); } }

/* Money tag: manila stock with a pointed, punched end and a solid lip. The shape lives on
   ::before because clip-path on the tag itself would also clip the drop-shadow lip. */
.money {
  --money-hole-at: 15px;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: baseline; align-content: center; flex-wrap: wrap; column-gap: 0.3em;
  max-width: 100%; min-height: 44px; padding: 6px 14px 6px 30px;
  color: var(--color-ink);
  font: var(--weight-strong) var(--text-md)/var(--leading-snug) var(--font-body);
  filter: drop-shadow(0 var(--lip) 0 var(--color-tag-edge));
}
.money::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(circle at var(--money-hole-at) 50%, var(--money-hole, var(--color-card)) 0 4px, transparent 4.5px), var(--color-tag);
  clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%);
}
.money > .icon { display: none; }
.money__fig {
  font: var(--weight-bold) var(--text-money-md)/1 var(--font-hand);
  font-variant-numeric: lining-nums; white-space: nowrap;
}
.money--sm { min-height: 40px; }
.money--sm .money__fig { font-size: var(--text-money-sm); }
.money--lg { padding: 8px 18px 8px 36px; }
.money--lg .money__fig { font-size: var(--text-money-lg); }
.money--xl {
  --money-hole-at: 20px;
  display: inline-grid; justify-items: start; align-content: center;
  padding: 12px 24px 8px 42px;
}
.money--xl .money__fig { font-size: var(--text-money-xl); }
/* The words over the big figure get air above the dollar sign's tall stroke. */
.money--xl .money__pre { margin-bottom: 4px; }
.money--words::before {
  background: radial-gradient(circle at var(--money-hole-at) 50%, var(--money-hole, var(--color-card)) 0 4px, transparent 4.5px), var(--color-tag-pale);
}
/* At least: a price that leaves out unpriced ingredients. An empty tag outlined in the tag's edge
   colour, with no manila and no lip, so it never passes for a confirmed price. ::before is the
   outline, ::after the white stock 2px inside it; the hole shows the outline colour through. */
.money--partial { filter: none; }
.money--partial::before { background: var(--color-tag-edge); }
.money--partial::after {
  content: ''; position: absolute; inset: var(--money-outline); z-index: -1;
  background: radial-gradient(circle at calc(var(--money-hole-at) - var(--money-outline)) 50%, transparent 0 4px, var(--color-card) 4.5px);
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 11px 100%, 0 50%);
}
.money--plain .money__fig { font-family: var(--font-body); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums lining-nums; }
/* Bare: a figure that stands directly on the money panel beside the panel's one tag. No stock, hole or lip. */
.money--bare { display: grid; justify-items: start; min-height: 0; padding: 0; filter: none; }
.money--bare::before { content: none; }
/* Hero: the biggest tag in the app, as wide as its panel. Drawn the same with or without an amount:
   a dash in ink is a tag waiting to be written on. */
.money--hero {
  display: grid; justify-items: start; align-content: center; width: 100%;
  padding: 16px 24px 12px 52px;
}
.money--hero::before {
  background: radial-gradient(circle at 26px 50%, var(--money-hole, var(--color-card)) 0 6px, transparent 6.5px), var(--color-tag);
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 20px 100%, 0 50%);
}
/* The hand's tall dollar stroke rises above its line, so the figure keeps clear of the label. */
.money--hero .money__fig { margin-top: 0.14em; font-size: var(--text-money-2xl); }
/* A saving is marked with one pass of a yellow marker at the foot of the figure, soaked into the manila.
   The stroke sits above the tag's stock and under the ink: both are at z-index -1 and this one comes later. */
.money--hero.cs-tile-good .money__fig { position: relative; }
.money--hero.cs-tile-good .money__fig::before {
  content: ''; position: absolute; z-index: -1; inset: auto 0 0.08em 0; height: 14px;
  background: var(--color-pepper); border-radius: var(--radius-marker);
  transform: rotate(-1.2deg); mix-blend-mode: multiply;
}
@media (min-width: 641px) {
  .money--hero.cs-tile-good .money__fig::before { height: 18px; }
}
@media (max-width: 640px) {
  .money--xl .money__fig { font-size: var(--text-money-xl-phone); }
}

/* Money panel: a white slip in a manila frame holding the one total of a screen. */
.money-panel {
  display: grid; gap: var(--space-3); justify-items: start;
  margin: 0 0 var(--space-5);
  padding: var(--space-5) var(--space-4);
  background: var(--color-card);
  border: 3px solid var(--color-tag);
  border-radius: var(--radius-card);
  box-shadow: 0 var(--lip) 0 var(--color-tag-edge);
  color: var(--color-ink);
  font-size: var(--text-md); line-height: var(--leading-body);
}
.money-panel[hidden] { display: none; }
.money-panel__text { font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink); text-wrap: pretty; }
/* Outside a money panel the rest of a price sentence (its source and date) is its own quiet line under the tag. */
:not(.money-panel) > .money + .money-panel__text { display: block; margin-top: var(--space-2); color: var(--color-ink-soft); }
/* Wider screens: the rest of the sentence stands beside the tag it continues. */
@media (min-width: 641px) {
  .money-panel { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--space-5); }
  .money-panel > .money-panel__text { max-width: var(--measure); }
}

/* A money panel of two labelled lines (what is paid in the store, what is paid at pickup): each line is a
   tag and its words. Between them, how many items have no price yet opens their names. Lines are ruled apart. */
.money-panel.money-split { grid-template-columns: minmax(0, 1fr); justify-items: stretch; gap: 0; padding-block: var(--space-3); }
.money-split__line {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4);
  margin: 0; padding: var(--space-2) 0;
}
.money-split__line > .money { flex: none; }
.money-split .money-split__line > .money-panel__text { display: block; flex: 1 1 12em; min-width: 0; margin: 0; color: var(--color-ink); }
.money-split > :is(.money-split__line, details, p) + :is(.money-split__line, details) { border-top: 1px solid var(--color-rule); }
/* The pickup label is short: it stays beside its tag at every width. */
.money-split__line--pickup { flex-wrap: nowrap; }
.money-split .money-split__line--pickup > .money-panel__text { flex-basis: 0; font-weight: var(--weight-strong); text-wrap: balance; }
.money-split__names {
  margin: 0; padding: 0 0 var(--space-3); list-style: none;
  columns: 2 9em; column-gap: var(--space-5);
  font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink);
}
.money-split__names > li { break-inside: avoid; padding: 2px 0; }
@media (max-width: 21em) {
  .money-split__line--pickup { flex-wrap: wrap; }
  .money-split .money-split__line--pickup > .money-panel__text { flex-basis: 100%; }
}
@media (min-width: 641px) {
  .money-split__line { flex-wrap: nowrap; }
  .money-split .money-split__line > .money-panel__text { flex: 1 1 auto; max-width: var(--measure); }
}

/* Badge: a status word on a small white pill with a lip-coloured line. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px;
  border-radius: var(--radius-pill);
  font: var(--weight-strong) var(--text-sm)/1.2 var(--font-body);
  background: var(--color-card); border: 1.5px solid var(--color-lip); color: var(--color-ink);
}
.badge > .icon { width: 16px; height: 16px; flex: none; }
.badge--info { background: var(--color-frame-wash); border-color: var(--color-frame-line); color: var(--color-frame-deep); }
.badge--solid { background: var(--color-frame); border-color: var(--color-frame); color: var(--color-on-frame); }
/* The status shape before the word, so the colour is never the only cue. */
.badge__mark { flex: none; width: 10px; height: 10px; border-radius: var(--radius-pill); background: currentColor; }
/* Not started: a stone line and a hollow circle. */
.badge--outline { border-color: var(--color-stone); color: var(--color-ink-soft); }
.badge--outline > .badge__mark { border: 2px solid currentColor; background: none; }
/* Done: pale green with a tick. */
.badge--ok { background: var(--color-ok-wash); border-color: var(--color-ok-wash); color: var(--color-ok); }
.badge--ok > .badge__mark { width: 6px; height: 11px; margin: 0 3px 3px 2px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; border-radius: 0; background: none; transform: rotate(45deg); }
/* Look before you act: a warn line and a triangle. */
.badge--warn { border-color: var(--color-warn); color: var(--color-warn); }
.badge--warn > .badge__mark { width: 12px; height: 10px; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }

/* Recipe type: a 16px dot in the type's colour, then the word in ink. The only place the food colours show. */
.type-label {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font: var(--weight-strong) var(--text-sm)/var(--leading-snug) var(--font-body);
  color: var(--color-ink);
}
.type-label::before {
  content: ''; flex: none; width: 16px; height: 16px; border-radius: var(--radius-pill);
  background: var(--type-dot, var(--color-type-other));
}
.type-label > .icon { display: none; }
.type-label--breakfast { --type-dot: var(--color-type-breakfast); }
.type-label--entree { --type-dot: var(--color-type-entree); }
.type-label--side { --type-dot: var(--color-type-side); }
.type-label--dressing { --type-dot: var(--color-type-dressing); }
.type-label--soup { --type-dot: var(--color-type-soup); }
.type-label--bread { --type-dot: var(--color-type-bread); }
.type-label--dessert { --type-dot: var(--color-type-dessert); }
.type-label--starter { --type-dot: var(--color-type-starter); }

/* Dialog. A popup is a .modal-overlay shown by its "open" class; the box must never fill the
   overlay, because a tap on the overlay itself is what closes it. */
.modal-overlay, .dialog-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-dialog);
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  background: var(--color-scrim);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.modal-overlay.open { display: flex; }
.modal-overlay > :first-child { margin: auto; }
#ppWelcomeOverlay { z-index: var(--z-welcome); }
#iosInstallOverlay { z-index: var(--z-install); }
#sbLoginModal { z-index: var(--z-signin); }
.confirm-overlay { z-index: var(--z-confirm); }
.dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--color-card);
  border-radius: var(--radius-sheet);
  box-shadow: var(--shadow-overlay);
  color: var(--color-ink);
}
.dialog--wide { width: min(760px, 100%); }
/* Opening only: closing removes "open" and the box is gone in the same frame. */
.modal-overlay.open > .dialog { animation: dialog-in var(--motion-base) var(--motion-ease); }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex-shrink: 0;
  padding: var(--space-4) var(--space-4) var(--space-3) 20px;
  border-bottom: 2px solid var(--color-frame);
}
.dialog__title {
  margin: 0;
  font: var(--weight-regular) var(--text-xl)/var(--leading-snug) var(--font-display);
  color: var(--color-frame-deep);
}
.dialog__head .dialog__title { padding-top: 6px; }
/* The title takes focus from script when the dialog opens; no ring. */
.dialog__title[tabindex="-1"]:focus { outline: none; }
/* The close glyph (× or ✕ as text) draws small for its size; this sets it about 16px wide, in ink. */
.dialog__head > .btn--icon { margin: -4px -4px 0 0; font-size: var(--text-glyph-lg); font-weight: var(--weight-strong); color: var(--color-ink); }
/* The close's ring is drawn over its own outline, one ring, so it does not outweigh the title. */
.dialog__head > .btn--icon:focus-visible { outline-width: 2px; outline-offset: -2px; }
.dialog__body {
  flex: 1;
  min-height: 0;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.dialog__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--color-rule);
  background: var(--color-paper);
}
/* Confirm: a question with two answers. The message keeps its own line breaks. */
.dialog--confirm { width: min(440px, 100%); }
.confirm__text { max-width: var(--measure); font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink); white-space: pre-line; }
/* With no title the question itself leads. */
.dialog--confirm > .dialog__body:first-child > .confirm__text { font-size: var(--text-lg); line-height: var(--leading-snug); }
/* A title with no message: the head's rule is the one line above the answers. */
.dialog__head + .confirm__foot { border-top: 0; }
/* Danger: the red word stands at the far end from the safe answer. */
.dialog--danger > .confirm__foot { justify-content: space-between; }
.dialog--danger > .confirm__foot > .confirm__yes { order: -1; }
/* Phones: a sheet from the bottom edge. The 48px strip of scrim above it must stay, so a tap there closes it. */
@media (max-width: 640px) {
  .modal-overlay, .dialog-scrim { align-items: flex-end; padding: 48px 0 0; }
  .modal-overlay > :first-child { margin: auto 0 0; }
  .dialog, .dialog--wide, .dialog--confirm { width: 100%; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; }
  .dialog__foot { justify-content: stretch; }
  /* Two to a row; a label too long for half a row takes a row, and one too long for the sheet wraps its words. */
  .dialog__foot > .btn { flex: 1 1 calc(50% - var(--space-2)); min-width: fit-content; padding-block: var(--space-1); white-space: normal; }
  /* The main action comes first. */
  .dialog__foot > :is(.btn-primary, .btn--primary) { order: -1; }
  /* The red word has its own row above the safe answer, which stays nearest the thumb. */
  .dialog--danger > .confirm__foot > .btn { flex-basis: 100%; }
}
/* Short or narrow phone screens, and enlarged text (em, so a large default text size counts): the sheet scrolls as
   one piece, so what it holds gets the room. Only the close button and the main action stay in view. The head and
   foot boxes dissolve: their children become rows of the sheet, which is what lets those two stick to its edges. */
@media (max-width: 640px) and (max-height: 36em), (max-width: 21em) {
  .dialog { overflow-x: hidden; scroll-padding-block: calc(var(--control-md) + var(--space-4)) calc(var(--control-lg) + var(--space-5)); }
  .modal-overlay > .dialog > * { flex: none; }
  .modal-overlay > .dialog > .dialog__body { overflow: visible; }
  /* !important: scripts show a foot with an inline display. A foot they hid stays hidden. */
  .dialog__head, .dialog__foot:not([hidden], [style*="display:none"], [style*="display: none"]) { display: contents !important; }
  .dialog__head > :not(.btn--icon) { padding: var(--space-4) var(--space-4) var(--space-3) 20px; border-bottom: 2px solid var(--color-frame); }
  .dialog__head:has(> .btn--icon) > :not(.btn--icon) { padding-inline-end: calc(var(--control, var(--control-md)) + var(--space-4)); }
  /* The close button rides the top corner over the scrolling sheet and takes no height of its own. */
  .modal-overlay > .dialog > .dialog__head > .btn--icon {
    order: -1; position: sticky; top: var(--space-2); z-index: 2; align-self: flex-end;
    margin: var(--space-2) var(--space-2) calc(-1 * (var(--control, var(--control-md)) + var(--space-2))) 0;
  }
  /* The foot's buttons: one to a row after the content, the main action first. */
  .modal-overlay > .dialog > .dialog__foot > * { order: 2; flex: none; min-width: 0; margin: 0 var(--space-4) var(--space-3); }
  .modal-overlay > .dialog > .dialog__foot > .btn { padding: var(--space-2) var(--space-3); white-space: normal; }
  /* The red word keeps its row above the safe answer. */
  .modal-overlay > .dialog--danger > .confirm__foot > .confirm__yes { order: 1; }
  /* The main action stays at the foot of the sheet on a white band, so the words that pass under it stay clear of it. */
  .modal-overlay > .dialog > .dialog__foot > :is(.btn-primary, .btn--primary) {
    order: 1; position: sticky; bottom: var(--space-3); z-index: 1; margin-top: var(--space-3);
    box-shadow: 0 var(--lip) 0 var(--color-frame-night), 0 0 0 var(--space-3) var(--color-card), calc(-1 * var(--space-4)) 0 0 var(--space-3) var(--color-card), var(--space-4) 0 0 var(--space-3) var(--color-card);
  }
  .modal-overlay > .dialog > .dialog__foot > :is(.btn-primary, .btn--primary):is(:active, :disabled) { box-shadow: 0 0 0 var(--space-3) var(--color-card), calc(-1 * var(--space-4)) 0 0 var(--space-3) var(--color-card), var(--space-4) 0 0 var(--space-3) var(--color-card); }
}

/* Status icons for notices, toasts and field errors, drawn in the colour of the text through a mask (the sprite cannot gain symbols). */
.notice, .toast, .pp-load-error, .field__error, .btn.is-saved {
  --icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5'/%3E%3Ccircle cx='12' cy='7.6' r='0.6' fill='black'/%3E%3C/svg%3E");
  --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.3 3.9 2.4 17.6A2 2 0 0 0 4.1 20.6h15.8a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0Z'/%3E%3Cpath d='M12 9v4.5'/%3E%3Ccircle cx='12' cy='17' r='0.6' fill='black'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --icon-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.2 12S5.8 5.5 12 5.5 21.8 12 21.8 12 18.2 18.5 12 18.5 2.2 12 2.2 12Z'/%3E%3Ccircle cx='12' cy='12' r='2.9'/%3E%3C/svg%3E");
}

/* Notice: a message inside the page. The icon and the words carry the kind, never the colour alone. */
.notice, .pp-load-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: var(--radius-control);
  font-size: var(--text-body, var(--text-md));
  line-height: var(--leading-body);
  color: var(--color-ink);
}
.notice::before, .pp-load-error::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  background: var(--notice-icon-ink, currentColor);
  -webkit-mask: var(--notice-icon) center / contain no-repeat;
  mask: var(--notice-icon) center / contain no-repeat;
}
.notice[hidden] { display: none; }
/* A notice may carry its own sprite icon in place of the drawn one: same size, colour and place. */
.notice > .notice__icon { display: inline-flex; align-items: center; flex: none; height: calc(1em * var(--leading-body)); color: var(--notice-icon-ink, currentColor); }
.notice__icon > .icon { width: 24px; height: 24px; }
.notice:has(> .notice__icon)::before { content: none; }
.notice > span, .notice__body, .pp-load-error > span { flex: 1 1 16ch; min-width: 0; }
/* With no button beside the words, the icon (one line tall) stays level with the first line of words. */
.notice:not(:has(> .btn)) { align-items: flex-start; }
.notice:not(:has(> .btn))::before { height: calc(1em * var(--leading-body)); }
.notice > .btn, .pp-load-error > .btn { margin-inline-start: auto; }
/* Phones: the words take the full width and the button its own line under them;
   the icon, one line tall, stays level with the first line of words. */
@media (max-width: 640px) {
  .notice, .pp-load-error { align-items: flex-start; }
  .notice::before, .pp-load-error::before { height: calc(1em * var(--leading-body)); }
  .notice > span, .notice__body, .pp-load-error > span { flex-basis: 0; flex-grow: 1; }
  /* The button has its own row, so a label too long for a zoomed screen wraps instead of widening the page. */
  .notice > .btn, .pp-load-error > .btn { flex: 1 1 100%; white-space: normal; }
}
.notice--danger, .pp-load-error {
  --notice-icon: var(--icon-alert);
  --notice-icon-ink: var(--color-danger);
  background: var(--color-card);
  border: 2px solid var(--color-danger);
}
.notice--warn {
  --notice-icon: var(--icon-alert);
  --notice-icon-ink: var(--color-warn);
  background: var(--color-card);
  border: 2px solid var(--color-warn);
}

.notice--ok {
  --notice-icon: var(--icon-check);
  --notice-icon-ink: var(--color-ok);
  --money-hole: var(--color-ok-wash);
  background: var(--color-ok-wash);
}
.notice--info {
  --notice-icon: var(--icon-info);
  --notice-icon-ink: var(--color-frame-deep);
  background: var(--color-frame-wash);
}
/* Read-only ribbon above the staff frame: calm pale blue, an eye, the words set by script as bare text (so the line never wraps under its icon). */
.notice--guest {
  --notice-icon: var(--icon-eye);
  --notice-icon-ink: var(--color-frame-deep);
  flex-wrap: nowrap;
  align-items: flex-start;
  margin-bottom: var(--space-3);
  background: var(--color-frame-wash);
}
.notice--guest::before { height: calc(1em * var(--leading-body)); }

/* "New version ready" note for staff: a one-line info notice above everything, placed where it covers no control.
   Desktop: bottom-right corner; in the staff area, beside Back and the page title, the one band there with no control.
   Phones: a one-line bar along the top edge, and the page moves down by its height so nothing lies under it. */
.update-note {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: var(--z-system);
  max-width: calc(100% - 24px);
  flex-wrap: nowrap;
  gap: var(--space-2);
  padding: 5px 6px 5px 14px;
  line-height: var(--leading-snug);
  box-shadow: var(--shadow-overlay);
}
.update-note > .btn { flex: none; min-height: 32px; padding: 0 12px; }
.update-note > .btn--primary { margin-inline-start: var(--space-1); }
.update-note > .btn--text { margin-inline-start: 0; padding: 0 var(--space-2); }
@media (min-width: 641px) {
  /* 105px: the header's height. */
  body[data-section="admin"] .update-note { top: calc(105px + 12px); bottom: auto; }
}
@media (max-width: 640px) {
  /* 52px: the bar's height (40px buttons, 4px and 7px padding, 1px rule); the body's top padding must match it. */
  body:has(> #ppUpdateNote) { padding-top: calc(52px + env(safe-area-inset-top)); }
  .update-note {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    min-height: calc(52px + env(safe-area-inset-top));
    max-width: none;
    align-items: center;
    gap: var(--space-1);
    padding: calc(4px + env(safe-area-inset-top)) 8px 7px 12px;
    border-bottom: 1px solid var(--color-frame-line);
    border-radius: 0;
    box-shadow: none;
    font-size: var(--text-sm);
  }
  .update-note::before { display: none; }
  /* 40px buttons; the bottom padding holds Reload's lip inside the bar. */
  .update-note > .btn { min-height: 40px; padding: 0 8px; font-size: var(--text-sm); }
  .update-note > .btn--text { padding: 0 2px; }
  .update-note > .btn--primary { margin-inline-start: 0; }
}

/* Toast: night blue (errors brick), on top of every popup; only its buttons take taps.
   One line is 42px tall, no taller than before, so a toast covers no more of the page; no shadow darkens the page around it. */
.pp-status {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom) + var(--toast-lift, 0px));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 420px;
  margin: 0 auto;
  pointer-events: none;
}
@media (min-width: 768px) {
  .pp-status { left: auto; right: 24px; margin: 0; }
  /* Wide screens: each toast as wide as its words, against the right edge, so a stack covers no more of the page than it must. */
  .pp-status-list { align-items: flex-end; }
}
.pp-status-list { display: flex; flex-direction: column; gap: var(--space-2); }
.toast {
  --control: var(--control-sm);
  --toast-icon: var(--icon-info);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 42px;
  padding: var(--space-1) var(--space-1) var(--space-1) var(--space-4);
  border-radius: var(--radius-control);
  background: var(--color-frame-night);
  color: var(--color-on-frame);
  font: var(--weight-regular) var(--text-md)/1.35 var(--font-body);
  animation: toast-in var(--motion-base) var(--motion-ease);
}
.toast::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--toast-icon) center / contain no-repeat;
  mask: var(--toast-icon) center / contain no-repeat;
}
.toast > span { flex: 1; min-width: 0; padding-block: var(--space-1); }
.toast > span:last-child { padding-inline-end: var(--space-3); }
.toast > button { pointer-events: auto; flex: none; }
/* The 44px close reaches into the toast's padding, so the toast stays 42px tall. */
.toast > .btn--icon { margin-block: -5px; }
.pp-status-ok { --toast-icon: var(--icon-check); }
/* Error: white with a brick outline, lip and icon, so it reads apart from information and never darkens the page text it sits over. */
.pp-status-error {
  --toast-icon: var(--icon-alert);
  background: var(--color-card);
  border: 2px solid var(--color-danger);
  box-shadow: 0 var(--lip) 0 var(--color-danger);
  color: var(--color-ink);
  padding: 2px 2px 2px 14px;
}
.pp-status-error::before { background: var(--color-danger); }
/* A bare brick cross: a ring would cut through the toast's own outline. The 44px target stays. */
.pp-status-error > .btn--icon { color: var(--color-danger); border-color: transparent; }
.pp-status-error > .btn--icon:active { background: var(--color-paper); }
/* An action on the error note is a button on the note's own white ground. */
.pp-status-error > .toast__action { margin-block: var(--space-1) var(--space-2); }
/* Phones: the sentence takes the width with the icon level with its first line; the action and the close share the row under it. */
@media (max-width: 640px) {
  .pp-status-error.toast--action { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; row-gap: 0; padding-top: var(--space-1); }
  .pp-status-error.toast--action::before { margin-top: calc(var(--space-1) + (1lh - 24px) / 2); }
  .pp-status-error.toast--action > span { grid-column: 2 / -1; padding-inline-end: var(--space-3); }
  .pp-status-error.toast--action > .toast__action { grid-area: 2 / 2; justify-self: start; margin-block: var(--space-1) var(--space-2); }
  .pp-status-error.toast--action > .btn--icon { grid-area: 2 / 3; margin-block: var(--space-1) 0; }
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast { animation: none; }
}

/* Rows: a list with no bullets, each row at least 56px on a ruled line (the last has none). */
.rows { margin: 0; padding: 0; list-style: none; }
.row {
  display: flex; align-items: center; gap: var(--space-3);
  min-height: var(--control-lg); padding: var(--space-2) 0;
  border-bottom: 1px solid var(--color-rule);
}
.row:last-child { border-bottom: 0; }
/* The name of a row takes the room; a long address breaks inside it. */
.row__main { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
/* A row that is one button or link: the words in ink, a frame-blue chevron at the right, pale blue when pressed. */
.row--tap {
  width: 100%; padding-inline: 0 var(--space-2);
  background: none; border-width: 0 0 1px; border-style: solid; border-color: var(--color-rule); border-radius: 0;
  color: var(--color-ink); font: var(--weight-regular) var(--text-md)/var(--leading-snug) var(--font-body);
  text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color var(--motion-fast);
}
.row--tap:last-child { border-bottom-width: 0; }
.row--tap::after {
  content: ''; flex: none; width: 9px; height: 9px; margin-inline-start: auto;
  border: solid var(--color-frame-deep); border-width: 0 2px 2px 0; transform: rotate(-45deg);
}
.row--tap > .icon { flex: none; width: 24px; height: 24px; color: var(--color-frame); }
@media (hover: hover) {
  .row--tap:hover { background: var(--color-paper); }
}
.row--tap:active { background: var(--color-frame-wash); }
.row--tap:focus-visible { outline-offset: -3px; border-radius: var(--radius-control); }

/* Table (staff registers): no grid lines; the head stands on a 2px deep-blue rule, rows on thin ones.
   It keeps its columns on a phone and scrolls sideways inside its wrap, the pad's gum strip staying put. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap::before { position: sticky; left: 0; }
.table { width: 100%; border-collapse: collapse; color: var(--color-ink); font-size: var(--text-body, var(--text-md)); }
.table th {
  padding: var(--space-3); border-bottom: 2px solid var(--color-frame-deep);
  font-weight: var(--weight-strong); line-height: var(--leading-snug); text-align: left; vertical-align: bottom; white-space: nowrap;
}
.table td { height: 52px; padding: 10px var(--space-3); border-bottom: 1px solid var(--color-rule); vertical-align: middle; }
.table tbody tr:last-child > td { border-bottom: 0; }
.table :is(th, td):first-child { padding-left: var(--space-4); }
.table :is(th, td):last-child { padding-right: var(--space-4); }
@media (hover: hover) {
  .table tbody tr:hover { background: var(--color-paper); }
}
/* The last cell holds the row's tools, at the right, danger last. */
.table .table__actions { text-align: right; white-space: nowrap; }
.table__actions > .btn + .btn { margin-inline-start: var(--space-1); }

/* Toolbar: what a list is filtered by at the left, its actions at the right, danger last. */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
/* Save bar: a panel's save button and its status line on one row at the end of the panel, on a rule. */
.save-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 2px solid var(--color-rule); }
.save-bar__status { color: var(--color-ink); font-weight: var(--weight-strong); }
.save-bar__status.is-ok { color: var(--color-ok); }
.save-bar__status.is-warn { color: var(--color-warn); }
.save-bar__status > .btn { margin-inline-start: var(--space-2); }
/* Sticky: stays at the foot of the screen while the class is on (the panel has changes not yet saved).
   It covers the page under it with its panel's ground, --save-bar-ground. */
.save-bar--sticky {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  background: var(--save-bar-ground, var(--color-paper));
}

/* Label and value pairs: labels in soft 600, values in ink, one pair to a line. */
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-3); font-size: var(--text-md); line-height: var(--leading-body); }
.kv:empty { display: none; }
.kv__label { color: var(--color-ink-soft); font-weight: var(--weight-strong); }
.kv__value { color: var(--color-ink); overflow-wrap: anywhere; }
/* A narrow or zoomed phone: each value goes under its label. */
@media (max-width: 22.4375em) {
  .kv { grid-template-columns: minmax(0, 1fr); }
}

/* Section head: a display title over its group; more room above than below. */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: var(--space-2) var(--space-4); margin: var(--space-6) 0 var(--space-3);
}
.section-head__title { font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--color-frame-deep); }
@media (min-width: 900px) { .section-head__title { font-size: var(--text-2xl); } }
/* Ruled head: a display title on a 2px deep-blue rule, for groups inside a list or a sheet. */
.section-head--ruled {
  padding-bottom: 6px; border-bottom: 2px solid var(--color-frame-deep);
  font: var(--weight-regular) var(--text-title)/var(--leading-snug) var(--font-display); color: var(--color-frame-deep);
}

/* Grocery rows: the layout every medium shares. Colours and sizes are set per medium: print below, screen in the checklist row. */
.grocery-item { display: flex; align-items: center; cursor: pointer; }
.grocery-item-name { flex: 1; }
.grocery-item-qty { white-space: nowrap; }
/* Already in the Starter Kit: a permanent strikethrough (not the user's tick) and a note beside the name. */
.grocery-item.kit-marked .kit-marked-note { display: inline-block; margin-left: 0.4rem; font-style: italic; text-decoration: none; opacity: 1; }
.grocery-garnish-note, .grocery-stock-note { display: inline-block; margin-left: 0.4rem; font-style: italic; }
/* The browser print of a list: tighter rows, in paper values. */
@media print {
  .grocery-item { gap: 0.75rem; padding: 0.45rem 0 0.45rem 0.25rem; border-bottom: 1px solid var(--border-light); border-radius: 4px; }
  .grocery-item:last-child { border-bottom: none; }
  .grocery-item.checked span { text-decoration: line-through; color: var(--warm-gray); opacity: 0.6; }
  .grocery-item-name { font-size: 0.92rem; }
  .grocery-item-qty { font-size: 0.85rem; color: var(--terra-dark); font-weight: 600; }
  .grocery-item.kit-marked .grocery-item-name,
  .grocery-item.kit-marked .grocery-item-qty { text-decoration: line-through; color: var(--warm-gray); opacity: 0.7; }
  .grocery-item.kit-marked .kit-marked-note { color: var(--terra); font-size: 0.85rem; }
  .grocery-garnish-note, .grocery-stock-note { color: var(--warm-gray); font-size: 0.85rem; }
}

/* Checklist row (.row--check): the tick leads, the label is the row, the value sits right.
   Screen only: the browser print of a list keeps its older, tighter rows. */
@media screen {
  .grocery-item {
    gap: var(--space-3); min-height: var(--control-lg); padding: var(--space-2) var(--space-2) var(--space-2) 0;
    border-bottom: 1px solid var(--color-rule); border-radius: 0;
    color: var(--color-ink);
    transition: background-color var(--motion-fast);
  }
  .grocery-item:last-child { border-bottom: none; }
  @media (hover: hover) {
    .grocery-item:hover { background: var(--color-paper); }
  }
  .grocery-item:active { background: var(--color-frame-wash); }
  .grocery-item-name { font-size: var(--text-lg); line-height: var(--leading-snug); color: var(--color-ink); }
  .grocery-item-qty {
    font-size: var(--text-md); font-weight: var(--weight-bold); line-height: var(--leading-snug);
    color: var(--color-ink); text-align: right; font-variant-numeric: tabular-nums lining-nums;
  }
  /* Ticked: struck through in the soft ink, never faded. */
  .grocery-item.checked span, .grocery-item.kit-marked .grocery-item-name, .grocery-item.kit-marked .grocery-item-qty {
    text-decoration: line-through; color: var(--color-ink-soft); opacity: 1;
  }
  .grocery-item.kit-marked .kit-marked-note { color: var(--color-frame-deep); font-size: var(--text-sm); }
  .grocery-garnish-note, .grocery-stock-note { color: var(--color-ink-soft); font-size: var(--text-sm); }
  .grocery-item-name.online { color: var(--color-ink); }
  /* Phones (.row--stack): the amount drops under the name, so long names keep the full width. */
  @media (max-width: 640px) {
    .grocery-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--space-3); row-gap: 2px; }
    .grocery-item > input, .grocery-item > span[aria-hidden] { grid-row: 1 / span 2; align-self: center; }
    .grocery-item > .grocery-item-name { grid-column: 2; grid-row: 1; }
    .grocery-item > .grocery-item-qty { grid-column: 2; grid-row: 2; text-align: left; }
    .grocery-item > button { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  }
}

/* Empty state: no box, one centred column; the icon in a pale blue disc, a title, one sentence, one main button.
   .empty holds a .disc; .ki-empty draws its own 64px disc round an .icon-lg. */
.empty, .ki-empty { display: flex; flex-direction: column; align-items: center; padding: var(--space-6) var(--space-4); text-align: center; color: var(--color-ink-soft); }
.empty { gap: var(--space-4); }
.empty__text { max-width: 40ch; margin: 0; font-size: var(--text-md); line-height: var(--leading-body); text-wrap: pretty; }
.ki-empty > .icon-lg {
  box-sizing: border-box;
  width: 64px;
  height: 64px;
  margin: 0 0 var(--space-4);
  padding: 14px;
  border: 2px solid var(--color-frame);
  border-radius: var(--radius-pill);
  background: var(--color-frame-wash);
  color: var(--color-frame-deep);
}
.ki-empty h3 { margin: 0 0 var(--space-2); font-size: var(--text-xl); line-height: var(--leading-snug); color: var(--color-frame-deep); }
.ki-empty p { max-width: 36ch; margin: 0 auto; font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink-soft); text-wrap: pretty; }
.ki-empty > .ki-btn-primary { margin-top: var(--space-5); }
/* Inline block, not flex: one label holds the program-name span, and flex items would split its words apart. */
.ki-empty > #recipeBoxEmptyBrowse { display: inline-block; padding-block: 12px; }

/* Disc: the one round holder for an icon or an emoji, a visible blue ring round a dark-blue icon. */
.disc {
  display: inline-grid; place-items: center; flex: none;
  box-sizing: border-box; width: 56px; height: 56px;
  border: 2px solid var(--color-frame); border-radius: var(--radius-pill);
  background: var(--color-frame-wash); color: var(--color-frame-night);
}
.disc > .icon { display: block; width: 28px; height: 28px; vertical-align: 0; }
.disc--lg { width: 64px; height: 64px; }
.disc--lg > .icon { width: 32px; height: 32px; }
/* Extra large: an emoji that names a whole dialog or gate. */
.disc--xl { width: 88px; height: 88px; font-size: var(--text-title-xl); line-height: 1; }

/* Steps: a numbered sequence on pepper discs joined by one dashed line.
   Stacked on phones (the line runs down); .steps--across lays three or fewer side by side. */
.steps { --steps-disc: 40px; display: grid; gap: var(--space-5); margin: 0; padding: 0; }
.steps__item {
  position: relative;
  display: grid; grid-template-columns: var(--steps-disc) minmax(0, 1fr); column-gap: var(--space-4);
}
.steps__num {
  grid-row: 1 / span 2;
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: var(--steps-disc); height: var(--steps-disc);
  border-radius: var(--radius-pill); background: var(--color-pepper); color: var(--color-ink);
  font: var(--weight-regular) var(--text-title)/1 var(--font-display);
  font-variant-numeric: lining-nums;
}
.steps__title {
  align-self: center; min-height: var(--steps-disc); display: flex; align-items: center;
  font: var(--weight-regular) var(--text-title)/var(--leading-snug) var(--font-display); color: var(--color-frame-deep);
}
.steps__text { grid-column: 2; margin-top: var(--space-1); font-size: var(--text-md); line-height: var(--leading-body); color: var(--color-ink); }
/* The joining line runs from under one disc to the top of the next, behind the discs. */
/* An ordered list keeps its own numbers: the disc is drawn from a counter, so the list stays one list
   and no number is added as text. Its text sits level with the middle of the disc. */
ol.steps { list-style: none; counter-reset: steps; }
ol.steps > .steps__item { counter-increment: steps; }
ol.steps > .steps__item::before {
  content: counter(steps);
  grid-row: 1;
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: var(--steps-disc); height: var(--steps-disc);
  border-radius: var(--radius-pill); background: var(--color-pepper); color: var(--color-ink);
  font: var(--weight-regular) var(--text-title)/1 var(--font-display);
  font-variant-numeric: lining-nums;
}
ol.steps > .steps__item > .steps__text { grid-row: 1; margin-top: calc((var(--steps-disc) - 1lh) / 2); }
.steps__item:not(:last-child)::after {
  content: ""; position: absolute;
  left: calc(var(--steps-disc) / 2 - 1px); top: var(--steps-disc); bottom: calc(-1 * var(--space-5));
  border-left: 2px dashed var(--color-lip);
}
@media (min-width: 641px) {
  .steps--across { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); column-gap: var(--space-5); }
  .steps--across .steps__item { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; align-content: start; }
  .steps--across .steps__num { grid-row: auto; margin-bottom: var(--space-3); }
  .steps--across .steps__title { min-height: 0; }
  .steps--across .steps__text { grid-column: 1; }
  .steps--across .steps__item:not(:last-child)::after {
    left: calc(var(--steps-disc) + var(--space-2)); right: calc(-1 * var(--space-5) + var(--space-2));
    top: calc(var(--steps-disc) / 2 - 1px); bottom: auto;
    border-left: 0; border-top: 2px dashed var(--color-lip);
  }
}
