/* Tabb web ordering. Design tokens mirror tabb_ui (initial.md §11.2). Light first; dark via the system or the footer toggle. */
:root {
  --bg: #fbf8f4; --surface: #ffffff; --surface-2: #f3eee7; --text: #1d1b19; --muted: #5d5650; --line: #ded6cc;
  --brand: #8a3b12; --brand-ink: #ffffff; --focus: #1f5fbf;
  --success: #1e6b3a; --warning: #8a5a00; --danger: #a4262c; --info: #1d4f91;
  --success-bg: #e5f3e9; --warning-bg: #fbf0d9; --danger-bg: #fbe7e8; --info-bg: #e6eef9;
  --radius: 12px; --radius-s: 8px; --gap: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161412; --surface: #201d1a; --surface-2: #2a2622; --text: #f2ede7; --muted: #b8afa5; --line: #3d3731;
    --brand: #f0a36f; --brand-ink: #1d1208; --focus: #8ab4ff;
    --success: #7fd39b; --warning: #f2c46b; --danger: #ff9a9e; --info: #9cc2ff;
    --success-bg: #183222; --warning-bg: #352812; --danger-bg: #3a1b1d; --info-bg: #182740;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161412; --surface: #201d1a; --surface-2: #2a2622; --text: #f2ede7; --muted: #b8afa5; --line: #3d3731;
  --brand: #f0a36f; --brand-ink: #1d1208; --focus: #8ab4ff;
  --success: #7fd39b; --warning: #f2c46b; --danger: #ff9a9e; --info: #9cc2ff;
  --success-bg: #183222; --warning-bg: #352812; --danger-bg: #3a1b1d; --info-bg: #182740;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 var(--font); }
main { max-width: 40rem; margin: 0 auto; padding: 8px 16px 112px; }
main:focus { outline: none; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 16px 0 8px; }
h2 { font-size: 1.25rem; margin: 24px 0 8px; }
a { color: var(--brand); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-s); z-index: 10; }
.skip:focus { top: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.top { display: flex; justify-content: space-between; align-items: center; max-width: 40rem; margin: 0 auto; padding: 12px 16px; }
.brand { font-weight: 700; letter-spacing: .02em; color: var(--brand); text-decoration: none; padding: 10px 0; }
.foot { max-width: 40rem; margin: 0 auto; padding: 16px; border-top: 1px solid var(--line); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.inline { display: inline; }
.stack { display: grid; gap: 8px; margin: 16px 0; }
.stack > .btn { margin-top: 8px; }
label { font-weight: 600; }
input, select, textarea { font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--muted); border-radius: var(--radius-s); padding: 12px; min-height: 48px; width: 100%; }
input[type="radio"], input[type="checkbox"] { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--brand); flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; margin: 0; }
legend { font-weight: 600; padding: 0 4px; }
.choice { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 400; }
.choice .price { margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--brand); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
/* Busy state while htmx sends a form or follows a link (W-L12). */
.htmx-request button[type="submit"]::after, a.htmx-request::after { content: ""; display: inline-block; width: .9em; height: .9em; margin-left: 8px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin 1s linear infinite; }
.htmx-request, .htmx-request button { cursor: progress; }
.link { background: none; border: 0; padding: 12px 4px; min-height: 44px; color: var(--brand); font: inherit; text-decoration: underline; cursor: pointer; }
.link[aria-pressed="true"] { font-weight: 700; text-decoration: none; }
.notice, .error, .info, .warn { border-radius: var(--radius-s); padding: 12px; margin: 12px 0; }
.notice { background: var(--success-bg); color: var(--success); }
.error { background: var(--danger-bg); color: var(--danger); font-weight: 600; }
.info { background: var(--info-bg); color: var(--info); }
.warn { background: var(--warning-bg); color: var(--warning); }
.banner { position: sticky; top: 0; z-index: 5; background: var(--warning-bg); color: var(--warning); padding: 12px 16px; text-align: center; font-weight: 600; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .875rem; font-weight: 600; background: var(--surface-2); }
.s-open, .s-ready, .s-delivered, .s-completed, .s-closed, .s-dispute-resolved { background: var(--success-bg); color: var(--success); }
.s-pending_approval, .s-closure_requested, .s-submitted, .s-cancel_requested, .s-dispute-open, .s-dispute-escalated { background: var(--warning-bg); color: var(--warning); }
.s-rejected, .s-canceled, .s-voided, .s-venue-closed { background: var(--danger-bg); color: var(--danger); }
.s-accepted, .s-preparing { background: var(--info-bg); color: var(--info); }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.badge.offer { background: var(--success-bg); color: var(--success); }
.badge.age { background: var(--warning-bg); color: var(--warning); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; position: sticky; top: 0; background: var(--bg); z-index: 2; }
.cats a { white-space: nowrap; padding: 10px 14px; border-radius: 999px; background: var(--surface-2); text-decoration: none; color: var(--text); min-height: 44px; }
.items, .lines, .promos { list-style: none; margin: 0; padding: 0; }
.item { display: grid; gap: 2px; padding: 14px 12px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; min-height: 48px; }
.item.off { opacity: .7; }
.item .thumb { float: right; width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-s); margin-left: 12px; }
.photo { display: block; max-width: 100%; height: auto; border-radius: var(--radius); margin: 8px 0; }
.pre { white-space: pre-line; }
.warn-card { border-color: var(--warning); }
.thread { list-style: none; padding: 0; margin: 8px 0; }
.thread li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.thread .who { font-weight: 600; }
.item .name { font-weight: 600; }
.item .desc { color: var(--muted); font-size: .9375rem; }
.item .price { font-weight: 600; }
.promos li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines li { display: flex; gap: 12px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.lines li > div:first-child { flex: 1; min-width: 12rem; }
.amt { font-variant-numeric: tabular-nums; font-weight: 600; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 16px 0; font-variant-numeric: tabular-nums; }
.totals dd { margin: 0; text-align: right; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0; margin: 8px 0; font-size: .875rem; color: var(--muted); }
.steps li::before { content: "○ "; }
.steps li.done { color: var(--success); }
.steps li.done::before { content: "✓ "; }
.steps li[aria-current="step"] { font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; justify-content: center; z-index: 4; }
.cartbar .btn { width: 100%; max-width: 38rem; }
.oauth { display: grid; gap: 12px; justify-items: center; margin: 16px 0; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.spinner { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.receipt table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.receipt th, .receipt td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.receipt .num { text-align: right; font-variant-numeric: tabular-nums; }
details { margin: 16px 0; }
summary { cursor: pointer; min-height: 44px; padding: 10px 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
