/* ==========================================================================
   PFG Veranstaltungen — Komponenten
   Setzt tokens.css voraus. Dokumentation + Beispiele: /styleguide.html
   Benennung: .komponente, .komponente-teil, Variante als eigene Klasse
   (.btn.btn-primary), Zustand als .is-* (is-active, is-loading …).
   ========================================================================== */

/* ---------- Reset + Basis ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
hr { border: 0; border-top: 1px solid var(--line-2); margin: var(--s-6) 0; }
table { border-collapse: collapse; }
[hidden], .hidden { display: none !important; }
::selection { background: var(--gold-soft); color: var(--text); }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: var(--s-4); top: -100px; z-index: var(--z-toast); }
.skip-link:focus { top: var(--s-4); }

/* ---------- Typografie ------------------------------------------------------ */
.display, .h1, .h2, .h3, .h4, h1, h2, h3, h4 {
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--text);
  text-wrap: balance;
}
.display { font-size: clamp(34px, 7vw, var(--fs-4xl)); font-weight: var(--fw-heavy); letter-spacing: var(--tracking-display); line-height: 1.04; }
h1, .h1 { font-size: clamp(28px, 5vw, var(--fs-3xl)); font-weight: var(--fw-heavy); letter-spacing: var(--tracking-display); }
h2, .h2 { font-size: clamp(22px, 3.6vw, var(--fs-2xl)); }
h3, .h3 { font-size: var(--fs-lg); letter-spacing: -0.015em; line-height: var(--lh-snug); }
h4, .h4 { font-size: var(--fs-md); letter-spacing: -0.01em; line-height: var(--lh-snug); font-weight: var(--fw-semibold); }
.lead { font-size: var(--fs-md); color: var(--text-2); line-height: 1.55; max-width: 62ch; text-wrap: pretty; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--gold-text); width: fit-content;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--gold); }
.eyebrow.eyebrow-plain::before { display: none; }
.muted { color: var(--text-2); }
.subtle { color: var(--text-3); }
.small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }
.strong { font-weight: var(--fw-semibold); }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11"; }
.mono, code, kbd { font-family: var(--font-mono); font-size: 0.92em; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: var(--r-xs); }
kbd {
  display: inline-block; padding: 1px 6px; border-radius: var(--r-xs);
  border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); font-size: var(--fs-xs);
}
.text-gold { color: var(--gold-text); }
.text-ok { color: var(--ok-text); }
.text-danger { color: var(--danger-text); }
.text-warn { color: var(--warn-text); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.price { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.price-lg { font-size: var(--fs-2xl); font-weight: var(--fw-heavy); letter-spacing: var(--tracking-display); }
.prose { max-width: 68ch; color: var(--text-2); }
.prose > * + * { margin-top: var(--s-3); }
.prose strong { color: var(--text); }

/* ---------- Layout ---------------------------------------------------------- */
.page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-main { flex: 1; padding-block: var(--s-6) var(--s-16); }
.page.has-tabbar .page-main { padding-bottom: var(--tabbar-space); }
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: calc(var(--container-narrow) + 2 * var(--gutter)); }
.section { padding-block: var(--s-8); }
.section + .section { padding-top: 0; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
  flex-wrap: wrap; margin-bottom: var(--s-5);
}
.section-head > div { min-width: 0; display: grid; gap: var(--s-2); }
/* Jede Hilfe setzt ihr --gap/--min selbst, damit Werte nicht in verschachtelte Hilfen durchsickern.
   Eigener Wert: style="--gap: 24px" am Element. */
.stack { --gap: var(--s-4); display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.stack-sm { --gap: var(--s-2); }
.stack-lg { --gap: var(--s-8); }
.row { --gap: var(--s-3); display: flex; align-items: center; gap: var(--gap); min-width: 0; }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-wrap, .cluster { flex-wrap: wrap; }
.cluster { --gap: var(--s-2); display: flex; align-items: center; gap: var(--gap); }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { flex: 1; }
.grid { --gap: var(--s-4); --min: 260px; display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min)), 1fr)); }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-kpi { --min: 170px; }
@media (max-width: 520px) { .grid-kpi { grid-template-columns: 1fr 1fr; gap: var(--s-3); } }

/* ---------- Kopfzeile (Glas, sticky) ----------------------------------------- */
.header {
  position: sticky; top: 0; z-index: var(--z-header);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(190%) blur(24px);
  backdrop-filter: saturate(190%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: var(--s-4);
  height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px);
}
.brand { display: flex; align-items: center; gap: var(--s-3); text-decoration: none; color: var(--text); min-width: 0; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 12px; object-fit: contain; flex-shrink: 0;
  background: #fff; box-shadow: var(--sh-1), 0 0 0 1px var(--line);
  padding: 3px;
}
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: var(--fw-bold); letter-spacing: -0.015em; font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.header-nav { display: flex; align-items: center; gap: var(--s-1); margin-left: var(--s-4); }
.header-link {
  display: inline-flex; align-items: center; height: 36px; padding: 0 var(--s-3);
  border-radius: var(--r-full); color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-sm);
  text-decoration: none; border: 0; background: none;
  transition: background var(--dur-1), color var(--dur-1);
}
.header-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.header-link[aria-current="page"], .header-link.is-active { background: var(--text); color: var(--bg); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
@media (max-width: 720px) { .header-nav { display: none; } .brand-sub { display: none; } }

/* ---------- Icons ------------------------------------------------------------ */
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; stroke-width: 1.6; }

/* ---------- Buttons ---------------------------------------------------------- */
.btn {
  --btn-h: 44px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  height: var(--btn-h); min-width: var(--btn-h); padding: 0 var(--s-5);
  border-radius: var(--r-full); border: 1px solid transparent;
  background: var(--surface); color: var(--text);
  font-size: var(--fs-base); font-weight: var(--fw-semibold); letter-spacing: -0.01em; line-height: 1;
  text-decoration: none; white-space: nowrap; user-select: none;
  box-shadow: var(--sh-1), inset 0 0 0 1px var(--line-2);
  transition: background var(--dur-1) ease, box-shadow var(--dur-2) var(--ease), color var(--dur-1), opacity var(--dur-1), transform var(--dur-1) var(--ease);
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-full); }
.btn[disabled], .btn.is-disabled { opacity: 0.45; pointer-events: none; }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  background: var(--gold); color: var(--on-gold);
  box-shadow: var(--sh-gold), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover { background: var(--gold-strong); }
.btn-secondary { background: var(--text); color: var(--bg); box-shadow: var(--sh-1); }
.btn-secondary:hover { background: var(--text); opacity: 0.88; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn-danger { background: var(--danger-solid); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 6px 16px rgba(217, 45, 32, 0.22); }
.btn-danger:hover { background: var(--danger-solid); filter: brightness(0.94); }
.btn-danger-ghost { background: transparent; box-shadow: none; color: var(--danger-text); }
.btn-danger-ghost:hover { background: var(--danger-bg); }

.btn-sm { --btn-h: 36px; padding: 0 var(--s-4); font-size: var(--fs-sm); }
.btn-sm .icon { width: 16px; height: 16px; }
.btn-lg { --btn-h: 54px; padding: 0 var(--s-8); font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 0; width: var(--btn-h); }
.btn-icon.btn-sm { width: 36px; }
.btn-group { display: inline-flex; gap: var(--s-2); flex-wrap: wrap; }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent;
  animation: ui-spin 0.7s linear infinite;
}
.btn-primary.is-loading::after { border-color: var(--on-gold) transparent var(--on-gold) transparent; }
.btn-secondary.is-loading::after, .btn-danger.is-loading::after { border-color: #fff transparent #fff transparent; }
.btn-secondary.is-loading::after { border-color: var(--bg) transparent var(--bg) transparent; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--gold); animation: ui-spin 0.7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

/* Text-Link als Knopf */
.link-btn { background: none; border: 0; padding: 0; color: var(--link); font-weight: var(--fw-medium); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Karten ----------------------------------------------------------- */
.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--sh-2), 0 0 0 1px var(--line);
  padding: var(--s-5); min-width: 0;
}
@media (min-width: 768px) { .card { padding: var(--s-6); } }
.card-flat { box-shadow: 0 0 0 1px var(--line); }
.card-inset { background: var(--surface-2); box-shadow: none; }
.card-tight { padding: var(--s-4); }
.card-flush { padding: 0; overflow: hidden; }
.card-hover { transition: box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease); cursor: pointer; }
.card-hover:hover { box-shadow: var(--sh-3), 0 0 0 1px var(--line); transform: translateY(-2px); }
.card-gold { box-shadow: var(--sh-2), 0 0 0 1.5px var(--gold-line); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.card-head > div { min-width: 0; }
.card-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); letter-spacing: -0.012em; line-height: var(--lh-snug); }
.card-sub { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.card-body > * + * { margin-top: var(--s-3); }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.card-flush .card-head { padding: var(--s-5) var(--s-5) 0; }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-3); object-fit: cover; width: 100%; }

/* Datumsblock (Veranstaltung) */
.datebadge {
  display: grid; place-items: center; align-content: center; flex-shrink: 0;
  width: 60px; height: 64px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--sh-1), 0 0 0 1px var(--line);
  overflow: hidden; line-height: 1;
}
.datebadge-month { align-self: stretch; justify-self: stretch; text-align: center; padding: 5px 0 4px; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: var(--tracking-caps); text-transform: uppercase; background: var(--gold); color: var(--on-gold); }
.datebadge-day { font-size: 26px; font-weight: var(--fw-heavy); letter-spacing: -0.04em; padding: 6px 0 2px; font-variant-numeric: tabular-nums; }
.datebadge-wd { font-size: var(--fs-2xs); color: var(--text-3); font-weight: var(--fw-semibold); padding-bottom: 6px; }

/* Meta-Zeile mit Icons (Datum · Ort · Uhrzeit) */
.meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); color: var(--text-2); font-size: var(--fs-sm); }
.meta-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.meta-item .icon { width: 16px; height: 16px; color: var(--text-3); }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl);
  padding: clamp(28px, 6vw, 56px);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(245, 184, 0, 0.30), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(245, 184, 0, 0.10), transparent 60%),
    var(--surface);
  box-shadow: var(--sh-2), 0 0 0 1px var(--line);
}
.hero-dark { background: radial-gradient(120% 140% at 100% 0%, rgba(245, 184, 0, 0.38), transparent 55%), #17171A; color: #F4F4F6; }
.hero-dark .lead, .hero-dark .muted { color: #C7C7CE; }
.hero-dark h1, .hero-dark .display { color: #fff; }
.hero > * + * { margin-top: var(--s-4); }

/* ---------- KPI-Kachel --------------------------------------------------------- */
.kpi {
  display: grid; gap: var(--s-2); align-content: start;
  background: var(--surface); border-radius: var(--r-lg); padding: var(--s-4) var(--s-5);
  box-shadow: var(--sh-1), 0 0 0 1px var(--line); min-width: 0;
}
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-2); font-weight: var(--fw-medium); }
.kpi-label .icon { width: 16px; height: 16px; color: var(--text-3); }
.kpi-value { font-size: clamp(24px, 3.4vw, 30px); font-weight: var(--fw-heavy); letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi-foot { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-3); }
.kpi-accent { box-shadow: var(--sh-1), 0 0 0 1.5px var(--gold-line); background: linear-gradient(160deg, var(--gold-soft), var(--surface) 60%); }
.trend {
  display: inline-flex; align-items: center; gap: 2px; padding: 2px 7px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
  background: var(--neutral-bg); color: var(--neutral-text);
}
.trend.up { background: var(--ok-bg); color: var(--ok-text); }
.trend.down { background: var(--danger-bg); color: var(--danger-text); }
.trend .icon { width: 12px; height: 12px; stroke-width: 2.6; }

/* ---------- Abzeichen / Status-Pillen -------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1;
  white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-text); width: fit-content;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.badge-nodot::before { display: none; }
.badge-lg { height: 30px; padding: 0 14px; font-size: var(--fs-sm); }
.badge-ok, .badge-paid, .badge-valid, .badge-admitted, .badge-on_sale { background: var(--ok-bg); color: var(--ok-text); }
.badge-warn, .badge-open, .badge-pending, .badge-used, .badge-draft { background: var(--warn-bg); color: var(--warn-text); }
.badge-danger, .badge-failed, .badge-invalid, .badge-cancelled, .badge-sold_out { background: var(--danger-bg); color: var(--danger-text); }
.badge-info, .badge-refunded { background: var(--info-bg); color: var(--info-text); }
.badge-neutral, .badge-expired, .badge-canceled, .badge-archived, .badge-not_admitted { background: var(--neutral-bg); color: var(--neutral-text); }
.badge-gold { background: var(--gold-soft); color: var(--gold-text); }
.badge-solid { background: var(--text); color: var(--bg); }
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-full);
  font-size: var(--fs-2xs); font-weight: var(--fw-bold); background: var(--gold); color: var(--on-gold); font-variant-numeric: tabular-nums;
}

/* ---------- Formularfelder --------------------------------------------------------- */
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
.label .opt { font-weight: var(--fw-regular); color: var(--text-3); }
.hint { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.4; }
.field-error { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--danger-text); }
.field-error:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-width: 0; min-height: 46px; padding: 11px 14px;
  font-size: 16px; /* iOS zoomt bei < 16 px */
  line-height: 1.35; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color var(--dur-1), box-shadow var(--dur-2) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: var(--focus-ring); }
.input[disabled], .select[disabled], .textarea[disabled] { background: var(--surface-2); color: var(--text-3); }
.input[readonly] { background: var(--surface-2); }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .input.is-invalid, .input[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg);
}
.textarea { min-height: 110px; resize: vertical; }
.select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' 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 12px center; background-size: 18px;
}
.input-sm, .select-sm { min-height: 38px; padding-block: 7px; border-radius: var(--r-sm); }
@media (min-width: 768px) { .input-sm, .select-sm { font-size: var(--fs-sm); } }
.input-group { position: relative; display: flex; align-items: center; }
.input-group > .icon { position: absolute; left: 14px; color: var(--text-3); pointer-events: none; width: 18px; height: 18px; }
.input-group > .icon + .input { padding-left: 42px; }
.input-group > .input-suffix { position: absolute; right: 14px; color: var(--text-3); font-size: var(--fs-sm); pointer-events: none; }
.input-group > .btn { position: absolute; right: 4px; --btn-h: 38px; }
.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.form-grid > .span-all { grid-column: 1 / -1; }
fieldset.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s-3); min-width: 0; }
fieldset.fieldset > legend { padding: 0; margin-bottom: var(--s-2); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }

/* Checkbox / Radio */
.check { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; font-size: var(--fs-base); line-height: 1.4; min-height: 28px; }
.check input {
  -webkit-appearance: none; appearance: none; flex-shrink: 0; margin: 1px 0 0;
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; transition: background var(--dur-1), border-color var(--dur-1); cursor: pointer;
}
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--gold); border-color: var(--gold); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--on-gold); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check input[type="radio"]:checked::after { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--on-gold); transform: none; }
.check input:focus-visible { box-shadow: var(--focus-ring); outline: none; }
.check small { display: block; color: var(--text-3); font-size: var(--fs-xs); }

/* Schalter */
.switch { display: inline-flex; align-items: center; gap: var(--s-3); cursor: pointer; }
.switch input {
  -webkit-appearance: none; appearance: none; margin: 0; position: relative; flex-shrink: 0;
  width: 51px; height: 31px; border-radius: var(--r-full); background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-2); transition: background var(--dur-2) var(--ease); cursor: pointer;
}
.switch input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18), 0 0 0 0.5px rgba(0,0,0,.06);
  transition: transform var(--dur-2) var(--ease);
}
.switch input:checked { background: var(--ok); box-shadow: none; }
.switch input:checked::after { transform: translateX(20px); }
.switch input:focus-visible { box-shadow: var(--focus-ring); outline: none; }

/* ---------- Segment-Schalter -------------------------------------------------------- */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-full);
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented > button, .segmented > label {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 var(--s-4); border-radius: var(--r-full); border: 0; background: none;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); white-space: nowrap; cursor: pointer;
  transition: background var(--dur-2) var(--ease), color var(--dur-1), box-shadow var(--dur-2);
}
.segmented > label > input { position: absolute; opacity: 0; pointer-events: none; }
.segmented > button:hover, .segmented > label:hover { color: var(--text); }
.segmented > [aria-pressed="true"], .segmented > .is-active, .segmented > label:has(input:checked) {
  background: var(--surface); color: var(--text); box-shadow: var(--sh-1), 0 0 0 0.5px var(--line-2);
}
.segmented > label:has(input:focus-visible) { box-shadow: var(--focus-ring); }
.segmented-block { display: flex; width: 100%; }
.segmented-block > * { flex: 1; }

/* ---------- Tabs ------------------------------------------------------------------- */
.tabs { display: flex; gap: var(--s-5); border-bottom: 1px solid var(--line-2); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: var(--s-3) 0; min-height: 44px;
  background: none; border: 0; color: var(--text-2); font-weight: var(--fw-semibold); font-size: var(--fs-sm); white-space: nowrap;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab[aria-selected="true"], .tab.is-active { color: var(--text); }
.tab[aria-selected="true"]::after, .tab.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; border-radius: 2px; background: var(--gold);
}

/* ---------- Chips / Filter ----------------------------------------------------------- */
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 var(--s-4); flex-shrink: 0;
  border-radius: var(--r-full); border: 0; background: var(--surface); color: var(--text-2);
  box-shadow: 0 0 0 1px var(--line-2); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap;
  transition: background var(--dur-1), color var(--dur-1), box-shadow var(--dur-1);
}
.chip:hover { color: var(--text); box-shadow: 0 0 0 1px var(--line-strong); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--text); color: var(--bg); box-shadow: none; }
.chip .icon { width: 16px; height: 16px; }
.chip-count { font-size: var(--fs-xs); font-variant-numeric: tabular-nums; opacity: 0.7; }
.chip-remove { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: -6px; border-radius: 50%; background: rgba(127,127,127,.18); border: 0; color: inherit; padding: 0; }
.chip-remove .icon { width: 12px; height: 12px; stroke-width: 2.4; }

/* ---------- Datentabelle ---------------------------------------------------------------- */
.table-wrap {
  width: 100%; overflow: auto; border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--sh-1), 0 0 0 1px var(--line); max-height: var(--table-max-h, none);
}
.table { width: 100%; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 11px var(--s-4); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.table th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-2); letter-spacing: 0.02em; white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--line-2); border-bottom: 0;
}
.table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.table tbody tr:hover td { background: var(--gold-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.is-clickable { cursor: pointer; }
.table .t-num, .table .num { text-align: right; white-space: nowrap; }
.table .t-actions { text-align: right; white-space: nowrap; width: 1%; }
.table .t-main { font-weight: var(--fw-semibold); color: var(--text); }
.table .t-sub { display: block; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-regular); }
.table-compact th, .table-compact td { padding: 7px var(--s-3); }
.table th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.table th[aria-sort] { color: var(--text); }

/* Am Telefon: Zeilen werden Karten. Jede td braucht data-label="Spaltenname". */
@media (max-width: 720px) {
  .table-cards { background: transparent; box-shadow: none; overflow: visible; max-height: none; border-radius: 0; }
  .table-cards .table, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards thead { display: none; }
  .table-cards tr {
    background: var(--surface); border-radius: var(--r-lg); padding: var(--s-2) var(--s-4);
    box-shadow: var(--sh-1), 0 0 0 1px var(--line); margin-bottom: var(--s-3);
  }
  .table-cards tbody tr:nth-child(even) td, .table-cards tbody tr:hover td { background: transparent; }
  .table-cards td {
    display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
    padding: 8px 0; border-bottom: 1px solid var(--line); text-align: right; min-width: 0;
  }
  .table-cards td:last-child { border-bottom: 0; }
  .table-cards td::before {
    content: attr(data-label); flex-shrink: 0; text-align: left;
    font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-3);
  }
  .table-cards td[data-label=""]::before, .table-cards td:not([data-label])::before { display: none; }
  .table-cards td.t-main { font-size: var(--fs-base); justify-content: flex-start; text-align: left; padding-top: var(--s-3); }
  .table-cards td.t-actions { justify-content: flex-end; width: 100%; }
}

/* ---------- Listen ------------------------------------------------------------------------- */
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1), 0 0 0 1px var(--line); overflow: hidden; }
.list-plain { background: none; box-shadow: none; border-radius: 0; }
.list-item {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); min-height: 60px;
  border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; width: 100%;
  background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left;
}
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, button.list-item:hover, .list-item.is-clickable:hover { background: var(--surface-2); text-decoration: none; }
.list-item.is-active { background: var(--gold-soft); }
.list-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.list-icon.is-gold { background: var(--gold-soft); color: var(--gold-text); }
.list-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.list-title { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-sub { font-size: var(--fs-sm); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-meta { display: grid; justify-items: end; gap: 4px; flex-shrink: 0; text-align: right; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.list-chevron { color: var(--text-3); width: 18px; height: 18px; }

/* Definitionsliste (Schlüssel/Wert) */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--s-2) var(--s-5); font-size: var(--fs-sm); }
.dl dt { color: var(--text-3); }
.dl dd { color: var(--text); font-weight: var(--fw-medium); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 420px) { .dl { grid-template-columns: 1fr; gap: 0; } .dl dd { margin-bottom: var(--s-2); } }

/* ---------- Leerer Zustand / Skeleton ----------------------------------------------------- */
.empty { display: grid; justify-items: center; text-align: center; gap: var(--s-2); padding: var(--s-12) var(--s-6); color: var(--text-2); }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 22px; background: var(--gold-soft); color: var(--gold-text); margin-bottom: var(--s-2); }
.empty-icon .icon { width: 28px; height: 28px; }
.empty-title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text); }
.empty-text { max-width: 42ch; font-size: var(--fs-sm); }
.empty .btn { margin-top: var(--s-3); }

.skeleton {
  display: block; border-radius: var(--r-sm); min-height: 14px;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%);
  background-size: 300% 100%; animation: ui-shimmer 1.4s ease-in-out infinite;
}
.skeleton-text { height: 14px; margin-block: 6px; width: var(--w, 100%); }
.skeleton-title { height: 24px; width: var(--w, 60%); }
.skeleton-block { height: var(--h, 120px); border-radius: var(--r-lg); }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }
@keyframes ui-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- Toast ---------------------------------------------------------------------------- */
.toast-region {
  position: fixed; z-index: var(--z-toast); left: 0; right: 0;
  bottom: calc(var(--toast-offset, 24px) + env(safe-area-inset-bottom, 0px));
  display: grid; justify-items: center; gap: var(--s-2); padding: 0 var(--s-4); pointer-events: none;
}
.page.has-tabbar ~ .toast-region, .has-tabbar .toast-region { --toast-offset: 104px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3);
  max-width: min(480px, 100%); padding: 12px 16px 12px 14px; border-radius: var(--r-md);
  background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: saturate(190%) blur(24px); backdrop-filter: saturate(190%) blur(24px);
  box-shadow: var(--sh-3), 0 0 0 1px var(--line-2);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  animation: ui-toast-in var(--dur-3) var(--ease);
}
.toast.is-leaving { animation: ui-toast-out var(--dur-2) ease forwards; }
.toast-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; background: var(--neutral-bg); color: var(--neutral-text); }
.toast-icon .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.toast-ok .toast-icon, .toast-success .toast-icon { background: var(--ok-bg); color: var(--ok-text); }
.toast-error .toast-icon, .toast-danger .toast-icon { background: var(--danger-bg); color: var(--danger-text); }
.toast-warn .toast-icon { background: var(--warn-bg); color: var(--warn-text); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info-text); }
@keyframes ui-toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes ui-toast-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }

/* ---------- Modal + Seitenblatt (<dialog>) ------------------------------------------------
   Der <dialog> ist eine unsichtbare, bildschirmfüllende Hülle; bewegt wird nur
   das innere .modal-panel (nie transform auf dem fixierten Element selbst). */
dialog.modal {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: var(--s-4); border: 0; background: transparent; color: var(--text);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
dialog.modal:not([open]) { display: none; }
dialog.modal::backdrop { background: var(--overlay); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: ui-fade var(--dur-2) ease; }
.modal-panel {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--modal-w, 520px);
  max-height: calc(100% - 16px); background: var(--surface-raised); border-radius: var(--r-xl);
  box-shadow: var(--sh-4), 0 0 0 1px var(--line); overflow: hidden;
  animation: ui-pop var(--dur-3) var(--ease);
}
.modal-sm { --modal-w: 420px; }
.modal-lg { --modal-w: 760px; }
.modal-xl { --modal-w: 1040px; }
.modal-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-6) var(--s-6) var(--s-2); }
.modal-head > div { flex: 1; min-width: 0; }
.modal-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.018em; line-height: 1.25; }
.modal-sub { margin-top: 4px; font-size: var(--fs-sm); color: var(--text-2); }
.modal-close { margin: -6px -10px 0 0; }
.modal-body { padding: var(--s-3) var(--s-6) var(--s-6); overflow-y: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.modal-body > * + * { margin-top: var(--s-4); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--s-2); flex-wrap: wrap;
  padding: var(--s-4) var(--s-6) calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface-raised);
}
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; background: var(--gold-soft); color: var(--gold-text); }
.modal-icon.is-danger { background: var(--danger-bg); color: var(--danger-text); }
@keyframes ui-pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes ui-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ui-sheet-left { from { transform: translateX(100%); } to { transform: none; } }

/* Telefon: Modal wird zum Blatt von unten */
@media (max-width: 640px) {
  dialog.modal { padding: 0; align-items: flex-end; }
  .modal-panel { max-width: none; max-height: 92%; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: ui-sheet-up var(--dur-3) var(--ease); }
  .modal-panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-strong); }
  .modal-head { padding-top: var(--s-8); }
  .modal-foot > .btn { flex: 1; }
}

/* Seitenblatt (Slideout von rechts) */
dialog.modal.sheet { padding: 0; justify-content: flex-end; align-items: stretch; }
dialog.modal.sheet .modal-panel {
  max-width: var(--sheet-w, 480px); height: 100%; max-height: none; border-radius: var(--r-xl) 0 0 var(--r-xl);
  animation: ui-sheet-left var(--dur-3) var(--ease);
}
.sheet-wide { --sheet-w: 720px; }
@media (max-width: 640px) {
  dialog.modal.sheet { align-items: flex-end; }
  dialog.modal.sheet .modal-panel { height: auto; max-height: 94%; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: ui-sheet-up var(--dur-3) var(--ease); }
}
html.has-modal { overflow: hidden; }

/* ---------- Fortschritt ------------------------------------------------------------------- */
.progress { position: relative; height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress-bar {
  height: 100%; width: calc(var(--value, 0) * 1%); border-radius: inherit; background: var(--gold);
  transition: width var(--dur-3) var(--ease);
}
.progress-ok .progress-bar { background: var(--ok); }
.progress-danger .progress-bar { background: var(--danger); }
.progress-dark .progress-bar { background: var(--text); }
.progress-lg { height: 12px; }
.progress-label { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-xs); color: var(--text-2); margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.progress-label strong { color: var(--text); }

/* ---------- Stepper (+/−) ----------------------------------------------------------------- */
.stepper {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--r-full);
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
}
.stepper-btn {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--text); box-shadow: var(--sh-1);
  transition: transform var(--dur-1) var(--ease), background var(--dur-1);
}
.stepper-btn:hover { background: var(--gold-soft); }
.stepper-btn:active { transform: scale(0.92); }
.stepper-btn[disabled] { opacity: 0.35; pointer-events: none; box-shadow: none; }
.stepper-btn .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.stepper-value {
  min-width: 40px; text-align: center; font-weight: var(--fw-bold); font-size: var(--fs-md);
  font-variant-numeric: tabular-nums; border: 0; background: none; padding: 0; width: 40px; -moz-appearance: textfield;
}
.stepper-value::-webkit-inner-spin-button, .stepper-value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Avatar ----------------------------------------------------------------------- */
.avatar {
  --av: 40px; display: inline-grid; place-items: center; flex-shrink: 0; width: var(--av); height: var(--av); border-radius: 50%;
  background: linear-gradient(140deg, #FFE08A, var(--gold)); color: #3D2E00;
  font-weight: var(--fw-bold); font-size: calc(var(--av) * 0.38); letter-spacing: -0.02em; line-height: 1; user-select: none;
}
.avatar-sm { --av: 28px; }
.avatar-lg { --av: 56px; }
.avatar-neutral { background: var(--surface-3); color: var(--text-2); }

/* ---------- Trennlinie -------------------------------------------------------------------- */
.divider { height: 1px; background: var(--line-2); border: 0; margin: var(--s-5) 0; }
.divider-label { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-5) 0; font-size: var(--fs-xs); color: var(--text-3); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.divider-label::before, .divider-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

/* ---------- Tooltip ([data-tooltip]) ------------------------------------------------------ */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: var(--z-popover);
  translate: -50% 4px; opacity: 0; pointer-events: none; white-space: nowrap;
  padding: 6px 10px; border-radius: var(--r-sm); background: var(--text); color: var(--bg);
  font-size: var(--fs-xs); font-weight: var(--fw-medium); line-height: 1.3; box-shadow: var(--sh-2);
  transition: opacity var(--dur-1), translate var(--dur-2) var(--ease);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after { opacity: 1; translate: -50% 0; }
[data-tooltip-pos="bottom"]::after { bottom: auto; top: calc(100% + 8px); }

/* ---------- Callout ------------------------------------------------------------------------ */
.callout {
  display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-md);
  background: var(--info-bg); color: var(--text); font-size: var(--fs-sm); line-height: 1.5;
}
.callout > .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--info-text); }
.callout-body { min-width: 0; flex: 1; }
.callout-body > * + * { margin-top: 4px; }
.callout-title { font-weight: var(--fw-semibold); color: var(--text); }
.callout-success { background: var(--ok-bg); } .callout-success > .icon { color: var(--ok-text); }
.callout-warn { background: var(--warn-bg); } .callout-warn > .icon { color: var(--warn-text); }
.callout-danger { background: var(--danger-bg); } .callout-danger > .icon { color: var(--danger-text); }
.callout-gold { background: var(--gold-soft); } .callout-gold > .icon { color: var(--gold-text); }

/* ---------- Anleitungsschritte ------------------------------------------------------------- */
.steps { counter-reset: step; display: grid; gap: 0; padding: 0; list-style: none; }
.step { position: relative; display: grid; grid-template-columns: 36px 1fr; gap: var(--s-4); padding-bottom: var(--s-6); counter-increment: step; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: counter(step); display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--on-gold); font-weight: var(--fw-heavy); font-size: var(--fs-sm); box-shadow: var(--sh-gold);
  position: relative; z-index: 1;
}
.step::after { content: ""; position: absolute; left: 17px; top: 40px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--line-2); }
.step:last-child::after { display: none; }
.step.is-done::before { content: "✓"; background: var(--ok); color: #fff; box-shadow: none; }
.step-body { min-width: 0; padding-top: 6px; }
.step-title { font-weight: var(--fw-semibold); font-size: var(--fs-md); letter-spacing: -0.01em; }
.step-body > * + * { margin-top: var(--s-2); }
.step-body p { color: var(--text-2); font-size: var(--fs-sm); }

/* ---------- Code-/Schlüsselfeld mit Kopieren ----------------------------------------------- */
.keyfield {
  display: flex; align-items: center; gap: var(--s-2); padding: 5px 5px 5px 14px; min-height: 48px; min-width: 0;
  border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.keyfield-value {
  flex: 1; min-width: 0; font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; padding: 0;
}
.keyfield.is-masked .keyfield-value { letter-spacing: 0.12em; }
.keyfield .btn { flex-shrink: 0; }
.keyfield.is-copied .btn-copy { background: var(--ok-bg); color: var(--ok-text); }
pre.code-block {
  margin: 0; padding: var(--s-4); border-radius: var(--r); background: #17171A; color: #E8E8ED;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre;
}

/* ---------- Admin-Layout ---------------------------------------------------------------------
   <div class="admin"> <aside class="admin-side">…</aside> <main class="admin-main">…</main> </div>
   Am Telefon: Seitenleiste als Drawer (Knopf mit data-drawer-toggle, initAdminLayout()). */
.admin { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.admin-side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-5) var(--s-3);
  background: var(--surface); border-right: 1px solid var(--line);
}
.admin-side .brand { padding: var(--s-1) var(--s-3) var(--s-5); }
.side-group { display: grid; gap: 2px; }
.side-group + .side-group { margin-top: var(--s-4); }
.side-label { padding: var(--s-2) var(--s-3) var(--s-1); font-size: var(--fs-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-caps); color: var(--text-3); }
.side-link {
  display: flex; align-items: center; gap: var(--s-3); min-height: 42px; padding: 0 var(--s-3); border-radius: var(--r);
  color: var(--text-2); font-weight: var(--fw-medium); font-size: var(--fs-sm); text-decoration: none;
  background: none; border: 0; width: 100%; text-align: left;
  transition: background var(--dur-1), color var(--dur-1);
}
.side-link .icon { width: 19px; height: 19px; color: var(--text-3); transition: color var(--dur-1); }
.side-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.side-link[aria-current="page"], .side-link.is-active { background: var(--gold-soft); color: var(--text); font-weight: var(--fw-semibold); }
.side-link[aria-current="page"] .icon, .side-link.is-active .icon { color: var(--gold-text); }
.side-link .count { margin-left: auto; }
.side-foot { margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--line); display: grid; gap: 2px; }
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  position: sticky; top: 0; z-index: var(--z-header); display: flex; align-items: center; gap: var(--s-3);
  min-height: 64px; padding: var(--s-2) var(--gutter);
  background: var(--glass); -webkit-backdrop-filter: saturate(190%) blur(24px); backdrop-filter: saturate(190%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.admin-top-title { font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.02em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-top-actions { margin-left: auto; display: flex; gap: var(--s-2); align-items: center; }
.admin-content { padding: var(--s-6) var(--gutter) var(--s-16); width: 100%; max-width: 1400px; display: grid; gap: var(--s-6); align-content: start; }
.admin-menu-btn { display: none; }
.admin-scrim { display: none; }
@media (max-width: 960px) {
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-menu-btn { display: inline-flex; }
  .admin-side {
    position: fixed; z-index: var(--z-drawer); top: 0; bottom: 0; left: -300px; width: 284px; height: auto;
    box-shadow: var(--sh-4); border-right: 0; visibility: hidden;
    padding-top: calc(var(--s-5) + env(safe-area-inset-top, 0px));
    transition: left var(--dur-3) var(--ease), visibility 0s linear var(--dur-3);
  }
  .admin.is-nav-open .admin-side { left: 0; visibility: visible; transition: left var(--dur-3) var(--ease), visibility 0s; }
  .admin-scrim {
    display: block; position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1); background: var(--overlay);
    opacity: 0; pointer-events: none; transition: opacity var(--dur-2);
  }
  .admin.is-nav-open .admin-scrim { opacity: 1; pointer-events: auto; }
  .admin.has-tabbar .admin-content { padding-bottom: var(--tabbar-space); }
}

/* ---------- Schwebende Glasleisten ---------------------------------------------------------
   Kein filter/transform auf den fixierten Hüllen (.tabbar, .actionbar) — Schatten
   als box-shadow auf der inneren Fläche (iOS). */
.tabbar {
  position: fixed; z-index: var(--z-tabbar); left: 0; right: 0; bottom: 0;
  padding: 0 var(--s-3) max(12px, env(safe-area-inset-bottom, 12px)); pointer-events: none;
}
.tabbar-surface {
  --tab-count: 4; --tab-index: 0;
  position: relative; display: grid; grid-template-columns: repeat(var(--tab-count), 1fr); align-items: center;
  max-width: 430px; height: 64px; margin: 0 auto; padding: 6px; pointer-events: auto; overflow: hidden;
  border-radius: 28px; border: 1px solid rgba(255, 255, 255, 0.88); user-select: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.90), rgba(255,255,255,0.62)),
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.98), transparent 58%),
    rgba(245, 184, 0, 0.07), rgba(255, 255, 255, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,1), inset 0 -1px 0 rgba(255,255,255,0.42),
    0 0 0 0.5px rgba(0,0,0,0.06), 0 18px 44px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  -webkit-backdrop-filter: saturate(190%) blur(24px); backdrop-filter: saturate(190%) blur(24px);
}
.tabbar-pill {
  position: absolute; left: 6px; top: 6px; width: calc((100% - 12px) / var(--tab-count)); height: 52px; border-radius: 22px;
  transform: translate3d(calc(var(--tab-index) * 100%), 0, 0); transition: transform var(--dur-2) var(--ease);
  background: linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.18) 46%, rgba(255,255,255,0.44)), rgba(245, 184, 0, 0.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), inset 0 -12px 22px rgba(255,255,255,0.18), 0 10px 28px rgba(0,0,0,0.14);
  pointer-events: none;
}
.tabbar-item {
  position: relative; z-index: 1; display: grid; justify-items: center; align-content: center; gap: 2px; height: 52px;
  border: 0; background: none; color: var(--text-2); text-decoration: none; font-size: 10.5px; font-weight: var(--fw-semibold); letter-spacing: 0.01em;
  -webkit-tap-highlight-color: transparent; transition: color var(--dur-1);
}
.tabbar-item .icon { width: 23px; height: 23px; stroke-width: 1.9; }
.tabbar-item[aria-current="page"] { color: var(--text); }
.tabbar-item[aria-current="page"] .icon { color: var(--gold-text); stroke-width: 2.2; }
.tabbar-item:hover { text-decoration: none; color: var(--text); }
.tabbar-item:focus-visible { outline-offset: -4px; border-radius: 20px; }
.tabbar-item .count { position: absolute; top: 3px; left: calc(50% + 6px); }
@media (min-width: 961px) { .tabbar.tabbar-mobile-only { display: none; } }

/* Aktionsleiste unten (z. B. Warenkorb-Summe + Weiter) */
.actionbar {
  position: fixed; z-index: var(--z-actionbar); left: 0; right: 0; bottom: 0; pointer-events: none;
  padding: 0 var(--s-3) max(12px, env(safe-area-inset-bottom, 12px));
}
.actionbar-surface {
  pointer-events: auto; display: flex; align-items: center; gap: var(--s-3); max-width: 720px; margin: 0 auto;
  min-height: 68px; padding: 10px 10px 10px 20px; border-radius: 24px;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: saturate(190%) blur(24px); backdrop-filter: saturate(190%) blur(24px);
  box-shadow: var(--sh-inset), 0 0 0 0.5px var(--line-2), 0 18px 44px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
}
.actionbar-info { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.actionbar-info small { color: var(--text-2); font-size: var(--fs-xs); }
.actionbar-info strong { font-size: var(--fs-lg); font-weight: var(--fw-heavy); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

:root[data-theme="dark"] .tabbar-surface { border-color: rgba(255,255,255,0.16); background: linear-gradient(135deg, rgba(32,32,38,0.86), rgba(22,22,27,0.62)), radial-gradient(circle at 50% 0%, rgba(255,255,255,0.20), transparent 58%), rgba(24,24,30,0.58); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -1px 0 rgba(255,255,255,0.06), 0 18px 44px rgba(0,0,0,0.44); }
:root[data-theme="dark"] .tabbar-pill { background: linear-gradient(145deg, rgba(255,255,255,0.24), rgba(255,255,255,0.07) 46%, rgba(255,255,255,0.14)), rgba(245,184,0,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), inset 0 -12px 22px rgba(255,255,255,0.06), 0 10px 28px rgba(0,0,0,0.28); }
:root[data-theme="dark"] .brand-logo { background: #fff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar-surface { border-color: rgba(255,255,255,0.16); background: linear-gradient(135deg, rgba(32,32,38,0.86), rgba(22,22,27,0.62)), radial-gradient(circle at 50% 0%, rgba(255,255,255,0.20), transparent 58%), rgba(24,24,30,0.58); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -1px 0 rgba(255,255,255,0.06), 0 18px 44px rgba(0,0,0,0.44); }
  :root:not([data-theme="light"]) .tabbar-pill { background: linear-gradient(145deg, rgba(255,255,255,0.24), rgba(255,255,255,0.07) 46%, rgba(255,255,255,0.14)), rgba(245,184,0,0.16); box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), inset 0 -12px 22px rgba(255,255,255,0.06), 0 10px 28px rgba(0,0,0,0.28); }
}

/* ---------- Diagramme (barChart / lineChart aus ui.js) --------------------------------------- */
.chart { position: relative; width: 100%; min-height: var(--chart-h, 240px); }
.chart-svg { width: 100%; height: var(--chart-h, 240px); overflow: visible; display: block; }
.chart-grid line { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis text, .chart-label { fill: var(--chart-axis); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-axis line { stroke: var(--line-2); }
.chart-bar { fill: var(--chart-1); transition: opacity var(--dur-1); }
.chart-bar.is-muted { opacity: 0.35; }
.chart-bar-bg { fill: transparent; }
.chart-line { fill: none; stroke: var(--chart-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: var(--chart-1); opacity: 0.14; }
.chart-dot { fill: var(--surface); stroke: var(--chart-1); stroke-width: 2.5; }
.chart-cursor { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute; z-index: 2; pointer-events: none; min-width: 120px; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-size: var(--fs-xs); line-height: 1.4; box-shadow: var(--sh-3);
  font-variant-numeric: tabular-nums; opacity: 0; transition: opacity var(--dur-1); white-space: nowrap;
}
.chart-tip.is-visible { opacity: 1; }
.chart-tip strong { display: block; font-size: var(--fs-sm); }
.chart-empty { display: grid; place-items: center; height: var(--chart-h, 240px); color: var(--text-3); font-size: var(--fs-sm); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); font-size: var(--fs-xs); color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c, var(--chart-1)); }

/* ---------- Saalplan (seatmap.js) ----------------------------------------------------------- */
.seatmap {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border-radius: var(--r-lg); background: var(--plan-floor); box-shadow: inset 0 0 0 1px var(--plan-border);
  overflow: hidden;
}
.seatmap-stage { position: relative; flex: 1; min-height: var(--seatmap-h, 420px); height: var(--seatmap-h, 420px); }
.seatmap-svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.seatmap-svg.is-panning { cursor: grabbing; }
.seatmap-controls { position: absolute; right: 10px; top: 10px; display: grid; gap: 2px; padding: 3px; border-radius: 16px; background: var(--glass-strong); box-shadow: var(--sh-2), 0 0 0 1px var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 2; }
.seatmap-controls button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; border: 0; background: none; color: var(--text); }
.seatmap-controls button:hover { background: var(--surface-3); }
.seatmap-controls button .icon { width: 20px; height: 20px; }
.seatmap-hint {
  position: absolute; left: 50%; bottom: 12px; z-index: 2; translate: -50% 0; max-width: calc(100% - 24px);
  padding: 7px 14px; border-radius: var(--r-full); background: var(--text); color: var(--bg);
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); box-shadow: var(--sh-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; pointer-events: none; transition: opacity var(--dur-2);
}
.seatmap-hint.is-visible { opacity: 1; }
.seatmap-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding: 10px var(--s-4); border-top: 1px solid var(--plan-border); background: var(--surface); font-size: var(--fs-xs); color: var(--text-2); }
.seatmap-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seatmap-legend i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; background: var(--seat-free); box-shadow: inset 0 0 0 1.5px var(--seat-free-line); }
.seatmap-legend i.is-selected { background: var(--seat-selected); box-shadow: inset 0 0 0 1.5px var(--seat-selected-line); }
.seatmap-legend i.is-taken { background: var(--seat-taken); box-shadow: none; }
.seatmap-legend i.is-cat { background: var(--seat-free); box-shadow: inset 0 0 0 3px var(--c); }
.seatmap-legend i.is-paid { background: var(--ok); box-shadow: none; }
.seatmap-legend i.is-open { background: var(--warn); box-shadow: none; }
.seatmap-legend i.is-admitted { background: var(--info); box-shadow: none; }
.seatmap-tip {
  position: absolute; z-index: 3; pointer-events: none; padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; box-shadow: var(--sh-3);
  opacity: 0; transition: opacity var(--dur-1);
}
.seatmap-tip.is-visible { opacity: 1; }
.seatmap-pop {
  position: absolute; z-index: 4; width: min(280px, calc(100% - 24px)); padding: var(--s-4); border-radius: var(--r-lg);
  background: var(--surface-raised); box-shadow: var(--sh-4), 0 0 0 1px var(--line); display: grid; gap: var(--s-3);
  animation: ui-pop var(--dur-2) var(--ease);
}
.seatmap-pop-title { font-weight: var(--fw-bold); font-size: var(--fs-md); letter-spacing: -0.01em; }
.seatmap-pop-text { font-size: var(--fs-sm); color: var(--text-2); }
.seatmap-pop .row { justify-content: flex-end; }

/* SVG-Inhalte */
.sm-floor-grid line { stroke: var(--plan-floor-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sm-stage rect { fill: var(--stage-fill); }
.sm-stage .sm-stage-edge { fill: var(--gold); }
.sm-stage text { fill: var(--stage-text); font-weight: 800; letter-spacing: 0.32em; }
.sm-area rect { fill: var(--area-other); stroke: var(--area-other-line); stroke-width: 3; stroke-dasharray: 14 10; }
.sm-area[data-kind="dancefloor"] rect { fill: var(--area-dancefloor); stroke: var(--area-dancefloor-line); }
.sm-area[data-kind="bar"] rect { fill: var(--area-bar); stroke: var(--area-bar-line); }
.sm-area[data-kind="entrance"] rect { fill: var(--area-entrance); stroke: var(--area-entrance-line); }
.sm-area[data-kind="wc"] rect { fill: var(--area-wc); stroke: var(--area-wc-line); }
.sm-area[data-kind="tech"] rect { fill: var(--area-tech); stroke: var(--area-tech-line); }
.sm-area text, .sm-text text { fill: var(--area-text); font-weight: 700; letter-spacing: 0.14em; }
.sm-text text { letter-spacing: 0.02em; }
.sm-table .sm-shape { fill: var(--table-fill); stroke: var(--table-line); stroke-width: 3; transition: fill var(--dur-1); }
.sm-table text { fill: var(--table-text); font-weight: 800; letter-spacing: -0.02em; pointer-events: none; }
.sm-table.is-clickable { cursor: pointer; }
.sm-table.is-clickable:hover .sm-shape { fill: var(--gold-soft); }
.sm-table.is-full .sm-shape { fill: var(--surface-3); }
.sm-table.is-full text { fill: var(--text-3); }
.sm-table.is-mine .sm-shape { stroke: var(--gold); stroke-width: 5; }
.sm-row-label { fill: var(--text-2); font-weight: 700; }
.seat { cursor: pointer; outline: none; }
.seat-hit { fill: transparent; }
.seat-dot { fill: var(--seat-free); stroke: var(--seat-cat, var(--seat-free-line)); stroke-width: 3.5; transition: fill var(--dur-1), stroke var(--dur-1); }
.seat.has-cat .seat-dot { stroke-width: 7; }
.seat-num { fill: var(--seat-text); font-weight: 700; font-size: 17px; pointer-events: none; opacity: 0; transition: opacity var(--dur-2); }
.seatmap-svg.is-detail .seat-num { opacity: 1; }
.seat:hover .seat-dot { fill: var(--seat-hover); }
.seat.is-selected .seat-dot { fill: var(--seat-selected); stroke: var(--seat-selected-line); stroke-width: 4; }
.seat.is-selected .seat-num { fill: var(--on-gold); }
.seat.is-taken { cursor: not-allowed; }
.seat.is-taken .seat-dot { fill: var(--seat-taken); stroke: var(--seat-taken-line); stroke-width: 2; }
.seat.is-taken .seat-num { fill: var(--text-3); }
.seat:focus-visible .seat-dot { stroke: var(--focus); stroke-width: 7; }
.seat-check { fill: none; stroke: var(--on-gold); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; pointer-events: none; }
.seat.is-selected .seat-check { opacity: 1; }
.seatmap-svg.is-detail .seat.is-selected .seat-check { opacity: 0; }
.seatmap.is-readonly .seat { cursor: default; }
.seatmap.is-readonly .seat:hover .seat-dot { fill: var(--seat-free); }
/* colorBy:'status' (Admin) */
.seat.is-paid .seat-dot { fill: var(--ok); stroke: var(--ok); }
.seat.is-open .seat-dot { fill: var(--warn); stroke: var(--warn); }
.seat.is-admitted .seat-dot { fill: var(--info); stroke: var(--info); }
.seat.is-paid .seat-num, .seat.is-open .seat-num, .seat.is-admitted .seat-num { fill: #fff; }

/* ---------- Bewegung reduzieren ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  .skeleton { animation: none; }
}

/* ---------- Druck ---------------------------------------------------------------------------- */
@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .header, .tabbar, .actionbar, .toast-region, .admin-side, .admin-top, .seatmap-controls, .no-print, .btn { display: none !important; }
  .admin { display: block; }
  .card, .kpi, .table-wrap, .list { box-shadow: none !important; border: 1px solid #ccc; break-inside: avoid; }
  .table th { position: static; background: #f2f2f2 !important; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- Rechtstexte (Impressum, Datenschutz, Ticketbedingungen; auch Vorschau im Adminbereich) ---------- */
.legal-text { line-height: 1.65; overflow-wrap: anywhere; }
.legal-text h2 { margin: var(--s-6) 0 var(--s-2); font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.legal-text > h2:first-child { margin-top: 0; }
.legal-text p + p, .legal-text ul + p, .legal-text p + ul { margin-top: var(--s-3); }
.legal-text ul { padding-left: 1.25em; list-style: disc; }
.legal-text li + li { margin-top: var(--s-2); }
.legal-text a { color: var(--gold-text); text-decoration: underline; text-underline-offset: 2px; }
