/* ============================================================
   LAUSITZ.APP — Streaming-Startseite
   Redesign 0.15.0 — dunkle Fläche, eine Schrift (Schibsted Grotesk,
   selbst gehostet), Rot nur für Marke, Fortschritt, Top-10 und Live.
   ============================================================ */

/* Schibsted Grotesk (OFL, siehe /fonts/OFL.txt). Variable Schrift 400–900,
   zwei Teilmengen: latin-ext trägt die sorbischen Buchstaben ě č ł ń ó ř š ž ć ź ŕ ś. */
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/fonts/schibsted-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root,
/* Dunkle Inseln: bleiben in beiden Modi dunkel, weil dieser Block ihre Tokens an Ort und Stelle
   neu setzt (Video-Player, Spiele, Reader, Lightbox, Live-Buehne, Audio-Grossansicht, Billboard
   samt Kopfzeile darueber, Dialoge, Kinder-Kopf). Neue dunkle Flaechen hier eintragen. */
.theme-island, .player, .game-player, .reader, .prov-lightbox, .live-stage, .audio-player,
.rc-art, .card-poster, .dt-dialog-back, .kids-hero, .hero {
  color: var(--text);   /* erbt sonst die (im hellen Modus dunkle) Schriftfarbe der Seite */
  /* Flächen — fast schwarz */
  --bg:        #0b0b0d;
  --bg-2:      #111114;
  --surface:   #18181b;
  --surface-2: #27272a;
  --bg-clear:  rgba(11,11,13,0);
  --line:        rgba(244,244,245,0.08);
  --line-strong: rgba(244,244,245,0.18);

  /* Schrift */
  --text:    #f4f4f5;
  --text-hi: #fff;                      /* Hover/aktiv, staerker als --text */
  --text-2:  #e4e4e7;                   /* zweite Stufe (Untertitel, Menuepunkte) */
  --text-soft: rgba(239,234,224,0.85);  /* Fliesstext mit leichter Daempfung */
  --muted:   #a1a1aa;
  --muted-2: #8a8a93;

  /* Rot (--red) ist reserviert für: Marke "L", Fortschrittsbalken, Top-10-Marke,
     Live-Punkt. Alle anderen Akzente sind neutral (weiß/grau).              */
  --red:         #e5483b;
  --red-text:    #e5483b;               /* Rot als Schriftfarbe (hell: dunkler, damit AA haelt) */
  --accent:      #f4f4f5;
  --accent-deep: #d4d4d8;
  --accent-ink:  #0b0b0d;
  --accent-soft: rgba(244,244,245,0.12);
  --btn-solid-bg:    #fff;              /* Primaerknopf */
  --btn-solid-hover: #e4e4e7;
  --btn-solid-ink:   #0b0b0d;
  --btn-info-bg:     rgba(109,109,110,0.7);
  --btn-info-hover:  rgba(109,109,110,0.9);
  --btn-info-ink:    #fff;
  --focus-ring:      #fff;
  --link:       #7dd3fc;
  --link-line:  rgba(125,211,252,0.45);
  --link-soft:  rgba(125,211,252,0.12);

  /* Flaechen-Toenungen fuer Hover, Chips, Felder (Weiss-Alpha auf Dunkel, Schwarz-Alpha auf Hell) */
  --tint-0: rgba(255,255,255,0.025);
  --tint-1: rgba(255,255,255,0.05);
  --tint-2: rgba(255,255,255,0.08);
  --tint-3: rgba(255,255,255,0.14);
  --tint-4: rgba(255,255,255,0.22);
  --tint-5: rgba(255,255,255,0.45);
  --inset:  rgba(0,0,0,0.25);           /* eingelassene Flaechen (dunkler als der Grund) */

  /* Leisten (Kopfzeile, untere Leiste, Mini-Player) und Menues */
  --bar-bg:        rgba(11,11,13,0.94);
  --bar-bg-strong: rgba(11,11,13,0.97);
  --pop-bg:        rgba(20,22,27,0.97);

  /* Abdunklung hinter Dialogen und Schatten */
  --scrim:      rgba(0,0,0,0.78);
  --scrim-soft: rgba(0,0,0,0.45);
  --overlay-mid: rgba(0,0,0,0.55);      /* Mitte des Verlaufs im Detail-Kopf */
  --shadow-card:  0 12px 30px -16px rgba(0,0,0,0.6);
  --shadow-pop:   0 30px 60px -20px rgba(0,0,0,0.7);
  --shadow-cover: 0 40px 100px -20px rgba(0,0,0,0.7);
  --shadow-menu:  0 16px 40px rgba(0,0,0,0.5);
  --shadow-sheet: 0 30px 80px rgba(0,0,0,0.6);

  /* Text und Marken ueber Bildern: immer hell (auch im hellen Modus) */
  --on-image: #fff;

  /* Secondary — nur noch als Token, nicht mehr im UI genutzt */
  --secondary:      #4d77d6;
  --secondary-soft: rgba(77,119,214,0.16);

  /* Danger — für destructive Actions (Track-Remove, Playlist-Delete, etc.). */
  --danger:      #ff6a78;
  --danger-soft: rgba(255,106,120,0.16);
}

/* Kopfzeile ueber dem Billboard (nur Desktop; mobil liegt das Billboard als Karte darunter): dieselben
   dunklen Tokens wie oben, getrennt wegen der Bildschirmbreite. theme.test.js prueft die Gleichheit. */
@media (min-width: 900px) {
  body.is-home-page.has-hero .topbar:not(.scrolled) {
  color: var(--text);   /* erbt sonst die (im hellen Modus dunkle) Schriftfarbe der Seite */
    /* Flächen — fast schwarz */
    --bg:        #0b0b0d;
    --bg-2:      #111114;
    --surface:   #18181b;
    --surface-2: #27272a;
    --bg-clear:  rgba(11,11,13,0);
    --line:        rgba(244,244,245,0.08);
    --line-strong: rgba(244,244,245,0.18);
  
    /* Schrift */
    --text:    #f4f4f5;
    --text-hi: #fff;                      /* Hover/aktiv, staerker als --text */
    --text-2:  #e4e4e7;                   /* zweite Stufe (Untertitel, Menuepunkte) */
    --text-soft: rgba(239,234,224,0.85);  /* Fliesstext mit leichter Daempfung */
    --muted:   #a1a1aa;
    --muted-2: #8a8a93;
  
    /* Rot (--red) ist reserviert für: Marke "L", Fortschrittsbalken, Top-10-Marke,
       Live-Punkt. Alle anderen Akzente sind neutral (weiß/grau).              */
    --red:         #e5483b;
    --red-text:    #e5483b;               /* Rot als Schriftfarbe (hell: dunkler, damit AA haelt) */
    --accent:      #f4f4f5;
    --accent-deep: #d4d4d8;
    --accent-ink:  #0b0b0d;
    --accent-soft: rgba(244,244,245,0.12);
    --btn-solid-bg:    #fff;              /* Primaerknopf */
    --btn-solid-hover: #e4e4e7;
    --btn-solid-ink:   #0b0b0d;
    --btn-info-bg:     rgba(109,109,110,0.7);
    --btn-info-hover:  rgba(109,109,110,0.9);
    --btn-info-ink:    #fff;
    --focus-ring:      #fff;
    --link:       #7dd3fc;
    --link-line:  rgba(125,211,252,0.45);
    --link-soft:  rgba(125,211,252,0.12);
  
    /* Flaechen-Toenungen fuer Hover, Chips, Felder (Weiss-Alpha auf Dunkel, Schwarz-Alpha auf Hell) */
    --tint-0: rgba(255,255,255,0.025);
    --tint-1: rgba(255,255,255,0.05);
    --tint-2: rgba(255,255,255,0.08);
    --tint-3: rgba(255,255,255,0.14);
    --tint-4: rgba(255,255,255,0.22);
    --tint-5: rgba(255,255,255,0.45);
    --inset:  rgba(0,0,0,0.25);           /* eingelassene Flaechen (dunkler als der Grund) */
  
    /* Leisten (Kopfzeile, untere Leiste, Mini-Player) und Menues */
    --bar-bg:        rgba(11,11,13,0.94);
    --bar-bg-strong: rgba(11,11,13,0.97);
    --pop-bg:        rgba(20,22,27,0.97);
  
    /* Abdunklung hinter Dialogen und Schatten */
    --scrim:      rgba(0,0,0,0.78);
    --scrim-soft: rgba(0,0,0,0.45);
    --overlay-mid: rgba(0,0,0,0.55);      /* Mitte des Verlaufs im Detail-Kopf */
    --shadow-card:  0 12px 30px -16px rgba(0,0,0,0.6);
    --shadow-pop:   0 30px 60px -20px rgba(0,0,0,0.7);
    --shadow-cover: 0 40px 100px -20px rgba(0,0,0,0.7);
    --shadow-menu:  0 16px 40px rgba(0,0,0,0.5);
    --shadow-sheet: 0 30px 80px rgba(0,0,0,0.6);
  
    /* Text und Marken ueber Bildern: immer hell (auch im hellen Modus) */
    --on-image: #fff;
  
    /* Secondary — nur noch als Token, nicht mehr im UI genutzt */
    --secondary:      #4d77d6;
    --secondary-soft: rgba(77,119,214,0.16);
  
    /* Danger — für destructive Actions (Track-Remove, Playlist-Delete, etc.). */
    --danger:      #ff6a78;
    --danger-soft: rgba(255,106,120,0.16);
  }
}

/* Seitenhintergrund fuer Verlaufsenden: wird NICHT in dunklen Inseln zurueckgesetzt,
   damit z. B. das Billboard unten in die Seite ausläuft. */
:root {
  --page-bg:       #0b0b0d;
  --page-bg-clear: rgba(11,11,13,0);
  --ring-hover:    rgba(244,244,245,0.85);   /* Hover-Rahmen um Karten (liegt auf der Seite, nicht im Bild) */

  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Typography — eine Schrift für alles */
  --display: 'Schibsted Grotesk', system-ui, sans-serif;
  --sans:    'Schibsted Grotesk', system-ui, sans-serif;
  --mono:    'SF Mono', 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --rail-gutter: 56px;   /* linker Rand von Header, Hero und Rails (mobil 16px) */
  --header-h: 72px;
  --max-w:  1480px;
}

/* Heller Modus (theme.js setzt data-theme am <html>; ohne theme.js bleibt alles dunkel).
   Gleiche Tokennamen wie oben, geprueft in apps/api/tests/theme.test.js. */
:root[data-theme="light"] {
  color-scheme: light;
  --page-bg:       #f6f6f7;
  --page-bg-clear: rgba(246,246,247,0);
  --ring-hover:    rgba(24,24,27,0.75);

  --bg:        #f6f6f7;
  --bg-2:      #eeeef0;
  --surface:   #ffffff;
  --surface-2: #e7e7ea;
  --bg-clear:  rgba(246,246,247,0);
  --line:        rgba(11,11,13,0.10);
  --line-strong: rgba(11,11,13,0.24);

  --text:    #18181b;
  --text-hi: #0b0b0d;
  --text-2:  #27272a;
  --text-soft: #3f3f46;
  --muted:   #52525b;
  --muted-2: #63636d;

  --red:         #e5483b;
  --red-text:    #b92b1a;
  --accent:      #18181b;
  --accent-deep: #3f3f46;
  --accent-ink:  #fafafa;
  --accent-soft: rgba(24,24,27,0.08);
  --btn-solid-bg:    #18181b;
  --btn-solid-hover: #3f3f46;
  --btn-solid-ink:   #fafafa;
  --btn-info-bg:     rgba(11,11,13,0.08);
  --btn-info-hover:  rgba(11,11,13,0.14);
  --btn-info-ink:    #18181b;
  --focus-ring:      #18181b;
  --link:       #0369a1;
  --link-line:  rgba(3,105,161,0.45);
  --link-soft:  rgba(3,105,161,0.10);

  --tint-0: rgba(11,11,13,0.025);
  --tint-1: rgba(11,11,13,0.04);
  --tint-2: rgba(11,11,13,0.07);
  --tint-3: rgba(11,11,13,0.12);
  --tint-4: rgba(11,11,13,0.20);
  --tint-5: rgba(11,11,13,0.40);
  --inset:  rgba(11,11,13,0.05);

  --bar-bg:        rgba(255,255,255,0.94);
  --bar-bg-strong: rgba(255,255,255,0.97);
  --pop-bg:        rgba(255,255,255,0.98);

  --scrim:      rgba(24,24,27,0.5);
  --scrim-soft: rgba(24,24,27,0.3);
  --overlay-mid: rgba(255,255,255,0.7);
  --shadow-card:  0 12px 30px -16px rgba(24,24,27,0.25);
  --shadow-pop:   0 30px 60px -20px rgba(24,24,27,0.3);
  --shadow-cover: 0 40px 100px -20px rgba(24,24,27,0.3);
  --shadow-menu:  0 16px 40px rgba(24,24,27,0.18);
  --shadow-sheet: 0 30px 80px rgba(24,24,27,0.22);

  --on-image: #fff;

  --secondary:      #3b62b8;
  --secondary-soft: rgba(59,98,184,0.12);

  --danger:      #c81e32;
  --danger-soft: rgba(200,30,50,0.10);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { overflow-x: hidden; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; padding: 0; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Skip-Link für Tastatur-Nutzer: per default off-screen, bei :focus sichtbar
   oben links. Pflicht für WCAG-2.1 Bypass-Blocks (2.4.1).                    */
.skip-link {
  position: absolute; top: 0; left: 0;
  z-index: 250;
  padding: 12px 18px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 14px;
  border-radius: 0 0 var(--radius-md) 0;
  transform: translateY(-100%);
  transition: transform 0.14s ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--text); outline-offset: 2px; }

/* ============================================================
   TOPBAR — Höhe fest (kein Layout-Sprung); auf der Startseite liegt sie
   transparent über dem Billboard, sonst auf dunklem Grund.
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; gap: 40px;
  padding: 0 var(--rail-gutter);
  background: var(--bar-bg-strong);
  border-bottom: 1px solid transparent;
  transition: background 0.2s ease, border-bottom-color 0.2s ease;
}
/* Startseite mit Billboard: Verlauf von oben, Hero schiebt sich unter die Leiste. */
body.is-home-page.has-hero .topbar {
  /* Kraeftiger, damit Navigation und Sprachwahl auch auf hellen Billboard-Bildern lesbar bleiben. */
  background: linear-gradient(180deg, rgba(11,11,13,0.94) 0%, rgba(11,11,13,0.7) 60%, rgba(11,11,13,0) 100%);
  /* Verlauf ueber die volle Hoehe inkl. 1 px Randlinie, sonst kachelt er dort und zeichnet einen dunklen Strich. */
  background-origin: border-box; background-repeat: no-repeat;
}
body.is-home-page.has-hero .topbar.scrolled,
.topbar.scrolled {
  background: var(--bar-bg);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em; line-height: 1;
  min-height: 44px;
}
.brand-mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  border-radius: 6px;
  font-weight: 900; font-size: 18px; line-height: 1;
}
.brand-word { color: var(--text); }
.brand-for { display: none; }

.primary-nav { display: flex; gap: 24px; align-items: center; }
/* Hamburger-Toggle entfällt: mobil übernehmen Kategorie-Chips und Tab-Leiste. */
.nav-toggle { display: none; }
.primary-nav button {
  position: relative;
  min-height: 44px; padding: 0 2px;
  font-size: 15px; font-weight: 400;
  color: var(--accent-deep);
  transition: color 0.15s ease;
}
.primary-nav button:hover { color: var(--text-hi); }
.primary-nav button.active { color: var(--text-hi); font-weight: 700; }

.topbar-right {
  display: inline-flex; align-items: center; gap: 12px;
  margin-left: auto;
}

/* Suche: Icon-Button, das Eingabefeld klappt links daneben auf. */
.search-wrap { position: relative; display: inline-flex; align-items: center; }
.search-field {
  width: 0; height: 40px; padding: 0; opacity: 0; pointer-events: none;
  border: 1px solid transparent; outline: 0;
  background: var(--tint-2); color: var(--text);
  font-family: var(--sans); font-size: 14px;
  border-radius: 999px;
  transition: width 0.22s ease, padding 0.22s ease, opacity 0.18s ease, border-color 0.22s ease;
}
.search-wrap.open .search-field {
  width: 260px; padding: 0 16px; opacity: 1; pointer-events: auto;
  border-color: var(--line-strong);
  margin-right: 4px;
}
.search-wrap.open .search-field:focus { border-color: var(--tint-5); }
.search-field::placeholder { color: var(--muted); }

.nav-icon {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.15s ease;
}
.nav-icon:hover { background: var(--tint-2); }
.nav-icon svg { width: 22px; height: 22px; }

/* Sprachumschalter: kompakter Text-Toggle "HSB / DSB / DE". */
.lang-toggle { display: inline-flex; align-items: center; }
.lang-toggle .lang-opt {
  min-width: 44px; height: 44px; padding: 0 4px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: color 0.15s ease;
}
.lang-toggle .lang-opt:hover { color: var(--text-hi); }
.lang-toggle .lang-opt[aria-pressed="true"] {
  color: var(--text-hi); font-weight: 700;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px;
}
.lang-toggle .lang-sep { color: #71717a; font-size: 14px; }

.avatar {
  width: 36px; height: 36px; border-radius: 6px;
  background: #3f6b8a;
  color: #fff; font-weight: 700; font-size: 15px;
  display: grid; place-items: center;
  cursor: pointer;
  border: 0;
  transition: box-shadow 0.18s ease;
}
.avatar:hover { box-shadow: 0 0 0 2px var(--tint-5); }

/* Sichtbarer Fokus für alles Bedienbare. */
:where(a, button, input, [tabindex]):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

@media (max-width: 1099px) {
  :root { --rail-gutter: 32px; }
  .brand-word { display: none; }
  .topbar { gap: 24px; }
  .primary-nav { gap: 16px; }
}
.primary-nav button { white-space: nowrap; }

/* Mobile Kategorie-Chips: nur < 900px (siehe Media-Query unten). */
.cat-nav { display: none; }

/* ============================================================
   HERO — Billboard: Bild füllt die Fläche, Text unten links
   ============================================================ */
.hero {
  position: relative;
  min-height: clamp(520px, 56vw, 780px);
  margin-top: calc(var(--header-h) * -1);
  /* Text unten links; oben immer Platz für die Leiste (Kicker nie unter dem Header). */
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 24px) var(--rail-gutter) clamp(190px, 14.5vw, 210px);
  background: var(--bg);
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -3; }
.hero-picture { position: absolute; inset: 0; z-index: -2; display: block; }
.hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-shade--side { background: linear-gradient(90deg, rgba(11,11,13,0.92) 0%, rgba(11,11,13,0.55) 38%, rgba(11,11,13,0) 65%); }
.hero-shade--bottom { top: auto; height: 320px; background: linear-gradient(0deg, #0b0b0d 0%, rgba(11,11,13,0) 100%); }

.hero-copy {
  width: min(600px, 100%);
  display: flex; flex-direction: column; gap: 18px;
}
.hero-kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.hero-kicker-mark {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--red); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 900;
}
.hero-title {
  margin: 0;
  font-weight: 900;
  color: var(--text);
  text-wrap: balance;
}
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 16px; color: #d4d4d8;
}
.hero-meta .hero-new { color: #4ade80; font-weight: 700; }
.hero-meta-short { display: none; }
.hero-desc {
  margin: 0;
  font-size: 19px; line-height: 1.45; color: #e4e4e7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.age-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
  border: 1px solid rgba(212,212,216,0.55); border-radius: 3px;
  font-size: 13px; line-height: 1; color: var(--text);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px;
  border-radius: 6px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  background: var(--btn-solid-bg); color: var(--btn-solid-ink);
}
.btn-primary:hover { background: var(--btn-solid-hover); }

.btn-ghost {
  background: var(--tint-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--tint-3); border-color: var(--line-strong); }

.btn-icon {
  /* Quadratisch, gleiche Höhe wie .btn (46), gleicher Border-Radius —      */
  /* damit Action-Bar im Detail-Overlay nicht "tanzt" wenn Icon-only und   */
  /* Label-Buttons gemischt sind.                                          */
  width: 46px; height: 46px; padding: 0;
  border: 1px solid var(--line);
  background: var(--tint-1);
}
.btn-icon:hover { background: var(--tint-2); border-color: var(--line-strong); }

/* Billboard-Buttons: Abspielen (weiß) und Mehr Infos (grau). */
.btn-play, .btn-info {
  height: 52px; padding: 0 28px 0 22px;
  font-size: 18px; font-weight: 700; letter-spacing: 0; gap: 10px;
}
.btn-play { background: var(--btn-solid-bg); color: var(--btn-solid-ink); }
.btn-play:hover { background: var(--btn-solid-hover); }
.btn-play svg, .btn-info svg { width: 22px; height: 22px; }
.btn-info { background: var(--btn-info-bg); color: var(--btn-info-ink); padding: 0 26px 0 20px; }
.btn-info:hover { background: var(--btn-info-hover); }
/* Merken im Billboard: Desktop nur Icon (Beschriftung für Screenreader), mobil mit Text. */
.hero-bm { position: relative; width: 52px; padding: 0; }
.hero-bm .hero-bm-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================
   CATEGORY CHIPS — own row, no overlap with shelves
   ============================================================ */
.chip-row {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0 var(--gutter);
  max-width: var(--max-w);
  margin: 0 auto clamp(28px, 4vw, 48px);
}
.chip {
  /* Touch-Target ≥40px Höhe (war 32px via 8+13.5+8 padding+font). */
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active {
  background: var(--text); color: var(--bg);
  border-color: var(--text); font-weight: 600;
}

/* ============================================================
   SHELVES — editorial grid sections, NOT broken rails
   ============================================================ */
main.shelves { display: block; }
.shelves {
  padding: 0 var(--gutter) clamp(60px, 8vw, 120px);
  max-width: var(--max-w); margin: 0 auto;
  display: grid; gap: clamp(40px, 5vw, 72px);
}
/* Mit Rails (Startseite) trägt <main> keinen Rand, damit sie bis zum Fensterrand laufen. */
main.shelves:has(> .shelves.is-rails) { padding: 0; max-width: none; margin: 0; }
/* Startseite: Rails laufen bis an den rechten Fensterrand. */
.shelves.is-rails {
  max-width: none; margin: 0; padding: 0 0 clamp(60px, 8vw, 100px);
  display: flex; flex-direction: column; gap: 44px;
  position: relative; z-index: 2;
}
body.is-home-page.has-hero .shelves.is-rails { margin-top: -150px; }

.shelf { position: relative; }
.shelf-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  gap: 18px;
}
.shelf-title {
  font-weight: 800;
  font-size: clamp(24px, 2.6vw, 32px);
  line-height: 1.1; letter-spacing: -0.02em;
  margin: 0; color: var(--text);
}
.shelf-title em { font-style: normal; }
.shelf-count {
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Card grid — responsive, no horizontal scroll */
.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: clamp(18px, 2vw, 28px);
}

/* Continue watching uses a wider card with 16:9 still */
.shelf--continue .shelf-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Legacy rail support (kept hidden, JS may still create row-scroll) */
.row-scroll { display: contents; }
.row-arrow { display: none; }
.shelf-head .row-arrow { display: none; }

/* ============================================================
   CARD — poster on top, title below (clean & legible)
   ============================================================ */
.card {
  position: relative;
  display: block;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: transform 0.2s ease;
  min-width: 0;
}
.card:hover { transform: translateY(-3px); }
.card:hover .card-poster {
  box-shadow: var(--shadow-pop), 0 0 0 1px var(--accent);
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--line);
  transition: box-shadow 0.2s ease;
}
/* Aspect ratios per content kind — videos are wider, audio is square, ebooks
   are taller than the default 2:3 to read like a book cover. */
.card[data-kind="video"] .card-poster { aspect-ratio: 16 / 9; }
.card[data-kind="audio"] .card-poster { aspect-ratio: 1 / 1; }
.card[data-kind="ebook"] .card-poster { aspect-ratio: 9 / 16; }
/* The Weiterschauen rail forces landscape regardless of kind. */
.card[data-aspect="landscape"] .card-poster { aspect-ratio: 16 / 9; }

/* Thumbnail image overlays the SVG poster. object-fit: cover so the image
   fills without distortion. The SVG underneath shows during img loading
   and as a permanent fallback for items without a thumb. */
.card-thumb {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  z-index: 1;
  background: var(--surface);
}

/* Playlists rendered as cards on the home grid get a 1:1 tile + accent block. */
.playlist-card .card-poster { aspect-ratio: 1 / 1; }
.shelf--playlists .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Legacy `.playlist-tracklist` (Tracklist im Detail-Overlay-Hijack vor dem  */
/* Rewrite zur dedizierten Playlist-View) wurde entfernt — die Klasse ist   */
/* nirgendwo mehr im JS/HTML referenziert. Aktuelle Tracklist lebt unter    */
/* `.playlist-view-tracks` weiter unten in dieser Datei.                    */

/* ====================================================================== */
/* Add-to-Playlist menu — compact, positioned popover (Spotify-style).      */
/*                                                                          */
/* Rationale: the old `.playlist-picker` was a class="overlay" modal that   */
/* collided with the detail overlay (same z-index 100) and used             */
/* `position: absolute` inside `.modal-card` which pushed the trigger       */
/* button off-screen. The replacement is a `position: fixed` popover that   */
/* JS positions next to the kebab/anchor, with its own z-index above all    */
/* other overlays. Toggled via the `hidden` attribute, not the legacy       */
/* `.overlay.open` flow.                                                    */
/* ====================================================================== */
.playlist-menu {
  position: fixed;
  z-index: 140;
  width: 320px;
  max-height: 480px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  font-family: inherit; color: var(--text);
  /* Spotify-style entry animation. */
  transform: translateY(-6px); opacity: 0;
  transition: transform 0.14s ease, opacity 0.14s ease;
  pointer-events: none;
}
.playlist-menu[aria-hidden="false"] {
  transform: translateY(0); opacity: 1;
  pointer-events: auto;
}
.playlist-menu-head {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--tint-1);
}
/* Eyebrow auf den Standard-Wert des Public-Frontends (13px / 0.16em / 700).
   War vorher 0.7rem (~11.2px) / 0.08em — drift zu Hero/Shelf-Eyebrow.    */
.playlist-menu-eyebrow { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0; }
.playlist-menu-title {
  margin: 4px 0 0; font-size: 0.85rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.playlist-menu-list {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 6px;
}
.playlist-menu-list:empty + .playlist-menu-create { border-top: 0; }
.playlist-menu-row {
  width: 100%;
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 10px;
  border: 0; background: transparent; color: var(--text);
  border-radius: 6px; cursor: pointer; text-align: left;
  transition: background 0.12s ease;
  font-family: inherit;
}
.playlist-menu-row:hover { background: var(--tint-1); }
.playlist-menu-row:focus-visible { background: var(--tint-2); outline: none; }
.playlist-menu-row[data-disabled="true"] { opacity: 0.45; cursor: default; }
.playlist-menu-row .row-cover {
  width: 32px; height: 32px; border-radius: 4px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px; color: rgba(255,255,255,0.9);
  overflow: hidden;
}
.playlist-menu-row .row-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-menu-row .row-meta { min-width: 0; }
.playlist-menu-row .row-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.playlist-menu-row .row-count { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.playlist-menu-row .row-status { font-size: 0.78rem; color: var(--muted); }
.playlist-menu-row[data-included="true"] .row-status { color: var(--accent); }
.playlist-menu-empty {
  padding: 18px 12px; text-align: center; color: var(--muted); font-size: 0.85rem;
}
.playlist-menu-create {
  /* Plus-Button auf 40px (AA-Touchziel) — Spalte entsprechend angepasst.   */
  display: grid; grid-template-columns: 1fr 40px; gap: 6px;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--line);
  background: var(--inset);
}
.playlist-menu-create input {
  padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--tint-1); color: var(--text);
  font-family: inherit; font-size: 14px;
  /* Höhe 40px — passt zum Plus-Button daneben. */
  height: 40px;
}
.playlist-menu-create input:focus { outline: none; border-color: var(--accent); }
.playlist-menu-create button {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 1.2rem; line-height: 1;
  border: 0; cursor: pointer;
  transition: background 0.12s ease;
}
.playlist-menu-create button:hover { background: var(--accent-deep); }

/* ====================================================================== */
/* Playlist view — dedicated full modal (NOT a detail-overlay hijack).      */
/*                                                                          */
/* The previous implementation overloaded `#overlay`, fighting it for the   */
/* hero/tracklist layout and inheriting all of its event handlers. Now      */
/* playlists have their own modal at a higher z-index, with hero + meta    */
/* side-by-side (Spotify) and the tracklist below.                          */
/* ====================================================================== */
.playlist-view {
  position: fixed; inset: 0;
  z-index: 130;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow-y: auto;
  color: var(--text);
}
.playlist-view[aria-hidden="false"] { display: flex; }
.playlist-view-topbar {
  position: sticky; top: 0;
  display: flex; align-items: center; gap: 18px;
  padding: 18px var(--gutter);
  background: var(--bar-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  z-index: 4;
}
.playlist-view-topbar .close-x {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--tint-1); color: var(--text-hi);
  border: 0; cursor: pointer;
}
.playlist-view-topbar .close-x:hover { background: var(--tint-3); }
.playlist-view-topbar .breadcrumb { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }
.playlist-view-topbar .spacer { flex: 1; }
.playlist-view-hero {
  display: grid; grid-template-columns: 232px 1fr; gap: 28px;
  align-items: end;
  padding: 32px var(--gutter) 24px;
  background: linear-gradient(180deg, var(--tint-3), var(--bg-clear) 70%);
}
.playlist-view-cover {
  width: 232px; height: 232px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow-pop);
  display: grid; place-items: center;
  overflow: hidden;
  font-family: var(--display); font-weight: 700; font-size: 96px; color: var(--accent-ink);
}
.playlist-view-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-view-meta { min-width: 0; display: grid; gap: 8px; }
/* Eyebrow harmonisiert mit Hero/Shelf-Eyebrow (13px / 0.16em / 700).      */
.playlist-view-eyebrow { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0; text-transform: uppercase; }
.playlist-view-meta h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.02;
  margin: 0;
  word-break: break-word;
  outline: none;
  /* Edit-Affordance: subtler Underline beim Hover, damit Admin sieht dass    */
  /* es klickbar/editierbar ist. Spotify nutzt das gleiche Pattern. Padding  */
  /* + negative-margin lassen das Hit-Field größer werden als die Schrift.  */
  padding: 4px 6px; margin-left: -6px;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, box-shadow 0.12s ease;
  cursor: text;
}
.playlist-view-meta h2:hover { background: var(--tint-1); box-shadow: inset 0 -2px 0 var(--line-strong); }
.playlist-view-meta h2:focus { background: var(--tint-1); box-shadow: inset 0 -2px 0 var(--accent); }
.playlist-view-meta h2:empty::before {
  content: 'Unbenannt'; color: var(--muted); font-weight: 400;
}
.playlist-view-meta p[contenteditable] {
  font-size: 0.95rem; color: var(--muted); margin: 0;
  outline: none;
  padding: 6px 8px; margin-left: -8px;
  border-radius: var(--radius-sm);
  min-height: 1.4em;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
  cursor: text;
}
.playlist-view-meta p[contenteditable]:hover { background: var(--tint-1); color: var(--text); }
.playlist-view-meta p[contenteditable]:empty::before {
  content: attr(data-placeholder); color: var(--muted-2);
}
.playlist-view-meta p[contenteditable]:focus { background: var(--tint-1); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.playlist-view-stats { font-size: 0.8rem; color: var(--muted); margin: 0; }
.playlist-view-actions {
  display: flex; gap: 12px; align-items: center;
  margin-top: 12px;
}
.playlist-view-actions .btn-primary svg { width: 18px; height: 18px; }
.playlist-view-actions .btn-ghost { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.playlist-view-actions .btn-ghost svg { width: 18px; height: 18px; }

.playlist-view-tracks {
  padding: 16px var(--gutter) 96px;
  display: grid; gap: 2px;
}
.playlist-view-tracks .track-row {
  display: grid;
  /* Remove-Spalte auf 40px (AA-Touchziel). */
  grid-template-columns: 32px 56px 1fr 80px 40px;
  align-items: center; gap: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease, box-shadow 0.12s ease;
  /* Outline für die Default-Browser-Focus weg, dafür eigener Focus-Ring.   */
  outline: none;
}
.playlist-view-tracks .track-row:hover { background: var(--tint-1); }
/* Tab-Fokus: deutlicher als Hover damit Keyboard-User weiß wo er steht.   */
.playlist-view-tracks .track-row:focus-visible {
  background: var(--tint-2);
  box-shadow: inset 0 0 0 2px var(--accent);
}
.playlist-view-tracks .track-number {
  color: var(--muted); font-variant-numeric: tabular-nums;
  font-size: 0.9rem; text-align: center;
}
/* ▶ ersetzt die Track-Nummer bei Hover oder Keyboard-Focus — kein visueller
   Drift zwischen Maus- und Keyboard-Bedienung.                              */
.playlist-view-tracks .track-row:hover .track-number,
.playlist-view-tracks .track-row:focus-visible .track-number { color: transparent; position: relative; }
.playlist-view-tracks .track-row:hover .track-number::after,
.playlist-view-tracks .track-row:focus-visible .track-number::after {
  content: '▶';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: var(--text);
}
.playlist-view-tracks .track-thumb {
  width: 56px; height: 56px;
  border-radius: 4px; object-fit: cover;
  background: var(--surface-2);
}
.playlist-view-tracks .track-thumb.placeholder {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.playlist-view-tracks .track-meta { min-width: 0; }
.playlist-view-tracks .track-title {
  font-weight: 600; font-size: 0.95rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.playlist-view-tracks .track-sub {
  color: var(--muted); font-size: 0.8rem; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.playlist-view-tracks .track-duration {
  color: var(--muted); font-size: 0.85rem;
  text-align: right;
}
.playlist-view-tracks .track-remove {
  /* 40×40 statt 32×32 — AA-Touchziel. Auf Touch immer sichtbar (siehe        */
  /* `@media (hover: none)` unten), sonst auf Desktop hover-reveal.          */
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: 1rem; border: 0; cursor: pointer;
  opacity: 0; transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.playlist-view-tracks .track-row:hover .track-remove,
.playlist-view-tracks .track-row:focus-visible .track-remove,
.playlist-view-tracks .track-row:focus-within .track-remove,
.playlist-view-tracks .track-remove:focus-visible { opacity: 1; }
.playlist-view-tracks .track-remove:hover,
.playlist-view-tracks .track-remove:focus-visible {
  background: var(--danger-soft);
  color: var(--danger);
}
.playlist-view-tracks .track-remove:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}
/* Touch-Devices haben keinen Hover-State — Remove muss immer sichtbar sein,*/
/* sonst sind Tracks dort unlöschbar.                                       */
@media (hover: none) {
  .playlist-view-tracks .track-remove { opacity: 0.6; }
  .playlist-view-tracks .track-remove:active { opacity: 1; background: var(--danger-soft); color: var(--danger); }
}
.playlist-view-tracks .tracks-empty {
  padding: 48px 12px; text-align: center; color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 720px) {
  .playlist-view-hero {
    grid-template-columns: 1fr;
    justify-items: center; text-align: center;
    padding: 22px 16px;
  }
  .playlist-view-cover { width: 180px; height: 180px; font-size: 72px; }
  .playlist-view-meta { text-align: center; justify-items: center; }
  .playlist-view-actions { justify-content: center; }
  .playlist-view-tracks .track-row {
    grid-template-columns: 24px 44px 1fr 40px;
  }
  .playlist-view-tracks .track-duration { display: none; }
}

/* ====================================================================== */
/* Card kebab "..." — hover-reveal on every card so users can add to a      */
/* playlist without opening the detail overlay first. Also surfaced on      */
/* touch devices via active state.                                          */
/* ====================================================================== */
.card { position: relative; }
.card-actions {
  position: absolute; top: 8px; right: 8px;
  display: flex; gap: 6px;
  z-index: 4;
}
.card-action {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff; border: 0; cursor: pointer;
  opacity: 0; transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.card-action svg { width: 16px; height: 16px; }
/* Merken-Knopf: Plus; gemerkt = Haken auf hellem Grund (Icon kommt aus bookmarkIconSvg) */
.card-heart[data-active="true"] {
  background: rgba(244,244,245,0.92); color: var(--accent-ink);
  opacity: 1; transform: translateY(0); /* gemerkte Cards zeigen Herz permanent. */
}
.card:hover .card-action,
.card:focus-within .card-action,
.card-action:focus-visible { opacity: 1; transform: translateY(0); }
.card-action:hover { background: rgba(0,0,0,0.9); }
.card-heart[data-active="true"]:hover { background: var(--accent-deep); }
@media (hover: none) {
  .card-action { opacity: 0.92; background: rgba(0,0,0,0.6); }
}
.card-poster .poster-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.card-poster .ink {
  display: none; /* legacy overlay no longer used; titles render below */
}

.card-progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: rgba(0,0,0,0.5);
}
.card-progress-fill {
  display: block; height: 100%;
  background: var(--red);
}

.card-access-badge, .card-kids-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 3px 8px;
  font-size: 12px; font-weight: 600;
  background: rgba(11,11,13,0.72);
  color: #fff;
  border-radius: 4px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 3;
}
.card-access-badge + .card-kids-badge { top: 38px; }

.card-body {
  padding: 12px 4px 0;
}
.card-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.card-title {
  font-family: var(--display); font-weight: 700;
  font-size: 17px; line-height: 1.22;
  color: var(--text); margin: 0;
  letter-spacing: -0.005em;
  text-wrap: balance;
  /* clamp to 2 lines */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tagline {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.45;
  color: var(--muted); margin: 4px 0 0;
  /* 1 Zeile statt 2 — verhindert dass Karten mit langem Künstlernamen
     doppelt so hoch werden wie ihre Nachbarn in der gleichen Row.        */
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
/* Card als Grid-Item: align-items: start damit Cards unterschiedlicher
   Höhe (wegen verschiedener aspect-ratios in gemischten Empfohlen-Reihen)
   oben aligned sind statt sich vertikal zu strecken.                     */
.shelf-grid .card { align-self: start; }

/* Continue-watching variant: wider 16:9 still + meta */
.shelf--continue .card-poster { aspect-ratio: 16 / 9; }
.shelf--continue .card-title { font-size: 15px; }

/* Procedural poster colors — set via inline SVG, kept for fallback */
.art-1, .art-2, .art-3, .art-4, .art-5, .art-6, .art-7, .art-8, .art-9, .art-10, .art-11, .art-12, .art-13, .art-14 {
  background: var(--surface);
}

/* ============================================================
   FALLBACK-FLÄCHE — ruhiger Farbton mit feinen Diagonalstreifen, kein Text
   Absolut positioniert: der Elternknoten MUSS position: relative (oder absolute)
   und overflow: hidden haben (.rc-art, .poster-art, .card-poster, Verlauf-Thumb).
   ============================================================ */
.art-fallback {
  position: absolute; inset: 0;
  background-color: var(--tone, #27272a);
  background-image:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, var(--tone, #27272a) 0%, var(--tone-2, #18181b) 100%);
}
.overlay-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   RAILS (Startseite) — horizontale Reihen, rechts am Fensterrand abgeschnitten
   ============================================================ */
.rail-head {
  display: flex; align-items: baseline; gap: 16px;
  padding: 0 var(--rail-gutter);
  margin-bottom: 12px;
}
.rail-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.rail-more {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--link-line); border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--link); white-space: nowrap;
}
.rail-more:hover { background: var(--link-soft); }
.rail-more:hover { text-decoration: underline; }

.rail-wrap { position: relative; }
.rail {
  display: flex; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 0 var(--rail-gutter) 4px;
  scroll-padding-left: var(--rail-gutter);
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior-x: contain;
}
.rail::-webkit-scrollbar { display: none; }
.shelf--rail-top10 .rail { gap: 4px; }

.rail-card {
  flex: 0 0 auto; scroll-snap-align: start;
  display: flex; flex-direction: column;
  min-width: 0; text-align: left;
  color: var(--text);
  border-radius: 6px;
}
.rc-art {
  position: relative; overflow: hidden;
  border-radius: 6px; background-color: var(--surface-2);
}
.rc-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.rc-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 96px; background: linear-gradient(0deg, rgba(11,11,13,0.85) 0%, rgba(11,11,13,0) 100%); }
.rc-title {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  font-size: 22px; line-height: 1; font-weight: 900; letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  overflow-wrap: anywhere; hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.rc-badge {
  padding: 2px 7px; font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(11,11,13,0.72); border-radius: 4px;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.rail-card:hover .rc-art, .rail-card:focus-visible .rc-art { box-shadow: 0 0 0 2px var(--ring-hover); }
.rail-card:focus-visible { outline: none; }

/* Weiterschauen: 16:9, 300px, Fortschritt + Restzeit */
.rail-card--continue { width: 300px; background: var(--surface); overflow: hidden; }
.rail-card--continue .rc-art { height: 169px; border-radius: 0; }
.rail-card--continue .rc-art { box-shadow: none; }
.rc-progress { display: block; height: 4px; background: #3f3f46; }
.rc-progress-fill { display: block; height: 4px; background: var(--red); }
.rc-meta { padding: 10px 14px 12px; font-size: 13px; color: var(--muted); }
.rail-card--continue:hover, .rail-card--continue:focus-visible { box-shadow: 0 0 0 2px var(--ring-hover); }

/* Filme & Serien, Kinder, Spiele: 16:9, 300px */
.rail-card--landscape { width: 300px; }
.rail-card--landscape .rc-art { height: 169px; }

/* Lesestoff: 2:3, 160px */
.rail-card--poster { width: 160px; }
.rail-card--poster .rc-art { height: 240px; }
.rail-card--poster .rc-title { left: 12px; right: 12px; bottom: 14px; font-size: 19px; line-height: 1.02; }
.rail-card--poster .rc-shade { height: 120px; }

/* Musik, Hörformate, Playlists: quadratisch, Titel darunter */
.rail-card--square { width: 200px; gap: 10px; }
.rail-card--square .rc-art { height: 200px; }
.rc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rc-name {
  font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rc-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.rail-card { padding: 0; background: transparent; cursor: pointer; font: inherit; }

/* Top 10: riesige Umriss-Zahl + 2:3-Poster */
.rail-card--top10 { position: relative; width: auto; flex: none; height: 240px; flex-direction: row; align-items: flex-end; }
.rc-rank {
  position: static; flex: none; margin-bottom: -18px; padding-right: 0.16em; margin-right: 4px;
  font-size: 230px; line-height: 1; font-weight: 900; letter-spacing: -0.08em;
  color: var(--bg); -webkit-text-stroke: 3px #52525b;
  pointer-events: none; user-select: none;
}
.rail-card--top10 .rc-art { flex: none; width: 160px; height: 240px; }
.rail-card--top10 .rc-shade { height: 120px; }
.rail-card--top10 .rc-title { left: 12px; right: 12px; bottom: 14px; font-size: 19px; line-height: 1.02; }
.rail-card--top10 .rc-badges { left: 6px; }

/* Vor-/Zurück-Buttons: nur auf Geräten mit Maus. */
.rail-nav { display: none; }
@media (hover: hover) and (pointer: fine) {
  .rail-nav {
    position: absolute; top: 0; bottom: 4px; z-index: 3;
    width: 48px; align-items: center; justify-content: center;
    color: var(--text-hi); opacity: 0; transition: opacity 0.15s ease;
  }
  .rail-nav svg { width: 28px; height: 28px; }
  .rail-nav--prev { left: 0; background: linear-gradient(90deg, var(--page-bg), var(--page-bg-clear)); }
  .rail-nav--next { right: 0; background: linear-gradient(270deg, var(--page-bg), var(--page-bg-clear)); }
  .rail-wrap:hover .rail-nav, .rail-wrap:focus-within .rail-nav { display: flex; opacity: 1; }
  .rail-wrap[data-at-start="true"] .rail-nav--prev,
  .rail-wrap[data-at-end="true"] .rail-nav--next { display: none; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.shelf-empty {
  padding: 40px 0;
  color: var(--muted);
  font-family: var(--sans); font-size: 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 6vw, 80px) var(--gutter) 104px; /* Platz unter dem Chat-Knopf (fixiert unten rechts) */
  background: var(--bg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: var(--max-w); margin: 0 auto;
}
.footer h4 {
  font-family: var(--sans); font-size: 12px; font-weight: 700;
  color: var(--muted); margin: 0 0 16px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.footer ul a { display: inline-flex; align-items: center; min-height: 28px; min-width: 24px; color: var(--muted); font-size: 14px; transition: color 0.15s ease; }
.footer ul a:hover { color: var(--text); }
.footer-brand {
  font-family: var(--display); font-weight: 800;
  font-size: 30px; font-weight: 700; line-height: 1;
  margin-bottom: 12px;
  letter-spacing: 0;
}
.footer-tag {
  color: var(--muted); font-size: 14px; max-width: 38ch;
  line-height: 1.6; margin: 0;
}
.footer-legal {
  max-width: var(--max-w); margin: clamp(36px, 5vw, 56px) auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; font-size: 12px; color: var(--muted-2);
  flex-wrap: wrap;
}
.footer-legal .lang {
  display: inline-flex; align-items: center; gap: 8px;
  /* Padding auf 8/14 — Touch-Target ≥40px Höhe ohne die Optik aufzublasen. */
  padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent;
  color: var(--text); font-size: 12px;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.footer-legal .lang:hover { background: var(--surface-2); border-color: var(--line-strong); }
.footer-legal .lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer-legal .lang #langCurrent { font-weight: 700; }
.footer-legal .lang .lang-sep { color: var(--muted-2); }
.footer-legal .lang #langOther { color: var(--muted); }
.lang-chips { display: inline-flex; gap: 4px; }
.lang-chip {
  min-width: 40px; min-height: 32px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 12px; font-weight: 700; letter-spacing: .04em; cursor: pointer;
}
.lang-chip:hover { background: var(--surface-2); color: var(--text); }
.lang-chip.active { background: var(--surface-2); border-color: var(--line-strong); color: var(--text); }
.lang-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================
   DETAIL OVERLAY — kept functional, restyled
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: var(--scrim);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  z-index: 100; display: none; overflow-y: auto;
  padding: 40px 20px;
}
.overlay.open { display: block; }
.overlay-card {
  max-width: 940px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl); overflow: hidden;
  box-shadow: var(--shadow-cover);
}
.overlay-hero {
  position: relative; aspect-ratio: 16/9;
  background: var(--surface-2); overflow: hidden;
}
.overlay-hero .overlay-hero-art {
  position: absolute; inset: 0;
}
.overlay-hero .overlay-hero-art svg {
  width: 100%; height: 100%; display: block;
}
.overlay-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--overlay-mid) 70%, var(--surface) 100%);
  pointer-events: none;
}
.overlay-close {
  position: absolute; top: 16px; right: 16px;
  width: 38px; height: 38px;
  background: rgba(0,0,0,0.7); border-radius: 50%;
  display: grid; place-items: center; z-index: 3; color: #fff;
}
.overlay-close:hover { background: var(--accent); color: var(--accent-ink); }
.overlay-hero-inner {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 30px 40px; z-index: 2;
}
.overlay-hero-inner h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(34px, 4.4vw, 56px);
  line-height: 0.98; margin: 0 0 16px; letter-spacing: -0.01em;
  color: var(--text);
}
.overlay-hero-inner .overlay-tagline {
  margin: -8px 0 16px; font-size: 17px; font-style: italic; color: var(--text-2);
}
.overlay-body .meta-row .pill--original { background: var(--red); border-color: var(--red); color: #fff; }
.overlay-body .meta-row .age-chip { color: var(--text); }
.overlay-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.overlay-body {
  padding: 28px 40px 40px;
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px;
}
.overlay-body .meta-row {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  color: var(--muted); font-size: 13px; margin-bottom: 14px;
}
.overlay-body .meta-row .match { color: var(--accent); font-weight: 700; }
.overlay-body .meta-row .pill {
  padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 4px;
  font-size: 11px; font-weight: 600; color: var(--text);
}
.overlay-body p {
  font-family: var(--sans); font-size: 15px; line-height: 1.65;
  color: var(--text-soft); margin: 0 0 16px;
}
.overlay-side dl { margin: 0; display: grid; gap: 14px; font-size: 14px; }
.overlay-side dt {
  color: var(--muted); font-size: 12px;
 margin-bottom: 4px;
}
.overlay-side dd { margin: 0; color: var(--text); }

/* Cast strip */
.cast-strip { margin: 0 40px 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.cast-strip h4 { font-size: 11px; color: var(--muted); margin: 0 0 14px; font-weight: 600; }
.cast-row { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-card { flex: 0 0 110px; cursor: pointer; }
.cast-photo { width: 110px; height: 110px; border-radius: 50%; overflow: hidden; margin-bottom: 8px; position: relative; border: 2px solid transparent; transition: border-color 0.18s ease, transform 0.18s ease; background: var(--surface-2); }
.cast-card:hover .cast-photo { border-color: var(--accent); transform: translateY(-2px); }
.cast-photo .initials { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--text); }
.cast-name { font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); margin: 0; }
.cast-role { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   VIDEO PLAYER — preserved
   ============================================================ */
.player { position: fixed; inset: 0; background: #000; z-index: 110; display: none; flex-direction: column; }
.player.open { display: flex; }
.player-stage {
  position: relative; flex: 1;
  background: radial-gradient(120% 80% at 50% 40%, #18120c 0%, #050505 60%, #000 100%);
  overflow: hidden;
}
.yt-embed { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 4; border: 0; background: #000; }
.ep-actions { display: flex; align-items: center; gap: 16px; }
.ep-panel header #epSave { color: #fff; font-weight: 600; }
.ep-panel header .ep-actions button { min-height: 32px; padding: 6px 4px; }
.player-stage video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
  z-index: 3;
}
.player-stage::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(60% 50% at 50% 45%, rgba(244,244,245,0.06), transparent 70%),
    linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.1) 40%, rgba(0,0,0,0.7) 100%);
}
.player-topbar {
  position: absolute; top: 0; left: 0; right: 0; padding: 22px 32px;
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  z-index: 5; color: #fff;
}
.player-topbar .title-block { flex: 1; min-width: 0; }
.player-topbar .kicker { font-size: 11px; color: var(--muted); }
.player-topbar h3 { margin: 4px 0 0; font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; }
.player-topbar .close-x { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.08); color: #fff; flex-shrink: 0; }
.player-topbar .close-x:hover { background: rgba(255,255,255,0.18); }

.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 32px 24px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
  z-index: 5; color: #fff;
}
.player-scrub { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; font-variant-numeric: tabular-nums; font-size: 13px; color: rgba(255,255,255,0.8); }
.player-range { flex: 1; -webkit-appearance: none; appearance: none; height: 4px; background: rgba(255,255,255,0.18); border-radius: 999px; cursor: pointer; }
.player-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; }
.player-range::-moz-range-thumb { width: 14px; height: 14px; background: var(--accent); border-radius: 50%; cursor: pointer; border: 0; }
.player-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.player-row > .group { display: flex; align-items: center; gap: 8px; }
.player-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.08); color: #fff; }
.player-btn:hover { background: rgba(255,255,255,0.18); }
.player-btn.play { width: 60px; height: 60px; background: var(--accent); color: var(--accent-ink); }
.player-btn.play:hover { background: var(--accent-deep); }
.player-btn svg { width: 18px; height: 18px; }
.player-btn.play svg { width: 24px; height: 24px; }

.ep-panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: 380px;
  background: rgba(11,11,13,0.92); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-left: 1px solid var(--line); transform: translateX(100%);
  /* Ueber "Ton einschalten" (7) und dem Vollbild-Fänger (7) */
  transition: transform 0.3s ease; z-index: 9;
  display: flex; flex-direction: column;
}
.ep-panel.open { transform: translateX(0); }
.ep-panel header { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.ep-panel header h4 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.ep-panel header button { color: var(--muted); font-size: 12px; }
.ep-list { flex: 1; overflow-y: auto; padding: 8px 12px 18px; }
.ep-item { display: grid; grid-template-columns: 140px 1fr; gap: 14px; padding: 12px; border-radius: var(--radius-md); cursor: pointer; transition: background 0.18s ease; }
.ep-item:hover { background: rgba(255,255,255,0.04); }
.ep-item.active { background: rgba(255,255,255,0.06); }
.ep-thumb { aspect-ratio: 16/9; border-radius: 6px; position: relative; overflow: hidden; background: var(--surface-2); }
.ep-num { color: var(--muted); font-size: 11px; }
.ep-title { font-size: 14px; font-weight: 600; margin: 4px 0 2px; line-height: 1.3; color: #fff; }
.ep-desc { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 0; }

/* ============================================================
   AUDIO PLAYER — preserved
   ============================================================ */
.audio-player {
  position: fixed; inset: 0; z-index: 110; display: none;
  background:
    radial-gradient(60% 60% at 70% 30%, rgba(244,244,245,0.08), transparent 70%),
        var(--bg);
  overflow: hidden;
}
.audio-player.open { display: block; }
.audio-topbar { position: relative; z-index: 2; padding: 22px 40px; display: flex; align-items: center; gap: 16px; }
.audio-topbar .breadcrumb { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; flex: 1; }
.audio-topbar .breadcrumb strong { color: var(--text); }
/* Zurück-Button: primärer Topbar-CTA — gefüllter Pillow-Style. */
.audio-topbar-back {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  border: 0; cursor: pointer;
  transition: background 0.14s ease;
}
.audio-topbar-back:hover { background: rgba(239,234,224,0.14); }
/* Options-Button: sekundär — kein Background-Fill, nur muted color. So */
/* sehen Zurück (primär) und Options (sekundär) nicht mehr identisch aus. */
.audio-topbar-options {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%;
  background: transparent; color: var(--muted);
  border: 0; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.audio-topbar-options:hover { background: var(--surface-2); color: var(--text); }

.audio-stage {
  position: relative; z-index: 1;
  max-width: var(--max-w); margin: 0 auto;
  padding: 20px 40px 40px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px;
  align-items: center; min-height: calc(100vh - 100px);
}
.audio-cover-wrap { position: relative; display: grid; place-items: center; }
.audio-cover {
  width: min(440px, 80%); aspect-ratio: 1;
  border-radius: var(--radius-lg); overflow: hidden;
  /* `--shadow-pop` ist `0 30px 60px -20px rgba(0,0,0,0.7)`; der Cover hier
     darf etwas dramatischer sein → eigener Token `--shadow-cover`.        */
  box-shadow: var(--shadow-cover);
  position: relative;
  background: var(--surface);
}
.audio-cover .audio-cover-art { position: absolute; inset: 0; }
.audio-cover .audio-cover-art svg { width: 100%; height: 100%; display: block; }

.audio-info { max-width: 540px; color: var(--text); }
/* Audio-Kicker auf den Public-Eyebrow-Standard (13/0.16/700) gezogen.    */
.audio-info .kicker { font-size: 13px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.audio-info h2 { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 4vw, 56px); line-height: 1.02; margin: 0 0 8px; letter-spacing: -0.01em; }
.audio-info .by { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.audio-info .by strong { color: var(--text); }
.audio-info .desc { color: rgba(239,234,224,0.78); font-size: 14px; line-height: 1.65; margin: 0 0 28px; max-width: 50ch; }

.waveform {
  display: flex; align-items: center; gap: 3px;
  height: 56px; margin-bottom: 12px;
  cursor: pointer;
  user-select: none;
  /* Touch action: disable native gestures so drag-scrubbing works on mobile. */
  touch-action: none;
  outline: none;
}
.waveform:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: var(--radius-sm); }
.waveform .bar { flex: 1; background: var(--line-strong); border-radius: 2px; transition: background 0.12s ease; pointer-events: none; }
.waveform .bar.passed { background: var(--red); }
.waveform .bar.playhead { background: var(--text); }

.audio-time { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; margin-bottom: 24px; }
.audio-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.audio-btn {
  position: relative;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  border: 0; cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.audio-btn:hover { background: rgba(239,234,224,0.16); }
.audio-btn svg { width: 18px; height: 18px; }
.audio-btn.play { width: 64px; height: 64px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 12px 30px rgba(0,0,0,0.4); }
.audio-btn.play:hover { background: var(--accent-deep); }
.audio-btn.play svg { width: 26px; height: 26px; }
/* Shuffle/Repeat: armed-highlight wenn mode an ist. Wir nutzen
   aria-pressed/data-mode statt einer `.active` Klasse — semantischer und
   keine zusätzliche Sync-Logik nötig.                                    */
.audio-btn[aria-pressed="true"],
.audio-btn[data-mode="one"],
.audio-btn[data-mode="all"] {
  background: var(--accent-soft);
  color: var(--accent);
}
.audio-btn[aria-pressed="true"]:hover,
.audio-btn[data-mode="one"]:hover,
.audio-btn[data-mode="all"]:hover {
  background: rgba(244,244,245,0.22);
}
/* Repeat-One Badge: kleine "1" über dem Icon, klassisches Spotify-Pattern.
   Wird nur bei mode="one" sichtbar, all/off sehen nur den Active-Bg.    */
.audio-btn[data-mode="one"]::after {
  content: '1';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 9px; font-weight: 700;
  font-family: var(--sans);
  line-height: 1;
  color: var(--accent);
}

/* ============================================================
   READER — preserved
   ============================================================ */
.reader { position: fixed; inset: 0; z-index: 110; display: none; background: #1a1816; flex-direction: column; }
.reader.open { display: flex; }
body[data-reader-theme="paper"] .reader { background: #1a1816; }
body[data-reader-theme="cream"]  .reader { background: #2a2520; }
body[data-reader-theme="dark"]   .reader { background: #0a0a0a; }

.reader-topbar { flex: 0 0 auto; padding: 16px 32px; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.reader-topbar .breadcrumb { font-size: 13px; color: var(--muted); }
.reader-topbar .breadcrumb strong { color: rgba(255,255,255,0.9); }
.reader-topbar .spacer { flex: 1; }
.reader-tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 6px; background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.75); font-size: 13px; }
.reader-tool:hover { background: rgba(255,255,255,0.1); color: #fff; }
.reader-tool svg { width: 15px; height: 15px; }

.reader-stage { flex: 1; overflow-y: auto; padding: 40px 20px 80px; position: relative; }
.page {
  max-width: 720px; margin: 0 auto;
  background: #f4ede0; color: #1c160a;
  border-radius: 4px; padding: 80px 90px 90px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  font-family: var(--sans);
  font-size: 18px; line-height: 1.75; min-height: 70vh; position: relative;
}
body[data-reader-theme="cream"] .page { background: #ecdfc6; }
body[data-reader-theme="dark"]  .page { background: #1a1a1a; color: #e6e1d4; }
.page .chapter-eyebrow { font-family: var(--sans); font-size: 11px; color: #8a6a2a; margin: 0 0 14px; }
.page h1 { font-family: var(--sans); font-weight: 700; font-size: 40px; line-height: 1.1; margin: 0 0 28px; letter-spacing: -0.01em; color: #1c160a; }
body[data-reader-theme="dark"] .page h1 { color: #f0e8d4; }
.page p { margin: 0 0 1em; }
.page p:first-of-type::first-letter { font-family: var(--sans); font-size: 4.2em; line-height: 0.85; font-weight: 700; float: left; margin: 6px 10px 0 0; color: #8a6a2a; }
body[data-reader-theme="dark"] .page p:first-of-type::first-letter { color: #d4a55a; }

.reader-footer { flex: 0 0 auto; padding: 14px 32px; display: grid; grid-template-columns: 220px 1fr 220px; gap: 20px; align-items: center; border-top: 1px solid rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); font-size: 13px; background: rgba(0,0,0,0.25); }
.reader-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; position: relative; }
.reader-bar > span { display: block; height: 100%; width: 24%; background: var(--red); }
.reader-nav { display: flex; gap: 8px; justify-content: flex-end; }
.reader-nav button { height: 34px; padding: 0 14px; border-radius: 6px; background: rgba(255,255,255,0.06); color: #fff; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.reader-nav button:hover { background: rgba(255,255,255,0.14); }

/* ============================================================
   TRACK PICKERS — preserved
   ============================================================ */
.picker {
  position: absolute; right: 32px; bottom: 110px; width: 320px; z-index: 8;
  background: rgba(20,22,27,0.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,0.7); padding: 6px;
  opacity: 0; transform: translateY(8px) scale(0.98); transform-origin: bottom right;
  pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease;
}
.picker.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.picker-tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(0,0,0,0.4); border-radius: 8px; padding: 4px; margin-bottom: 4px; }
.picker-tabs button { padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); }
.picker-tabs button.active { background: rgba(255,255,255,0.08); color: var(--text); }
.picker-list { padding: 4px; max-height: 280px; overflow-y: auto; }
.track-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text-soft); font-size: 14px; }
.track-row:hover { background: var(--tint-1); color: var(--text); }
.track-row.active { color: var(--accent); }
.track-row .flag { width: 26px; height: 18px; border-radius: 3px; flex-shrink: 0; overflow: hidden; }
.flag-de { background: linear-gradient(180deg, #000 0 33%, #d00 33% 66%, #fc0 66% 100%); }
.flag-sb { background: linear-gradient(180deg, #0a4cb8 0 33%, #d00 33% 66%, #fff 66% 100%); }
.flag-en { background: linear-gradient(45deg, #012169 0 30%, #fff 30% 50%, #c8102e 50% 60%, #fff 60% 70%, #012169 70%); }
.flag-cs { background: linear-gradient(135deg, #11457e 0 50%, #fff 50% 75%, #d7141a 75%); }
.flag-off { background: var(--tint-1); color: var(--muted); font-size: 11px; }
.flag-ad  { background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; }

/* ============================================================
   LIBRARY / PROFILE — preserved
   ============================================================ */
.lib { position: fixed; inset: 0; z-index: 115; background: var(--bg); display: none; flex-direction: column; overflow-y: auto; }
.lib.open { display: flex; }
.lib-topbar { position: sticky; top: 0; display: flex; align-items: center; gap: 18px; padding: 18px var(--gutter); background: var(--bar-bg); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); z-index: 5; }
.lib-topbar .breadcrumb { font-size: 14px; color: var(--muted); }
.lib-topbar .breadcrumb strong { color: var(--text); }
.lib-topbar .spacer { flex: 1; }

.lib-banner { padding: 60px var(--gutter) 40px; display: grid; grid-template-columns: auto 1fr auto; gap: 32px; align-items: center; background: linear-gradient(180deg, var(--bg-2), var(--bg)); border-bottom: 1px solid var(--line); }
.profile-avatar-xl { width: 110px; height: 110px; border-radius: 18px; background: var(--surface-2); display: grid; place-items: center; color: var(--text); font-family: var(--display); font-weight: 700; font-size: 50px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.lib-banner .pname { font-family: var(--display); font-weight: 700; font-size: clamp(32px, 4vw, 50px); line-height: 1.02; margin: 0 0 8px; letter-spacing: -0.01em; }
.lib-banner .pmeta { color: var(--muted); font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.lib-banner .pstats { display: flex; gap: 32px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.lib-banner .switch-profile { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; background: var(--tint-1); border: 1px solid var(--line); color: var(--text); font-size: 13px; font-weight: 600; }
.lib-banner .switch-profile:hover { background: var(--tint-3); }

.lib-tabs { display: flex; gap: 28px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); position: sticky; top: 76px; background: var(--bar-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); z-index: 4; }
.lib-tab { position: relative; padding: 18px 0; font-size: 14px; font-weight: 600; color: var(--muted); transition: color 0.15s ease; }
.lib-tab:hover { color: var(--text); }
.lib-tab.active { color: var(--text); }
.lib-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); }
.lib-tab .count { display: inline-block; margin-left: 6px; padding: 2px 7px; background: var(--tint-2); border-radius: 999px; font-size: 11px; color: var(--muted); }
.lib-tab.active .count { background: var(--accent-soft); color: var(--accent); }

.lib-body { padding: 32px var(--gutter) 80px; }
.lib-pane { display: none; }
.lib-pane.active { display: block; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px; }

.pref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 1000px; }
.pref-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--tint-0); }
.pref-card h4 { font-size: 12px; color: var(--muted); margin: 0 0 16px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pref-row:last-child { border-bottom: 0; }
.pref-row .label { color: var(--text); }
.pref-row .value { color: var(--muted); font-size: 13px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-stack { position: fixed; right: 24px; bottom: 24px; z-index: 200; display: grid; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 14px 16px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--pop-bg); color: var(--text); box-shadow: 0 18px 40px rgba(0,0,0,0.4); animation: toastIn 220ms ease; font-size: 14px; }
.toast.is-success { border-color: var(--accent-soft); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   NOTIFICATIONS PANEL — slide-in von rechts, unter Topbar
   ============================================================ */
.nav-icon { position: relative; }
.bell-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
}
.notif-panel {
  position: fixed; top: 64px; right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 96px);
  z-index: 135;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  display: none; flex-direction: column;
  animation: slideDown 0.14s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.notif-panel[aria-hidden="false"] { display: flex; }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.notif-head h3 { margin: 0; font-family: var(--display); font-size: 1.1rem; font-weight: 700; }
.notif-panel .icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.notif-panel .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.notif-panel .icon-btn svg { width: 16px; height: 16px; }
.notif-list { padding: 6px; overflow-y: auto; }
.notif-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}
.notif-item:hover { background: var(--tint-1); }
.notif-item-title { font-weight: 600; font-size: .9rem; color: var(--text); margin-bottom: 2px; }
.notif-item-body { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.notif-empty { padding: 32px 18px; text-align: center; color: var(--muted); font-size: .9rem; }

/* ============================================================
   BOTTOM TAB-BAR (Mobile) — Spotify-Pattern: primary nav at thumb-reach
   ============================================================ */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 85;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bar-bg-strong);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--surface-2);
}
.bottom-bar .bbtn {
  min-height: 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: transparent;
  color: var(--muted);
  font-size: 11px; font-weight: 500;
  transition: color 0.12s ease;
}
.bottom-bar .bbtn svg { width: 22px; height: 22px; }
.bottom-bar .bbtn:hover { color: var(--text); }
.bottom-bar .bbtn.active, .bottom-bar .bbtn[aria-current="page"] { color: var(--text-hi); font-weight: 700; }

/* ============================================================
   GLOBAL MINI PLAYER — persistent bottom bar
   Spotify-Stil: bleibt während Navigation sichtbar, Click öffnet Full-Player.
   z-index 90 → unter Overlays (100), Player (110), Library (115), Drawer
   (130), Add-Menu (140), Toast (200). Sodass Modals immer darüber liegen.
   ============================================================ */
.mini-player {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 90;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 12px;
  background: var(--bar-bg);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  color: var(--text);
  /* Slide-up Animation beim ersten Erscheinen. */
  transform: translateY(0);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.mini-player[hidden] { display: none; }
.mini-cover {
  grid-row: 1 / 3; grid-column: 1;
  width: 56px; height: 56px;
  border: 0; padding: 0; background: var(--surface-2);
  border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 22px;
  color: rgba(255,255,255,0.7);
}
.mini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-meta {
  grid-row: 1 / 3; grid-column: 2;
  min-width: 0; cursor: pointer; user-select: none;
  display: grid; gap: 2px;
}
.mini-title {
  font-weight: 600; font-size: 14px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-sub {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-controls {
  grid-row: 1 / 3; grid-column: 3;
  display: flex; align-items: center; gap: 6px;
}
.mini-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 0; background: transparent;
  border-radius: 50%; color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.mini-btn:hover { background: var(--tint-2); }
.mini-btn svg { width: 16px; height: 16px; }
.mini-btn.mini-play {
  background: var(--accent); color: var(--accent-ink);
  width: 40px; height: 40px;
}
.mini-btn.mini-play:hover { background: var(--accent-deep); }
.mini-btn.mini-play svg { width: 18px; height: 18px; }
.mini-btn.mini-close { color: var(--muted); }
.mini-btn.mini-close:hover { color: var(--danger); }
.mini-btn[aria-pressed="true"] { color: var(--accent); }
.mini-progress {
  grid-row: 2; grid-column: 1 / -1;
  height: 3px;
  background: var(--tint-2);
  border-radius: 999px;
  margin-top: 4px;
  cursor: pointer;
  overflow: hidden;
}
.mini-progress-fill {
  height: 100%; width: 0%;
  background: var(--red);
  transition: width 0.18s linear;
}

/* Sodass der Footer/letzte Shelf nicht unter dem Mini-Player liegt. */
body.has-mini-player main.shelves,
body.has-mini-player .lib,
body.has-mini-player .footer { padding-bottom: 160px; }
body.has-mini-player .reader-footer { bottom: 84px; }

@media (max-width: 640px) {
  .mini-player {
    grid-template-columns: 48px 1fr auto;
    padding: 8px 12px 10px; gap: 10px;
  }
  .mini-cover { width: 48px; height: 48px; }
  .mini-btn { width: 32px; height: 32px; }
  .mini-btn.mini-play { width: 36px; height: 36px; }
  /* Auf Phone: Vor/Zurück + Queue versteckt, nur Play + Schließen bleiben. */
  .mini-btn[id="miniPrev"], .mini-btn[id="miniQueue"] { display: none; }
}

/* ============================================================
   QUEUE DRAWER — slide-in von rechts (Spotify-Pattern)
   Zeigt aktuelles Item + nachfolgende Queue-Items mit Reorder/Remove.
   ============================================================ */
.queue-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  z-index: 135;
  background: var(--bg);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
  display: none; flex-direction: column;
  animation: queueSlideIn 0.22s ease;
}
@keyframes queueSlideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.queue-drawer[aria-hidden="false"] { display: flex; }
.queue-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.queue-head h3 { margin: 0; font-family: var(--display); font-size: 1.2rem; font-weight: 700; }
.queue-drawer .icon-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text);
}
.queue-drawer .icon-btn:hover { background: var(--surface-2); }
.queue-drawer .icon-btn svg { width: 16px; height: 16px; }
.queue-current-head, .queue-next-head {
  padding: 14px 20px 6px;
  font-size: 11px; font-weight: 700;
  color: var(--muted);
}
.queue-current { padding: 0 12px 8px; }
.queue-list {
  flex: 1; overflow-y: auto;
  padding: 0 12px 24px;
}
.queue-item {
  display: grid; grid-template-columns: 44px 1fr auto;
  align-items: center; gap: 12px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
}
.queue-item:hover { background: var(--tint-1); }
.queue-item.is-active { background: var(--accent-soft); }
.queue-item .q-cover {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.queue-item .q-cover img { width: 100%; height: 100%; object-fit: cover; }
.queue-item .q-meta { min-width: 0; }
.queue-item .q-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item.is-active .q-title { color: var(--accent); }
.queue-item .q-sub {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.queue-item .q-remove {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: transparent; color: var(--muted);
  border: 0; cursor: pointer;
  opacity: 0; transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.queue-item:hover .q-remove,
.queue-item:focus-within .q-remove { opacity: 1; }
.queue-item .q-remove:hover { background: var(--danger-soft); color: var(--danger); }
.queue-empty {
  padding: 32px 20px; text-align: center; color: var(--muted); font-size: 14px;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--tint-2); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--tint-3); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .overlay-body { grid-template-columns: 1fr; gap: 24px; padding: 24px 28px 32px; }
  .overlay-hero-inner { padding: 24px 28px; }
  .audio-stage { grid-template-columns: 1fr; gap: 32px; padding: 16px 28px 40px; min-height: 0; max-width: 720px; text-align: left; }
  .audio-cover { width: 100%; max-width: 380px; margin: 0 auto; }
  .audio-info { max-width: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .shelves { padding: 0 18px 60px; gap: 44px; }
  .shelves.is-rails { padding: 0 0 60px; }
  .shelf-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .shelf-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card-title { font-size: 15px; }
  .card-tagline { display: none; }
  .footer { padding: 40px 18px 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 12px; }
  .overlay { padding: 0; }
  .overlay-card { border-radius: 18px 18px 0 0; max-height: 92vh; overflow-y: auto; margin: 8vh 0 0; width: 100%; }
  /* Kopf waechst mit dem Inhalt: Titel, Tagline und Knoepfe stehen im Fluss unter
     dem Bildbereich statt absolut am unteren Rand (sonst ragt der Titel oben heraus). */
  .overlay-hero { aspect-ratio: auto; min-height: 0; }
  .overlay-hero-inner { position: relative; padding: 46vw 20px 22px; }
  .overlay-hero-inner h2 { font-size: 28px; }
  .overlay-actions { gap: 8px; }
  .overlay-actions .btn-primary { flex: 1 0 100%; justify-content: center; }
  /* Nebenknoepfe nur mit Symbol; die Beschriftung bleibt fuer Screenreader. */
  .overlay-actions .btn-ghost,
  .overlay-actions .btn-icon { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .overlay-actions .btn-ghost span,
  .lib-topbar .reader-tool span {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  .lib-topbar { gap: 10px; }
  .lib-topbar .reader-tool { flex: none; width: 40px; padding: 0; justify-content: center; }
  /* Platz unter der letzten Karte, damit der Feedback-Knopf Abmelden nicht verdeckt. */
  .pref-grid { grid-template-columns: minmax(0, 1fr); padding-bottom: 88px; }
  .pref-row .value { min-width: 0; overflow-wrap: anywhere; text-align: right; }
  .overlay-body { padding: 18px 20px; gap: 20px; }
  .cast-strip { margin: 0 20px 26px; }
  .player-topbar { padding: 14px 16px; }
  .player-controls { padding: 14px 16px 20px; }
  .player-row { flex-direction: column; gap: 12px; align-items: stretch; }
  /* Audio-Player mobile: Topbar weniger Padding, Stage knapper. */
  .audio-topbar { padding: 14px 18px; }
  .audio-stage { padding: 8px 18px 36px; gap: 24px; }
}

/* Schmale Phones (≤480px): 7 Audio-Controls passen mit 48px-Buttons + 12px
   Gap nicht in <410px. Buttons + Gap einkürzen, Play bleibt prominent.    */
@media (max-width: 480px) {
  .audio-controls { gap: 4px; justify-content: space-between; }
  .audio-btn { width: 44px; height: 44px; }
  .audio-btn svg { width: 16px; height: 16px; }
  .audio-btn.play { width: 56px; height: 56px; }
  .audio-btn.play svg { width: 22px; height: 22px; }
  .audio-info .kicker { margin-bottom: 10px; }
  .audio-info h2 { font-size: clamp(28px, 7vw, 36px); }
  .audio-info .by { margin-bottom: 18px; }
  .audio-info .desc { margin-bottom: 22px; }
  .audio-cover { max-width: 320px; }
  /* Repeat-Badge auf kleineren Buttons leicht versetzt. */
  .audio-btn[data-mode="one"]::after { top: 6px; right: 8px; }
  .player-row .group { justify-content: center; flex-wrap: wrap; }
  .ep-panel { width: 100%; }
}

@supports (padding: max(0px)) {
  .player-controls, .reader-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

/* Container-Detail: Trackliste (Alben, Podcasts, Hörbücher) */
.overlay-parent { margin: 8px 0 0; color: var(--muted); font-size: 0.9rem; }
.overlay-parent-link { color: inherit; text-decoration: underline; }
.episode-list .child-head { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 24px 12px; }
.episode-list .child-list { display: grid; gap: 2px; padding: 0 24px 24px; }
.child-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px 12px;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; outline: none;
}
.child-row:hover { background: var(--tint-1); }
.child-row:focus-visible { background: var(--tint-2); box-shadow: inset 0 0 0 2px var(--accent); }
.child-row.is-active { background: var(--accent-soft); }
.child-row.is-active .child-title, .child-row.is-active .child-num { color: var(--accent); }
.child-num { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-size: 0.9rem; }
.child-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.child-dur { color: var(--muted); font-size: 0.85rem; }
.child-play {
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent;
  color: inherit; display: grid; place-items: center; cursor: pointer;
}
.child-play svg { width: 18px; height: 18px; }
.child-play:hover { background: var(--tint-3); }

/* ============================================================
   PROFILE (Provider): Profilseite /p/:slug, Verzeichnis, Folgen
   ============================================================ */
body.is-profile-page .hero,
body.is-profile-page .chip-row,
body.is-kids-page .hero,
body.is-kids-page .chip-row { display: none !important; }

.prov-link { color: inherit; text-decoration: none; }
.prov-link:hover, .prov-link:focus-visible { text-decoration: underline; color: var(--text); }
.overlay-provider { margin: 10px 0 0; color: var(--muted); font-size: 0.95rem; }

/* "Von <Profil>" im Detail-Overlay: Chip mit Avatar, Ziel /p/:slug */
.prov-by-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  min-height: 36px; padding: 4px 14px 4px 4px;
  border-radius: 999px; background: var(--tint-2); border: 1px solid var(--line);
  color: var(--text); font-size: 14px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.prov-by-chip:hover, .prov-by-chip:focus-visible { border-color: var(--line-strong); background: var(--tint-3); }
.prov-by-label { color: var(--muted); }
.prov-by-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.prov-by-chip .prov-verified { margin-left: 0; }

.prov-avatar {
  position: relative; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  color: var(--accent-ink); font-family: var(--display); font-weight: 700;
  border: 1px solid var(--line-strong);
}
.prov-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prov-avatar-xs { width: 28px; height: 28px; font-size: 11px; }
.prov-avatar-sm { width: 32px; height: 32px; font-size: 13px; }
.prov-avatar-lg { width: 84px; height: 84px; font-size: 28px; }

.prov-verified { display: inline-flex; vertical-align: middle; margin-left: 8px; color: var(--secondary); }
.prov-verified svg { width: 0.7em; height: 0.7em; min-width: 16px; min-height: 16px; }

/* Verzeichnis /kuenstler: Karten mit Cover-Streifen, Avatar darauf */
.prov-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.prov-card {
  --prov-accent: var(--line-strong);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 0 12px 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.prov-card:hover, .prov-card:focus-visible { border-color: var(--prov-accent); transform: translateY(-2px); }
.prov-card-cover { position: relative; align-self: stretch; height: 88px; margin: 0 -12px; overflow: hidden; }
.prov-card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prov-card .prov-avatar-lg { margin-top: -42px; border: 3px solid var(--surface); }
.prov-card-name { font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere; }
.prov-card-name .prov-verified { margin-left: 4px; }
.prov-card-type, .prov-card-count { font-size: 12.5px; color: var(--muted); }
.prov-more-head {
  font-family: var(--display); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px);
  margin: 0; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}

/* Profilseite /p/:slug. Akzentfarbe des Profils kommt als Custom Property vom Seitenknoten:
   --prov-accent (Flaeche), --prov-accent-ink (Schrift darauf, AA), --prov-accent-text (Akzent auf dem Seitengrund, AA). */
.prov-page {
  --prov-accent: var(--accent);
  --prov-accent-ink: var(--accent-ink);
  --prov-accent-text: var(--text);
  --rail-gutter: 0px;
  display: block;
  /* Grid-Kind von .shelves: ohne min-width 0 machen die scrollenden Rails die Seite breiter als das Fenster. */
  min-width: 0;
}
.prov-panel, .prov-tabs, .prov-head > * { min-width: 0; max-width: 100%; }
.prov-icon { display: inline-flex; flex: none; }
.prov-icon svg { width: 18px; height: 18px; }

/* Banner nur mit echtem Titelbild (flach); der Avatar ragt hinein. Ohne Bild gibt es keinen Banner. */
.prov-cover {
  position: relative; height: clamp(120px, 17vw, 220px);
  border-radius: var(--radius-lg); overflow: hidden;
}
.prov-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prov-page.has-accent .prov-cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--prov-accent); }

/* Kopf im Instagram-Muster. Breit: Avatar links, rechts Name + Aktionen, Zaehler, Text. */
.prov-head {
  display: grid; grid-template-columns: 150px minmax(0, 1fr);
  grid-template-areas: "avatar top" "avatar stats" "avatar about" "avatar create";
  column-gap: clamp(24px, 5vw, 64px); align-items: start;
  max-width: 960px; margin: 0 auto; padding: 28px clamp(12px, 2.4vw, 32px) 0;
}
.prov-page.has-cover .prov-head { padding-top: 14px; }
.prov-head > .prov-avatar-xl { grid-area: avatar; justify-self: center; }
.prov-avatar-xl { width: 150px; height: 150px; font-size: 48px; border-width: 3px; }
.prov-page.has-accent .prov-avatar-xl { border-color: var(--prov-accent); }
.prov-page.has-cover .prov-avatar-xl { margin-top: -75px; border-color: var(--bg); box-shadow: var(--shadow-card); }
.prov-top { grid-area: top; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }
.prov-name {
  display: inline-flex; align-items: center; flex-wrap: wrap; max-width: 100%;
  font-family: var(--display); font-weight: 700; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em;
  margin: 0; overflow-wrap: anywhere;
}
.prov-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.prov-actions .btn { height: 38px; padding: 0 18px; font-size: 14px; gap: 8px; }
.prov-actions .prov-share { width: 38px; padding: 0; }
.prov-page .prov-follow.btn-primary, .prov-page .prov-edit.btn-primary, .prov-page .prov-empty-btn.btn-primary { background: var(--prov-accent); color: var(--prov-accent-ink); }
.prov-page .prov-follow.btn-primary:hover, .prov-page .prov-edit.btn-primary:hover, .prov-page .prov-empty-btn.btn-primary:hover { background: var(--prov-accent); filter: brightness(1.08); }
.prov-follow[disabled], .prov-play-all[disabled] { opacity: 0.6; cursor: default; }
.prov-page .btn:focus-visible, .prov-page .prov-bio-more:focus-visible, .prov-stat-in:focus-visible { outline: 2px solid var(--prov-accent-text); outline-offset: 2px; }

/* Zaehler: fette Zahl, Beschriftung daneben (am Handy untereinander in Spalten). */
.prov-stats { grid-area: stats; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 36px; margin: 18px 0 0; padding: 0; font-size: 16px; }
.prov-stat-in { display: inline; padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: inherit; border-radius: 4px; }
button.prov-stat-in { cursor: pointer; }
button.prov-stat-in:hover .prov-stat-label { text-decoration: underline; }
.prov-stat-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.prov-stat-label { color: var(--text); }

.prov-about { grid-area: about; margin-top: 16px; display: grid; gap: 6px; justify-items: start; min-width: 0; }
.prov-about > * { max-width: 100%; margin: 0; }
.prov-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.prov-page.has-accent .prov-meta > span:first-child { color: var(--prov-accent-text); }
.prov-dot { color: var(--muted-2); }
.prov-tagline { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.prov-bio-text {
  white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: 15px; margin: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.prov-bio.is-open .prov-bio-text { display: block; -webkit-line-clamp: unset; overflow: visible; }
.prov-bio-more { min-height: 32px; padding: 0; background: none; border: 0; font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); border-radius: 4px; cursor: pointer; }
.prov-bio-more:hover { color: var(--text); }
.prov-bio-more[hidden] { display: none; }

.prov-links { display: flex; flex-wrap: wrap; gap: 10px; }
.prov-head .prov-links { gap: 8px; margin-top: 6px; }
.prov-link-btn { height: 40px; padding: 0 16px 0 12px; gap: 8px; font-size: 14px; }
.prov-head .prov-link-btn { height: 32px; padding: 0 12px 0 9px; gap: 6px; font-size: 13px; border-radius: 999px; }
.prov-link-icon { display: inline-flex; width: 18px; height: 18px; color: var(--prov-accent-text); }
.prov-link-icon svg { width: 18px; height: 18px; }
.prov-head .prov-link-icon, .prov-head .prov-link-icon svg { width: 16px; height: 16px; }
.prov-link-label { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* Linktree-Knoepfe (freie Links des Profils): etwas kraeftiger als die festen Felder, auf dem Handy volle Breite. */
.prov-link-free { font-weight: 600; border-color: var(--line-strong); }
@media (max-width: 599px) {
  .prov-links .prov-link-free { flex: 1 1 100%; justify-content: center; }
  .prov-links .prov-link-free .prov-link-label { max-width: none; }
}

/* Schnellwege fuer Mitglieder */
.prov-create { grid-area: create; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.prov-create .btn { height: 36px; padding: 0 14px; font-size: 13.5px; gap: 6px; }

/* Reiter: haften unter der Kopfleiste der Seite (--header-h), aktiv in Akzentfarbe. */
.prov-tabs {
  position: sticky; top: var(--header-h); z-index: 20; scroll-margin-top: var(--header-h);
  display: flex; justify-content: safe center; gap: 4px; margin: 28px 0;
  background: var(--bar-bg-strong); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.prov-tabs::-webkit-scrollbar { display: none; }
.prov-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  min-height: 48px; padding: 0 22px; font-weight: 600; font-size: 14px; letter-spacing: 0.02em; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.prov-tab-icon { display: inline-flex; flex: none; }
.prov-tab-icon svg { width: 20px; height: 20px; }
.prov-tab:hover { color: var(--text); }
.prov-tab.active { color: var(--text); border-bottom-color: var(--prov-accent-text); }
.prov-tab.active .prov-tab-icon { color: var(--prov-accent-text); }
.prov-tab:focus-visible { outline: 2px solid var(--prov-accent-text); outline-offset: -3px; border-radius: 4px; }
.prov-tab-count {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; font-size: 12px;
  background: var(--tint-2); color: var(--text);
}
.prov-panel { display: grid; gap: clamp(32px, 4vw, 56px); }
.prov-content { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.prov-content .shelf--rail { min-width: 0; }

/* Leerzustand fuer Mitglieder: Karte mit Handlungsaufforderung */
.prov-empty {
  display: grid; justify-items: center; gap: 10px; text-align: center; box-sizing: border-box;
  width: 100%; max-width: 560px; margin: 0 auto; padding: clamp(28px, 5vw, 52px) 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
}
.prov-empty-icon { display: flex; flex: none; width: 64px; height: 64px; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--line-strong); color: var(--prov-accent-text); }
.prov-empty-icon svg { width: 30px; height: 30px; }
.prov-empty-title { margin: 6px 0 0; font-size: 20px; font-weight: 700; }
.prov-empty-text { margin: 0; max-width: 42ch; color: var(--muted); line-height: 1.5; }
.prov-empty .prov-empty-btn, .prov-empty .prov-gallery-add { margin-top: 8px; }
.prov-empty .prov-gallery-add { justify-content: center; }

/* Bilder: Raster mit Vorschaubildern, Klick oeffnet die Lightbox */
.prov-gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.prov-gallery-cell { min-width: 0; }
.prov-gallery-item {
  display: block; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  border-radius: var(--radius-md); background: var(--surface-2);
}
.prov-gallery-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.prov-gallery-item:hover img { transform: scale(1.03); }
.prov-gallery-item:focus-visible { outline: 3px solid var(--prov-accent-text); outline-offset: 2px; }
.prov-gallery-item.is-broken { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.prov-gallery-caption {
  margin: 8px 2px 0; font-size: 13px; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Alben: je Album ein Abschnitt mit Ueberschrift; Bilder ohne Album unter "Allgemein" */
.prov-panel > .prov-album { min-width: 0; }
.prov-album-head { margin: 0 0 12px; font-size: 18px; font-weight: 700; display: flex; align-items: baseline; gap: 10px; overflow-wrap: anywhere; }
.prov-album-count { font-size: 13px; font-weight: 500; color: var(--muted); }
.prov-gallery-add { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.prov-gallery-add-btn { min-height: 40px; }
.prov-gallery-add-note { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
/* Melden: bewusst schlicht, kein Knopf-Look */
.report-link {
  background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.report-link:hover, .report-link:focus-visible { color: var(--text); }
.overlay-report { margin: 12px 0 0; }
.prov-report-row { margin: 8px 0 0; text-align: left; }

.prov-lightbox {
  --prov-accent-text: var(--text);
  position: fixed; inset: 0; z-index: 400;
  display: grid; place-items: center; padding: 56px 72px;
  background: rgba(5,5,7,0.94);
}
.prov-lightbox[hidden] { display: none; }
body.prov-lb-open { overflow: hidden; }
.prov-lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.prov-lb-img { display: block; max-width: min(1280px, 100%); max-height: calc(100vh - 170px); object-fit: contain; border-radius: var(--radius-md); }
.prov-lb-caption { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; text-align: center; font-size: 14.5px; color: var(--text); max-width: 760px; }
.prov-lb-counter { color: var(--muted); font-variant-numeric: tabular-nums; }
.prov-lb-btn {
  position: absolute; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(244,244,245,0.12); color: #fff;
}
.prov-lb-btn:hover { background: rgba(244,244,245,0.22); }
.prov-lb-btn:focus-visible { outline: 3px solid var(--prov-accent-text); outline-offset: 2px; }
.prov-lb-btn[hidden] { display: none; }
.prov-lb-btn svg { width: 24px; height: 24px; }
.prov-lb-close { top: 16px; right: 16px; }
.prov-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.prov-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

.prov-posts { display: grid; gap: 14px; max-width: 760px; }
.prov-post { padding: 18px 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.prov-page.has-accent .prov-post { border-left: 3px solid var(--prov-accent); }
.prov-post-date { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.prov-post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.prov-post-title { display: inline-block; margin-top: 12px; color: var(--prov-accent-text); font-weight: 600; }
.prov-post-title:hover { text-decoration: underline; }

.prov-info-panel { max-width: 760px; display: grid; gap: 22px; }
.prov-desc { margin: 0; white-space: pre-wrap; line-height: 1.65; overflow-wrap: anywhere; font-size: 16px; }
.prov-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 0; }
.prov-fact { padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.prov-fact dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.prov-fact dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.prov-info-head { margin: 0; font-size: 18px; font-weight: 700; }
.prov-location { margin: 0; color: var(--muted); }

.follows-section { margin-bottom: 28px; }
.follows-title { font-family: var(--display); font-size: 20px; margin: 0 0 14px; }
.follows-list { display: flex; flex-wrap: wrap; gap: 10px; }
.prov-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
}
.prov-chip:hover, .prov-chip:focus-visible { border-color: var(--accent); }
.prov-chip-name { font-size: 14px; font-weight: 600; }

/* Mobil (unter 900 px): Galerie zweispaltig */
@media (max-width: 899px) {
  .prov-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .prov-gallery-caption { font-size: 12.5px; }
  .prov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .prov-lightbox { padding: 64px 12px 84px; background: #050507; } /* am Handy deckend: die Tab-Leiste schien durch */
  .prov-lb-img { max-height: calc(100vh - 200px); border-radius: 6px; }
  .prov-lb-prev, .prov-lb-next { top: auto; bottom: 16px; transform: none; }
  .prov-lb-prev { left: calc(50% - 64px); }
  .prov-lb-next { right: calc(50% - 64px); }
}
/* Handy (bis 640 px): Avatar links, Zaehler als Spalten rechts; darunter Name, Text, Aktionen ueber die volle Breite. */
@media (max-width: 640px) {
  .prov-cover { height: 120px; border-radius: var(--radius-md); }
  .prov-head {
    grid-template-columns: 84px minmax(0, 1fr);
    grid-template-areas: "avatar stats" "name name" "about about" "actions actions" "create create";
    column-gap: 16px; padding: 16px 0 0;
  }
  .prov-page.has-cover .prov-head { padding-top: 0; }
  .prov-avatar-xl { width: 84px; height: 84px; font-size: 28px; border-width: 2px; }
  .prov-page.has-cover .prov-avatar-xl { margin-top: -42px; border-width: 3px; }
  .prov-top { display: contents; }
  .prov-name { grid-area: name; font-size: 20px; margin-top: 12px; }
  .prov-actions { grid-area: actions; margin-top: 16px; flex-wrap: nowrap; }
  .prov-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 8px; gap: 6px; font-size: 13.5px; height: 40px; }
  .prov-actions .prov-share { flex: 0 0 44px; }
  .prov-actions .btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .prov-stats { margin: 0; align-self: center; flex-wrap: nowrap; gap: 4px; justify-content: space-around; text-align: center; }
  .prov-stat { flex: 1 1 auto; min-width: 0; }
  .prov-stat-in { display: flex; flex-direction: column; align-items: center; font-size: 12px; line-height: 1.3; overflow-wrap: normal; }
  .prov-stat-num { font-size: 17px; }
  .prov-about { margin-top: 8px; }
  .prov-create { gap: 6px; }
  .prov-create .btn { flex: 1 1 auto; padding: 0 10px; font-size: 13px; }
  /* Leiste bis an die Raender: darunter scrollender Inhalt schimmert nicht seitlich neben ihr durch. */
  .prov-tabs { margin: 18px 0 22px; justify-content: stretch; box-shadow: 0 0 0 100vmax var(--bar-bg-strong); clip-path: inset(0 -100vmax); }
  .prov-tab { flex: 1 1 0; min-width: 0; padding: 0 6px; gap: 6px; font-size: 13px; letter-spacing: 0; }
  .prov-tab-count { display: none; }
}
@media (display-mode: standalone) {
  .prov-tabs { top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); scroll-margin-top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .prov-gallery-item img, .prov-card { transition: none; }
}


/* ============================================================
   E-BOOK-READER (foliate-js / PDF.js): Host, Laden, Inhaltsverzeichnis
   ============================================================ */
.reader-host[hidden], .reader-loading[hidden], .reader-toc[hidden], .page[hidden] { display: none !important; }
body { --rd-bg: #f4ede0; --rd-fg: #1c160a; }
body[data-reader-theme="cream"] { --rd-bg: #ecdfc6; --rd-fg: #2b2210; }
body[data-reader-theme="dark"]  { --rd-bg: #1a1a1a; --rd-fg: #e6e1d4; }
.reader-host {
  position: absolute; inset: 0;
  background: var(--rd-bg); color: var(--rd-fg);
}
.reader-foliate { display: block; width: 100%; height: 100%; }
.reader-pdf { height: 100%; overflow: auto; display: grid; justify-items: center; align-items: start; align-content: start; align-content: safe center; padding: 12px 0 24px; -webkit-overflow-scrolling: touch; }
.reader-pdf-canvas { background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,0.25); max-width: 100%; }
body[data-reader-theme="cream"] .reader-pdf-canvas { filter: sepia(0.35); }
body[data-reader-theme="dark"] .reader-pdf-canvas { filter: invert(0.9) hue-rotate(180deg); }
.reader-loading {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px;
  color: rgba(255,255,255,0.8); font-size: 14px; text-align: center; padding: 24px;
}
.reader-loading-bar { width: min(280px, 70vw); height: 4px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.reader-loading-bar > span { display: block; height: 100%; width: 0; background: var(--red); transition: width 0.2s ease; }
.reader-toc {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); z-index: 6;
  overflow-y: auto; padding: 18px 16px 28px;
  background: rgba(11,11,13,0.97); border-left: 1px solid var(--line);
  color: rgba(255,255,255,0.88);
}
.reader-toc h3 { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.reader-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.reader-toc-item { width: 100%; text-align: left; padding: 9px 10px; border-radius: 6px; background: transparent; color: inherit; font-size: 14px; line-height: 1.35; cursor: pointer; border: 0; }
.reader-toc-item:hover, .reader-toc-item:focus-visible { background: rgba(255,255,255,0.08); }
@media (max-width: 720px) {
  .reader-topbar { padding: 10px 14px; gap: 8px; flex-wrap: wrap; }
  .reader-footer { grid-template-columns: 1fr; gap: 10px; padding: 10px 16px; }
  .reader-nav { justify-content: space-between; }
}

/* ============================================================
   KINDERBEREICH: /kinder, Badge auf Karten, Rail-Link
   ============================================================ */
.card-kids-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3; pointer-events: none;
  padding: 3px 9px; border-radius: 999px;
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  background: #ffd23f; color: #2a1a00;
}
.shelf-more { font-size: 14px; font-weight: 600; color: var(--link); text-decoration: none; white-space: nowrap; }
.shelf-more:hover, .shelf-more:focus-visible { text-decoration: underline; }
.child-head .child-label { flex: 1 0 100%; margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }

.kids-page { display: grid; gap: clamp(28px, 4vw, 48px); padding-top: 18px; }
.kids-hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  padding: clamp(24px, 4vw, 44px);
  border-radius: 36px;
  background: linear-gradient(135deg, #ffd23f 0%, #ff8a5c 55%, #ff5d8f 100%);
  color: #2a1a00;
}
.kids-title { margin: 0 0 8px; font-family: var(--display); font-weight: 800; font-size: clamp(40px, 7vw, 76px); line-height: 1; letter-spacing: -0.01em; }
.kids-sub { margin: 0; font-size: clamp(17px, 2.2vw, 22px); font-weight: 600; max-width: 28ch; }
.kids-featured { width: clamp(150px, 20vw, 230px); }
.kids-body { display: grid; gap: clamp(28px, 4vw, 44px); }
.kids-row-title { margin: 0 0 16px; font-family: var(--display); font-weight: 800; font-size: clamp(26px, 3.4vw, 38px); color: var(--text); }
.kids-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: clamp(14px, 2vw, 24px); }
.kids-empty { color: var(--muted); font-size: 18px; text-align: center; padding: 32px 0; }
.kid-tile {
  display: grid; gap: 8px; text-align: left; padding: 10px 10px 14px;
  border: 0; border-radius: 28px; cursor: pointer;
  background: var(--surface-2, rgba(255,255,255,0.06)); color: var(--text);
  transition: transform 0.15s ease, background 0.15s ease;
}
.kid-tile:hover, .kid-tile:focus-visible { transform: translateY(-3px) scale(1.02); background: var(--surface, rgba(255,255,255,0.1)); }
.kid-tile:focus-visible { outline: 3px solid #ffd23f; outline-offset: 2px; }
.kid-art { position: relative; aspect-ratio: 1 / 1; border-radius: 22px; overflow: hidden; }
.kid-art .poster-art, .kid-art .poster-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.kid-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kid-title { padding: 0 6px; font-size: clamp(17px, 2vw, 20px); font-weight: 800; line-height: 1.2; }
.kid-kind { padding: 0 6px; font-size: 13px; color: var(--muted); }
.kid-tile--big { background: rgba(255,255,255,0.35); color: #2a1a00; }
.kid-tile--big .kid-kind { color: rgba(42,26,0,0.7); }
@media (max-width: 720px) {
  .kids-hero { grid-template-columns: 1fr; border-radius: 28px; }
  .kids-featured { width: 100%; max-width: 220px; }
  .kids-grid { grid-template-columns: repeat(2, 1fr); }
  .kid-tile { border-radius: 24px; }
}

/* ============================================================
   SPIELE — Karten 16:9 mit Play-Symbol, Spiel-Player (iframe)
   ============================================================ */
.card[data-kind="game"] .card-poster { aspect-ratio: 16 / 9; }
.card[data-kind="game"] .card-poster::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
  border-radius: 50%; pointer-events: none; z-index: 2;
  background: rgba(0,0,0,0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 6.5v11l9-5.5z'/%3E%3C/svg%3E") center / 60% no-repeat;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4); transition: transform 0.15s ease, background-color 0.15s ease;
}
.card[data-kind="game"]:hover .card-poster::after { transform: scale(1.1); background-color: var(--accent-deep, rgba(0,0,0,0.8)); }
.shelf--games .shelf-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
body.is-games-page .hero,
body.is-games-page .chip-row { display: none !important; }
.games-head { margin: 0 0 24px; }
.games-title { margin: 0 0 6px; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 56px); line-height: 1.05; }
.games-sub { margin: 0; color: var(--muted); font-size: 16px; }
.games-body { display: grid; gap: clamp(24px, 4vw, 40px); }
.games-empty { color: var(--muted); text-align: center; padding: 32px 0; }
.kid-tile--game .kid-art { aspect-ratio: 16 / 9; }
.kids-grid--games { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.game-player { position: fixed; inset: 0; z-index: 112; display: none; flex-direction: column; background: #0d0c0b; height: 100vh; height: 100dvh; }
.game-player.open { display: flex; }
.game-topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.game-topbar .spacer { flex: 1; }
.game-title { margin: 0; font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.game-frame { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #000; display: block; }
.game-note { flex: 0 0 auto; margin: 0; padding: 6px 16px; font-size: 12px; color: var(--muted); text-align: center; }
@media (max-width: 720px) {
  .game-topbar { padding: 8px 10px; gap: 6px; }
  .game-title { font-size: 14px; }
  .game-topbar .reader-tool { height: 34px; padding: 0 9px; font-size: 12px; }
  .game-frame { height: calc(100dvh - 52px); }
  .game-note { display: none; }
  .shelf--games .shelf-grid, .kids-grid--games { grid-template-columns: 1fr; }
}

/* ---- Abo / Kauf ---- */
body.is-abo-page .hero,
body.is-abo-page .chip-row { display: none !important; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin-bottom: clamp(28px, 4vw, 48px); }
.plan-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.plan-name { margin: 0; font-family: var(--display); font-weight: 800; font-size: 22px; }
.plan-desc { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.plan-price { margin: 0; font-size: 28px; font-weight: 800; }
.plan-interval { font-size: 14px; font-weight: 500; color: var(--muted); }
.plan-card .btn { justify-content: center; }
.access-section { display: grid; gap: 14px; }
.access-body { display: grid; gap: 14px; justify-items: start; }
.access-note { margin: 0; color: var(--muted); font-size: 14px; }
.access-note--warn { color: var(--danger); }
.access-group-title { margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.access-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; }
.detail-offers { display: grid; gap: 10px; margin-top: 14px; }
.detail-offer { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.detail-offer-price { font-weight: 700; }
.detail-offers-note { margin: 0; color: var(--muted); font-size: 14px; }

/* ---- Dialoge (Galerie "Bilder hinzufuegen", Melden, Profil beanspruchen; datingDialog in app.js) ---- */
/* Die Kennenlern-Oberflaeche selbst ist die eigenstaendige App unter /jank-hanka (apps/jankhanka). */
.dt-sub { margin: 0 0 8px; font-family: var(--display); font-size: 20px; }
.dt-form { display: grid; gap: 16px; }
.dt-field { display: grid; gap: 6px; }
.dt-label { font-size: 13px; font-weight: 600; }
.dt-input { width: 100%; box-sizing: border-box; padding: 11px 12px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: rgba(0,0,0,.28); color: var(--text); font: inherit; font-size: 16px; }
.dt-input:focus-visible { outline: 2px solid var(--dt-glow, #f0a07a); outline-offset: 2px; }
.dt-textarea { resize: vertical; min-height: 100px; }
.dt-dialog-back { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.7); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.dt-dialog { width: min(440px, 100%); max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); padding: 20px; display: grid; gap: 14px; }
.dt-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* App-Vorstellung im Detail-Fenster (Titel mit Beispielbildern, docs/APP-VORSTELLUNG.md): waagerechte Bildreihe unter den
   Knoepfen. Seitenverhaeltnis immer erhalten: feste Hoehe, Breite aus den echten Massen (aspect-ratio am Bild),
   object-fit: contain; nie eine feste Hoehe mit 100 % Breite. Nur Tokens aus dem Bestand (hell und dunkel). */
.overlay-shots { padding: 18px 40px 0; }
.overlay-shots[hidden] { display: none; }
.shots-row { --shot-h: 300px; list-style: none; display: flex; gap: 14px; margin: 0; padding: 4px 0 14px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.shot { flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; }
.shot-btn { display: block; padding: 0; border: 0; background: none; border-radius: var(--radius-md); overflow: hidden; cursor: zoom-in; line-height: 0; }
.shot-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.shot-img { display: block; height: var(--shot-h); width: auto; max-width: min(520px, 82vw); object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-md); box-sizing: border-box; }
.shots-note { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
#overlayDesc.is-pre { white-space: pre-line; }
.shot-caption { margin: 0; width: 0; min-width: 100%; color: var(--muted); font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .overlay-shots { padding: 16px 28px 0; }
  .shots-row { --shot-h: 240px; }
}

/* ============================================================
   LIVESTREAMS (/live, /live/:slug) -- Vertrag docs/API-LIVE.md
   ============================================================ */
body.is-live-page .hero,
body.is-live-page .chip-row { display: none !important; }
.primary-nav button[hidden] { display: none; }
.primary-nav button.nav-live { display: inline-flex; align-items: center; gap: 6px; }
.primary-nav button.nav-live[hidden] { display: none; }
.nav-live-dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.primary-nav button.nav-live.is-live .nav-live-dot { display: inline-block; animation: live-pulse 1.4s ease-in-out infinite; }

.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--sans); font-size: 11px; font-weight: 800; line-height: 1.4;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); animation: live-pulse 1.4s ease-in-out infinite; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.live-page { display: grid; gap: clamp(20px, 3vw, 36px); padding-top: 18px; min-width: 0; }
.live-page-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(32px, 5vw, 56px); line-height: 1.05; }
.live-body { display: grid; gap: clamp(24px, 4vw, 44px); min-width: 0; }
.live-section-title { margin: 0 0 14px; font-family: var(--display); font-weight: 800; font-size: clamp(22px, 3vw, 30px); }
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: clamp(14px, 2vw, 22px); }
.live-empty { padding: 28px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); text-align: center; }
.live-empty-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--text); }
.live-empty-hint { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.live-card { display: grid; gap: 8px; min-width: 0; }
.live-card-main { display: grid; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
.live-card-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.live-card-thumb img, .live-stage-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.live-card-thumb .live-badge { position: absolute; top: 10px; left: 10px; }
.live-card-main:hover .live-card-title, .live-card-main:focus-visible .live-card-title { text-decoration: underline; }
.live-card-title { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.live-card-meta { margin: 0; color: var(--muted); font-size: 13px; }
.live-card-in { color: var(--text); font-weight: 600; }
.live-card-action { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.live-card-action.is-muted { color: var(--muted); font-weight: 500; }
a.live-card-action:hover { text-decoration: underline; }

.live-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 2px; color: var(--muted); font-size: 14px; text-decoration: none; justify-self: start; }
.live-back:hover { color: var(--text); }
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.live-main { display: grid; gap: 14px; min-width: 0; }
.live-head { display: grid; gap: 10px; }
.live-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(24px, 3.4vw, 38px); line-height: 1.1; overflow-wrap: anywhere; }
.live-statusrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.live-status { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
.live-viewers { color: var(--muted); font-size: 14px; }
.live-provider { color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.live-provider:hover { text-decoration: underline; }
.live-share { height: 38px; padding: 0 16px; }
.live-desc { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

.live-stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  /* Querformat am Handy: nie hoeher als der sichtbare Bereich (Video passt sich per contain ein). */
  max-height: calc(100svh - var(--header-h) - 24px);
  background: #000; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  overflow: hidden;
}
.live-stage:fullscreen { max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; }
.live-stage:-webkit-full-screen { max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; }
/* Nur fuer Screenreader (Signalverlust-Ansage) */
.live-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Eigener Vollbild-Knopf: Buehne samt Tonspurwahl im Vollbild */
.live-fs {
  position: absolute; z-index: 3; right: 12px; bottom: 56px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 6px; background: rgba(11,11,13,0.72); color: #fff; border: 1px solid rgba(244,244,245,0.18);
}
.live-fs:hover { background: rgba(11,11,13,0.9); }
.live-fs svg { width: 20px; height: 20px; }
/* Chrome zeigt bei controlslist="nofullscreen" ein ausgegrautes Vollbild-Symbol; der eigene Knopf ersetzt es. */
.live-stage .live-video[controlslist~="nofullscreen"]::-webkit-media-controls-fullscreen-button { display: none; }
.live-video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.live-stage-bg { position: absolute; inset: 0; opacity: 0.55; }
.live-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 16px; text-align: center; background: rgba(8,9,12,0.5);
}
.live-overlay--lost { background: rgba(8,9,12,0.72); }
.live-overlay[hidden] { display: none; }
.live-overlay-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(18px, 3vw, 28px); color: var(--text); overflow-wrap: anywhere; }
.live-overlay-sub { margin: 0; color: var(--text); opacity: 0.85; font-size: clamp(13px, 1.8vw, 16px); }
.live-overlay-btn { margin-top: 4px; text-decoration: none; }
.live-spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--accent); animation: live-spin 0.9s linear infinite; }
@keyframes live-spin { to { transform: rotate(360deg); } }
.live-unmute { position: absolute; z-index: 3; left: 12px; bottom: 56px; height: 38px; padding: 0 16px; }
.live-unmute[hidden] { display: none; }
/* Tonspurwahl bei mehreren Tonspuren (Dolmetscher): Chip-Pille im Sorbflix-Stil, eigener Pfeil,
   dunkle Aufklappliste, schmal genug fuer Handybreite. */
.live-lang {
  position: absolute; z-index: 3; right: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 4px 4px 4px 14px; border-radius: 999px;
  background: rgba(11,11,13,0.72); border: 1px solid rgba(244,244,245,0.18);
  color: var(--text); font-size: 13px; font-weight: 600;
}
.live-lang[hidden] { display: none; }
.live-lang-select {
  appearance: none; -webkit-appearance: none; color-scheme: dark;
  min-width: 0; max-width: 100%; min-height: 32px; padding: 0 30px 0 12px;
  border-radius: 999px; border: 1px solid rgba(244,244,245,0.3);
  background: var(--text) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230b0b0d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center / 10px 7px;
  color: var(--bg); font: inherit; font-weight: 700; text-overflow: ellipsis; cursor: pointer;
}
.live-lang-select option { background: var(--surface); color: var(--text); }
.live-lang-select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.live-countdown { display: flex; gap: clamp(8px, 2vw, 18px); }
.live-cd-cell { display: grid; gap: 2px; min-width: clamp(52px, 11vw, 84px); padding: 10px 6px; background: rgba(8,9,12,0.6); border: 1px solid var(--line-strong); border-radius: var(--radius-md); }
.live-cd-num { font-family: var(--display); font-weight: 800; font-size: clamp(24px, 5vw, 48px); line-height: 1; font-variant-numeric: tabular-nums; }
.live-cd-label { font-size: 12px; color: var(--muted); }
.live-pw-form { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(100%, 360px); }
.live-pw-input {
  flex: 1 1 160px; min-width: 0; height: 46px; padding: 0 14px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px;
  font: inherit;
}
.live-pw-error { margin: 0; min-height: 1.2em; color: var(--danger); font-size: 14px; }

.live-chat {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-md);
  height: 420px; overflow: hidden;
}
.live-chat[hidden] { display: none; }
.live-chat-title { margin: 0; padding: 12px 14px; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.live-chat-empty { margin: 0; padding: 14px; color: var(--muted); font-size: 14px; }
.live-chat-empty[hidden] { display: none; }
.live-chat-list { list-style: none; margin: 0; padding: 8px 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.live-msg { padding: 5px 0; min-width: 0; }
.live-msg-meta { display: flex; align-items: baseline; gap: 8px; }
.live-msg-name { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.live-msg-time { font-size: 11px; color: var(--muted-2); }
.live-msg-body { margin: 2px 0 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.live-chat-form { display: grid; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.live-chat-form input {
  min-width: 0; width: 100%; height: 40px; padding: 0 12px; box-sizing: border-box;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-size: 14px;
}
.live-chat-name[hidden] { display: none; }
.live-chat-line { display: flex; gap: 8px; }
.live-chat-send { height: 40px; padding: 0 16px; }
.live-chat-foot { display: flex; justify-content: space-between; gap: 8px; min-height: 1.2em; }
.live-chat-note { margin: 0; color: var(--danger); font-size: 12px; }
.live-chat-count { margin-left: auto; color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }

@media (min-width: 960px) {
  .live-layout.has-chat { grid-template-columns: minmax(0, 1fr) 340px; }
  .live-layout.has-chat .live-chat { height: auto; position: sticky; top: 80px; max-height: calc(100vh - 110px); aspect-ratio: auto; align-self: stretch; min-height: 420px; }
}
@media (max-width: 640px) {
  /* Kleiner und ohne Beschriftung (das Auswahlfeld hat sie als Label), damit das Bild frei bleibt. */
  .live-lang { padding: 3px; gap: 0; }
  .live-lang-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 480px) {
  .live-chat { height: 360px; }
  .live-unmute { bottom: 52px; }
  /* iOS Safari zoomt bei Feldern unter 16px die ganze Seite heran. */
  .live-lang-select, .live-chat-form input { font-size: 16px; }
  .live-chat-form { padding-right: 64px; } /* Platz fuer den Feedback-Knopf unten rechts */
}
@media (prefers-reduced-motion: reduce) {
  .live-dot, .nav-live-dot, .live-spinner { animation: none !important; }
}

/* ============================================================
   MOBILE (< 900px) — Kartenhero, Kategorie-Chips, Tab-Leiste
   ============================================================ */
@media (max-width: 899px) {
  :root { --rail-gutter: 16px; --header-h: 60px; }

  .topbar { gap: 8px; padding: 0 8px 0 16px; background: var(--bg); }
  body.is-home-page.has-hero .topbar { background: var(--bg); }
  .brand { gap: 8px; font-size: 20px; min-width: 0; }
  .brand-mark { width: 28px; height: 28px; font-size: 17px; }
  .brand-word { display: none; }
  .topbar { gap: 8px; }
  .brand-for { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .primary-nav, .nav-toggle, .nav-bell, .avatar { display: none; }
  .topbar-right { gap: 0; }
  .lang-toggle { order: 1; }
  .search-wrap { order: 2; position: static; }
  /* Suchfeld klappt über die Kopfzeile, das Icon bleibt zum Schließen sichtbar. */
  .topbar { position: sticky; }
  .search-wrap.open .search-field {
    position: absolute; left: 12px; right: 56px; top: 8px; width: auto; height: 44px; margin: 0; z-index: 4;
    background: var(--surface-2);
  }
  .search-wrap .nav-icon { position: relative; z-index: 5; }

  .cat-nav { display: flex; gap: 8px; padding: 1px 16px 13px; overflow-x: auto; scrollbar-width: none; }
  .cat-nav::-webkit-scrollbar { display: none; }
  .cat-nav a { flex: 0 0 auto; height: 44px; display: flex; align-items: center; }
  .cat-nav a span {
    height: 36px; padding: 0 14px;
    border: 1px solid var(--tint-5); border-radius: 18px;
    display: flex; align-items: center;
    font-size: 14px; font-weight: 600; white-space: nowrap;
  }
  .cat-nav a.active span, .cat-nav a[aria-current="page"] span { background: var(--btn-solid-bg); color: var(--btn-solid-ink); border-color: var(--btn-solid-bg); }

  /* Billboard wird zur Karte */
  .hero {
    display: block; padding: 0; min-height: 0;
    height: 470px; margin: 0 16px; border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    background: #0e1a2b;
  }
  .hero-shade--side { display: none; }
  .hero-shade--bottom { height: 300px; background: linear-gradient(0deg, rgba(11,11,13,0.96) 0%, rgba(11,11,13,0.75) 45%, rgba(11,11,13,0) 100%); }
  .hero-copy {
    position: absolute; left: 16px; right: 16px; bottom: 16px; width: auto;
    align-items: center; text-align: center; gap: 12px;
  }
  .hero-kicker { gap: 6px; font-size: 14px; }
  .hero-kicker-mark { width: 16px; height: 16px; border-radius: 3px; font-size: 10px; }
  .hero-meta, .hero-desc { display: none; }
  .hero-meta-short { display: block; font-size: 13px; color: #d4d4d8; }
  .hero-actions { width: 100%; flex-wrap: nowrap; gap: 8px; margin-top: 0; }
  .hero-actions .btn-play, .hero-actions .hero-bm { flex: 1; width: auto; height: 44px; padding: 0 12px; font-size: 16px; gap: 8px; }
  .hero-actions .btn-info:not(.hero-bm) { display: none; }
  .hero-actions .btn-play svg, .hero-actions .hero-bm svg { width: 18px; height: 18px; }
  .hero-bm .hero-bm-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

  /* Rails: 16px Rand, keine Überlappung mit dem Hero */
  body.is-home-page.has-hero .shelves.is-rails { margin-top: 28px; gap: 28px; }
  .rail-head { margin-bottom: 10px; }
  .rail-title { font-size: 18px; }
  .rail-card--continue { width: 150px; border-radius: 5px; }
  .rail-card--continue .rc-art { height: 84px; }
  .rail-card--continue .rc-shade { height: 52px; }
  .rail-card--continue .rc-title { left: 8px; right: 8px; bottom: 8px; font-size: 13px; letter-spacing: -0.02em; }
  .rc-progress, .rc-progress-fill { height: 3px; }
  .rc-meta { display: none; }
  .rail-card--landscape { width: 220px; }
  .rail-card--landscape .rc-art { height: 124px; }
  .rail-card--landscape .rc-title { font-size: 16px; left: 10px; right: 10px; bottom: 10px; }
  .rail-card--square { width: 132px; gap: 6px; }
  .rail-card--square .rc-art { height: 132px; border-radius: 5px; }
  .rc-name { font-size: 13px; }
  .rc-sub { font-size: 12px; }
  .rail-card--poster { width: 120px; }
  .rail-card--poster .rc-art { height: 180px; }
  .rail-card--poster .rc-title { font-size: 15px; left: 8px; right: 8px; bottom: 10px; }
  .shelf--rail-top10 .rail { gap: 2px; }
  .rail-card--top10 { width: auto; height: 160px; }
  .rc-rank { font-size: 150px; margin-bottom: -10px; margin-right: 2px; -webkit-text-stroke-width: 2px; }
  .rail-card--top10 .rc-art { width: 106px; height: 160px; border-radius: 5px; }
  .rail-card--top10 .rc-shade { height: 80px; }
  .rail-card--top10 .rc-title { left: 8px; right: 8px; bottom: 10px; font-size: 13px; letter-spacing: 0; }

  /* Tab-Leiste sichtbar, Inhalt und Mini-Player rutschen darüber */
  .bottom-bar { display: grid; }
  body.has-mini-player main.shelves,
  body.has-mini-player .lib,
  body.has-mini-player .footer { padding-bottom: 210px; }
  body:not(.has-mini-player) main.shelves,
  body:not(.has-mini-player) .lib { padding-bottom: 0; }
  body:not(.has-mini-player) .footer { padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  body:not(.has-mini-player) .shelves { padding-bottom: 80px; }
  body.has-mini-player .shelves { padding-bottom: 0; }
  .mini-player { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .toast-stack { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; left: 16px; right: 16px; max-width: none; }
}

/* Chip-Zeile (Filter) gibt es nicht auf der Startseite. */
body.is-home-page .chip-row, body.is-neu-page .chip-row { display: none; }
/* Billboard nur auf der Startseite. */
body:not(.is-home-page) .hero { display: none; }

@media (prefers-reduced-motion: reduce) {
  .rail { scroll-behavior: auto; }
  .rail-nav, .search-field { transition: none; }
}

/* Feedback-Button (debug-widget.js) nie über Tab-Leiste oder deren Einträge legen. */
@media (max-width: 899px) {
  body .debug-fab { bottom: calc(62px + 12px + env(safe-area-inset-bottom, 0px)); }
  body.has-mini-player .debug-fab { bottom: calc(62px + 84px + env(safe-area-inset-bottom, 0px)); }
}

/* Altersfreigabe nie über dem Textblock: unter 1100px ausblenden. */

/* ---- Externe Inhalte: Quellenzeile, Kartenkennzeichen, Spotify-Embed ---- */
.overlay-source { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.overlay-source .source-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.overlay-source .source-link:hover, .overlay-source .source-link:focus-visible { color: var(--text, #fff); }
.card-source-badge {
  position: absolute; left: 10px; bottom: 14px; z-index: 3; pointer-events: none;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  background: rgba(11,11,13,0.72); color: rgba(255,255,255,0.88);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.rc-art .card-source-badge { top: 8px; right: 8px; left: auto; bottom: auto; }
.spotify-embed { display: block; width: 100%; max-width: 560px; border: 0; border-radius: 12px; margin-top: 18px; background: transparent; }
.audio-player.is-spotify .waveform,
.audio-player.is-spotify .audio-time,
.audio-player.is-spotify .audio-controls { display: none; }
/* Lautstaerke: Spotify und Bandcamp nehmen keine an (Stumm-Knopf und Regler wirkten nicht),
   SoundCloud schon (has-remote-volume, per postMessage). */
.audio-player.is-spotify:not(.has-remote-volume) .audio-volume { display: none; }
.game-topbar .reader-tool[hidden] { display: none; }
@media (max-width: 720px) {
  .game-topbar { flex-wrap: wrap; }
  .game-topbar .game-title { flex: 1 0 100%; }
  .game-topbar .spacer { display: none; }
  .game-topbar .reader-tool { white-space: nowrap; flex: 1 1 auto; }
  .game-frame { height: calc(100dvh - 96px); }
}

/* ============================================================
   KATEGORIEN — Kacheln auf /entdecken und als Reihe auf der Startseite
   ============================================================ */
.cat-tiles .rail-head { padding: 0; }
.shelves.is-rails .cat-tiles .rail-head { padding: 0 var(--rail-gutter); }
.cat-tiles h1.rail-title { font-size: clamp(26px, 3vw, 34px); margin: 8px 0 6px; }
.cat-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.shelves.is-rails .cat-grid { padding: 0 var(--rail-gutter); }
.cat-tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
  min-height: 96px; padding: 14px 16px; border-radius: var(--radius-md, 10px); overflow: hidden;
  background: var(--tile-tone, #3a3a40);
  background: linear-gradient(135deg, var(--tile-tone, #3a3a40) 0%, color-mix(in srgb, var(--tile-tone, #3a3a40) 45%, #0b0b0d) 100%);
  color: #fff; text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cat-tile::after {
  content: ''; position: absolute; right: -18px; top: -18px; width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255,255,255,0.1);
}
.cat-tile:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.35); }
.cat-tile:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.cat-tile-title { font-size: 17px; font-weight: 700; line-height: 1.2; }
.cat-tile-count { font-size: 13px; color: rgba(255,255,255,0.85); }
@media (max-width: 899px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .shelves.is-rails .cat-tiles--rail .cat-grid {
    display: flex; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
  }
  .shelves.is-rails .cat-tiles--rail .cat-grid::-webkit-scrollbar { display: none; }
  .cat-tiles--rail .cat-tile { flex: 0 0 150px; min-height: 84px; scroll-snap-align: start; }
  .cat-tile-title { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .cat-tile { transition: none; } .cat-tile:hover { transform: none; } }
/* YouTube: Tonspur- und Qualitaetswahl gibt es dort nicht. */
.player-stage.is-youtube #qualityBtn, .player-stage.is-youtube #audioTrackBtn { display: none; }
/* Eingebettete Player (YouTube, Vimeo) als Spalte: Kopfleiste, Rahmen und Steuerleiste stehen
   untereinander, der Rahmen fuellt den Rest (flex 1, min-height 0). So liegt bei keiner Breite, keiner
   Titellaenge (die Kopfleiste waechst mit) und auch im Vollbild etwas Eigenes ueber dem Rahmen
   (YouTube API Services Developer Policies III.F.2, III.I; fuer Vimeo genauso), und YouTubes bzw.
   Vimeos eigene Leisten im Rahmen liegen nicht unter unseren Knoepfen. Keine festen Pixelhoehen.
   Vimeo: Vimeos eigene Leiste bedient das Video (Play, Zeitleiste, Ton, Vollbild). Unsere Leiste
   behaelt Merken, Link, Folgen und Vollbild. */
.vimeo-embed { display: block; width: 100%; border: 0; background: #000; }
.player-stage.is-youtube,
.player-stage.is-vimeo { display: flex; flex-direction: column; background: #000; }
.player-stage.is-youtube .player-topbar, .player-stage.is-youtube .player-controls,
.player-stage.is-vimeo .player-topbar, .player-stage.is-vimeo .player-controls { position: relative; flex: none; background: #000; }
.player-stage.is-youtube .player-topbar, .player-stage.is-vimeo .player-topbar { order: 1; }
.player-stage.is-youtube .yt-embed,
.player-stage.is-vimeo .vimeo-embed { order: 2; flex: 1 1 auto; min-height: 0; position: relative; z-index: 4; }
/* Ueber den Leisten (z-index 5): an der gemeinsamen Kante (Bruchteile eines Pixels) gehoert der Punkt dem Rahmen. */
.player-stage.is-youtube > .yt-embed, .player-stage.is-vimeo > .vimeo-embed { z-index: 6; }
/* .yt-embed liegt ohne YouTube-Buehne absolut ueber der ganzen Flaeche (inset 0, height 100%). */
.player-stage.is-youtube .yt-embed { inset: auto; height: auto; }
.player-stage.is-youtube .player-controls, .player-stage.is-vimeo .player-controls { order: 3; }
/* Mindestens 200x200 px (YouTube Required Minimum Functionality: "a viewport that is at least 200px by
   200px"), auch bei langen Titeln und auf dem Handy quer. Reicht die Hoehe fuer Kopfleiste, 200 px und
   Steuerleiste nicht, rollt die Buehne, statt dass etwas ueber oder unter dem Rahmen liegt. */
.player-stage.is-youtube .yt-embed, .player-stage.is-vimeo .vimeo-embed { min-height: 200px; min-width: 200px; }
.player-stage.is-youtube, .player-stage.is-vimeo { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
/* Kopfleiste begrenzt: Titel hoechstens zwei Zeilen (ganz im title-Attribut), Vorspann eine Zeile. */
.player-stage.is-youtube .player-topbar h3, .player-stage.is-vimeo .player-topbar h3 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere;
}
.player-stage.is-youtube .player-topbar .kicker, .player-stage.is-vimeo .player-topbar .kicker { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "Ton einschalten" steht hier in der Kopfleiste selbst (app.js placeUnmuteButton), im Fluss vor
   "Minimieren": er kann nie ueber dem Rahmen liegen. Wird es eng, rutscht er in eine zweite Zeile. */
.player-stage.is-youtube .player-topbar, .player-stage.is-vimeo .player-topbar { flex-wrap: wrap; row-gap: 8px; }
.player-stage.is-youtube .player-topbar .title-block, .player-stage.is-vimeo .player-topbar .title-block { flex: 1 1 10rem; }
.player-topbar > .player-unmute { position: static; flex: none; margin-left: auto; box-shadow: none; }
.player-topbar:has(> .player-unmute:not([hidden])) h3 { -webkit-line-clamp: 1; }
/* Tonspur und Qualitaet gibt es bei YouTube und Vimeo nicht: der geschlossene Waehler liegt dort nicht
   einmal unsichtbar ueber dem Rahmen. Ebenso kein Vollbild-Faenger und kein Ausblenden der Leisten. */
.player-stage.is-youtube .picker, .player-stage.is-vimeo .picker,
.player-stage.is-youtube .fs-catcher, .player-stage.is-vimeo .fs-catcher { display: none !important; }
.player.is-fs.controls-hidden .player-stage.is-youtube .player-topbar, .player.is-fs.controls-hidden .player-stage.is-youtube .player-controls,
.player.is-fs.controls-hidden .player-stage.is-vimeo .player-topbar, .player.is-fs.controls-hidden .player-stage.is-vimeo .player-controls { opacity: 1; pointer-events: auto; }
/* Niedrige Fenster (Handy quer): Leisten knapper, Knoepfe in einer Zeile, damit der Rahmen 200 px hoch bleibt. */
@media (max-height: 500px) {
  .player-stage.is-youtube .player-topbar, .player-stage.is-vimeo .player-topbar { padding-top: 8px; padding-bottom: 8px; }
  .player-stage.is-youtube .player-topbar h3, .player-stage.is-vimeo .player-topbar h3 { font-size: 18px; -webkit-line-clamp: 1; }
  .player-stage.is-youtube .player-controls, .player-stage.is-vimeo .player-controls { padding-top: 8px; padding-bottom: max(8px, env(safe-area-inset-bottom, 0px)); }
  .player-stage.is-youtube .player-scrub { margin-bottom: 6px; }
  .player-stage.is-youtube .player-row, .player-stage.is-vimeo .player-row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .player-stage.is-youtube .player-row > .group, .player-stage.is-vimeo .player-row > .group { flex-wrap: wrap; }
  .player-stage.is-youtube .player-btn.play { width: 42px; height: 42px; }
  .player-stage.is-youtube .vol-range, .player-stage.is-vimeo .vol-range { display: none; }
}
/* Titelliste und Menue "Mehr" bei YouTube und Vimeo: neben (quer) bzw. unter (hoch) der Buehne, der
   Rahmen macht Platz, statt dass sie ueber ihm liegen. Beim eigenen Video bleibt die Titelliste eine
   Schublade ueber dem Bild. Das Menue haengt app.js dafuer in den Player (dockAddMenu). */
.player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo):has(> .ep-panel.open, > .playlist-menu.is-docked) { flex-direction: row; }
.player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo):has(> .ep-panel.open, > .playlist-menu.is-docked) > .player-stage { flex: 1 1 0; min-width: 200px; min-height: 0; }
.player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo) > .ep-panel.open,
.player > .playlist-menu.is-docked {
  position: relative; inset: auto; flex: 0 1 min(380px, 40%); width: auto; min-width: 0; min-height: 0; max-height: none; transform: none; transition: none;
}
.player > .playlist-menu.is-docked { z-index: auto; border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; }
/* Angedockt rollt das Menue als Ganzes (die Liste behaelt ihre Hoehe statt auf 0 zu schrumpfen), damit
   auch "Neue Playlist" auf kleinen Handys erreichbar bleibt. */
.player > .playlist-menu.is-docked { overflow-y: auto; overscroll-behavior: contain; }
.player > .playlist-menu.is-docked > .playlist-menu-list { flex: 1 0 auto; overflow: visible; }
/* Ohne Gleiten: beim Schliessen laege die Liste sonst 0,3 s ueber dem schon wieder breiten Rahmen. */
.player:has(> .player-stage.is-youtube, > .player-stage.is-vimeo) > .ep-panel { transition: none; }
@media (orientation: portrait) {
  .player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo):has(> .ep-panel.open, > .playlist-menu.is-docked) { flex-direction: column; }
  /* Erst gibt die Liste darunter nach (bis zu ihrer Mindesthoehe --dock-min, sie rollt selbst), dann die
     Buehne: sie rollt, der Rahmen behaelt seine 200 px. Die Buehne behaelt sonst Kopfleiste, Rahmen und
     Steuerleiste ganz. */
  .player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo):has(> .ep-panel.open, > .playlist-menu.is-docked) {
    --dock-min: min(50%, 260px);
  }
  .player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo):has(> .ep-panel.open, > .playlist-menu.is-docked) > .player-stage {
    flex: 1 0 auto; max-height: calc(100% - var(--dock-min));
  }
  .player.open:has(> .player-stage.is-youtube, > .player-stage.is-vimeo) > .ep-panel.open,
  .player > .playlist-menu.is-docked { flex: 0 1 45%; min-height: var(--dock-min); border-left: 0; border-top: 1px solid var(--line); }
  .player > .playlist-menu.is-docked { flex-basis: auto; max-height: 50%; border-width: 1px 0 0; }
}
.player.is-mini:not(.open) > .playlist-menu.is-docked { display: none; }
.player-stage.is-vimeo .player-scrub,
.player-stage.is-vimeo #videoRewind,
.player-stage.is-vimeo #playerToggle,
.player-stage.is-vimeo #videoForward,
.player-stage.is-vimeo #qualityBtn,
.player-stage.is-vimeo #audioTrackBtn { display: none; }
@media (max-width: 720px) {
  .player-stage.is-vimeo .player-row { flex-direction: row; justify-content: space-between; }
}

.guest-note { margin: 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-md, 10px); color: var(--muted); font-size: 14px; }

/* Web-Apps/Apps: Startseite statt Spielrahmen */
.game-player.is-launch .game-frame, .game-player.is-launch .game-note,
.game-player.is-launch #gameFullscreen, .game-player.is-launch #gameReload, .game-player.is-launch #gameExternal { display: none; }
.game-launch { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px 20px; text-align: center; max-width: 640px; margin: 0 auto; }
.game-launch-img { width: min(100%, 420px); aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-md, 10px); }
.game-launch-title { margin: 0; font-size: 24px; font-weight: 700; }
.game-launch-desc { margin: 0; color: var(--muted); line-height: 1.5; }
.game-launch-btn { min-width: 180px; justify-content: center; }
.game-launch-note { margin: 0; font-size: 13px; color: var(--muted); }

/* Live-Radio: kein Spulen, keine Restzeit */
.audio-player.is-live .waveform, .audio-player.is-live .audio-time,
.audio-player.is-live #audioRewind, .audio-player.is-live #audioForward,
.audio-player.is-live #audioShuffle { visibility: hidden; }

/* Yumpu-Hefte im Reader */
/* Yumpu-Hefte: ganze Flaeche, keine eigene Fussleiste (die steuert nur PDF/EPUB) */
.reader.is-embed .reader-footer, .reader.is-embed #readerTheme, .reader.is-embed #readerBookmark { display: none; }
.reader.is-embed .reader-stage { padding: 0; overflow: hidden; display: flex; }
.page.is-embed { flex: 1; max-width: none; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; box-shadow: none; display: flex; }
.reader-embed { display: block; flex: 1; width: 100%; height: 100%; min-height: 0; border: 0; background: #fff; }

/* Yumpu auf Touch-Geraeten: Cover und Knopf statt eingebettetem Viewer */
.reader-launch { min-height: 60vh; }
.reader-launch-cover { width: min(70vw, 320px); height: auto; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.35); }

/* Sorbflix-Marke: Bildmarke (icon.svg) und Wortmarke mit rotem "flix" */
.brand-logo { width: 32px; height: 32px; display: block; flex-shrink: 0; }
.brand-flix { color: var(--red-text); }
.brand-word { font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 899px) { .brand-logo { width: 28px; height: 28px; } }

/* Bereichsseiten: Titel und Reiter (Alle + Unterkategorien) */
body.is-area-page .chip-row { display: none !important; }
.area-head { padding: 24px var(--rail-gutter) 8px; display: flex; flex-direction: column; gap: 14px; }
#shelves:not(.is-rails) > .area-head { padding-left: 0; padding-right: 0; }
.area-title { margin: 0; font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.area-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.area-tabs::-webkit-scrollbar { display: none; }
.area-tab {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none;
}
.area-tab:hover { border-color: var(--tint-5); }
.area-tab.active { background: var(--btn-solid-bg); color: var(--btn-solid-ink); border-color: var(--btn-solid-bg); }
.area-tab-count { font-size: 12px; font-weight: 500; opacity: 0.7; }
/* Hauptnavigation mit neun Bereichen: enger und notfalls seitlich wischbar */
/* Fuenf Hauptkategorien passen; kein Scrollen, damit die Aufklappmenues sichtbar sind. */
.primary-nav { min-width: 0; overflow: visible; }
@media (max-width: 1399px) { .primary-nav { gap: 16px; } .primary-nav button { font-size: 14px; } }
@media (max-width: 1199px) {
  .primary-nav { gap: 11px; } .primary-nav button { font-size: 13px; }
  .topbar { gap: 16px; }
  .topbar-right { gap: 6px; }
  .lang-toggle { font-size: 12px; }
}

@media (max-width: 1499px) { .topbar { gap: 24px; } }
/* Kopfzeile mit neun Bereichen: Bibliothek als Symbol; unter 1366 px stehen die
   Bereiche als Chip-Leiste unter der Kopfzeile (wie mobil), die Wortmarke bleibt. */
.nav-library { display: grid; place-items: center; color: var(--accent-deep); }
.nav-library:hover { color: var(--text-hi); }

/* Billboard: Ueberblendung, Punkte, Hochkant-Cover */
.hero-picture, .hero-copy { transition: opacity 0.26s ease; }
.hero.is-switching .hero-picture, .hero.is-switching .hero-copy { opacity: 0; }
.hero.is-cover .hero-img { object-fit: contain; object-position: 85% 50%; }
.hero-kicker-logo { width: 18px; height: 18px; display: block; }
.hero-dots { position: absolute; z-index: 3; left: var(--rail-gutter); bottom: clamp(150px, 11vw, 168px); display: flex; gap: 8px; }
.hero-dot { width: 28px; height: 6px; padding: 0; border-radius: 999px; background: rgba(255,255,255,0.35); border: 0; cursor: pointer; }
.hero-dot.active { background: #fff; }
.hero-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (max-width: 899px) { .hero-dots { position: static; justify-content: center; margin: 8px 0 0; } }
@media (prefers-reduced-motion: reduce) { .hero-picture, .hero-copy { transition: none; } }

@media (max-width: 899px) { .nav-library { display: none; } }
.nav-library.active { color: var(--text-hi); }
.cat-nav a[hidden] { display: none !important; }

/* Aufklappmenue je Hauptkategorie (Unterkategorien) */
.nav-item { position: relative; display: flex; align-items: center; }
.nav-menu {
  position: absolute; top: 100%; left: -14px; z-index: 60; min-width: 240px; padding: 8px;
  display: none; flex-direction: column; gap: 2px;
  background: var(--pop-bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-menu);
}
/* Offen nur mit is-open (apps/web/nav-menu.js): nicht per :hover/:focus-within, das hielt die Liste nach einem Klick offen. */
.nav-item.is-open .nav-menu { display: flex; }
.nav-menu-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 38px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; text-decoration: none; white-space: nowrap;
}
.nav-menu-link:hover, .nav-menu-link:focus-visible { background: var(--tint-2); color: var(--text-hi); }
.nav-menu-count { font-size: 12px; color: var(--muted); }
/* Startseite: Unterkategorien als Chips unter jeder Hauptkategorie */
.rail-subs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 0 var(--rail-gutter) 12px; }
.rail-subs::-webkit-scrollbar { display: none; }
.rail-sub {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none;
}
.rail-sub:hover, .rail-sub:focus-visible { border-color: var(--tint-5); background: var(--tint-1); }

/* ============================================================
   VOD-Player 0.23.0: Ton einschalten, Tonspur und Qualitaet, Direktlink, Download
   ============================================================ */
/* Stumm gestartet (Autoplay mit Ton blockiert, YouTube beim Direktlink) */
.player-unmute { position: absolute; z-index: 7; left: 32px; top: 96px; height: 40px; padding: 0 16px; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.45); }
.player-unmute svg { width: 18px; height: 18px; }
/* Bei YouTube und Vimeo steht er in der Kopfleiste (.player-topbar > .player-unmute), nicht im Video. */
/* Picker liegt in der Buehne (auch im Vollbild sichtbar), ueber dem Fehlermelde-Knopf */
.player-stage .picker { bottom: 132px; }
.picker-tabs.is-single { grid-template-columns: 1fr; }
.picker-tabs button[hidden] { display: none; }
.picker-list .track-row { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
/* Nur im Picker: .track-row heisst auch die Playlist-Zeile (Grid), dort waere ::before ein sechstes Grid-Element */
.picker-list .track-row::before { content: ''; flex: 0 0 16px; width: 16px; font-size: 13px; line-height: 1; }
.picker-list .track-row.active::before { content: '\2713'; }
.picker-list .track-row .track-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.picker-list .track-row .track-sub { flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: var(--muted); }
.picker-list .track-row:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.player-btn[aria-expanded="true"] { background: rgba(255,255,255,0.22); }
/* Profil-Menue: "Meine Videos" */
.lib-tool-link { text-decoration: none; color: var(--text); }
/* Sichtbarkeit im Detail (nur fuer Eigentuemer sichtbar: Privat, Nicht gelistet) */
.overlay-body .meta-row .pill--visibility { border-style: dashed; color: var(--muted); }
@media (max-width: 899px) {
  .player-unmute { left: 16px; top: 76px; }
  .player-topbar > .player-unmute { height: 36px; padding: 0 12px; }
  .player-stage .picker { right: 12px; left: 12px; width: auto; bottom: 200px; }
}

/* ============================================================
   0.22: Sorbflix – Liste/Kacheln, Startseite Schauen, Vollbild,
   Einwilligung, Rechtsseiten, PWA ohne Zoomen und Ueberlaufen
   ============================================================ */

/* Kein Doppeltipp-Zoom, keine automatische Schriftvergroesserung, nichts ragt seitlich heraus. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }
img, video, iframe, canvas, svg { max-width: 100%; }
/* iOS zoomt beim Fokus in Felder unter 16 px. */
@media (pointer: coarse) {
  input, select, textarea, .search-field { font-size: max(16px, 1em); }
}
/* Installierte App (iPhone mit Notch): Kopfzeile unter der Statusleiste. */
@media (display-mode: standalone) {
  .topbar { padding-top: env(safe-area-inset-top, 0px); height: calc(var(--header-h) + env(safe-area-inset-top, 0px)); }
}

/* Kachel/Liste-Schalter */
.area-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.view-bar { display: flex; justify-content: flex-end; padding: 8px var(--rail-gutter) 0; }
#shelves:not(.is-rails) > .view-bar, .prov-content > .view-bar { padding-left: 0; padding-right: 0; }
.view-toggle { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; flex-shrink: 0; }
.view-toggle-btn {
  width: 36px; height: 32px; display: grid; place-items: center; border-radius: 999px;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
}
.view-toggle-btn svg { width: 18px; height: 18px; }
.view-toggle-btn:hover { color: var(--text); }
.view-toggle-btn[aria-pressed="true"] { background: var(--btn-solid-bg); color: var(--btn-solid-ink); }
.view-toggle-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kids-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

/* Listenansicht */
.item-list { display: flex; flex-direction: column; gap: 2px; }
.shelf--list .item-list, .shelf--list > .rail-head ~ .list-more { margin: 0 var(--rail-gutter); }
.shelf--list .rail-subs { padding-bottom: 8px; }
.list-row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 8px; border-radius: var(--radius-md, 10px); cursor: pointer;
}
.list-row:hover { background: var(--tint-1); }
.lr-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.list-row[data-kind="audio"] .lr-thumb, .list-row[data-kind="ebook"] .lr-thumb { aspect-ratio: 1; width: 72px; justify-self: center; }
.lr-thumb > img, .lr-thumb > .art-fallback, .lr-thumb > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.list-row[data-kind="ebook"] .lr-thumb > img { object-fit: contain; background: var(--bg-2); }
.lr-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.25); }
.lr-progress i { display: block; height: 100%; background: var(--accent); }
.lr-body { min-width: 0; }
.lr-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lr-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.lr-meta { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.lr-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-sub .prov-link { color: inherit; }
.lr-actions { display: flex; align-items: center; gap: 4px; }
.lr-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 0; background: transparent; color: var(--text); cursor: pointer;
}
.lr-btn svg { width: 18px; height: 18px; }
.lr-btn:hover { background: var(--tint-2); }
.lr-play { background: var(--btn-solid-bg); color: var(--btn-solid-ink); }
.lr-play:hover { background: var(--btn-solid-hover); }
.lr-heart[data-active="true"] { color: var(--accent); }
.list-more { display: inline-block; margin-top: 6px; padding: 8px; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.list-more:hover { color: var(--text); }
@media (max-width: 599px) {
  .list-row { grid-template-columns: 96px minmax(0, 1fr) auto; gap: 10px; padding: 6px 4px; }
  .list-row[data-kind="audio"] .lr-thumb, .list-row[data-kind="ebook"] .lr-thumb { width: 56px; }
  .lr-actions .lr-heart { display: none; }
  .lr-btn { width: 38px; height: 38px; }
  .lr-title { font-size: 14px; }
}

/* Startseite: Schauen-Kopf unter dem Billboard */
.area-head--home { padding-top: 8px; position: relative; z-index: 2; }

/* Trackliste: einzelne Lieder in Warteschlange/Playlist */
.child-more {
  width: 36px; height: 40px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.child-more svg { width: 18px; height: 18px; }
.child-more:hover, .child-more:focus-visible { color: var(--text); background: var(--tint-3); }
@media (hover: hover) { .child-row .child-more { opacity: 0.55; } .child-row:hover .child-more, .child-more:focus-visible { opacity: 1; } }
.child-head .child-label { margin: 0 auto 0 0; }

/* Playlist-Menue: Warteschlange oben */
.playlist-menu-queue { padding: 6px 6px 0; }
.playlist-menu-queue:empty { display: none; }
.playlist-menu-action .row-cover { background: var(--tint-2); color: var(--text); }
.playlist-menu-label { padding: 10px 14px 0; font-size: 12px; text-transform: none; }
.playlist-menu-queue:empty + .playlist-menu-label { padding-top: 8px; }

/* Videoplayer: Folgenliste */
.ep-item { width: 100%; text-align: left; border: 0; background: transparent; color: inherit; align-items: center; grid-template-columns: 120px minmax(0, 1fr); }
.ep-thumb { display: block; }
.ep-thumb > img, .ep-thumb > .art-fallback, .ep-thumb > svg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-meta { display: flex; flex-direction: column; min-width: 0; }
.ep-meta .ep-title { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ep-item.active .ep-title { color: var(--accent); }
.player-btn[hidden] { display: none !important; }

/* Vollbild: Bild ueber die ganze Flaeche, Leisten darueber und ausblendbar */
/* YouTube im Vollbild: Leisten oberhalb und unterhalb des Videos, nicht darueber (Player nicht verdecken). */
.player.is-fs .player-topbar, .player.is-fs .player-controls { transition: opacity 0.25s ease; }
.player.is-fs.controls-hidden .player-topbar, .player.is-fs.controls-hidden .player-controls { opacity: 0; pointer-events: none; }
.player.is-fs.controls-hidden { cursor: none; }
.fs-catcher { display: none; position: absolute; inset: 0; z-index: 7; }
.player.is-fs.controls-hidden .fs-catcher { display: block; }
.player.is-pseudo-fs { z-index: 200; }
.player.is-pseudo-fs .player-topbar { padding-top: max(14px, env(safe-area-inset-top)); padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.player.is-pseudo-fs .player-controls { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
#videoFullscreen[aria-pressed="true"], #videoFullscreenBtn[aria-pressed="true"] { background: rgba(255,255,255,0.22); }

/* Einwilligung */
.consent-backdrop {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: flex-end; justify-content: center;
  background: var(--scrim); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.consent-backdrop--gate { align-items: center; z-index: 320; }
/* Solange der Datenschutz-Bogen offen ist, verdeckt der Melde-Knopf (debug-widget.js) sonst "Nur notwendige". */
body:has(.consent-backdrop) .debug-fab { display: none; }
/* Banner beim ersten Besuch: kein Vollbild-Schleier. Klicks (etwa auf "Abspielen") gehen durch die Flaeche
   zur Seite; nur der Bogen selbst faengt sie ab. Die Frage beim Abspielen (--gate) bleibt modal. */
.consent-backdrop:not(.consent-backdrop--gate) { background: transparent; pointer-events: none; }
.consent-backdrop:not(.consent-backdrop--gate) .consent-sheet { pointer-events: auto; }
.consent-sheet {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface, #16161a); color: var(--text); border: 1px solid var(--line-strong); border-radius: 16px;
  padding: 22px 22px 18px; box-shadow: var(--shadow-sheet);
}
.consent-title { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.consent-text, .consent-note { margin: 0 0 12px; line-height: 1.55; font-size: 14.5px; }
.consent-note { color: var(--muted); font-size: 13.5px; }
.consent-cats { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.consent-cats li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.consent-cats li span { color: var(--muted); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consent-actions .btn { min-height: 44px; justify-content: center; }
.consent-actions--equal .btn { flex: 1 1 180px; }
.consent-links { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.consent-links a { color: var(--text); }

/* Rechtsseiten */
body.is-legal-page .chip-row { display: none !important; }
.legal-page { max-width: 820px; margin: 0 auto; padding: 32px 0 48px; line-height: 1.6; }
#shelves > .legal-page { padding-left: 0; padding-right: 0; }
.legal-title { margin: 0 0 8px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -0.02em; }
.legal-note, .legal-lead, .legal-stand { color: var(--muted); }
.legal-body h2 { margin: 32px 0 8px; font-size: 20px; }
.legal-body h3 { margin: 20px 0 6px; font-size: 16px; }
.legal-body p, .legal-body li { font-size: 15px; }
.legal-body a, .legal-links a, .privacy-card a { color: var(--text); text-decoration: underline; }
.legal-body ul { padding-left: 20px; }
.legal-box { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--tint-1); }
.legal-basis { color: var(--muted); font-size: 14px; }
.legal-table-wrap { overflow-x: auto; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.legal-table td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-word; }
.privacy-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; }
.privacy-card--stack { display: block; }
.privacy-card h2 { margin: 0 0 4px; font-size: 17px; }
.privacy-card p { margin: 0; color: var(--muted); font-size: 14px; }
.privacy-switch {
  position: relative; flex-shrink: 0; width: 52px; height: 30px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--tint-4); transition: background 0.18s ease;
}
.privacy-switch[aria-checked="true"] { background: var(--accent, #2f7a5a); }
.privacy-switch:disabled { cursor: not-allowed; opacity: 0.7; }
.privacy-switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.18s ease; }
.privacy-switch[aria-checked="true"] .privacy-switch-knob { transform: translateX(22px); }
.privacy-switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.privacy-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }
.privacy-status { margin: 0; color: var(--muted); font-size: 13.5px; }
.privacy-keys { margin: 10px 0 14px; padding-left: 20px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--muted); }
.privacy-wipe { margin-top: 6px; }
.legal-links { margin-top: 28px; color: var(--muted); }
@media (max-width: 899px) { .legal-page { padding: 20px 0 40px; } }

/* Schieberegler (Zeitleiste, Lautstaerke, Leseposition): sichtbarer Punkt zum Ziehen,
   gefuellter Teil in Rot. Das Feld ist 28 px hoch (Safari schnitt den Punkt bei 4 px ab),
   die Spur 4 px; --fill setzt syncRangeFill(). */
.player-range, .vol-range, .reader-seek {
  -webkit-appearance: none; appearance: none; background: transparent; height: 28px; margin: 0; padding: 0;
  cursor: pointer; --fill: 0%; touch-action: pan-y;
}
.player-range { flex: 1; min-width: 0; }
.player-range::-webkit-slider-runnable-track, .vol-range::-webkit-slider-runnable-track, .reader-seek::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--red) var(--fill), rgba(255,255,255,0.24) var(--fill));
}
.player-range::-webkit-slider-thumb, .vol-range::-webkit-slider-thumb, .reader-seek::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.45); transition: transform 0.12s ease;
}
.player-range:active::-webkit-slider-thumb, .vol-range:active::-webkit-slider-thumb, .reader-seek:active::-webkit-slider-thumb { transform: scale(1.25); }
.player-range::-moz-range-track, .vol-range::-moz-range-track, .reader-seek::-moz-range-track { height: 4px; border-radius: 999px; background: rgba(255,255,255,0.24); }
.player-range::-moz-range-progress, .vol-range::-moz-range-progress, .reader-seek::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--red); }
.player-range::-moz-range-thumb, .vol-range::-moz-range-thumb, .reader-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.player-range:focus-visible, .vol-range:focus-visible, .reader-seek:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 4px; }

/* Lautstaerke */
.vol { display: inline-flex; align-items: center; gap: 6px; }
.vol-range { width: 96px; }
.vol .vol-x { display: none; }
.vol.is-muted .vol-x { display: inline; }
.vol.is-muted .vol-wave { display: none; }
.vol.no-range .vol-range { display: none; }
.audio-volume { display: flex; justify-content: center; margin: -14px 0 24px; }
.audio-volume .vol-range { width: 160px; }
@media (max-width: 599px) {
  .player-row .vol-range { display: none; }
  .player-row { gap: 8px; }
  .player-row > .group { gap: 4px; }
  .player-btn { width: 38px; height: 38px; }
  .player-btn.play { width: 52px; height: 52px; }
}
@media (max-width: 380px) { #videoRewind, #videoForward { display: none; } }

/* Leser: Positionsregler */
.reader-seek { width: 100%; }
.reader.no-nav .reader-footer { display: none; }
#readerBookmark.is-on svg { fill: currentColor; }
.waveform { position: relative; }
.wave-knob { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25), 0 1px 4px rgba(0,0,0,0.45); pointer-events: none; }
/* Raster-Elemente duerfen schmaler als ihr Inhalt werden (sonst ragten Reiterleisten seitlich heraus). */
.shelves > *, .area-head > *, .kids-page, .kids-body, .privacy-card-text { min-width: 0; }
.privacy-card-text { flex: 1; }
.legal-body, .legal-page { overflow-wrap: anywhere; }
/* Feedback-Knopf nicht ueber Player- und Leser-Bedienung legen. */
body:has(#videoPlayer.open) .debug-fab, body:has(#audioPlayer.open) .debug-fab, body:has(#reader.open) .debug-fab, body:has(#gamePlayer.open) .debug-fab { display: none !important; }
/* Hinweise sind reine Information: Tipps gehen durch sie hindurch (mobil liegen sie oben ueber
   den Knoepfen der Kopfzeile, z. B. "Zurueck" in der Leseansicht). */
.toast-stack, .toast { pointer-events: none; }
.reader .breadcrumb #readerBreadcrumb:empty + * { margin-left: 0; }
/* Eine Spalte, die nie breiter als der Bildschirm wird (lange Woerter/Reiter brechen oder scrollen innen). */
.shelves { grid-template-columns: minmax(0, 1fr); }
.kids-grid > *, .prov-grid > * { min-width: 0; }
/* Rechtsseiten: volle Spaltenbreite (margin:auto allein machte sie im Raster so breit wie den Inhalt). */
.legal-page { width: 100%; box-sizing: border-box; }
.shelf-grid > .card, .shelf-grid > * { min-width: 0; }
.card-meta { flex-wrap: wrap; row-gap: 2px; }

/* ---- 0.22: Playlist und Warteschlange (Bedienbarkeits-Pruefung) ---- */
/* Mini-Player: Warteschlange auch auf dem Handy; vorgemerkt mit Hinweiszeile. */
@media (max-width: 640px) {
  .mini-btn[id="miniQueue"] { display: grid; }
  .mini-btn { width: 40px; height: 40px; }
  .mini-btn.mini-play { width: 42px; height: 42px; }
}
.mini-player.is-pending .mini-progress { visibility: hidden; }
.mini-player.is-pending .mini-sub { color: var(--text); }
/* Schublade mit Hintergrundflaeche */
.queue-backdrop { position: fixed; inset: 0; z-index: 134; background: var(--scrim-soft); }
.queue-backdrop[hidden] { display: none; }
@media (max-width: 640px) {
  .queue-drawer { top: auto; height: min(78dvh, 640px); width: 100vw; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; }
}
/* Hinweise: nicht unter dem Feedback-Knopf, ueber dem Mini-Player */
.toast-stack { right: 88px; }
/* Desktop: Hinweise ueber dem Mini-Player; laeuft ein eigenes Video im Mini-Fenster, ueber dem Fenster.
   Mobil stehen sie oben (bottom:auto bleibt). "not all and (max-width: 899px)" ist genau das Gegenstueck
   zur mobilen Abfrage, ohne Luecke bei gebrochenen Breiten (Zoom, z. B. 899,5 px). Ist ein eingebetteter
   Player (YouTube, Vimeo) sichtbar, setzt app.js den Stapel neben den Rahmen (placeToasts). */
@media not all and (max-width: 899px) {
  body.has-mini-player .toast-stack { bottom: 104px; }
  body:has(#videoPlayer.is-mini:not(.open)) .toast-stack { bottom: calc(96px + 230px + 12px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 899px) { .toast-stack { right: 16px; } }
/* Neben einem eingebetteten Player (app.js placeToasts setzt top/bottom/max-height): nichts ragt in
   den Rahmen, auch kein Schatten und keine Einblend-Bewegung; aeltere Hinweise fallen dann weg. Passt
   der neueste nicht, wird der Stapel so breit wie der freie Streifen (is-wide), dann knapper gesetzt
   (is-tight); reicht auch das nicht, macht die Spalte im offenen Player oben Platz (--toast-room). */
.toast-stack.is-placed { overflow: hidden; }
.toast-stack > .toast[hidden] { display: none; }
@media not all and (max-width: 899px) { .toast-stack.is-wide { justify-items: end; } }
.toast-stack.is-tight > .toast { padding: 6px 10px; font-size: 13px; line-height: 1.3; }
.player-stage.is-youtube > .player-topbar, .player-stage.is-vimeo > .player-topbar { margin-top: var(--toast-room, 0px); }
/* Mobil: Feedback-Knopf ueber dem Mini-Player (Leiste 62 px + Mini-Player ca. 70 px) */
@media (max-width: 899px) {
  body.has-mini-player .debug-fab { bottom: calc(62px + 80px + env(safe-area-inset-bottom, 0px)) !important; }
}
/* Bibliothek */
body.is-library-page .chip-row { display: none !important; }
.new-playlist { display: flex; gap: 8px; margin: 4px 0 16px; max-width: 520px; }
.new-playlist input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--tint-1); color: var(--text); font: inherit; }
.new-playlist input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lib-empty-state { padding: 18px 0 6px; }
.lib-empty-title { margin: 0 0 4px; font-weight: 700; }
.lib-empty-hint { margin: 0; color: var(--muted); }
@media (max-width: 599px) {
  .playlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* Minimierter Videoplayer: schwebendes Fenster ueber dem Mini-Player (wie YouTube/Spotify). */
.pip-expand, .pip-close { display: none; }
/* Mini-Fenster: Video 356x200 (YouTube verlangt mindestens 200x200 px), darueber eine 28 px hohe Leiste
   zum Oeffnen und Schliessen statt einer Klickflaeche auf dem Video (YouTube-Player nicht verdecken).
   z-index 136: ueber Detail, Bibliothek, Lesern und Warteschlange, damit ein laufendes Video sichtbar bleibt.
   Mit YouTube oder Vimeo 410: ueber allen Ebenen der Seite (auch Menues, Galerie, Dialoge; die hoechste
   sonst ist 400), damit nichts den Rahmen verdeckt; Menues, Hinweise und Dialoge weichen ihm aus (app.js
   positionPopover, placeToasts, --embed-free-*). */
.player.is-mini:not(.open) {
  display: flex; position: fixed; inset: auto; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  width: 358px; height: 230px; z-index: 136; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.6); border: 1px solid var(--line-strong);
}
.player.is-mini:not(.open):has(> .player-stage.is-youtube, > .player-stage.is-vimeo) { z-index: 410; }
.player.is-mini:not(.open) .player-topbar, .player.is-mini:not(.open) .player-controls,
.player.is-mini:not(.open) .ep-panel, .player.is-mini:not(.open) .picker, .player.is-mini:not(.open) .fs-catcher,
.player.is-mini:not(.open) .player-unmute { display: none !important; }
/* Unter der Leiste: das eigene <video> liegt absolut, die Rahmen von YouTube und Vimeo stehen in der
   Spalte (siehe .player-stage.is-youtube) und fuellen den Platz unter dem padding-top. */
.player.is-mini:not(.open) .player-stage { padding-top: 28px; box-sizing: border-box; overflow: hidden; }
.player.is-mini:not(.open) .player-stage video { top: 28px; height: calc(100% - 28px); }
.player.is-mini:not(.open) .pip-expand { display: block; position: absolute; top: 0; left: 0; right: 0; height: 28px; z-index: 8; background: #141416; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.player.is-mini:not(.open) .pip-expand::before { content: ""; position: absolute; left: 50%; top: 11px; width: 9px; height: 9px; margin-left: -5px; border-left: 2px solid rgba(255,255,255,0.85); border-top: 2px solid rgba(255,255,255,0.85); transform: rotate(45deg); }
.player.is-mini:not(.open) .pip-close {
  display: grid; place-items: center; position: absolute; top: 2px; right: 4px; z-index: 9; width: 24px; height: 24px;
  border-radius: 50%; border: 0; background: transparent; color: #fff; cursor: pointer;
}
.player.is-mini:not(.open) .pip-close svg { width: 14px; height: 14px; }
.player.is-mini:not(.open) .pip-expand:focus-visible { outline: 2px solid #fff; outline-offset: -3px; border-radius: 12px; }
@media (max-width: 899px) {
  .player.is-mini:not(.open) { width: min(358px, calc(100vw - 24px)); height: 230px; right: 12px; bottom: calc(62px + 84px + env(safe-area-inset-bottom, 0px)); }
  body:has(#videoPlayer.is-mini:not(.open)) .debug-fab { display: none !important; }
}
/* Niedrige Fenster (Handy quer, auch mit Browserleisten): unten rechts laege das Mini-Fenster ueber der
   Kopfleiste (Suche, Sprachwahl) oder ragte oben hinaus. Dann links unter der Kopfleiste: Leiste und
   Rahmen (200 px) ganz im Fenster, die Knoepfe des Mini-Players unten rechts bleiben frei. Ist das Fenster
   selbst dafuer zu niedrig, geht das ganze Mini-Fenster vor. */
@media (max-height: 500px) {
  .player.is-mini:not(.open) {
    top: max(0px, min(calc(var(--header-h) + 8px), calc(100vh - 234px)));
    top: max(0px, min(calc(var(--header-h) + 8px), calc(100dvh - 234px))); bottom: auto;
    left: max(12px, env(safe-area-inset-left, 0px)); right: auto;
  }
}
body:has(#videoPlayer.is-mini:not(.open)) .debug-fab { display: none !important; }
/* iPhone quer (viewport-fit=cover): Inhalt nicht unter der Notch */
@supports (padding: max(0px)) {
  .topbar { padding-left: max(var(--rail-gutter, 16px), env(safe-area-inset-left)); padding-right: max(var(--rail-gutter, 16px), env(safe-area-inset-right)); }
  .mini-player, .bottom-bar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}
/* Aeltere Browser ohne dvh */
.consent-sheet { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }

/* Billboard-Titel: einzige Groessenregel (Bugreport #5, 0.24.6: bei 1300 px 34 statt 47 px),
   hoechstens zwei Zeilen, lange (sorbische) Woerter brechen um statt aus dem Bildschirm zu laufen. */
.hero-title {
  font-size: clamp(28px, 2.6vw, 44px); line-height: 1.04; letter-spacing: -0.025em;
  max-width: min(760px, 100%); overflow-wrap: anywhere; hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 899px) {
  .hero-title { font-size: clamp(22px, 6.4vw, 30px); line-height: 1.08; -webkit-line-clamp: 3; }
  .hero-copy { max-width: 100%; min-width: 0; }
}
/* Interpret unter dem Titel (Musikvideos, Lieder) */
.hero-artist { margin: 6px 0 0; font-size: 18px; font-weight: 600; color: #e4e4e7; }
@media (max-width: 899px) { .hero-artist { font-size: 14px; margin-top: 2px; } }
.rc-artist { display: block; margin-top: 2px; font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.82); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-art.has-artist .rc-title { bottom: 34px; -webkit-line-clamp: 2; }
.rc-art > .rc-artist { position: absolute; left: 14px; right: 14px; bottom: 13px; margin: 0; font-size: 13px; text-shadow: 0 1px 8px rgba(0,0,0,0.7); }
.audio-cover-art { position: relative; }
.audio-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Dialoge und Galerie der Seite, solange ein YouTube- oder Vimeo-Rahmen im Mini-Fenster laeuft: der
   Hintergrund bleibt ganzflaechig und modal (inset 0; das Mini-Fenster liegt mit z-index 410 ohnehin
   darueber), nur der Inhalt rueckt per padding in den groessten freien Bereich daneben (app.js
   markEmbedFree setzt --embed-free-*). Ohne Mini-Fenster sind die Werte 0 (wie bisher). */
.consent-backdrop {
  padding: calc(16px + var(--embed-free-top, 0px)) calc(16px + var(--embed-free-right, 0px))
    calc(max(16px, env(safe-area-inset-bottom, 0px)) + var(--embed-free-bottom, 0px)) calc(16px + var(--embed-free-left, 0px));
}
.consent-sheet { max-height: min(calc(100dvh - 32px), 100%); padding-bottom: 0; }
/* Rollt der Bogen (wenig Platz), bleiben die Knoepfe und die Links an seiner Unterkante stehen
   (app.js: .consent-foot um .consent-actions und .consent-links); sonst steht der Fuss im Fluss. */
.consent-foot {
  position: sticky; bottom: 0; z-index: 1; margin: 0 -22px; padding: 12px 22px 18px;
  background: var(--surface, #16161a); border-top: 1px solid var(--line);
}
.prov-lightbox {
  padding: calc(56px + var(--embed-free-top, 0px)) calc(72px + var(--embed-free-right, 0px))
    calc(56px + var(--embed-free-bottom, 0px)) calc(72px + var(--embed-free-left, 0px));
}
.prov-lb-close { top: calc(16px + var(--embed-free-top, 0px)); right: calc(16px + var(--embed-free-right, 0px)); }
.prov-lb-prev { left: calc(16px + var(--embed-free-left, 0px)); top: calc(var(--embed-free-top, 0px) + (100% - var(--embed-free-top, 0px) - var(--embed-free-bottom, 0px)) / 2); }
.prov-lb-next { right: calc(16px + var(--embed-free-right, 0px)); top: calc(var(--embed-free-top, 0px) + (100% - var(--embed-free-top, 0px) - var(--embed-free-bottom, 0px)) / 2); }
.prov-lb-img { max-height: calc(100vh - var(--embed-free-top, 0px) - var(--embed-free-bottom, 0px) - 170px); }
@media (max-width: 899px) {
  .prov-lightbox {
    padding: calc(64px + var(--embed-free-top, 0px)) calc(12px + var(--embed-free-right, 0px))
      calc(84px + var(--embed-free-bottom, 0px)) calc(12px + var(--embed-free-left, 0px));
  }
  .prov-lb-img { max-height: calc(100vh - var(--embed-free-top, 0px) - var(--embed-free-bottom, 0px) - 200px); }
  .prov-lb-prev, .prov-lb-next { top: auto; bottom: calc(16px + var(--embed-free-bottom, 0px)); }
  .prov-lb-prev { left: calc(var(--embed-free-left, 0px) + (100% - var(--embed-free-left, 0px) - var(--embed-free-right, 0px)) / 2 - 64px); }
  .prov-lb-next { right: calc(var(--embed-free-right, 0px) + (100% - var(--embed-free-left, 0px) - var(--embed-free-right, 0px)) / 2 - 64px); }
}
/* Dialoge: der Dialog passt in den freien Bereich und rollt selbst (sonst ragte er zentriert oben hinaus). */
.dt-dialog-back {
  padding: calc(16px + var(--embed-free-top, 0px)) calc(16px + var(--embed-free-right, 0px))
    calc(16px + var(--embed-free-bottom, 0px)) calc(16px + var(--embed-free-left, 0px));
  grid-template-rows: minmax(0, 1fr);
}
.dt-dialog { max-height: min(92dvh, 100%); }
/* Ueber das Mini-Fenster (es liegt ueber den Dialogen) geht der Player auch bei offenem Dialog auf. Die
   Dialoge liegen hoeher als der offene Player (300/400 gegen 110) und laegen dann ueber dem Rahmen und den
   Leisten. Galerie-, Melde- und Beanspruchen-Dialoge schliessen beim Routenwechsel ohnehin (app.js closePageDialogs); was
   offen bleibt (die Einwilligung), ruht, solange der Player offen ist. Die Abfrage vor fremden Inhalten
   (#consentGate) bleibt sichtbar. */
body:has(#videoPlayer.open) .dt-dialog-back, body:has(#videoPlayer.open) #consentBanner { display: none; }
/* Anmelden (#loginModal) genauso: Hintergrund ganzflaechig, die Karte im freien Bereich (rollt das Overlay).
   z-index 105: ueber der Detailseite (#overlay, gleiche Klasse, steht spaeter im Dokument und lag sonst
   ueber der Anmeldung), unter dem offenen Player (110), also nie ueber einem YouTube-Rahmen. */
#loginModal {
  z-index: 105;
  padding: calc(40px + var(--embed-free-top, 0px)) calc(20px + var(--embed-free-right, 0px))
    calc(40px + var(--embed-free-bottom, 0px)) calc(20px + var(--embed-free-left, 0px));
}
@media (max-width: 720px) {
  #loginModal { padding: var(--embed-free-top, 0px) var(--embed-free-right, 0px) var(--embed-free-bottom, 0px) var(--embed-free-left, 0px); }
  /* Neben dem Mini-Fenster: die Karte fuellt den freien Bereich und rollt selbst (sonst laege das Formular
     mit 10vh Abstand und 92vh Hoehe unter dem Fenster); !important gegen den Inline-Abstand in index.html. */
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .overlay-card { margin: 0 auto !important; max-height: 100%; }
  /* Die Kopfgrafik rollte mit dem Formular nach oben und nahm den Schliessen-Knopf mit (Karte oben abgeschnitten).
     Neben dem Mini-Fenster ist der Kopf deshalb eine schmale, oben haftende Leiste mit Titel und Schliessen-Knopf. */
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero {
    position: sticky; top: 0; z-index: 4; aspect-ratio: auto; overflow: visible;
    padding: 12px 64px 12px 16px !important; min-height: 56px !important; display: flex; align-items: center;
    background: var(--surface); border-bottom: 1px solid var(--line);
  }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero::after { display: none; }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero .overlay-hero-inner { position: static; padding: 0; }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero .brand { display: none; }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero h2 { text-align: left; font-size: 1.15rem !important; }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero .overlay-hero-inner { text-align: left !important; }
  body:has(#videoPlayer.is-mini:not(.open)) #loginModal .login-hero .overlay-close { top: 50%; right: 12px; transform: translateY(-50%); width: 44px; height: 44px; }
}

/* ============================================================
   FARBMODUS — Umschalter und Feinheiten des hellen Modus
   (Tokens: Kopf dieser Datei; gesetzt von theme.js)
   ============================================================ */
.theme-toggle .ti-moon { display: none; }
:root[data-theme="light"] .theme-toggle .ti-sun { display: none; }
:root[data-theme="light"] .theme-toggle .ti-moon { display: block; }
.theme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.theme-chip {
  min-width: 44px; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.theme-chip:hover { background: var(--surface-2); color: var(--text); }
.theme-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.theme-chip:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* Die Bibliothek nutzt die Knopfklasse des Readers (.reader-tool, weisse Schrift fuer den dunklen Reader). */
:root[data-theme="light"] .lib-topbar .reader-tool { background: var(--tint-1); color: var(--text-soft); }
:root[data-theme="light"] .lib-topbar .reader-tool:hover { background: var(--tint-2); color: var(--text-hi); }
/* Anmeldedialog (frueher Inline-Styles in index.html) */
.login-hero { background: linear-gradient(135deg, var(--accent-soft), rgba(0,0,0,0.9)); }
:root[data-theme="light"] .login-hero { background: linear-gradient(135deg, var(--accent-soft), var(--bg-2)); }
.login-input { display: block; width: 100%; padding: .75rem 1rem; border: 1px solid var(--tint-3); border-radius: 8px; background: var(--tint-1); color: var(--text-hi); font-size: 1rem; margin-bottom: 1rem; box-sizing: border-box; }
.login-input--last { margin-bottom: 1.5rem; }
.login-error { padding: .75rem 1rem; border-radius: 8px; background: rgba(255,80,80,.12); color: #ff8080; font-size: .875rem; margin-bottom: 1rem; }
.login-notice { padding: .75rem 1rem; border-radius: 8px; background: rgba(80,160,255,.12); color: #9cc8ff; font-size: .875rem; margin-top: 1rem; }
:root[data-theme="light"] .login-error { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="light"] .login-notice { background: var(--link-soft); color: var(--link); }
/* Verlaufszeilen in der Bibliothek (frueher per JS-Hover) */
.history-row:hover { background: var(--tint-1); }
/* Abmelden (frueher Inline-Style) */
.btn-logout { width: 100%; justify-content: center; margin-top: .5rem; color: #ff8080; border-color: rgba(255,80,80,.3); }
:root[data-theme="light"] .btn-logout { color: var(--danger); border-color: rgba(200,30,50,.35); }
/* Billboard: im hellen Modus laeuft das Bild unten in den hellen Seitengrund aus (nicht in Schwarz).
   Mobil ist das Billboard eine Karte mit eigenem dunklem Verlauf und bleibt, wie es ist. */
@media (min-width: 900px) {
  :root[data-theme="light"] .hero-shade--bottom {
    height: 230px;
    background: linear-gradient(0deg, var(--page-bg) 0%, color-mix(in srgb, var(--page-bg) 82%, transparent) 40%, var(--page-bg-clear) 100%);
  }
}
/* Im Rahmen von serbska.app ist die Seite fest hell, ein Umschalter waere wirkungslos. */
html.eingebettet .theme-toggle, html.eingebettet .theme-card { display: none !important; }

/* Hoeren -> Musik: Reihe der Kuenstlerprofile (Karten des Verzeichnisses /kuenstler in einer waagerechten Reihe) */
.shelf--rail-providers { margin-bottom: 24px; }
.rail--providers { align-items: stretch; }
.rail--providers .prov-card { flex: 0 0 190px; scroll-snap-align: start; }

/* Redaktionsprofil (Kuenstler-Portal): dezenter Hinweis unter dem Namen, Beteiligte im Detail, Kurzvideos in der Reihe */
.prov-editorial { margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--line, rgba(255,255,255,.2)); border-radius: 10px; max-width: 560px; }
.prov-editorial-text { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.prov-claim { font-size: 13.5px; }
.credit-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.credit-detail { color: var(--muted); }
.child-label--shorts { padding: 0 24px; margin: 18px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* Ladeanzeige beim Kaltstart (bis /api/home antwortet): ruhige Platzhalter-Karten aus den Tokens */
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 16px; padding: 24px var(--rail-gutter, 16px); }
.sk-card { aspect-ratio: 16 / 9; border-radius: 10px; background: var(--tint-1); position: relative; overflow: hidden; }
.sk-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--tint-2), transparent); transform: translateX(-100%); animation: sk-shimmer 1.4s ease-in-out infinite; }
@keyframes sk-shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk-card::after { animation: none; } }

/* Nicht gefunden: sichtbarer Hinweis statt stillem Sprung */
.notfound-page { max-width: 640px; margin: 0 auto; padding: 72px var(--rail-gutter, 16px) 96px; text-align: center; }
.notfound-title { margin: 0 0 10px; font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.02em; }
.notfound-text { margin: 0 0 24px; color: var(--muted); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.notfound-home { display: inline-flex; min-height: 44px; align-items: center; text-decoration: none; }

/* Fremd-Player (Bandcamp, Spotify, SoundCloud) in einer Warteschlange: Hinweis und Knopf "Naechster Titel" */
.remote-next { display: grid; gap: 10px; justify-items: start; max-width: 560px; margin-top: 14px; }
.remote-next[hidden] { display: none; }
.remote-next-hint { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.remote-next-btn { min-height: 44px; }

/* Reihenkarten: Wrapper mit Link und Knopf als Geschwister; die Hoehe des Kartenbildes je Form (--art-h) wie in den
   .rc-art-Regeln, der Knopf liegt unten rechts im Bild. */
.rail-item { position: relative; flex: 0 0 auto; scroll-snap-align: start; display: flex; --art-h: 169px; }
.rail-item--continue, .rail-item--landscape { --art-h: 169px; }
.rail-item--poster, .rail-item--top10 { --art-h: 240px; }
.rail-item--square { --art-h: 200px; }
.rail-item > .card-play { top: calc(var(--art-h) - 54px); right: 10px; bottom: auto; }
@media (max-width: 899px) {
  .rail-item--continue { --art-h: 84px; }
  .rail-item--landscape { --art-h: 124px; }
  .rail-item--poster { --art-h: 180px; }
  .rail-item--square { --art-h: 132px; }
  .rail-item--top10 { --art-h: 160px; }
  .rail-item > .card-play { top: calc(var(--art-h) - 52px); right: 8px; }
}
.rail-item:hover .card-play, .rail-item:focus-within .card-play { opacity: 1; transform: none; }
/* Abspielknopf auf Karten (K1): am Rechner beim Ueberfahren oder Fokussieren, auf Touch-Geraeten immer sichtbar.
   Mindestens 44 px Tippflaeche; der Titel in der Karte lasst rechts Platz frei. Die Flaeche ist ein dunkles Kartenbild
   (Insel), daher der Primaerknopf-Token. */
.card-play {
  position: absolute; right: 10px; bottom: 10px; z-index: 4; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--btn-solid-bg); color: var(--btn-solid-ink); box-shadow: 0 4px 14px rgba(0,0,0,0.45);
  opacity: 0; transform: translateY(6px); transition: opacity 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.card-play svg { width: 22px; height: 22px; margin-left: 2px; }
.card-play:hover { background: var(--btn-solid-hover); }
.card-play:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.card:hover .card-play, .rail-card:hover .card-play, .card:focus-within .card-play, .rail-card:focus-within .card-play, .card-play:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .card-play { opacity: 1; transform: none; } }
.rc-art.has-play .rc-title, .rc-art.has-play .rc-artist { padding-right: 52px; box-sizing: border-box; }
@media (max-width: 899px) { .card-play { right: 8px; bottom: 8px; } }

/* Unterzeile der Karten: Album/Herausgeber und Interpret als einzelne Links, immer eine Zeile (stabile Kartenhoehe). */
.byline { display: flex; flex-wrap: nowrap; align-items: baseline; gap: 0 6px; min-width: 0; overflow: hidden; white-space: nowrap; }
.card-tagline.byline { display: flex; }
.byline-part { min-width: 0; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; color: inherit; text-decoration: none; }
.byline-sep { flex: none; color: var(--muted); }
.byline-link:hover { color: var(--text-hi); text-decoration: underline; }
.byline-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; border-radius: 3px; color: var(--text-hi); }
.rc-byline { width: 0; min-width: 100%; margin-top: 2px; }
.rail-item { flex-direction: column; }
/* Zeile unter Bildkarten (landscape, poster, continue, top10): feste Hoehe, auch ohne Inhalt */
.rc-byline--row { height: 19px; margin-top: 6px; font-size: 13px; line-height: 19px; color: var(--muted); }

/* Redaktionsprofil: Stand des eigenen Uebernahme-Antrags */
.prov-claim-status { margin: 0; color: var(--text); font-size: 13.5px; font-weight: 600; }

/* ============================================================
   KONTO (/konto): Seite statt Modal. Reiter, Studio-Eintraege, Karten, Zeilen.
   Nur Tokens: hell und dunkel kommen aus :root bzw. :root[data-theme="light"].
   ============================================================ */
body.is-konto-page .hero,
body.is-konto-page .chip-row { display: none !important; }
.konto-page { padding: 28px var(--gutter) 96px; max-width: 1100px; margin: 0 auto; }
.konto-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px 24px; align-items: center; margin-bottom: 20px; }
.konto-head .profile-avatar-xl { width: 84px; height: 84px; font-size: 36px; border-radius: 16px; box-shadow: none; border: 1px solid var(--line); }
.konto-head .pname { font-family: var(--display); font-weight: 700; font-size: clamp(26px, 4vw, 38px); line-height: 1.05; margin: 0 0 6px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.konto-head .pmeta { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.konto-head .pstats { color: var(--muted); font-size: 13px; margin-top: 6px; }
.konto-head-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.konto-head-links:not(:has(> :not([hidden]):not([style*="display: none"]))) { display: none; }
.konto-link { height: 36px; padding: 0 14px; font-size: 13px; text-decoration: none; }
.konto-tabs { margin-bottom: 22px; padding-bottom: 6px; }
.konto-tabs .area-tab { flex: none; }
.konto-body { min-width: 0; }

.konto-card { background: var(--tint-0); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px; min-width: 0; }
.konto-sec-head { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.konto-sec-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.konto-card > .konto-sec-title { margin-bottom: 14px; }
.konto-sub-title { margin: 0 0 6px; font-size: 15px; }
.konto-count { color: var(--muted); font-size: 13px; }
.konto-note { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.konto-note.is-warn { color: var(--text); border-left: 3px solid var(--tint-5); padding-left: 10px; }
.konto-note.is-bad { color: var(--danger); }
.konto-empty { margin: 0 0 6px; font-weight: 700; }
.konto-status { margin: 0 0 12px; padding: 9px 12px; border-radius: var(--radius-md); background: var(--tint-2); font-size: 14px; }
.konto-status.is-error { background: var(--danger-soft); color: var(--danger); }
.konto-status.is-success { background: var(--accent-soft); color: var(--text-hi); }

.konto-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-small { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.konto-card .btn { text-decoration: none; }

.konto-list { display: grid; gap: 0; }
.konto-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); min-width: 0; }
.konto-list > .konto-row:first-child, .konto-list > .konto-pl:first-child > .konto-row { border-top: 0; }
.konto-pl { border-top: 1px solid var(--line); }
.konto-pl:first-child { border-top: 0; }
.konto-pl > .konto-row { border-top: 0; }
.konto-thumb { flex: none; width: 72px; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; font-weight: 700; }
.konto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.konto-row-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.konto-row-title { color: var(--text); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.konto-row-title:hover, .konto-row-title:focus-visible { text-decoration: underline; }
.konto-row-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.konto-row-actions { flex: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }

.konto-inline-form { display: flex; gap: 8px; margin: 0 0 14px; max-width: 560px; }
.konto-inline-form input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--tint-1); color: var(--text); font: inherit; }
.konto-pl-panel { padding: 4px 0 12px 84px; }
.konto-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-width: 560px; }
.konto-order-item { display: flex; align-items: center; gap: 6px; }
.konto-order-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
@media (max-width: 720px) {
  .konto-page { padding-top: 18px; }
  .konto-head { gap: 14px; }
  .konto-head .profile-avatar-xl { width: 64px; height: 64px; font-size: 26px; border-radius: 14px; }
  .konto-row { flex-wrap: wrap; }
  .konto-row-actions { flex: 1 1 100%; justify-content: flex-start; }
  .konto-thumb { width: 64px; }
  .konto-pl-panel { padding-left: 0; }
  .konto-card { padding: 16px; }
  .konto-inline-form { max-width: none; }
}

.konto-studio-card { padding: 16px 20px; }
.konto-studio-card .konto-sec-title { font-size: 16px; margin-bottom: 10px; }
.konto-studio-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ============================================================
   EINBETTUNGSMODUS (Rahmen von serbska.app) — nur html.eingebettet
   embed-mode.js setzt die Klasse, wenn window.self !== window.top. Das Menue von serbska.app
   steht unten; Sorbflix zeigt keine eigene Tab-Leiste mehr. Ohne Rahmen gilt keine dieser Regeln.
   Die Abstaende, die 62 px fuer die Tab-Leiste freihielten, fallen weg (Zahlen = frueherer Wert minus 62).
   ============================================================ */
html.eingebettet .bottom-bar { display: none !important; }
@media (max-width: 899px) {
  html.eingebettet .mini-player { bottom: env(safe-area-inset-bottom, 0px); }
  html.eingebettet body.has-mini-player main.shelves,
  html.eingebettet body.has-mini-player .lib,
  html.eingebettet body.has-mini-player .footer { padding-bottom: 148px; }
  html.eingebettet body:not(.has-mini-player) .footer { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
  html.eingebettet body .debug-fab { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  html.eingebettet body.has-mini-player .debug-fab { bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important; }
  html.eingebettet .player.is-mini:not(.open) { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  /* Ziele der Tab-Leiste: Bibliothek und Konto wieder in der Kopfzeile ("Neu" steht in der Kategorienzeile,
     "Start" ist die Marke). Kleine Abstaende, damit die Kopfzeile bei 320 px nicht umbricht. */
  html.eingebettet .nav-library, html.eingebettet .avatar { display: grid; }
  /* Der Schriftzug neben dem Logo haette keinen Platz mehr ("S..."); das Logo bleibt der Weg zum Start,
     den Namen zeigt das Menue von serbska.app. */
  html.eingebettet .brand-for { display: none; }
  html.eingebettet .topbar { padding-right: 4px; }
  html.eingebettet .topbar-right { gap: 0; }
}
/* Sehr schmal (320 px): sonst bliebe der Marke (= Start) keine Breite. Tippflaechen 36 bis 40 px breit, 44 px hoch. */
@media (max-width: 359px) {
  html.eingebettet .topbar { gap: 4px; padding-left: 12px; }
  html.eingebettet .brand { min-width: 32px; }
  html.eingebettet .topbar-right .nav-icon { width: 38px; }
  html.eingebettet .lang-toggle .lang-opt { min-width: 34px; }
}
