:root {
  --ink: #101418;
  --muted: #4a5560;
  --line: #c7d0d9;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --brand: #0b5c3b;
  --brand-ink: #ffffff;
  --accent: #8a2b16;
  --ok: #17603a;
  --warn: #7a4b00;
  --focus: #1a5cff;
}
* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}
a { color: #084d9c; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: #fff; color: var(--ink);
  padding: .75rem 1rem; z-index: 100; border: 2px solid var(--ink);
}
.skip-link:focus { left: 1rem; top: 1rem; }
.wrap { width: min(1180px, 94vw); margin: 0 auto; }
.site-header { background: var(--brand); color: var(--brand-ink); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding: .7rem 0; }
.brand { color: #fff; font-weight: 800; font-size: 1.2rem; text-decoration: none; letter-spacing: .01em; }
.site-header nav { display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.site-header nav a { color: #fff; text-decoration: none; padding: .35rem .1rem; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a:focus-visible { border-bottom-color: #fff; }
.who { margin-left: auto; display: flex; align-items: center; gap: .75rem; font-size: .9rem; }
.who form { margin: 0; }
.link-button { background: none; border: 0; color: #fff; text-decoration: underline; cursor: pointer; font: inherit; padding: .25rem; }
main { padding: 1.5rem 0 3rem; }
h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.2; margin: 0 0 .35rem; }
h2 { font-size: 1.25rem; margin: 1.7rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
.lede { color: var(--muted); margin: 0 0 1.2rem; max-width: 70ch; }
.notice { background: #e7f4ec; border-left: 5px solid var(--ok); padding: .7rem 1rem; margin: 0 0 1rem; }
.notice.error { background: #fdecea; border-left-color: var(--accent); }
.alert { background: #fdecea; border-left: 5px solid var(--accent); padding: .7rem 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.card .value { display: block; font-size: 1.8rem; font-weight: 800; line-height: 1.1; }
.card .label { color: var(--muted); font-size: .9rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; margin: 0 0 1.2rem; }
.panel h2:first-child, .panel h1:first-child { margin-top: 0; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
caption { text-align: left; font-weight: 700; padding: .4rem 0; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #eef2f5; font-size: .9rem; }
tbody tr:hover { background: #f3f7fa; }
.table-scroll { overflow-x: auto; }
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid currentColor; }
.badge.placed { color: #6b2b00; background: #fff0e1; }
.badge.accepted { color: #084d9c; background: #e7f0fd; }
.badge.ready { color: var(--ok); background: #e7f4ec; }
.badge.out_for_delivery { color: #5b2a86; background: #f1e8fb; }
.badge.completed { color: var(--muted); background: #eef2f5; }
.badge.cancelled { color: var(--accent); background: #fdecea; }
.badge.owner, .badge.platform_admin { color: #fff; background: #333; }
.badge.staff { color: #333; background: #e6e6e6; }
form.stack { display: grid; gap: .8rem; max-width: 760px; }
.field { display: grid; gap: .25rem; }
.field label, .field > .label { font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select, textarea {
  width: 100%; padding: .6rem .65rem; border: 1px solid #7c8794; border-radius: 6px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 5.5rem; }
button, .button {
  display: inline-block; background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: .6rem .95rem; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; text-align: center;
}
button.secondary, .button.secondary { background: #fff; color: var(--brand); }
button.danger { background: var(--accent); border-color: var(--accent); }
button.small { padding: .35rem .6rem; font-size: .9rem; }
button:disabled { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: end; }
.actions.space-between { justify-content: space-between; }
.actions.mt-1 { margin-top: 1rem; }
.actions.mt-half { margin-top: .5rem; }
.panel.light { color: #101418; }
.inline { display: inline; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0; padding: .8rem; }
legend { font-weight: 700; padding: 0 .35rem; }
.allergen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .35rem .9rem; }
.details { color: var(--muted); font-size: .9rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.transcript { white-space: pre-wrap; overflow-wrap: anywhere; background: #f4f6f8; border: 1px solid var(--line); padding: 1rem; border-radius: 6px; max-height: 32rem; overflow: auto; }
.allergy-banner { background: #fff3cd; border: 2px solid #7a4b00; padding: .6rem .8rem; border-radius: 6px; font-weight: 700; }
.payment { font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.site-footer { border-top: 1px solid var(--line); padding: 1rem 0 2rem; color: var(--muted); font-size: .9rem; }
.error-page { max-width: 46rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Kitchen screen */
.kitchen-page { background: #0f1419; color: #fff; min-height: 100vh; }
.kitchen-page a { color: #9fd5ff; }
.kitchen-page .site-header { background: #07110c; }
.kitchen-page .site-footer { color: #b8c2cc; border-color: #2c3844; }
.kitchen-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.kitchen-card { background: #fff; color: #101418; border-radius: 10px; padding: 1rem; border: 4px solid #69737d; }
.kitchen-card.new { border-color: #b3261e; }
.kitchen-card.accepted { border-color: #084d9c; }
.kitchen-card.ready { border-color: #17603a; }
.kitchen-card.out_for_delivery { border-color: #5b2a86; }
.kitchen-card h3 { margin: 0; font-size: 1.35rem; }
.kitchen-card .meta { color: #3f4a55; font-size: .95rem; }
.kitchen-card ul { padding-left: 1.1rem; margin: .5rem 0; }
.kitchen-card .allergy-banner { margin: .5rem 0; }
.kitchen-card .payment { color: #8a2b16; }
.kitchen-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; margin-top: .6rem; }
.kitchen-actions button { min-height: 48px; }
.kitchen-empty { font-size: 1.2rem; color: #dbe4ec; }
.live-region { min-height: 1.5rem; font-weight: 700; color: #ffe08a; }

/* Print ticket, 80mm thermal */
.ticket { width: 80mm; max-width: 100%; margin: 0 auto; background: #fff; color: #000; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.ticket h1 { font-size: 16px; text-align: center; margin: 0 0 4px; }
.ticket .center { text-align: center; }
.ticket .rule { border-top: 1px dashed #000; margin: 6px 0; }
.ticket .allergy { border: 2px solid #000; padding: 6px; font-weight: 800; margin: 6px 0; }
.ticket .pay { font-size: 16px; font-weight: 800; text-align: center; border: 2px solid #000; padding: 4px; margin: 6px 0; }
.ticket table { font-size: 12px; }
.ticket th, .ticket td { border: 0; padding: 2px 0; }
@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .ticket { width: 80mm; }
  @page { margin: 4mm; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (max-width: 720px) {
  .who { margin-left: 0; }
  th, td { padding: .45rem; }
}
