:root {
  --bg: #f6f4ef; --surface: #ffffff; --surface-2: #f0ede6; --ink: #1d1b18; --muted: #6b665d; --line: #e2ddd2;
  --brand: #b8432a; --brand-ink: #ffffff; --ok: #2f7a4a; --ok-bg: #e5f2e9; --warn: #9a6400; --warn-bg: #fdf1d8;
  --bad: #b3261e; --bad-bg: #fbe3e1; --info-bg: #e6eef8; --info: #2b5a8c;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171614; --surface: #211f1c; --surface-2: #2a2824; --ink: #f1ede6; --muted: #a7a093; --line: #36332e;
    --brand: #e0694c; --ok: #6fc28c; --ok-bg: #1f3326; --warn: #e3b25a; --warn-bg: #3a2f17; --bad: #f08a80; --bad-bg: #3e2220;
    --info-bg: #1d2a3a; --info: #8fb8e6; --shadow: none; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--font); }
a { color: var(--brand); }
h1 { font-size: 1.4rem; margin: 0 0 .25rem; } h2 { font-size: 1.15rem; margin: 1.25rem 0 .6rem; } h3 { font-size: 1rem; margin: 0 0 .4rem; }
.wrap { max-width: 980px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; }
.topbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.topbar .title { font-weight: 700; } .topbar .sub { color: var(--muted); font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.demo-banner { background: var(--warn-bg); color: var(--warn); font-size: .8rem; text-align: center; padding: 4px 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid-wide { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
.big { font-size: 1.6rem; font-weight: 700; }
button, .btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px;
  padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button.primary, .btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
button.ghost { background: transparent; }
button.sm { min-height: 34px; padding: 6px 10px; font-size: .85rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.block { width: 100%; }
input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); min-height: 44px; width: 100%; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 10px; }
.chk { display: flex; gap: 10px; align-items: center; color: var(--ink); font-size: 1rem; padding: 8px 0; }
.chk input { width: 22px; height: 22px; min-height: 0; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.notice { border-radius: 10px; padding: 10px 12px; background: var(--info-bg); color: var(--info); }
.notice.warn { background: var(--warn-bg); color: var(--warn); } .notice.bad { background: var(--bad-bg); color: var(--bad); } .notice.ok { background: var(--ok-bg); color: var(--ok); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button { flex: 0 0 auto; min-height: 38px; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; color: var(--muted); font-weight: 600; }
.table-scroll { overflow-x: auto; }
#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px;
  border-radius: 10px; max-width: calc(100% - 32px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; } #toast.bad { background: var(--bad); color: #fff; }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 18px 16px 24px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }
/* Gast */
.menu-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .name { font-weight: 600; } .menu-item.soldout { opacity: .55; }
.cartbar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; }
.qty { display: inline-flex; align-items: center; gap: 8px; } .qty button { min-width: 44px; padding: 0; }
/* Tische */
.tbl { text-align: left; display: block; width: 100%; min-height: 96px; padding: 12px; border-radius: var(--radius); }
.tbl.has-open { border-color: var(--brand); }
.tbl.alert { box-shadow: 0 0 0 3px var(--warn) inset; }
.tbl .t-label { font-weight: 700; font-size: 1.05rem; }
/* Kueche */
.ticket { border-left: 5px solid var(--brand); }
.ticket .line { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--line); }
.ticket .line.done { opacity: .5; text-decoration: line-through; }
/* Kuechen-/Bar-Monitor: Status und Wartezeit */
.ticket[data-state="preparing"] { border-left-color: var(--info); }
.ticket[data-state="ready"] { border-left-color: var(--ok); background: var(--ok-bg); }
.ticket.wait-warn { border-left-color: var(--warn); box-shadow: 0 0 0 2px var(--warn) inset; }
.ticket.wait-bad { border-left-color: var(--bad); box-shadow: 0 0 0 3px var(--bad) inset; }
.ticket .wait { font-weight: 600; } .ticket.wait-warn .wait { color: var(--warn); } .ticket.wait-bad .wait { color: var(--bad); }
.ticket .t-head { font-size: 1.15rem; }
.ticket .size { font-weight: 700; }
.ticket .note { color: var(--warn); font-weight: 600; }
.pickup { border-left: 5px solid var(--ok); }
.terminal { text-align: center; padding: 24px 12px; border-radius: var(--radius); background: var(--surface-2); }
.terminal .amount { font-size: 2.2rem; font-weight: 800; }
.mode-card { cursor: pointer; } .mode-card[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; }
.kpi .label { font-size: .8rem; color: var(--muted); } .kpi .value { font-size: 1.4rem; font-weight: 700; }
.qr { background: #fff; padding: 6px; border-radius: 8px; display: inline-block; line-height: 0; }
.qr svg { width: 120px; height: 120px; }
fieldset.sizes { border: 0; padding: 0; margin: 8px 0 0; } fieldset.sizes legend { padding: 0; }
[hidden] { display: none !important; }
#netstate { margin: 12px 16px 0; }
/* QR-Aufsteller (Druck) */
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.qr-card { background: #fff; color: #111; border: 1.5px dashed #999; border-radius: 12px; padding: 14px 12px; text-align: center; break-inside: avoid; }
.qr-card .tenant { font-size: .8rem; color: #555; }
.qr-card .loc { font-size: 1.1rem; font-weight: 700; }
.qr-card .tbl-name { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: 2px 0 8px; }
.qr-card .qr { padding: 0; }
.qr-card .qr svg { width: 46mm; height: 46mm; }
.qr-card .how { font-size: .9rem; margin-top: 6px; }
.qr-card .test-mark { background: #b3261e; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .03em; border-radius: 6px; padding: 2px 6px; margin-bottom: 4px; }
.qr-card.is-test { border-color: #b3261e; }
.allergen-info { margin-top: 2px; color: var(--muted); } .allergen-info.open { color: var(--warn); }
.al-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 10px; }
.al-grid .chk { padding: 3px 0; font-size: .85rem; }
.qr-card .url { font-size: .65rem; color: #555; word-break: break-all; margin-top: 4px; font-family: ui-monospace, Consolas, monospace; }
.qr-card .logo img { max-height: 14mm; max-width: 50mm; object-fit: contain; display: block; margin: 0 auto 2px; }
.qr-card .cta { font-size: 1rem; font-weight: 700; margin-top: 6px; }
/* Einzeldruck: ein grosser Aufsteller (A6 hoch) je Seite */
.qr-sheet.single { grid-template-columns: minmax(260px, 105mm); justify-content: center; }
.qr-sheet.single .qr-card .qr svg { width: 62mm; height: 62mm; }
.qr-sheet.single .qr-card .tbl-name { font-size: 2.4rem; }
.qr-sheet.single .qr-card .logo img { max-height: 20mm; max-width: 70mm; }
@media print { .topbar, .no-print, .demo-banner { display: none !important; } .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; } .wrap { max-width: none; padding: 0; }
  @page { size: A4; margin: 10mm; }
  .qr-sheet { grid-template-columns: 1fr 1fr; gap: 5mm; }
  .qr-card { height: 85mm; padding: 3mm 4mm; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .qr-card .tbl-name { font-size: 1.7rem; margin-bottom: 4px; } .qr-card .qr svg { width: 40mm; height: 40mm; }
  .qr-card .logo img { max-height: 9mm; } .qr-card .cta { font-size: .9rem; margin-top: 3px; }
  .qr-sheet.single { grid-template-columns: 105mm; }
  .qr-sheet.single .qr-card { width: 105mm; height: 148mm; padding: 6mm; }
  .qr-sheet.single .qr-card .qr svg { width: 62mm; height: 62mm; } .qr-sheet.single .qr-card .logo img { max-height: 18mm; } }
