:root {
  --paper: #f5eddf; --card: #fffaf0; --ink: #2a1a14; --muted: #7a6a5f; --line: #dccfba;
  --blood: #7a1f2b; --blood-dark: #5a1520; --pine: #1f4a36; --gold: #b8863b; --warn: #a8531a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #1c1411; --card: #261b17; --ink: #f2e8d8; --muted: #b3a291; --line: #43342d;
          --blood: #d0606d; --blood-dark: #e07c88; --pine: #6fb08f; --gold: #d9a64f; --warn: #e49560; }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.45 var(--sans);
       padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }

/* Kopf mit Fortschritt */
.top { background: #7a1f2b; color: #fff7ea; padding: calc(14px + env(safe-area-inset-top)) 0 14px; }
.top h1 { font-size: 26px; letter-spacing: .2px; }
.top p { margin: 2px 0 0; opacity: .85; font-size: 14px; }
.steps { display: flex; gap: 6px; margin-top: 12px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,247,234,.3); }
.steps i.on { background: #ffd98a; }

.banner { margin: 14px 0 0; padding: 10px 12px; border-left: 4px solid var(--gold); background: var(--card); font-size: 15px; }
.banner.err { border-color: var(--blood); color: var(--blood-dark); }

h2.cat { margin: 26px 0 8px; font-size: 22px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.prod { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prod h3 { font-size: 19px; }
.prod .meta { color: var(--muted); font-size: 14px; }
.prod .price { font-family: var(--serif); font-size: 18px; text-align: right; white-space: nowrap; }
.prod .tag { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 700; letter-spacing: .6px;
             text-transform: uppercase; color: var(--warn); }
.prod.sold { opacity: .55; }
.prod .ctl { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.line-sum { color: var(--muted); font-size: 14px; }

.stepper { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.stepper button { width: 48px; height: 44px; border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.stepper button:active { background: var(--line); }
.stepper output { min-width: 84px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.add { border: 2px solid var(--pine); color: var(--pine); background: transparent; border-radius: 999px; height: 44px; padding: 0 22px;
       font-weight: 700; cursor: pointer; }

label { display: block; margin: 16px 0 6px; font-weight: 600; }
input[type=text], input[type=email], input[type=tel], input[type=password], .wishrow input[type=number], textarea {
  width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.hint { color: var(--muted); font-size: 14px; margin-top: 4px; }

.choice { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.chip { flex: 1 1 140px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); text-align: left; cursor: pointer; }
.chip[aria-pressed=true] { border-color: var(--blood); background: color-mix(in srgb, var(--blood) 10%, var(--card)); }
.chip small { display: block; color: var(--muted); }
.prod .choice { grid-column: 1 / -1; margin: 2px 0 0; }
.prod .choice .chip { flex: 1 1 0; text-align: center; padding: 10px 8px; font-weight: 600; }
.chip:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.slots .chip { text-align: center; flex: none; font-variant-numeric: tabular-nums; }
.slots .chip small { text-decoration: none; }

.sum { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; margin: 12px 0; }
.sum .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.sum .row:last-child { border: 0; }
.sum .total { font-family: var(--serif); font-size: 22px; font-weight: 700; }

/* untere Leiste */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 2px solid var(--ink);
       padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); z-index: 5; }
.bar .wrap { display: flex; align-items: center; gap: 12px; }
.bar .tot { flex: 1; line-height: 1.2; }
.bar .tot b { font-family: var(--serif); font-size: 20px; }
.bar .tot small { display: block; color: var(--muted); font-size: 12px; }
.btn { border: 0; border-radius: 12px; background: var(--blood); color: #fff7ea; font-weight: 700; padding: 0 22px; height: 52px; cursor: pointer; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
@media (prefers-color-scheme: dark) { .btn:not(.ghost) { background: #a8323f; color: #fff7ea; } }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }

.ticket { text-align: center; background: var(--card); border: 2px dashed var(--ink); border-radius: 16px; padding: 22px 16px; margin-top: 18px; }
.ticket .done { background: #2f6b3a; color: #fff; font-size: 20px; font-weight: 700; padding: 12px 10px; border-radius: 10px; margin-bottom: 12px; }
.ticket .nolabel { font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-top: 6px; }
.ticket .tk-items { text-align: left; display: inline-block; max-width: 100%; }
.ticket .no { font-family: var(--serif); font-size: 64px; line-height: 1.1; letter-spacing: 2px; color: var(--ink); font-weight: 700; }
.ticket img { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 8px; margin: 12px 0; }
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--pine); color: #fff; font-size: 14px; font-weight: 700; }

mark { background: #ffe14d; color: #1a1a1a; font-weight: 700; padding: 0 4px; border-radius: 3px; }

/* Eigene Wuensche des Kunden (Betrieb, Packliste, Zettel) */
.wish { margin: 8px 0 0; padding: 8px 10px; border: 2px dashed #b8860b; background: #fff8dc; color: #1a1a1a; font-size: 15px; }
.wishrow input[type=number] { padding: 13px 8px; text-align: center; }
.wishrow { display: grid; grid-template-columns: 1fr 72px 82px auto; gap: 6px; margin-top: 8px; align-items: center; }
.wishrow .chip { height: 40px; min-width: 40px; }
@media (max-width: 420px) { .wishrow { grid-template-columns: 1fr 64px 72px auto; } }
.vac { background: #1a1a1a; color: #fff; padding: 0 4px; border-radius: 3px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.wishrow .wvac { grid-column: 1 / -1; }
/* Vakuumieren: kleine, dezente Auswahl statt grosser Flaeche */
.prod .choice .chip[data-vac], .wishrow .chip.wvac { flex: 0 0 auto; width: auto; height: auto; min-width: 0; justify-self: start; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; text-align: center; }
.chip[data-vac]::before, .chip.wvac::before { content: "\25CB "; }
.chip[data-vac][aria-pressed=true]::before, .chip.wvac[aria-pressed=true]::before { content: "\25CF "; }

/* Text ist ueberall markier- und kopierbar (Doppeltippen/Gedrueckthalten auf iPad), auch in Treffer-Buttons */
body, body *:not(svg):not(video) { -webkit-user-select: text; user-select: text; }
.hit, .hit * { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
input, textarea { -webkit-user-select: text; user-select: text; }

/* Erfassen: unsichere Zeilen aus dem Foto-Lesen hervorheben */
.warn { background: rgba(255, 225, 77, .14); outline: 1px solid #e0b800; border-radius: 8px; padding: 4px; }
