/* ============================================================
   Savry – Design-System v3  ·  "Vibrant & Block-based" / OLED-Dark
   Mobile-first. Selbst gehostete Schriften (Righteous + Poppins).
   ============================================================ */

/* ---- Schriften (lokal, datenschutzkonform) ---- */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Poppins-400.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/Poppins-500.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/Poppins-600.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/Poppins-700.woff2') format('woff2'); }
@font-face { font-family: 'Righteous'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Righteous-400.woff2') format('woff2'); }

:root {
  --font: 'Poppins', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Righteous', 'Poppins', system-ui, sans-serif;

  /* Flächen / OLED-Dark */
  --bg: #08070f;
  --bg-grad:
    radial-gradient(1100px 560px at 50% -12%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(820px 520px at 110% 8%, color-mix(in srgb, var(--accent-2) 16%, transparent), transparent 58%),
    radial-gradient(760px 520px at -10% 105%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%);
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);

  /* Text (hoher Kontrast) */
  --text: #f6f6fb;
  --muted: #aeaecb;     /* ~5:1 auf --bg */
  --muted-2: #82829c;
  --placeholder: #9a9ab8;

  /* Marke / Akzente (vibrant) */
  --accent: #6a47ff;          /* Session-Akzent – per Session überschreibbar (Weiß-Kontrast >4.5:1) */
  --accent-2: #22d3ee;        /* Duotone-Cyan für Verläufe */
  --brand: #6a47ff;           /* FESTE Markenfarbe (Logo/Wortmarke) – NICHT pro Session ändern */
  --brand-2: #22d3ee;
  --accent-ink: #ffffff;
  --play: #22c55e;            /* Abspielen/Erfolg-Grün */
  --ok: #2dd4a7;
  --danger: #ff5d73;
  --warn: #ffb454;

  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 26px;
  --pill: 999px;
  --shadow: 0 14px 44px -10px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, 0.55);
  --glow: 0 10px 34px -8px color-mix(in srgb, var(--accent) 60%, transparent);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);

  --maxw: 680px;
  --dur: 220ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --press: 0.96;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Sichtbarer Fokus für Tastatur-Nutzer (überall) */
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

/* ---- Kopf / Marke ---- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 2px 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; flex: none;
  background: url('/s-logo.png?v=10') center / contain no-repeat;
}
.brand .logo svg { display: none; }
.brand h1 { font-size: 1.3rem; margin: 0; letter-spacing: -0.01em; line-height: 1.1; }
.brand .sub { color: var(--muted); font-size: 0.82rem; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brandmark { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.01em; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brandmark {
    background: linear-gradient(92deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}

/* ---- Karten / Sektionen ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.card + .card { margin-top: 14px; }
.section-title {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 24px 4px 12px; font-weight: 700;
}

/* ---- Hero ---- */
.hero {
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 55%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}
.hero-title { font-size: 1.7rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.hero-sub { color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ---- Now Playing ---- */
.nowplaying {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(118deg, color-mix(in srgb, var(--accent) 26%, transparent), var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--border));
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.nowplaying img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; flex: none; }
.nowplaying .np-label {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: #ece8ff; font-weight: 800; display: flex; align-items: center; gap: 7px;
}
.nowplaying .np-title { font-weight: 700; font-size: 1.05rem; }
.nowplaying .np-artist { color: var(--muted); font-size: 0.9rem; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: currentColor; border-radius: 2px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(1) { height: 40%; animation-delay: 0s; }
.eq i:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.eq i:nth-child(3) { height: 60%; animation-delay: 0.4s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* ---- Eingaben / Suche ---- */
.search { position: relative; }
.search input[type="text"], .search input[type="search"] {
  width: 100%; padding: 16px 16px 16px 50px; font-size: 1.05rem; font-family: inherit;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); outline: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search input::placeholder { color: var(--placeholder); }
.search input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.search .mag { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
.search .spin { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }

input, textarea, select { font-family: inherit; font-size: 1rem; }
.field { width: 100%; padding: 14px 14px; font-size: 1rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); min-height: 48px; }
.field::placeholder { color: var(--placeholder); }
.field:focus { border-color: var(--accent); box-shadow: var(--ring); }
textarea.field { min-height: auto; }
label.lbl { display: block; font-size: 0.82rem; color: var(--muted); margin: 14px 2px 6px; font-weight: 600; }

/* ---- Track-Treffer ---- */
.track {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: 1px solid transparent; min-height: 64px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.1s var(--ease);
}
.track:hover { background: var(--surface-2); border-color: var(--border); }
.track:active { transform: scale(0.985); }
.track img, .track .ph {
  width: 54px; height: 54px; border-radius: 12px; object-fit: cover; flex: none;
  background: var(--surface-2); display: grid; place-items: center; color: var(--muted-2);
}
.track .meta { min-width: 0; flex: 1; }
.track .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .a { color: var(--muted); font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-x { font-size: 0.6rem; font-weight: 700; background: rgba(0, 0, 0, 0.42); color: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; margin-left: 6px; vertical-align: middle; }
.add-plus { color: var(--accent); flex: none; width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); }
.add-plus svg { width: 18px; height: 18px; display: block; }
.track:hover .add-plus { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.mag svg { display: block; }

/* ---- Wunschkarten ---- */
.req { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.req + .req { margin-top: 10px; }
.req img, .req .ph { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted-2); }
.req .meta { min-width: 0; flex: 1; }
.req .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req .a { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req .who { color: var(--muted); font-size: 0.78rem; margin-top: 3px; }
.req .msg { color: var(--text); font-size: 0.82rem; margin-top: 4px; opacity: 0.9; font-style: italic; }

.vote {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 56px; min-height: 56px; padding: 6px 8px; border-radius: 14px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-weight: 800; -webkit-appearance: none; appearance: none;
  transition: transform 0.1s var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
  user-select: none; gap: 2px;
}
.vote:active { transform: scale(0.9); }
.vote.voted { background: color-mix(in srgb, var(--accent) 24%, transparent); border-color: var(--accent); color: #fff; box-shadow: var(--ring); }
.vote .n { font-size: 1.05rem; line-height: 1; font-variant-numeric: tabular-nums; }
.vote .heart { line-height: 1; display: inline-flex; }
.vote .heart svg { width: 18px; height: 18px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 18px; min-height: 46px; font-size: 0.98rem; font-weight: 600; font-family: inherit;
  border-radius: 13px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
  transition: transform 0.09s var(--ease), filter var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, var(--accent-2))); border-color: transparent; color: var(--accent-ink); box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ok { background: var(--play); border-color: transparent; color: #04230f; }
.btn.danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 9px 12px; min-height: 40px; font-size: 0.85rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Status-Pills ---- */
.pill { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: var(--pill); border: 1px solid var(--border); white-space: nowrap; }
.pill.pending { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 42%, transparent); }
.pill.accepted { background: color-mix(in srgb, var(--play) 18%, transparent); color: var(--play); border-color: color-mix(in srgb, var(--play) 42%, transparent); }
.pill.played { background: var(--surface-2); color: var(--muted); }
.pill.rejected { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 42%, transparent); }

/* ---- Leer / Hinweis ---- */
.empty { text-align: center; color: var(--muted); padding: 34px 12px; }
.empty .big { font-size: 2.4rem; margin-bottom: 8px; line-height: 1; }
.hint { color: var(--muted); font-size: 0.88rem; }

/* ---- Toast ---- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(22px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 12px; }
.toast {
  background: #14131d; border: 1px solid var(--border-strong); color: var(--text);
  padding: 13px 18px; border-radius: 14px; box-shadow: var(--shadow); font-weight: 600;
  display: flex; align-items: center; gap: 10px; max-width: 92vw;
  animation: toastin 0.28s var(--ease);
}
.toast.ok { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
@keyframes toastin { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Sheet / Modal ---- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(4, 4, 10, 0.62); backdrop-filter: blur(5px);
  display: none; align-items: flex-end; justify-content: center; z-index: 200;
}
.sheet-backdrop.open { display: flex; animation: fadein 0.2s var(--ease); }
.sheet {
  width: 100%; max-width: var(--maxw); background: #13121c; border: 1px solid var(--border-strong);
  border-radius: 26px 26px 0 0; padding: 16px 18px calc(26px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow); animation: sheetin 0.32s var(--ease);
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 26px; } }
@keyframes sheetin { from { transform: translateY(36px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.sheet .grip { width: 42px; height: 5px; background: var(--border-strong); border-radius: 999px; margin: -2px auto 14px; }

.spinner { width: 18px; height: 18px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Utilities ---- */
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.grow { flex: 1; min-width: 0; }

/* ---- Switch ---- */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; }
.switch + .switch { border-top: 1px solid var(--border); }
.toggle { width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; cursor: pointer; flex: none; transition: background var(--dur) var(--ease); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform var(--dur) var(--ease); }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on::after { transform: translateX(20px); }
.sw-label { font-weight: 600; }
.sw-desc { color: var(--muted); font-size: 0.8rem; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 8px; text-align: center; }
.stat .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---- Tabs ---- */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.tabs button { flex: 1; min-width: 0; padding: 10px 4px; min-height: 44px; border: none; background: transparent; color: var(--muted); font-weight: 600; font-family: inherit; border-radius: 11px; cursor: pointer; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.tabs button.active { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, var(--accent-2))); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.tab-count { font-size: 0.7rem; opacity: 0.85; font-variant-numeric: tabular-nums; }

/* ---- QR ---- */
.qrbox { background: #fff; padding: 14px; border-radius: 18px; display: inline-block; box-shadow: var(--shadow-sm); border: none; -webkit-appearance: none; appearance: none; }
.qrbox svg, .qrbox canvas { display: block; width: 200px; height: 200px; }

/* ---- Marke / Hero / Join ---- */
.join-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.join-card { max-width: 400px; width: 100%; padding: 30px 22px; }
.code-input {
  width: 100%; text-align: center; font-family: var(--font-display); font-size: 2.1rem; font-weight: 400;
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
  padding: 18px 12px; background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text); outline: none; caret-color: var(--accent);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.code-input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.code-input::placeholder { color: var(--placeholder); }

/* ---- Footer (Rechts-Links) ---- */
.legal-footer { color: var(--muted); }
.legal-footer a { color: var(--muted); text-decoration: none; }
.legal-footer a:hover { color: var(--text); text-decoration: underline; }

/* ---- Live-Gästezähler ---- */
.live-pill { display: inline-flex; align-items: center; gap: 7px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--pill); padding: 6px 12px; font-size: 0.8rem; font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(255, 77, 109, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 77, 109, 0); } }

/* ---- Segment-Umschalter (Sortierung) ---- */
.seg { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px; }
.seg button { border: none; background: transparent; color: var(--muted); font-weight: 600; font-family: inherit; font-size: 0.82rem; padding: 9px 14px; min-height: 44px; border-radius: 10px; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg button.active { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, var(--accent-2))); color: var(--accent-ink); }

/* ---- Klebende Suche ---- */
.search-sticky { position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 20; box-shadow: var(--shadow); }

/* ---- Code-Anzeige (Dashboard) ---- */
.code-display { font-size: 0.9rem; color: var(--muted); }
.code-big { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: 0.16em; color: var(--text); margin-left: 4px; }

/* ---- QR auf schmalen Screens oben ---- */
@media (max-width: 560px) {
  .qr-share { flex-direction: column-reverse; align-items: stretch; }
  .qr-share .qrbox { margin: 0 auto; }
}

/* ---- Erfolgs-Overlay ---- */
.success-overlay { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; background: rgba(6, 6, 12, 0.74); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease); z-index: 300; padding: 24px; }
.success-overlay.show { opacity: 1; }
.success-text { font-size: 1.25rem; font-weight: 700; text-align: center; }
.success-check svg { width: 104px; height: 104px; }
.success-check circle { stroke: var(--play); stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; }
.success-check path { stroke: var(--play); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; }
.success-overlay.show .success-check circle { animation: dash 0.5s var(--ease) forwards; }
.success-overlay.show .success-check path { animation: dash 0.4s 0.3s var(--ease) forwards; }
@keyframes dash { to { stroke-dashoffset: 0; } }

/* ---- Rechtsseiten ---- */
.legal { line-height: 1.65; max-width: 760px; }
.legal h1 { font-size: 1.6rem; margin: 0 0 4px; }
.legal h2 { font-size: 1.14rem; margin: 26px 0 8px; letter-spacing: -0.01em; }
.legal h3 { font-size: 0.98rem; margin: 18px 0 6px; color: var(--text); }
.legal p, .legal li { color: var(--text); }
.legal ul { padding-left: 20px; }
.legal a { color: var(--accent); }
.legal .meta { color: var(--muted); font-size: 0.9rem; }
.notice { background: color-mix(in srgb, var(--warn) 15%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 44%, var(--border)); border-radius: 14px; padding: 12px 14px; margin: 14px 0; font-size: 0.9rem; }

/* ---- Animationen / Skeleton ---- */
.fade-in { animation: fadein 0.32s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.skel-row { height: 64px; margin-bottom: 8px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---- A11y: Skip-Link & visuell versteckt ---- */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 500; background: var(--accent); color: var(--accent-ink); padding: 11px 16px; border-radius: 10px; font-weight: 700; text-decoration: none; transform: translateY(-180%); transition: transform var(--dur) var(--ease); }
.skip-link:focus { transform: none; box-shadow: var(--shadow); }
.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; }
.brandlink { text-decoration: none; display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }

/* ---- Button als Link ---- */
.linklike { background: none; border: none; padding: 0; margin: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: none; }
.linklike:hover { color: var(--text); text-decoration: underline; }

/* ---- Solide Gefahr (Session löschen) ---- */
.btn.danger-solid { background: var(--danger); border-color: transparent; color: #2a0710; font-weight: 700; }
.btn.danger-solid:hover { filter: brightness(1.06); }

/* ---- Hero-Suche (dominanter Primär-Block) ---- */
.search-hero { background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 60%), var(--surface); border-color: color-mix(in srgb, var(--accent) 28%, var(--border)); }
.search-hero .search input { font-size: 1.12rem; padding-top: 18px; padding-bottom: 18px; }
.search-label { font-weight: 700; font-size: 1.06rem; margin: 0 2px 10px; letter-spacing: -0.01em; }

/* ---- Kollabierbarer Einladen-Block ---- */
.collapsible-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; width: 100%; background: none; border: none; color: inherit; font: inherit; padding: 0; text-align: left; }
.chevron { transition: transform var(--dur) var(--ease); color: var(--muted); display: inline-flex; flex: none; }
.collapsed .chevron { transform: rotate(-90deg); }
.collapsed .collapsible-body { display: none; }

/* ---- QR Vollbild (Tap-to-Zoom) ---- */
.qr-zoom { position: fixed; inset: 0; background: rgba(4,4,10,.88); backdrop-filter: blur(6px); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 20px; z-index: 320; padding: 24px; }
.qr-zoom.open { display: flex; animation: fadein .2s var(--ease); }
.qr-zoom .qrbox { padding: 20px; }
.qr-zoom .qrbox svg { width: min(80vw, 70vh); height: min(80vw, 70vh); }
.qr-zoom .zoom-code { font-family: var(--font-display); font-size: clamp(2.2rem, 13vw, 4rem); letter-spacing: 0.16em; color: #fff; }
.qr-zoom .hint { color: #cfcfe6; }
.qrbox { cursor: zoom-in; }

/* ---- Stat-Karten ---- */
.stat[title] { cursor: help; }
@media (max-width: 520px) { .stat { padding: 11px 6px; } .stat .v { font-size: 1.35rem; } }

/* ---- Offline-Banner ---- */
.offline-banner { position: fixed; left: 0; right: 0; top: 0; z-index: 450; background: var(--warn); color: #2a1c00; text-align: center; font-weight: 700; font-size: .88rem; padding: calc(8px + env(safe-area-inset-top)) 12px 8px; transform: translateY(-100%); transition: transform var(--dur) var(--ease); }
.offline-banner.show { transform: none; }

/* ---- Sheet Swipe-to-dismiss ---- */
.sheet { touch-action: pan-y; }
.sheet.dragging { transition: none; }

/* ---- ARIA-Tabs (Sortierung) ---- */
.seg button[aria-selected="true"] { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 80%, var(--accent-2))); color: var(--accent-ink); }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
