/* ============ Forms ============ */
label { display: block; margin-bottom: var(--space-2); font-size: var(--text-label); font-weight: 500; color: var(--muted-foreground); }
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  margin: 0;
  font-size: var(--text-body);
  color: var(--foreground);
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea,
button[data-date-range] {
  width: 100%;
  min-height: var(--control-h);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  transition: border-color 0.2s ease-out, box-shadow 0.2s ease-out;
}
input[type="number"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); opacity: 0.8; }
input:not([type="checkbox"]):not([type="radio"]):focus-visible, select:focus-visible, textarea:focus-visible, button[data-date-range]:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}
input:disabled, select:disabled, textarea:disabled { background-color: var(--muted); color: var(--muted-foreground); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
input[type="file"] { font: inherit; color: var(--muted-foreground); }

/* Drop-downs, date and time boxes in the Symphony look, on every page with no page rules (owner, 2026-10-29): the browser's own grey
   macOS control is turned off and a chevron drawn in the theme's muted colour sits at the right, so it follows light, dark and every colour
   theme. The chevron is two gradients (a \ then a /), not an SVG, because an SVG background cannot take a theme colour. The open list stays
   the browser's own (Safari cannot style it); where the browser can style it (appearance: base-select) it gets the card look below. */
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: calc(var(--space-3) + 20px);
  background-image: linear-gradient(45deg, transparent calc(50% - 0.8px), var(--chevron, var(--muted-foreground)) calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px)),
    linear-gradient(135deg, transparent calc(50% - 0.8px), var(--chevron, var(--muted-foreground)) calc(50% - 0.8px) calc(50% + 0.8px), transparent calc(50% + 0.8px));
  background-size: 6px 6px;
  background-position: right calc(var(--space-3) + 5px) center, right var(--space-3) center;
  background-repeat: no-repeat;
  text-overflow: ellipsis;
  cursor: pointer;
}
select:focus-visible { --chevron: var(--accent-ink); }
@media (hover: hover) { select:hover:not(:disabled) { border-color: var(--accent); } }
select:disabled { cursor: not-allowed; opacity: 1; --chevron: var(--border-strong); }
select[multiple], select[size]:not([size="1"]) { padding-right: var(--space-3); background-image: none; }
select option { background: var(--card); color: var(--foreground); }
@supports (appearance: base-select) {
  select:not([multiple]), ::picker(select) { appearance: base-select; }
  select:not([multiple]) { display: inline-flex; align-items: center; }
  select::picker-icon { display: none; } /* the chevron above is the one */
  ::picker(select) { margin-block: var(--space-1); padding: var(--space-1); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card); color: var(--foreground); box-shadow: var(--shadow-lg); }
  select option { min-height: 40px; padding: var(--space-2) var(--space-3); border-radius: calc(var(--radius) - 4px); }
  select option:hover, select option:focus-visible { background: var(--muted); outline: none; }
  select option:checked { background: var(--accent-tint); color: var(--accent-ink); font-weight: 600; }
  select option::checkmark { display: none; }
}
/* time (and any date box a page still has): the same box; the numbers in the mono face like other figures; iPhone Safari's own look
   (its width, centred text) is turned off */
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"]) { -webkit-appearance: none; appearance: none; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: start; }
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-date-and-time-value { text-align: start; }
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-fields-wrapper { padding: 0; }
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-text { color: var(--muted-foreground); }
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-hour-field:focus,
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-minute-field:focus,
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-day-field:focus,
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-month-field:focus,
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-datetime-edit-year-field:focus { background: var(--accent-tint); color: var(--accent-ink); border-radius: 4px; outline: none; }
input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"])::-webkit-calendar-picker-indicator { opacity: 0.6; cursor: pointer; }
@media (hover: hover) { input:is([type="date"], [type="time"], [type="datetime-local"], [type="month"]):hover:not(:disabled) { border-color: var(--accent); } }

form { display: grid; gap: var(--space-4); max-width: var(--w-form); }
/* related fields share a row */
[data-row] { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-4); align-items: start; }
form > div, form > fieldset { min-width: 0; }
/* tick boxes that are separate questions go one under the other, not run together on one line (O-32) */
fieldset[data-ticks] > label:has(> input[type="checkbox"]) { display: flex; }
fieldset { margin: 0; padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-lg); }
legend { padding: 0 var(--space-2); font-weight: 600; }

/* Filter bars: a div of labelled fields sitting directly in a page */
main > div:has(> div > label),
main > div:has(> label),
main > section > div:has(> div > label),
[data-filters] {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  padding: 0 0 var(--space-4);
  border-bottom: 1px solid var(--border);
}
main > div:has(> div > label) > div,
main > section > div:has(> div > label) > div,
[data-filters] > div { min-width: 180px; flex: 1 1 180px; max-width: 320px; }
main > div:has(> div > label) label { margin-bottom: var(--space-2); }
/* A tick box or a count sitting in a filter bar lines up with the middle of the fields, and the count goes to the right end. */
main > div:has(> div > label) > :is(label, span) { display: inline-flex; align-items: center; min-height: var(--control-h); margin: 0; } /* as tall as the boxes beside it */
main > div:has(> div > label) > span:last-child { margin-left: auto; text-align: right; }

/* Hint text under a field */
input + p, select + p, textarea + p { margin: var(--space-2) 0 0; font-size: var(--text-label); color: var(--muted-foreground); }

/* Pick-lists: a list whose items are a lone button (not rows that merely contain one, like recipe lines) */
ul:has(> li > button:only-child) { list-style: none; padding: 0; display: grid; gap: var(--space-2); max-height: 320px; overflow-y: auto; }
ul:has(> li > button:only-child) button { width: 100%; justify-content: flex-start; text-align: left; font-weight: 500; }

/* Messages */
[role="alert"] {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--danger);
  background: var(--danger-bg);
  color: var(--foreground);
  font-weight: 500;
}
p[role="alert"] { margin: var(--space-2) 0; font-size: var(--text-label); }
/* a wrong field (components/ui/FieldErrors.tsx): a red line under it, not a box */
p[role="alert"][data-field-error] { margin: var(--space-1) 0 0; padding: 0; border: 0; background: none; color: var(--danger); }
/* an info or "Saved" note: one muted line, no box (owner, 2026-10-22); errors keep the red box above. The loading placeholder is a
   div[role="status"] with its own rules (06-cards-stats.css). */
[role="status"] { font-size: var(--text-label); color: var(--muted-foreground); }
/* A warning (something to look at, nothing went wrong: an estimated price, an order sheet still to complete) is amber, not the error red
   (UX-21, C4). Mark the box data-warning, without role="alert". */
[data-warning] { display: grid; gap: var(--space-1); justify-items: start; margin: var(--space-4) 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius); border: 1px solid color-mix(in oklab, var(--warn) 45%, transparent); background: var(--warn-bg); color: var(--foreground); font-weight: 500; }
[data-warning] p { margin: 0; }
p[data-warning] { display: block; margin: var(--space-2) 0; font-size: var(--text-label); }
div[role="alert"] { display: grid; gap: var(--space-1); justify-items: start; margin: var(--space-4) 0; }
div[role="alert"] p { margin: 0; }

/* ============ Buttons ============ */
/* the line icons (NavIcon) sit on the line of the words beside them */
svg[data-nav-icon] { flex: none; vertical-align: -0.15em; }
button {
  min-height: var(--control-h);
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: var(--text-body);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.2s ease-out, border-color 0.2s ease-out, filter 0.2s ease-out;
}
/* A link that looks like a button: data-button, or data-button="primary" for the main action; data-back is a quiet "back to the list" link. */
a[data-button] { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); padding: 0 var(--space-4); box-sizing: border-box; border-radius: var(--radius); border: 1px solid var(--border-strong); background: transparent; color: var(--foreground); font-size: var(--text-body); font-weight: 600; text-decoration: none; transition: background-color 0.2s ease-out, border-color 0.2s ease-out, filter 0.2s ease-out; }
a[data-button="primary"] { border-color: transparent; background: var(--accent); color: var(--accent-foreground); }
a[data-back] { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-h); padding: 0 var(--space-4) 0 var(--space-3); box-sizing: border-box; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground); font-size: var(--text-body); font-weight: 600; text-decoration: none; transition: background-color 0.2s ease-out, border-color 0.2s ease-out, color 0.2s ease-out; }
a[data-button]:focus-visible, a[data-back]:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
@media (hover: hover) {
  a[data-button]:hover { background: var(--muted); border-color: var(--accent-line); }
  a[data-button="primary"]:hover { background: var(--accent); filter: brightness(1.1); }
  a[data-back]:hover { background: var(--muted); border-color: var(--accent-line); color: var(--foreground); }
}
div[data-actions] { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
button:active:not(:disabled) { transform: scale(0.98); }
button[type="submit"] {
  border-color: transparent;
  background: var(--accent);
  color: var(--accent-foreground);
  box-shadow: none;
}
button:disabled { cursor: not-allowed; background: var(--muted); color: var(--muted-foreground); border-color: var(--border); box-shadow: none; }
@media (hover: hover) {
  button:hover:not(:disabled) { background: var(--muted); border-color: var(--accent-line); }
  button[type="submit"]:hover:not(:disabled) { background: var(--accent); filter: brightness(1.1); }
}
button[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-ink); }

/* Segmented control (Cards / Table) */
div[role="group"]:is([aria-label="Layout"], [aria-label="Show"]) { display: inline-flex; }
div[role="group"]:is([aria-label="Layout"], [aria-label="Show"]) button { border-radius: 0; }
div[role="group"]:is([aria-label="Layout"], [aria-label="Show"]) button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
div[role="group"]:is([aria-label="Layout"], [aria-label="Show"]) button:last-child { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }

div[role="group"]:not([aria-label="Layout"], [aria-label="Show"]) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
div[role="group"]:not([aria-label="Layout"], [aria-label="Show"]) p { margin: 0 var(--space-2) 0 0; font-weight: 500; }

/* The one confirm step (components/ui/ConfirmButton.tsx, docs/office-ui.md, UX-3): a box with the question on its own line, then the
   confirm button and Cancel. The confirm button is plain for archive and red outlined for what cannot be undone. */
div[data-confirm] { justify-content: flex-start; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--card); }
div[data-confirm] > p { flex-basis: 100%; max-width: none; margin: 0; text-align: start; }
div[data-confirm] > button { margin: 0; }
/* asked in the dialog (a button in a table cell, UX-63): the dialog is the box */
dialog div[data-confirm] { padding: 0; border: 0; background: none; }

/* Danger (UX-2): delete, remove, clear, terminate. Red words and a red outline, as on the employee page; never a filled red button
   outside Admin. */
button[data-danger] { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 50%, transparent); }
@media (hover: hover) { button[data-danger]:hover:not(:disabled) { background: var(--danger-bg); border-color: var(--danger); } }
/* a dialog's Delete is the submit button: red outline too, not the accent fill of [data-dialog-actions] button[type="submit"] (UX-46) */
[data-dialog-actions] button[type="submit"][data-danger]:not(:disabled) { background: transparent; color: var(--danger); border-color: color-mix(in oklab, var(--danger) 50%, transparent); }

/* Hold to confirm (owner, 2026-11-02; ConfirmButton.tsx): a red fill runs across a danger button while it is held, 0.8 s, then a tick.
   Only transform; with reduced motion no fill runs, the hold is still needed and the tick still comes. */
button[data-hold] { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button[data-hold]::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in oklab, var(--danger) 22%, transparent); transform: scaleX(0); transform-origin: left; transition: transform 0.2s ease-out; }
button[data-hold][data-holding]::before { transform: scaleX(1); transition: transform 0.8s linear; }
button[data-hold][data-held]::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) { button[data-hold][data-holding]::before { transform: scaleX(0); } }
small[data-hold-hint] { flex-basis: 100%; color: var(--muted-foreground); }

/* Copied (owner, 2026-11-02; CopyButton.tsx): the copy icon turns into a tick and the words say Copied for 1.5 s. */
button[data-copy] { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
button[data-copy] > [data-copy-icon] { display: inline-grid; }
button[data-copy] > [data-copy-icon] > svg { grid-area: 1 / 1; transition: transform 0.2s ease-out, opacity 0.2s ease-out; }
button[data-copy] > [data-copy-icon] > svg:last-child, button[data-copy][data-copied] > [data-copy-icon] > svg:first-child { opacity: 0; transform: scale(0.6); }
button[data-copy][data-copied] > [data-copy-icon] > svg:last-child { opacity: 1; transform: none; }

/* Saved (owner, 2026-11-02; SavedNotice.tsx marks the button that made the save): a tick and Saved on the button for 1.2 s, its own
   words hidden underneath so it keeps its size. The green notice still comes too. */
button[data-saved] { --saved-ink: var(--foreground); position: relative; color: transparent !important; }
button[data-saved]:is([type="submit"], [data-primary]) { --saved-ink: var(--accent-foreground); }
button[data-saved] > * { visibility: hidden; }
button[data-saved]::after { content: "Saved"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-inline-start: 1.4em; color: var(--saved-ink); animation: saved-in 0.2s ease-out; }
button[data-saved]::before { content: ""; position: absolute; top: 50%; left: calc(50% - 1.9em); width: 1em; height: 1em; margin-top: -0.5em; background: var(--saved-ink); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E") center / contain no-repeat; animation: saved-in 0.2s ease-out; }
@keyframes saved-in { from { opacity: 0; transform: scale(0.9); } }

/* "New <thing>" (UX-1): the main action of a list, at its top right. One solid accent button, whatever the page wraps it in: the
   selector is a little heavier than the row rules ([data-actions] > a:not(:first-child), the header link rows) so it wins over them. */
:is(a[href], button[type])[data-new]:not(:disabled) {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--control-h); padding: 0 var(--space-4); box-sizing: border-box;
  border-radius: var(--radius); border: 1px solid transparent; background: var(--accent); color: var(--accent-foreground);
  font-size: var(--text-body); font-weight: 600; text-decoration: none; white-space: nowrap;
}
@media (hover: hover) { :is(a[href], button[type])[data-new]:not(:disabled):hover { background: var(--accent); border-color: transparent; filter: brightness(1.1); } }
:is(a, button)[data-new]:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* A greyed button says why underneath (UX-19): <small data-why> straight after the button's row. */
[data-why] { display: block; margin-top: var(--space-1); font-size: var(--text-label); color: var(--muted-foreground); }


/* Form footer: the submit button and its Cancel link sit in one row with a gap, and any button
   that follows the form (e.g. "Archive this ingredient") gets space above it. */
form > div:has(> button[type="submit"]) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
form + button, form + div[role="group"] { margin-top: var(--space-4); }

/* ============ Batch recipe pages: one column width, aligned rows ============ */
/* "Scale this batch", the form and its buttons all share the form's width, so their edges line up */
[data-batch-page] > details, [data-batch-page] > div:has(> form) { max-width: var(--w-form); }

/* header fields: name + category on one row, then yield / portion size / menu price on three equal columns */
[data-row="2"] { grid-template-columns: 2fr 1fr; }
[data-row="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
[data-row] > div > label { display: block; margin-bottom: var(--space-2); }
[data-row] > div > label > span { white-space: nowrap; }
/* number + unit side by side */
[data-pair] { display: grid; grid-template-columns: minmax(0, 1fr) 9.5rem; gap: var(--space-2); }

/* ingredient picker: the two filters share a row, search takes the full width, and every part is spaced */
[data-picker] > div:first-child { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
[data-picker] > div:first-child > div:last-child { grid-column: 1 / -1; }
[data-picker] label { display: block; margin-bottom: var(--space-2); }
[data-picker] > * + * { margin-top: var(--space-4); }

/* recipe lines: name | quantity | unit | remove, in the same columns on every row */
[data-lines] { margin-top: var(--space-4); }
[data-lines] > li { display: grid; grid-template-columns: minmax(0, 1fr) 8rem 6rem auto; gap: var(--space-3); align-items: center; }
[data-lines] > li > :is(input, select) { width: 100%; }
/* the dish version form shares the lines layout (a line cost sits between the unit and Remove) and works outside a <section> */
/* one bordered list with hairlines between the lines, not a box per line (layout review, owner 2026-10-22) */
[data-lines] { list-style: none; padding: 0; display: grid; gap: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
[data-lines] > li { position: relative; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
[data-lines] > li:first-child { border-top: 0; }
[data-lines] > li > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[data-lines][data-cost] > li { grid-template-columns: minmax(0, 1fr) 8rem 6rem 5.5rem auto; }
[data-lines][data-cost] > li > span:nth-last-child(2) { text-align: right; font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted-foreground); }
[data-lines] > li > button { width: auto; }
/* batch lines carry a cost and a share of the batch cost between the unit and Remove */
[data-lines][data-share] > li { grid-template-columns: minmax(0, 1fr) 8rem 6rem 5.5rem 4.5rem auto; }
[data-lines][data-share] > li > span:nth-last-child(3), [data-lines][data-share] > li > span:nth-last-child(2) { text-align: right; font-family: var(--font-mono); font-size: var(--text-label); color: var(--muted-foreground); }

@media (max-width: 640px) {
  [data-row="2"], [data-row="3"], [data-picker] > div:first-child { grid-template-columns: 1fr; }
  [data-lines] > li { grid-template-columns: minmax(0, 1fr) 6rem auto; }
  [data-lines] > li > span:first-child { grid-column: 1 / -1; }
  /* dish lines: the name and its cost share the first row, quantity, unit and Remove sit on the second */
  [data-lines][data-cost] > li { grid-template-columns: minmax(0, 1fr) 5.5rem auto; }
  [data-lines][data-cost] > li > span:first-child { grid-column: 1 / 3; grid-row: 1; }
  [data-lines][data-cost] > li > span:nth-last-child(2) { grid-column: 3; grid-row: 1; }
  [data-lines][data-share] > li { grid-template-columns: minmax(0, 1fr) 5.5rem auto; }
  [data-lines][data-share] > li > span:first-child { grid-column: 1; grid-row: 1; }
  [data-lines][data-share] > li > span:nth-last-child(3) { grid-column: 2; grid-row: 1; }
  [data-lines][data-share] > li > span:nth-last-child(2) { grid-column: 3; grid-row: 1; }
}

/* Batch form flow: summary strip and chart on top, recipe lines, then an "Add ingredient" button that opens the picker */
[data-summary] dl { margin: 0; }

[data-add] { margin-top: var(--space-4); }
[data-add] + [data-picker] { margin-top: var(--space-4); }

/* the batch editor's Save and Cancel sit side by side under the form, as in the dish editor (UX-36): no pinned full-width bar, which
   covered the ingredient list now that it is always open */
[data-save-bar] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
/* the warning boxes above the form share the column width too */
[data-batch-page] > :is(div[role="alert"], p[role="alert"], [data-warning]) { max-width: var(--w-form); }

/* polish: tag beside an ingredient name, breathing room under the title, no empty gaps */
[data-lines] > li > span:first-child > span { display: inline-block; margin-left: var(--space-2); font-size: var(--text-caption); font-weight: 500; color: var(--amber); }
[data-batch-page] > h1 + form { margin-top: var(--space-4); }
[data-lines]:empty, [data-batch-page] div[aria-live]:empty { display: none; }
[data-batch-page] > h1 + div:has(> form) { margin-top: var(--space-4); }

/* Touch screens: everything you tap gets a 44px hit area: table sort buttons, links on their own (table cells,
   list items, recipe lines, back links), the rows that open a section, the export menu and the file picker */
@media (pointer: coarse) {
  table th button { min-height: 44px; min-width: 44px; }
  main :is(td, li, div) > a:not([data-stat]), main > a, main p > a:only-child, [data-lines] a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  /* one rule for every control on a touch screen (UX-5, C4): the dish rename pencil (28px), Edit menu price (24px), badge chips, channel
     price boxes, option group Rename and Remove, report date presets (38px), Summary tabs, Settings opening hours and Open/Closed were all
     under 44px, each set smaller by its own page. !important so no page's own size wins; a button that is only an icon is 44 wide too.
     A Summary tile is a link, but a card, not a line of text: it keeps its own layout (UX-29, its words were centred on a phone) */
  :is(main, dialog, [role="dialog"], [popover]) :is(button, select, input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="hidden"]), [data-button], [role="tab"], summary) { min-height: 44px !important; }
  :is(main, dialog, [role="dialog"], [popover]) button:not(:has(> :not(svg, [aria-hidden="true"], [data-sr]))) { min-width: 44px !important; }
  main input[type="number"] { min-width: 4.5rem; }
  :is(main, dialog) label:has(> input:is([type="checkbox"], [type="radio"])) { min-height: 44px !important; align-items: center; }
  main :is(h2, h3, [data-name-line]) > a { display: inline-flex; align-items: center; min-height: 44px; } /* "View more" beside a heading, a name on its own */
  html nav[aria-label="Main"] a, html nav[aria-label="Main"] button { min-height: 44px; }
  html nav[aria-label="Main"] button[aria-label*="mode" i], html nav[aria-label="Main"] button[title*="mode" i] { min-width: 44px; }
  nav[aria-label="Main"] > div div[data-nav-links] a { display: inline-flex; align-items: center; }
  summary { padding-block: 12px; }
  main [data-menu] > div > a, [data-menu] button { min-height: 44px; }
  input[type="file"] { min-height: 44px; }
  label:has(> input[type="checkbox"]) { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; }
  input[type="checkbox"] { width: 24px; height: 24px; }
  :is(th, td)[data-tick] > input[type="checkbox"] { width: 24px; height: 24px; } /* the bill ticks on Sales by bill were 18px (UX-5) */
}

/* grid children may shrink below their content, so a wide table inside the chart scrolls instead of stretching the page */
form > * { min-width: 0; }
[data-actions] { display: flex; flex-wrap: wrap; gap: var(--space-3); } /* 12px between buttons, as div[data-actions] above: 8 read cramped */


/* A new PIN, shown once (Profile > Reset PIN) */
/* the PIN alone is big (owner, 2026-10-21: the whole sentence was, in Till login); on its own line when inside a sentence */
strong[data-pin-reveal] { display: block; }
[data-pin-reveal] { margin: var(--space-4) 0; font-family: var(--font-mono); font-size: 56px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent-ink); }

/* Promotions form: tick-box rows and the dish search picks */
form[data-promo-form] { display: grid; gap: var(--space-4); max-width: var(--w-form); } /* 16px, as every other form */
form[data-promo-form] fieldset { display: grid; gap: var(--space-2); }
form[data-promo-form] [data-chips] { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
form[data-promo-form] [data-chips] label { display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
form[data-promo-form] ul[data-picks] { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); }
form[data-promo-form] ul[data-picks] small { color: var(--muted-foreground); margin-left: var(--space-2); }

/* Email a spec sheet: the address and its button on one line with room between them, wrapping on a phone (owner, 2026-10-22) */
[data-email-share] { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
[data-email-share] > input { flex: 1 1 16rem; min-width: 0; margin: 0; }
[data-email-share] > button { flex: none; margin: 0; }
[data-email-share] > span { flex: 1 0 100%; font-size: var(--text-label); }

/* A part of a page a sign-in may read but not change (components/ui/ReadOnly.tsx, O-93): the fieldset adds no box of its own */
fieldset[data-read-only] { display: contents; }
fieldset[data-read-only] :disabled { opacity: 0.6; } /* switches with a look of their own still read as not for pressing */
/* The typical yields under Yield % (owner, 2026-11-04): small one-tap buttons in the hint box, wrapping on a phone */
[data-yield-hint] p { margin: 0; }
[data-yield-hint] p + p { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

/* Floating labels (owner, 2026-11-07): in an empty box the label sits inside it where the placeholder would be, and floats back up to
   its usual place above when the box is focused or filled. The label keeps its line above either way, so no form changes height or
   moves; only the words travel (transform, 0.2 s ease-out, none with reduced motion). Both ways forms write a field get it: a label
   followed by its box, and a label wrapped round its words and the box (there the label moves down and the box moves back up by as much).
   "Empty" is :placeholder-shown; LiveFields gives every text box a blank placeholder so it can say so, and before that (the server's
   first paint) an empty value attribute stands in. Text-like boxes only: not numbers, dates, searches, drop-downs or long text. */
label:has(+ input:is(:not([type]), [type="text"], [type="email"], [type="tel"], [type="password"], [type="url"])),
label:has(> input:is(:not([type]), [type="text"], [type="email"], [type="tel"], [type="password"], [type="url"])):not(:has(> :not(input))),
label:has(> input:is(:not([type]), [type="text"], [type="email"], [type="tel"], [type="password"], [type="url"])):not(:has(> :not(input))) > input {
  transition: transform 0.2s ease-out, border-color 0.2s ease-out, box-shadow 0.2s ease-out;
  transform-origin: left center;
}
:is(form, dialog, main, [data-card], section) label:not(:is([data-lines] *, [data-search], main > div:has(> div > label) > label)):has(+ input:is(:not([type]), [type="text"], [type="email"], [type="tel"], [type="password"], [type="url"]):is(:placeholder-shown, :not([placeholder]):is([value=""], :not([value]))):not(:focus, :disabled, :autofill)) {
  transform: translate(var(--space-3), calc(0.5lh + var(--space-2) + var(--control-h) / 2)) scale(1.08);
}
:is(form, dialog, main, [data-card], section) label:not(:is([data-lines] *, [data-search], main > div:has(> div > label) > label)):not(:has(> :not(input))):has(> input:is(:not([type]), [type="text"], [type="email"], [type="tel"], [type="password"], [type="url"]):is(:placeholder-shown, :not([placeholder]):is([value=""], :not([value]))):not(:focus, :disabled, :autofill)) {
  --float-down: calc(0.5lh + var(--control-h) / 2);
  transform: translate(var(--space-3), var(--float-down)) scale(1.08);
  > input { transform: scale(calc(1 / 1.08)) translate(calc(-1 * var(--space-3)), calc(-1 * var(--float-down))); background-color: transparent; }
}
/* the placeholder ("for example …") shows once the box is focused, never under the resting label */
label + input:not(:focus)::placeholder, label > input:not(:focus)::placeholder { color: transparent; }
:is([data-lines], [data-search]) input:not(:focus)::placeholder, main > div:has(> div > label) > label + input:not(:focus)::placeholder { color: var(--muted-foreground); }
@media (prefers-reduced-motion: reduce) { label, label > input { transition: none !important; } }

/* Live checks (owner, 2026-11-07, LiveFields): a quiet tick at the right of a box once what is typed looks right (an email, a phone
   number, a tax ID, or a box with a pattern), drawn as two strokes in the good colour (gradients, so it follows the theme, as the
   drop-down chevron); the hint under a wrong box comes only when the box is left or typing pauses, in FieldErrors' red line. */
input[data-valid]:not([type="checkbox"]):not([type="radio"]):not([type="file"]) {
  padding-right: calc(var(--space-3) + 20px);
  background-image: linear-gradient(45deg, transparent calc(50% - 1px), var(--good) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(135deg, transparent calc(50% - 1px), var(--good) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
  background-size: 6px 6px, 11px 11px;
  background-position: right calc(var(--space-3) + 10px) top calc(50% + 2px), right var(--space-3) top calc(50% - 0px);
  background-repeat: no-repeat;
}
