:root {
  --ground: #EEF2F6; --surface: #FFFFFF; --sunk: #E4EAF1; --ink: #132130; --ink-2: #3F5165;
  --muted: #66788A; --line: #D2DBE4; --accent: #2254C0; --on-accent: #FFFFFF; --accent-soft: #DDE7FA;
  --ok: #276F45; --ok-soft: #DCEFE3; --warn: #8A5800; --warn-soft: #F9EACB; --bad: #AD3228; --bad-soft: #F7DDD9;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, "Roboto Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0D141C; --surface: #141E29; --sunk: #1B2733; --ink: #E4EBF2; --ink-2: #B3C1CE;
    --muted: #8596A7; --line: #263545; --accent: #8AADF7; --on-accent: #0D141C; --accent-soft: #1C2C4B;
    --ok: #7ACB99; --ok-soft: #163323; --warn: #E6B65E; --warn-soft: #382A11; --bad: #F28C80; --bad-soft: #3B1D1A;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.boot { padding: 40px; color: var(--muted); }
.muted { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); font-weight: 400; }

/* Anmeldung */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; display: grid; gap: 16px; }
.login-card.wide { max-width: 520px; }
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.login-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.login-head h1 { overflow-wrap: anywhere; }
.login-brand { display: flex; align-items: center; gap: 10px; min-height: 34px; min-width: 0; }
.login-brand img { width: 30px; height: 30px; display: block; flex: none; }
.login-brand h1 { font-size: 20px; line-height: 1.2; }
.login-brand small { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-left: 2px; }
select.lang-select { width: auto; min-height: 34px; padding: 3px 8px; font-size: 14px; flex: none; }
.sheet-lang { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: -8px; }
.login-card p { margin: 0; color: var(--ink-2); }
.stack { display: grid; gap: 14px; }
.link-btn { background: none; border: 0; padding: 4px 0; color: var(--accent); cursor: pointer; font-weight: 600; text-align: left; }

/* Formulare */
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--ink-2); align-content: start; }
input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="text"], input[type="tel"], input[type="url"],
input[type="date"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 16px;
}
input[type="file"] { padding: 8px; }
textarea { resize: vertical; line-height: 1.45; }
input:disabled, select:disabled { background: var(--sunk); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input { flex: 1; min-width: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 400; color: var(--ink); }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0; display: grid; gap: 8px; }
legend { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; font-size: 14px; cursor: pointer; }
.day-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: inherit; }
.btn:hover { background: var(--sunk); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 14px; }
.btn.big { min-height: 56px; font-size: 18px; padding: 10px 22px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-outline { color: var(--bad); border-color: var(--bad); }
.btn.danger-outline:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.msg { margin: 0; padding: 10px 13px; border-radius: 9px; font-size: 15px; }
.msg.error { background: var(--bad-soft); color: var(--bad); }
.msg.info { background: var(--accent-soft); color: var(--ink); }

/* Rahmen */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 56px; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand img { width: 26px; height: 26px; display: block; }
.brand small { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.business { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 200px; }
.business select { width: auto; max-width: 280px; min-height: 36px; padding: 4px 8px; font-weight: 600; }
.who { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) { .who-mail { display: none; } }
.nav-wrap { max-width: 1100px; margin: 0 auto; padding: 0 8px; }
nav.tabs { display: flex; gap: 2px; overflow-x: auto; }
nav.tabs a { padding: 12px 12px 10px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 600; white-space: nowrap; }
nav.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
nav.tabs a.dim { color: var(--muted); }

main { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; display: grid; gap: 16px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.head h2 { margin: 0; font-size: 24px; letter-spacing: -0.01em; }
.head p { margin: 2px 0 0; color: var(--muted); }
.section-title { margin: 8px 0 0; font-size: 17px; }
.subnav { display: flex; gap: 4px; background: var(--sunk); padding: 3px; border-radius: 9px; flex-wrap: wrap; }
.subnav a { padding: 6px 12px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 14px; }
.subnav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.card h3 { margin: 0; font-size: 17px; }
.card p { margin: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.split { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tile b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.tile span { color: var(--muted); font-size: 13px; }
.tile.attention { border-color: var(--warn); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.plain-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.quote { margin: 0; padding: 8px 12px; background: var(--sunk); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.price { font-size: 22px; font-weight: 700; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--sunk); white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; color: var(--muted); font-size: 13px; }
.empty { padding: 24px; text-align: center; color: var(--muted); margin: 0; }

.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; vertical-align: 1px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }

#toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--ground); padding: 11px 16px; border-radius: 10px; font-size: 15px; max-width: min(92vw, 520px); box-shadow: 0 6px 24px rgba(0,0,0,.18); z-index: 20; }
#toast.error { background: var(--bad); color: #fff; }

/* Karte und Adresse */
.map-box { height: 340px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.result { width: 100%; text-align: left; display: grid; gap: 1px; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.result:hover { border-color: var(--accent); }
.map-pin { display: grid; place-items: center; }
.map-pin span { background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; box-shadow: 0 2px 6px rgba(0,0,0,.25); position: relative; }
.map-pin span::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: var(--accent); }

/* Luftschiff */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch-btn[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
.preview-app { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--sunk); }
/* Die Karte in der App ist immer hell, die Vorschau deshalb auch im Dunkelmodus */
.preview-map { height: 176px; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(201,220,243,.6), rgba(242,239,233,0) 72%), repeating-linear-gradient(35deg, #F2EFE9 0 26px, #F8F6F2 26px 28px), #F2EFE9; }
.preview-ship { display: grid; justify-items: center; }
.preview-ship::after { content: ""; width: 16px; height: 5px; margin-top: 9px; border-radius: 50%; background: rgba(19,33,48,.22); }
.preview-float .airship, .poster .airship { display: block; filter: drop-shadow(0 2px 2px rgba(24,45,80,.16)); }
.ad-label { position: relative; margin-top: 3px; font-size: 11px; font-weight: 700; background: rgba(255,255,255,.96); color: #132130; padding: 2px 8px 3px; border-radius: 8px;
  box-shadow: inset 0 2px 0 var(--p, #D2DBE4), 0 0 0 .5px rgba(19,33,48,.1), 0 1px 3px rgba(24,48,79,.18); }
.ad-label::before { content: ""; position: absolute; bottom: 100%; left: 50%; width: 18px; height: 4px; margin-left: -9px; border: solid rgba(90,107,125,.7); border-width: 0 1px; }
.ad-label::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1px; height: 9px; background: rgba(90,107,125,.5); }
@media (prefers-reduced-motion: no-preference) {
  .preview-float { animation: ship-float 5.2s ease-in-out infinite; }
  @keyframes ship-float { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-.8deg); } }
}
.preview-sheet { background: var(--surface); padding: 12px 14px; display: grid; gap: 6px; }
.preview-name { font-size: 19px; }
.preview-photo { width: 100%; max-height: 140px; object-fit: cover; border-radius: 8px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Einlösen am Tresen */
.redeem-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 760px) { .redeem-grid { grid-template-columns: 1fr; } }
.code-input { font-family: var(--f-mono); font-size: 28px !important; letter-spacing: 6px; text-align: center; min-height: 60px !important; text-transform: uppercase; }
.scanner { position: relative; border-radius: 12px; overflow: hidden; background: #0B1624; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; }
.result-box { border-radius: 14px; padding: 18px; display: grid; gap: 8px; }
.result-box.ok { background: var(--ok-soft); color: var(--ok); border: 2px solid var(--ok); }
.result-box.bad { background: var(--bad-soft); color: var(--bad); border: 2px solid var(--bad); }
.result-box h3 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 8px; }
.result-icon { flex: none; display: block; }
.result-box p { margin: 0; color: var(--ink); font-size: 17px; }
.counter-code { font-family: var(--f-mono); font-size: 56px; font-weight: 700; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); }

/* Aktionen */
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps span { font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--sunk); color: var(--muted); }
.steps span[aria-current="step"] { background: var(--accent); color: var(--on-accent); }
.kind-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.kind-choice label { border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; cursor: pointer; font-weight: 400; }
.kind-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind-choice input { accent-color: var(--accent); }
.bar-chart { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 104px 1fr 50px; gap: 8px; align-items: center; font-size: 14px; }
.bar-row .bar { height: 12px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.bar-row .bar > span { display: block; height: 100%; background: var(--accent); }

/* Materialien (Druck) */
.poster { background: #fff; color: #132130; border: 1px solid var(--line); border-radius: 12px; padding: 28px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.poster h2 { margin: 0; font-size: 30px; }
.poster .qr { width: 240px; height: 240px; }
.poster .small { font-size: 13px; color: #5A6B7D; overflow-wrap: anywhere; }
.poster .eyebrow { color: #5A6B7D; }
.poster .guide { text-align: left; max-width: 560px; display: grid; gap: 8px; font-size: 16px; margin: 0; padding-left: 22px; }
@media print {
  .top, #toast, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .poster { border: 0; page-break-after: always; }
}
