/* ============================================================
   Döner Runde — "Bestellzettel" UI
   Warmes Papier, Kreidetafel-Band, Kassenbon rechts.
   Mobile-first; ab 900px zweispaltig (Composer links / Zettel rechts).
   ============================================================ */

@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/zilla-slab-600.woff2") format("woff2");
}
@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/zilla-slab-700.woff2") format("woff2");
}

:root {
  --paper: #f1e9d8;
  --paper-sunk: #e7ddc6;
  --card: #fffdf6;
  --ink: #221a12;
  --ink-2: #5b4d3c;
  --ink-3: #897960;
  --line: #dbcdad;
  --rule: #c3b085;

  --red: #ad3327;
  --red-deep: #862115;
  --red-wash: #f5e3dd;
  --amber: #b9791b;
  --amber-wash: #f4e7ca;
  --char: #211b18;

  --wa: #1c9d4e;
  --wa-strong: #167f3f;
  --ok: #2f7d46;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(34, 26, 18, .07);
  --shadow: 0 2px 4px rgba(34, 26, 18, .06), 0 14px 34px -16px rgba(34, 26, 18, .28);

  --display: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --tap: 44px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 96, 60, .05) 27px 28px);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--red); color: #fff; }
:where(a) { color: var(--red); }

:where(button, input, select, a, summary):focus-visible {
  outline: 2.5px solid var(--red);
  outline-offset: 2px;
  border-radius: 5px;
}

* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid var(--paper); }

.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.ic {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Shell ---------- */

.page {
  min-height: 100dvh;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

/* ---------- Masthead: Kreidetafel-Band ---------- */

.masthead {
  background: var(--char);
  border-bottom: 3px solid var(--red);
  color: #f1e9d8;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
}

.mast-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 13px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 4px 16px;
}

.mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: #f1e9d8;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.mark img { width: 30px; height: 30px; display: block; }

.mast-text { min-width: 0; flex: 1 1 auto; }
.masthead h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  letter-spacing: .005em;
  color: #fbf6ea;
}
.tagline {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: #b7a888;
}

.mast-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

@media (max-width: 540px) {
  .masthead h1 { font-size: 1.42rem; }
  .tagline { display: none; }
  .mast-meta { order: 3; width: 100%; justify-content: flex-start; }
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b7a888;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6f6355;
}
.conn.is-online .dot { background: #57c47e; animation: pulse 2.4s ease-out infinite; }
.conn.is-offline .dot { background: var(--red); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(87, 196, 126, .5); }
  70% { box-shadow: 0 0 0 7px rgba(87, 196, 126, 0); }
  100% { box-shadow: 0 0 0 0 rgba(87, 196, 126, 0); }
}

.info-wrap { position: relative; display: flex; }
.info-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1.5px solid #4a413b;
  border-radius: 999px;
  background: transparent;
  color: #b7a888;
  cursor: pointer;
}
.info-btn:hover { color: #fbf6ea; border-color: #6f6355; }
.info-btn .ic { width: 15px; height: 15px; }

.tooltip {
  position: absolute;
  z-index: 60;
  right: 0;
  top: calc(100% + 10px);
  width: min(300px, calc(100vw - 32px));
  padding: 13px 15px;
  background: var(--card);
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  line-height: 1.5;
  text-align: left;
}
.tooltip p { margin: 0 0 8px; }
.tooltip p:last-child { margin-bottom: 0; }
.tooltip strong { color: var(--ink); }
.tooltip-title { font-size: 0.9rem; }
.tooltip ol {
  margin: 0 0 8px;
  padding-left: 1.15em;
  display: grid;
  gap: 6px;
}
.tooltip ol li { padding-left: 2px; }
.tooltip-hint {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted, var(--ink-2));
}
.tooltip-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(20, 16, 12, 0.5);
}

@media (max-width: 560px) {
  .tooltip {
    position: fixed;
    right: 16px;
    left: 16px;
    top: auto;
    bottom: 16px;
    width: auto;
    max-height: 70vh;
    overflow-y: auto;
    padding: 18px;
    font-size: 0.9rem;
    border-radius: 16px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
  }
  .tooltip ol { gap: 9px; }
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.left-col,
.receipt-col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

/* ---------- Panels ---------- */

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px 16px;
}

.panel-title {
  margin: 0 0 15px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--red);
  background: var(--red-wash);
  border-radius: 999px;
  padding: 1px 9px;
}

/* ---------- Composer / Form ---------- */

.order-form { display: flex; flex-direction: column; gap: 14px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.field-kuerzel { grid-column: 1 / -1; }
@media (min-width: 420px) {
  .field-row { grid-template-columns: minmax(72px, .7fr) 1fr 1fr; }
  .field-kuerzel { grid-column: auto; }
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--ink-2);
}
.label-hint { font-weight: 500; color: var(--ink-3); }

input[type="text"],
input[type="number"],
input[type="search"],
input[type="time"],
select {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color .14s ease, box-shadow .14s ease;
  appearance: none;
}
input::placeholder { color: var(--ink-3); }

input[type="text"]:hover,
input[type="number"]:hover,
input[type="search"]:hover,
input[type="time"]:hover,
select:hover { border-color: var(--rule); }

input[type="text"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="time"]:focus,
select:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-wash);
}

select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b4d3c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

#name[readonly] {
  background: var(--paper-sunk);
  color: var(--ink-2);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  cursor: default;
}
#name[readonly]:hover { border-color: var(--line); }

.price-input { position: relative; }
.price-input input { padding-right: 24px; font-variant-numeric: tabular-nums; }
#price, #qty { appearance: textfield; -moz-appearance: textfield; }
#price::-webkit-outer-spin-button, #price::-webkit-inner-spin-button,
#qty::-webkit-outer-spin-button, #qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price-suffix {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-3);
  font-weight: 700;
  pointer-events: none;
}

.label-link {
  appearance: none;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--red);
  cursor: pointer;
  padding: 0 0 0 5px;
  text-decoration: underline;
}
.label-link:hover { color: var(--red-deep); }

/* ---------- Mengen-Stepper ---------- */
.stepper { display: flex; align-items: stretch; }
.stepper input {
  flex: 1;
  width: auto;
  min-width: 40px;
  text-align: center;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step-btn {
  flex: none;
  width: 36px;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  cursor: pointer;
}
.step-btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.step-btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.step-btn:hover { background: var(--red-wash); border-color: var(--red); color: var(--red); }
.step-btn:active { background: var(--red); color: #fff; }

.menu-desc {
  margin: -4px 0 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  font-style: italic;
}

/* ---------- Gericht-Picker (Overlay / Sheet) ---------- */

.dish-field { position: relative; gap: 8px; }

/* Trigger (sieht aus wie ein Feld) */
.dish-trigger {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: var(--tap);
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  text-align: left;
  color: var(--ink-3);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.dish-trigger:hover { border-color: var(--rule); }
.dish-trigger .ic { width: 17px; height: 17px; color: var(--ink-3); flex: none; }
.dish-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dish-search-wrap { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; }
.dish-search-ic {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  pointer-events: none;
}
#dish-search { padding-left: 37px; padding-right: 38px; }
#dish-search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.dish-search-clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
}
.dish-search-clear:hover { color: var(--red); }
.dish-search-clear .ic { width: 15px; height: 15px; }

.dish-pop {
  display: none;
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: 100%;
  padding: 12px;
  background: var(--card);
  border: 1.5px solid var(--rule);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
.dish-pop.is-open { display: block; }

.dish-pop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.dish-pop-close {
  flex: none;
  display: none;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}

.cat-filter { gap: 6px; margin-bottom: 10px; }

.dish-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.dish-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.dish-item:hover,
.dish-item.is-active { border-color: var(--red); background: var(--red-wash); }
.dish-item .d-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dish-item .d-name { font-weight: 650; font-size: 0.95rem; }
.dish-item .d-cat {
  align-self: flex-start;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
}
.dish-item .d-desc { font-size: 0.79rem; color: var(--ink-3); line-height: 1.35; }
.dish-item .d-prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: none;
  text-align: right;
}
.dish-item .d-p {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 0.85rem;
  color: var(--ink-2);
  white-space: nowrap;
}
.dish-item .d-p-k {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dish-empty { padding: 16px 8px; font-size: 0.88rem; color: var(--ink-3); text-align: center; }
.dish-count { margin: 8px 2px 0; font-size: 0.74rem; color: var(--ink-3); text-align: right; }

.dish-chosen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 8px 9px 14px;
  background: var(--red-wash);
  border: 1.5px solid var(--red);
  border-radius: var(--r-sm);
}
.dish-chosen-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.combo-clear {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
}
.combo-clear:hover { background: #fff; color: var(--red); }
.combo-clear .ic { width: 15px; height: 15px; }

/* Sheet auf Mobil */
@media (max-width: 719px) {
  body.sheet-open { overflow: hidden; }
  .dish-pop.is-open {
    position: fixed;
    inset: 0;
    z-index: 200;
    top: 0;
    border: 0;
    border-radius: 0;
    padding: max(14px, env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .dish-pop.is-open .dish-pop-close { display: grid; }
  .dish-pop.is-open .dish-list { max-height: none; flex: 1; }
  .dish-pop.is-open .cat-filter { flex: none; max-height: 84px; overflow-y: auto; }
}

/* ---------- Chips ---------- */

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-row:empty { display: none; }

.chip {
  appearance: none;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  min-height: 36px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .08s ease;
}
.chip:hover { border-color: var(--red); background: var(--red-wash); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"], .chip.chip-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.chip.chip-variant { font-weight: 700; }
.chip.chip-variant .chip-price { opacity: .82; font-weight: 600; margin-left: 5px; }

.option-block { display: flex; flex-direction: column; gap: 6px; }

/* „inkl."-Zeile unter den Varianten */
.dish-incl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 2px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
}
.dish-incl .incl-k {
  font-weight: 800;
  color: var(--ok);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.dish-incl .incl-pill {
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 13%, var(--card));
  color: color-mix(in srgb, var(--ok) 78%, var(--ink));
  font-weight: 600;
}

#drink-label .label-hint { font-weight: 500; }

/* ---------- Extras-Block ---------- */
.extras {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 13px;
  background: var(--paper-sunk);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.extras-title {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.extras .field input { background: var(--card); }

.note-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 0;
  padding: 9px 11px;
  font-size: 0.9rem;
  font-weight: 550;
  color: var(--ink);
  background: var(--red-wash);
  border-radius: var(--r-sm);
}
.note-preview-label {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red-deep);
}

/* ---------- Fehler / leer ---------- */
.form-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--red-deep);
  background: var(--red-wash);
  border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  border-radius: var(--r-sm);
}
.form-error .ic { color: var(--red); margin-top: 1px; }

.empty-state {
  margin: 6px 0 0;
  padding: 18px 14px;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-3);
  background: var(--paper-sunk);
  border-radius: var(--r-sm);
}

/* ---------- Buttons ---------- */
.form-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  appearance: none;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--r-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background .14s ease, border-color .14s ease, color .14s ease, transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn .ic { width: 1.15em; height: 1.15em; }

.btn-primary { flex: 1; background: var(--red); color: #fff; box-shadow: 0 2px 0 var(--red-deep); }
.btn-primary:hover { background: var(--red-deep); }
.btn-primary:active { box-shadow: 0 1px 0 var(--red-deep); }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-sunk); color: var(--ink); }

.btn-whatsapp { background: var(--wa); color: #fff; }
.btn-whatsapp:hover { background: var(--wa-strong); }

.btn-dark { background: var(--char); color: #f1e9d8; }
.btn-dark:hover { background: #0e0b0a; }

.btn-reset[data-armed="true"] {
  color: #fff !important;
  background: var(--red) !important;
  border-color: var(--red) !important;
}

/* ============================================================
   Der Bestellzettel (Kassenbon)
   ============================================================ */

.receipt {
  position: relative;
  background: var(--card);
  padding: 20px 18px 18px;
  box-shadow: var(--shadow);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
/* gezackte Perforation oben + unten */
.receipt::before,
.receipt::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  height: 9px;
  background:
    linear-gradient(45deg, var(--paper) 33.3%, transparent 33.4%) 0 0 / 13px 9px repeat-x,
    linear-gradient(-45deg, var(--paper) 33.3%, transparent 33.4%) 0 0 / 13px 9px repeat-x;
}
.receipt::before { top: -1px; }
.receipt::after { bottom: -1px; transform: scaleY(-1); }

.receipt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 2px dashed var(--rule);
}
.receipt-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: .01em;
  color: var(--ink);
}
.receipt-sub {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.receipt-empty {
  margin: 16px 0;
  font-size: 0.88rem;
  color: var(--ink-3);
  text-align: center;
}

.grouped-list { list-style: none; margin: 0; padding: 6px 0 0; }
.grouped-list:empty { display: none; }
.grouped-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  column-gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
}
.grouped-list li:last-child { border-bottom: 0; }

.grouped-list .g-main { min-width: 0; }
.grouped-list .g-line {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}
.grouped-list .g-qty {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--red);
  margin-right: 3px;
}
.grouped-list .g-sum {
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.grouped-list .incl-line { margin-top: 3px; }

/* „inkl."-Zeile */
.incl-line {
  display: block;
  font-size: 0.76rem;
  line-height: 1.35;
  color: color-mix(in srgb, var(--ok) 74%, var(--ink));
}
.incl-line .incl-k {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  margin-right: 3px;
}

/* Varianten-Tag */
.v-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
  white-space: nowrap;
}
.v-tag.v-menu { background: var(--amber-wash); color: var(--amber); }
.v-tag.v-einzeln { background: var(--paper-sunk); color: var(--ink-2); }
.v-tag.v-extra { background: color-mix(in srgb, var(--ok) 16%, var(--card)); color: var(--ok); }

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 3px double var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.receipt-total strong {
  font-family: var(--display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Vorbestellung ---------- */
.preorder {
  display: flex;
  gap: 11px;
  margin-top: 16px;
  padding: 12px 13px;
  background: var(--paper-sunk);
  border-radius: var(--r-sm);
}
.preorder-ic { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ink-3); }
.preorder-body { flex: 1; min-width: 0; }
.preorder-label { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.preorder-control { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.preorder-control input[type="time"] {
  flex: 1 1 auto;
  max-width: 190px;
  min-height: 42px;
  background: var(--card);
  font-variant-numeric: tabular-nums;
}
.preorder-clear {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink-3);
  cursor: pointer;
}
.preorder-clear:hover { color: var(--red); border-color: var(--red); }
.preorder-clear .ic { width: 15px; height: 15px; }
.preorder-hint { margin: 8px 0 0; font-size: 0.76rem; line-height: 1.4; color: var(--ink-3); }
.preorder.is-set { background: var(--amber-wash); }
.preorder.is-set .preorder-ic { color: var(--amber); }
@media (max-width: 480px) {
  .preorder-control input[type="time"] { max-width: none; }
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 16px;
}
.export-actions .btn-whatsapp { grid-column: 1 / -1; }
.export-actions .btn-reset { grid-column: 1 / -1; }

.app-footer {
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 16px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--muted, #8f8067);
}
.app-footer strong { color: var(--ink, #2a211a); font-weight: 600; }

/* ---------- Wer zahlt was ---------- */
.per-person {
  margin-top: 16px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.pp-head {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.pp-sub {
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 4px;
}
.person-list { list-style: none; margin: 0; padding: 0; }
.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: 0; }
.person-name { font-weight: 600; color: var(--ink); }
.person-sum {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.person-empty {
  font-size: 0.8rem;
  color: var(--ink-3);
}
.pp-hint {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--ink-3);
  line-height: 1.4;
}
.pp-hint strong { color: var(--ink-2); }

/* ---------- Einzelne Bestellungen ---------- */

.orders-details > summary {
  list-style: none;
  cursor: pointer;
  margin-bottom: 0;
}
.orders-details > summary::-webkit-details-marker { display: none; }
.summary-chevron {
  width: 16px; height: 16px;
  margin-left: auto;
  color: var(--ink-3);
  transition: transform .18s ease;
}
.orders-details[open] > summary { margin-bottom: 14px; }
.orders-details[open] .summary-chevron { transform: rotate(180deg); }

.orders-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }

.order-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 11px;
  row-gap: 3px;
  padding: 8px 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  animation: card-in .2s cubic-bezier(.2, .7, .3, 1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(-4px); } }

.order-card.has-actions { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.order-card.is-mine { border-color: var(--red); background: color-mix(in srgb, var(--red) 4%, var(--card)); }
.order-card.is-extra { border-style: dashed; }

.who {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 32px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--paper-sunk);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.order-card.is-mine .who { background: var(--red); color: #fff; }

.what { min-width: 0; padding: 1px 0; }
.what .dish { display: block; font-weight: 600; font-size: 0.92rem; line-height: 1.3; }
.what .incl-line { margin-top: 2px; }
.what .note { display: block; margin-top: 1px; font-size: 0.79rem; line-height: 1.3; color: var(--red-deep); }

.order-price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.order-actions { display: flex; justify-content: flex-end; gap: 4px; }
.icon-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.order-card.is-mine .icon-btn { border-color: color-mix(in srgb, var(--red) 26%, var(--line)); }
.icon-btn:hover, .icon-btn:active { background: var(--red-wash); color: var(--red-deep); }
.icon-btn .ic { width: 17px; height: 17px; }
@media (hover: none) { .order-actions .icon-btn { color: var(--red); } }

.q-badge { font-family: var(--mono); font-weight: 700; color: var(--red); }

/* ---------- Kürzel-Gate ---------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--paper);
  background-image: repeating-linear-gradient(0deg, transparent 0 27px, rgba(120, 96, 60, .05) 27px 28px);
}
.gate-card {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 30px 24px;
}
.gate-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--char);
}
.gate-mark img { width: 40px; height: 40px; display: block; }
.gate-card h1 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
}
.gate-card p { margin: 0 0 4px; font-size: 0.86rem; color: var(--ink-2); line-height: 1.45; }
.gate-card input {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.gate-card .btn-primary { width: 100%; flex: none; }
.gate-recent { justify-content: center; margin-top: 2px; }

#gate-step-kuerzel, #gate-step-pin {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
#gate-step-pin .btn-primary, #gate-step-pin .btn-ghost { width: 100%; }

.pin-group { display: flex; gap: 8px; justify-content: center; }
.pin-cell {
  width: 52px;
  height: 60px;
  padding: 0;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  caret-color: var(--red);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
}
.pin-cell:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
.pin-group.shake { animation: shake .35s ease; }
.pin-repeat { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pin-repeat-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
@media (max-width: 360px) {
  .pin-cell { width: 46px; height: 54px; font-size: 1.4rem; }
  .pin-group { gap: 6px; }
}

.gate-hint { margin: 0; font-size: 0.82rem; font-weight: 700; color: var(--red-deep); }

.shake { animation: shake .35s ease; }
@keyframes shake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* ---------- Motion prefs ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ---------- Breakpoints ---------- */

@media (min-width: 560px) {
  .panel { padding: 20px 20px; }
  .receipt { padding: 22px 22px 20px; }
}

/* Desktop: links Composer + eigene Bestellungen, rechts der Zettel */
@media (min-width: 900px) {
  .wrap {
    max-width: 1060px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    align-items: start;
    gap: 28px;
    padding-top: 26px;
  }
  .receipt-col { position: sticky; top: 20px; }
  .export-actions { grid-template-columns: 1fr 1fr; }
  .left-col > .panel { max-width: 640px; }
  .order-actions .icon-btn { width: 38px; height: 38px; }
}

@media (min-width: 1160px) {
  .wrap { grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); max-width: 1140px; }
}
