/* The Mill pre-orders, staff side (staff.js). The proposal's staff,
   email and print-sheet rules (Research/2026-10-19-preorder-proposal),
   then the demo's own pieces: the wide screen, the Toast controls, the
   banner, the inbox and the booking page. */
:root {
  --paper: #ffffff; --paper-ink: #141414; --paper-muted: #4d4d4d; --paper-line: #c9c9c9; --paper-tint: #f2f2f2;
  --warn-ink: #7a4b00; --frame-shadow: rgb(20 30 30 / 22%);
  --font-mail: Arial, Helvetica, sans-serif; --font-shell: 'Raleway', 'Helvetica Neue', Arial, sans-serif;
  --font-m-head: var(--font-head); --font-m-body: var(--font-body);
}

/* ---------- Pre-orders, staff side ----------
   The pre-order app's own screens. The Mill's guest-side look (white,
   charcoal and teal, Playfair headings, Raleway text), kept plain for a busy
   shift: big buttons, soft rounded corners, status as words and quiet pills.
   Fixed in both themes, like the guest phones. */
.po { color: var(--m-charcoal); font-family: var(--font-m-body); font-size: 15px; line-height: 1.45; font-variant-numeric: lining-nums; color-scheme: light; }
.po-app { container-type: inline-size; overflow: hidden; border-radius: 16px; background: var(--m-paper); box-shadow: 0 0 0 1px var(--m-line), 0 30px 60px -32px var(--frame-shadow); }
.po-top { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--m-line); background: var(--m-white); }
.po-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.po-brand b { display: block; font-family: var(--font-m-head); font-size: 20px; font-weight: 600; line-height: 1.15; }
.po-brand small { display: block; color: var(--m-muted); font-size: 12.5px; font-weight: 500; }
.po-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.po-btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--m-white); box-shadow: inset 0 0 0 1.5px var(--m-line); color: var(--m-charcoal); font-family: var(--font-m-body); font-size: 14px; font-weight: 700; white-space: nowrap; }
.po-btn--go { background: var(--m-teal); box-shadow: none; color: var(--m-white); }
.po-btn--line { box-shadow: inset 0 0 0 1.5px var(--m-teal); color: var(--m-teal); }
.po-btn--amber { background: var(--m-amber-soft); box-shadow: inset 0 0 0 1.5px var(--m-amber-ink); color: var(--m-amber-ink); }
.po-bar { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; justify-content: space-between; padding: 18px 20px 0; }
.po-title { font-family: var(--font-m-head); font-size: 26px; font-weight: 600; line-height: 1.15; }
.po-title small { display: block; margin-top: 2px; color: var(--m-muted); font-family: var(--font-m-body); font-size: 13px; font-weight: 500; }
.po-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--m-white); box-shadow: inset 0 0 0 1px var(--m-line); }
.po-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 9px; color: var(--m-muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.po-tab[aria-current="page"] { background: var(--m-teal); color: var(--m-white); }
.po-feed { display: flex; gap: 8px; align-items: flex-start; padding: 12px 20px 0; color: var(--m-muted); font-size: 13.5px; }
.po-feed .i { margin-top: 1px; color: var(--m-ok); }
.po-page { display: grid; gap: 20px; padding: 18px 20px 22px; }
.po-day { display: grid; gap: 8px; }
.po-day__h { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-family: var(--font-m-head); font-size: 18px; font-weight: 600; line-height: 1.2; }
.po-day__h small { color: var(--m-muted); font-family: var(--font-m-body); font-size: 13px; font-weight: 500; }
.po-list { display: grid; list-style: none; border-radius: 14px; background: var(--m-white); box-shadow: 0 0 0 1px var(--m-line); }
.bk { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px 12px; align-items: baseline; padding: 14px 16px; border-top: 1px solid var(--m-line); }
.bk:first-child { border-top: 0; }
.bk > * { min-width: 0; }
.bk__state, .bk__acts { grid-column: 1 / -1; }
@container (min-width: 700px) {
  .bk { grid-template-columns: 70px minmax(0, 1fr) minmax(0, 220px) auto; gap: 16px; align-items: center; }
  .bk__state, .bk__acts { grid-column: auto; }
}
.bk__time { font-size: 17px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; }
.bk__who b { display: block; font-size: 16px; font-weight: 700; }
.bk__who span { color: var(--m-muted); font-size: 13.5px; }
.bk__state { display: grid; gap: 6px; }
.st { justify-self: start; display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.st .i { width: 14px; height: 14px; stroke-width: 2.5; }
.st--done { background: var(--m-ok-soft); color: var(--m-ok); }
.st--prog { background: var(--m-teal-soft); color: var(--m-teal-deep); }
.st--need { background: var(--m-amber-soft); color: var(--m-amber-ink); }
.st--closed { background: var(--m-paper); box-shadow: inset 0 0 0 1px var(--m-line); color: var(--m-muted); }
.st--due { padding-inline: 0; color: var(--m-amber-ink); }
.st--sent { padding-inline: 0; color: var(--m-muted); font-weight: 500; }
.meter { display: grid; grid-template-columns: repeat(var(--n, 10), minmax(0, 1fr)); gap: 3px; max-width: 200px; height: 8px; }
.meter i { border-radius: 2px; background: var(--m-line); }
.meter i.on { background: var(--m-teal); }
.meter i.day { background: repeating-linear-gradient(135deg, var(--m-teal) 0 2px, var(--m-teal-soft) 2px 5px); }
.bk__acts { display: flex; flex-wrap: wrap; gap: 8px; }
@container (max-width: 420px) {
  .po-top { padding-inline: 14px; }
  .po-bar, .po-feed, .po-page { padding-inline: 12px; }
  .po-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .po-tab { justify-content: center; padding: 0 6px; }
  .bk { grid-template-columns: 70px minmax(0, 1fr); column-gap: 10px; padding: 12px 14px; }
  .bk__time { font-size: 16px; }
  .bk__who b { font-size: 15px; }
}

.po-form { display: grid; gap: 14px; padding: 16px 18px 0; }
.po-field { display: grid; gap: 6px; }
.po-field label, .po-field .lbl { font-size: 14px; font-weight: 700; }
.po-hint { color: var(--m-muted); font-size: 12.5px; }
.po-input { min-height: 48px; font-variant-numeric: lining-nums tabular-nums; }
.po-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 360px) {
  .po-row2 { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; }
  .po-row2 select { padding: 0 4px 0 10px; }
}
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; overflow: hidden; border-radius: 10px; box-shadow: inset 0 0 0 1.5px var(--m-line); }
.stepper button { min-height: 48px; border: 0; background: var(--m-paper); color: var(--m-charcoal); font-family: var(--font-shell); font-size: 24px; font-weight: 500; }
.stepper input { min-width: 0; min-height: 48px; border: 0; border-inline: 1.5px solid var(--m-line); background: var(--m-white); color: var(--m-charcoal); font-size: 18px; font-weight: 700; text-align: center; }
.po-check { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px; border-radius: 12px; background: var(--m-sage-soft); font-size: 14px; font-weight: 700; }
.po-check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--m-teal); }
.po-check span { display: block; color: var(--m-muted); font-size: 13px; font-weight: 500; }
.po-match { display: grid; gap: 4px; margin: 14px 18px 0; padding: 12px 14px; border-radius: 12px; background: var(--m-amber-soft); font-size: 13.5px; }
.po-match b { color: var(--m-amber-ink); font-size: 14px; }


/* ---------- Kitchen email and paper ---------- */
.mail { overflow: hidden; border-radius: 12px; background: var(--paper); color: var(--paper-ink); font-family: var(--font-mail); font-size: 14px; line-height: 1.45; color-scheme: light; box-shadow: 0 0 0 1px var(--paper-line), 0 30px 60px -32px var(--frame-shadow); }
.mail__head { display: grid; gap: 3px; padding: 16px 20px; border-bottom: 1px solid var(--paper-line); background: var(--paper-tint); font-size: 13px; }
.mail__head div { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
.mail__head dt, .mail__head .k { color: var(--paper-muted); }
.mail__subj { margin-top: 6px; font-size: 17px; font-weight: 700; }
.mail__body { display: grid; gap: 14px; padding: 18px 20px 22px; }
.mail__body h4 { font-size: 15px; }
.mail__flag { padding: 10px 12px; border: 2px solid var(--paper-ink); background: var(--paper-tint); font-weight: 700; }
.mail__flag span { display: block; margin-top: 3px; font-weight: 400; }
.mail__warn { padding: 10px 12px; border: 1.5px solid var(--warn-ink); border-radius: 6px; background: var(--m-amber-soft); color: var(--paper-ink); }
.mail table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.mail th, .mail td { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.mail th { color: var(--paper-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.mail td.q { width: 36px; font-weight: 700; font-variant-numeric: tabular-nums; }
.totals { display: grid; gap: 14px; }
@media (min-width: 560px) { .totals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.totals > * { min-width: 0; }
.mail__guests { display: grid; gap: 8px; list-style: none; }
.mail__guests li { padding-bottom: 8px; border-bottom: 1px solid var(--paper-line); font-size: 13.5px; }
.mail__guests b { display: block; }
.mail__foot { color: var(--paper-muted); font-size: 12.5px; }

.a4 { max-width: 100%; width: 100%; overflow: hidden; padding: 6% 6.5%; background: var(--paper); color: var(--paper-ink); font-family: var(--font-mail); font-size: 11.5px; line-height: 1.4; color-scheme: light; box-shadow: 0 0 0 1px var(--paper-line), 0 30px 60px -32px var(--frame-shadow); }
@media (min-width: 700px) { .a4 { aspect-ratio: 210 / 297; } }
.a4__head { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; padding-bottom: 10px; border-bottom: 2px solid var(--paper-ink); }
.a4__head img { width: 52px; height: 52px; }
.a4__head b { display: block; font-family: var(--font-m-head); font-size: 20px; line-height: 1.1; }
.a4__meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 2px; }
.a4__flag { margin: 10px 0; padding: 8px 10px; border: 2px solid var(--paper-ink); font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.a4__flag span { display: block; margin-top: 2px; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.a4 h4 { margin: 8px 0 4px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.a4-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.a4-totals > * { min-width: 0; }
.a4-totals ul { list-style: none; display: grid; gap: 1px; }
.a4-totals li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px; }
.a4-totals li b { font-variant-numeric: tabular-nums; }
.a4-table-wrap { overflow-x: auto; }
.a4 table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.a4 th, .a4 td { padding: 4px 4px; border: 1px solid var(--paper-line); text-align: left; vertical-align: top; }
.a4 th { background: var(--paper-tint); font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; }
.a4 td em { font-style: normal; color: var(--paper-muted); }
.a4 td strong { font-weight: 700; }
.a4__foot { margin-top: 8px; color: var(--paper-muted); font-size: 10px; }

/* ---------- Demo additions ---------- */
.screen--wide { max-width: 1180px; background: transparent; }
@media (min-width: 700px) { .screen--wide { min-height: 0; overflow: visible; border-radius: 0; box-shadow: none; } }
.screen--wide .po-app { min-height: 100%; }
@media (max-width: 699px) { .screen--wide .po-app { border-radius: 0; } }
.po-top .po-btn { text-decoration: none; }
.po-btn .i { width: 16px; height: 16px; }
.po-btn .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--m-amber-soft); color: var(--m-amber-ink); font-size: 12px; }
a.po-btn { text-decoration: none; }
.po-split { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .po-split { grid-template-columns: minmax(0, 1fr) 320px; } }
.ctl { display: grid; align-content: start; gap: 10px; margin: 0 20px 22px; padding: 16px; border-radius: 14px; background: var(--m-white); box-shadow: 0 0 0 1px var(--m-line); }
@media (min-width: 1000px) { .ctl { position: sticky; top: calc(var(--bar-h) + 16px); margin: 18px 20px 22px 0; } }
.ctl h2 { font-family: var(--font-head); font-size: 19px; font-weight: 600; }
.ctl h3 { margin-top: 6px; font-size: 14px; font-weight: 700; }
.ctl__lede { color: var(--m-muted); font-size: 13px; }
.ctl__list { display: grid; gap: 8px; }
.ctl__btn { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: var(--m-teal-soft); color: var(--m-teal-deep); text-align: left; }
.ctl__btn:disabled { opacity: 0.55; cursor: default; }
.ctl__btn .i { margin-top: 1px; }
.ctl__btn b { display: block; font-size: 14px; }
.ctl__btn small { display: block; color: var(--m-charcoal); font-size: 12.5px; font-weight: 500; }
.ctl__safe { display: grid; gap: 4px; padding-left: 18px; list-style: disc; color: var(--m-muted); font-size: 13px; }
.po-banner { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 2px 10px; align-items: center; margin: 12px 20px 0; padding: 10px 6px 10px 14px; border-radius: 12px; background: var(--m-ok-soft); color: var(--m-ok); }
.po-banner b { grid-column: 1; font-size: 14.5px; }
.po-banner span { grid-column: 1; color: var(--m-charcoal); font-size: 13.5px; }
.po-banner .m-iconbtn { grid-column: 2; grid-row: 1 / span 2; background: none; color: var(--m-ok); }
.po-detail { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .po-detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.po-card { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: var(--m-white); box-shadow: 0 0 0 1px var(--m-line); }
.po-card h3 { font-family: var(--font-head); font-size: 19px; font-weight: 600; }
.po-card p { display: flex; flex-wrap: wrap; gap: 8px; }
.po-log { display: grid; gap: 0; border-top: 1px solid var(--m-line); }
.po-log li { display: grid; gap: 2px; padding: 9px 0; border-bottom: 1px solid var(--m-line); font-size: 14px; }
.po-log span { color: var(--m-muted); font-size: 13px; }
.po-card .po-match { display: grid; margin: 0; }
.po-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.po-form--wide { max-width: 560px; padding: 16px 20px 24px; }
.inbox { display: grid; border-radius: 14px; background: var(--m-white); box-shadow: 0 0 0 1px var(--m-line); }
.inbox li + li { border-top: 1px solid var(--m-line); }
.inbox__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 14px 16px; color: inherit; text-decoration: none; }
.inbox__row b { grid-column: 1; font-size: 15px; }
.inbox__row small { grid-column: 2; grid-row: 1; color: var(--m-muted); font-size: 12.5px; white-space: nowrap; }
.inbox__row.is-new b::before { content: ''; display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--m-teal); }
.inbox__kind { grid-column: 1 / -1; justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--m-teal-soft); color: var(--m-teal-deep); font-size: 12px; font-weight: 700; }
.inbox__kind--cancel, .inbox__kind--undelivered, .inbox__kind--cutoff, .inbox__kind--changed-booking { background: var(--m-amber-soft); color: var(--m-amber-ink); }
.inbox__empty { padding: 18px 16px; color: var(--m-muted); }
.mail__warn b { color: var(--paper-ink); }
.sheet-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.po-page .a4 { max-width: 760px; }
.po-page .mail { max-width: 760px; }
@media print {
  .demo-bar, .po-top, .sheet-actions, .toast-msg { display: none !important; }
  body, .stage, .po-app { background: #fff !important; box-shadow: none !important; padding: 0 !important; }
  .a4 { box-shadow: none; aspect-ratio: auto; padding: 0; }
}
