/* ==========================================================
   Mediathek – Gestaltung
   Dunkle Hör-Oberfläche: links die Seitenleiste, rechts der
   Hauptbereich, unten der Player. Jede Kategorie und jede
   Aufnahme färbt den Kopf der Seite in ihrer eigenen Farbe
   (aus dem Titelbild oder der Kategorie). Messing markiert,
   was man drücken kann und was gerade läuft.
   Schrift: Atkinson Hyperlegible Next – entworfen für beste
   Lesbarkeit, auch für Menschen mit eingeschränkter Sehkraft.
   ========================================================== */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/atkinson-hyperlegible-next-latin-wght-normal.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;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@property --page-color { syntax: '<color>'; inherits: true; initial-value: #2B2226; }
@property --p-color { syntax: '<color>'; inherits: true; initial-value: #4A1023; }

:root {
  color-scheme: dark;

  /* Grundtöne: warmes Dunkel mit einem Hauch Bordeaux */
  --frame: #0F0B0D;
  --panel: #18131A;
  --raise: #241D22;
  --raise-2: #30282D;
  --line: #3A3036;
  --line-strong: #574A51;
  --ink: #F6F0EC;
  --ink-2: #B9AEAB;
  --ink-3: #8F8483;
  --messing: #D9A84E;
  --messing-hi: #E9BE6A;
  --messing-ink: #231604;
  --bordeaux: #7E1B3A;
  --danger: #FF8A80;
  --danger-soft: #3B1D1F;
  --ok: #7FD6A4;
  --ok-soft: #17301F;
  --focus: #8AB4FF;

  /* Namen, die die Verwaltung verwendet */
  --saal: var(--frame);
  --surface: var(--raise);
  --surface-2: var(--raise-2);
  --accent: var(--messing);
  --accent-text: var(--messing);
  --accent-soft: rgba(217, 168, 78, 0.14);
  --on-accent: var(--messing-ink);

  --font: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5rem;
  --step-3: 2rem;

  --r-tile: 6px;
  --r-panel: 10px;
  --r-field: 8px;
  --wrap: 880px;
  --player-h: 0px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--frame);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--frame);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

img { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 0.18em; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { cursor: default; }
[hidden] { display: none !important; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--frame); padding: 10px 14px; border-radius: 8px;
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.loading { padding: 80px 20px; text-align: center; color: var(--ink-2); }
.desktop-only { display: none !important; }

/* ==========================================================
   Gerüst – zuerst fürs Handy
   ========================================================== */

.sidebar { display: none; }

.main-panel {
  container: main / inline-size;
  min-height: 100vh;
  background-color: var(--panel);
  background-image: linear-gradient(180deg,
    var(--page-color) 0,
    color-mix(in srgb, var(--page-color) 45%, var(--panel)) 220px,
    var(--panel) 440px);
  background-repeat: no-repeat;
  background-attachment: local;
  transition: --page-color 0.45s ease;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--player-h) + 12px);
}

/* ---------- Kopfzeile im Hauptbereich ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  transition: background-color 0.2s ease;
}
.topbar.is-scrolled { background-color: color-mix(in srgb, var(--page-color) 55%, var(--frame)); }

.topbar-nav { display: flex; gap: 8px; }
.topbar-title {
  flex: 1; min-width: 0; font-weight: 750; font-size: var(--step-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transition: opacity 0.2s ease;
}
.topbar.show-title .topbar-title { opacity: 1; }
body.is-root .topbar-title { visibility: hidden; }
.topnav { display: flex; gap: 8px; align-items: center; margin-left: auto; }

body.is-root #tb-back { display: none; }
.topbar .brand-mobile { display: none; }
body.is-root .topbar .brand-mobile { display: flex; }
#main:focus { outline: none; }

.round-btn {
  width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center;
  border-radius: 999px; border: 0; background: rgba(0, 0, 0, 0.45); color: var(--ink);
  text-decoration: none;
}
.round-btn:hover:not([disabled]) { background: rgba(0, 0, 0, 0.7); }
.round-btn[disabled] { opacity: 0.4; }
.round-btn .icon { width: 22px; height: 22px; }
.round-btn-small { width: 32px; height: 32px; }
.round-btn-small .icon { width: 18px; height: 18px; }

.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--ink); text-decoration: none; font-weight: 780; font-size: var(--step-1); letter-spacing: -0.01em;
}
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-mark-slot { display: flex; flex: none; }
.brand-logo { display: grid; place-items: center; overflow: hidden; border-radius: 8px; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo.is-plate { background: #fff; padding: 3px; }
.side-top .brand .brand-mark { width: 36px; height: 36px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Tab-Leiste (Handy) ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: linear-gradient(180deg, rgba(15, 11, 13, 0.82), var(--frame) 45%);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-2); text-decoration: none; font-size: 0.8125rem; font-weight: 650;
}
.tabbar .icon { width: 26px; height: 26px; }
.tabbar a[aria-current='page'] { color: var(--ink); }
.tabbar a[aria-current='page'] .icon { stroke-width: 2.6; }

/* ---------- Seiteninhalt ---------- */

.page { padding: 4px 16px 32px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px 24px; }

.greeting { font-size: clamp(1.75rem, 1.2rem + 2.4cqi, 2.375rem); font-weight: 800; margin: 6px 0 18px; }
.page-title { font-size: clamp(1.75rem, 1.2rem + 2.4cqi, 2.375rem); font-weight: 800; margin: 6px 0 18px; }
.section-title { font-size: var(--step-2); font-weight: 780; margin: 0 0 12px; }

/* ---------- Kategorien als Liste (Startseite, Seitenleiste, „Mehr“) ---------- */

.quick, .library {
  list-style: none; margin: 0; padding: 0;
}
.quick {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 28px;
}
.lib-item {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  color: var(--ink); text-decoration: none;
}
.lib-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.lib-text strong { font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-text span { color: var(--ink-2); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.quick .lib-item {
  height: 60px; padding-right: 10px; border-radius: var(--r-tile); overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.quick .lib-text strong {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  line-height: 1.2; font-size: 0.9375rem;
}
@media (max-width: 420px) {
  .quick .lib-text strong + span { display: none; }
}
.quick .lib-item:hover { background: rgba(255, 255, 255, 0.14); }
.quick .tile { width: 60px; height: 60px; border-radius: 0; }
.quick .tile > .icon { width: 26px; height: 26px; }
.quick-compact { margin-bottom: 24px; }

.library { display: flex; flex-direction: column; gap: 2px; }
.library .lib-item { padding: 8px; border-radius: var(--r-tile); }
.library .lib-item:hover { background: var(--raise); }
.library .lib-item[aria-current='page'] { background: var(--raise-2); }
.library .lib-item[aria-current='page'] strong { color: var(--messing); }
.library .tile { width: 48px; height: 48px; }
.library .tile > .icon { width: 22px; height: 22px; }
.library-page .lib-item { padding: 8px 0; }

/* ---------- Kachel (Bild oder Kategorie-Symbol) ---------- */

.tile {
  position: relative; display: grid; place-items: center; flex: none;
  width: 60px; height: 60px; border-radius: var(--r-tile); overflow: hidden;
  background: var(--tile-bg, var(--bordeaux)); color: #fff;
}
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile > .icon { width: 28px; height: 28px; opacity: 0.95; }

/* ---------- Regale ---------- */

.shelf { container: shelf / inline-size; margin: 0 0 30px; }
.shelf-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.shelf-head h2 { font-size: var(--step-2); font-weight: 780; margin-right: auto; min-width: 0; }
.shelf-head h2 a { color: inherit; text-decoration: none; }
.shelf-head h2 a:hover { text-decoration: underline; }
.shelf-all { color: var(--ink-2); font-size: var(--step--1); font-weight: 700; text-decoration: none; white-space: nowrap; }
.shelf-all:hover { color: var(--ink); text-decoration: underline; }
.shelf-arrows { display: none; gap: 6px; align-self: center; }

.shelf-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(40vw, 172px); gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  margin: 0 -16px; padding: 2px 16px 8px;
  scrollbar-width: none;
}
.shelf-row::-webkit-scrollbar { display: none; }

/* ---------- Karte ---------- */

.card { position: relative; min-width: 0; scroll-snap-align: start; border-radius: 8px; }
.card-art { position: relative; aspect-ratio: 1; margin-bottom: 10px; }
.card-art .tile {
  width: 100%; height: 100%; border-radius: var(--r-tile);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}
.card-art .tile > .icon { width: 36%; height: 36%; }
.card-progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  border-radius: 0 0 var(--r-tile) var(--r-tile); overflow: hidden;
  background: rgba(0, 0, 0, 0.55);
}
.card-progress::after {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p, 0%);
  background: var(--messing);
}
.card-link { display: block; color: var(--ink); text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: 8px; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 720; line-height: 1.3;
}
.card-link:hover .card-title { text-decoration: underline; }
.card-sub, .card-langs {
  margin-top: 3px; font-size: var(--step--1); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-sub { color: var(--ink-2); }
.card-langs { color: var(--messing); font-weight: 650; }
.card.is-current .card-title { color: var(--messing); }

.play-fab {
  display: grid; place-items: center; border: 0; border-radius: 999px;
  background: var(--messing); color: var(--messing-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.play-fab:hover { background: var(--messing-hi); }
.card-play { position: absolute; right: 8px; bottom: 10px; z-index: 2; width: 42px; height: 42px; }
.card-play .icon { width: 20px; height: 20px; }

/* ---------- Hinweis, Leer-Zustand ---------- */

.hint {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; margin: 0 0 28px;
  background: var(--raise); border-left: 4px solid var(--messing);
  border-radius: var(--r-field);
}
.hint > .icon { color: var(--messing); margin-top: 3px; }
.hint p { flex: 1; color: var(--ink-2); max-width: 70ch; }
.hint strong { display: block; color: var(--ink); margin-bottom: 2px; }
.hint .btn { flex: none; }
@media (max-width: 640px) {
  .hint { flex-wrap: wrap; }
  .hint p { flex-basis: calc(100% - 40px); }
  .hint .btn { margin-left: 34px; }
}

.empty {
  padding: 46px 24px; text-align: center; color: var(--ink-2);
  background: var(--raise); border-radius: var(--r-panel); margin-bottom: 28px;
}
.empty strong { display: block; color: var(--ink); font-size: var(--step-1); margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }

.more { display: flex; justify-content: center; margin: 18px 0 8px; }

/* ==========================================================
   Kopf einer Kategorie- oder Aufnahme-Seite
   ========================================================== */

.hero { display: flex; flex-direction: column; gap: 18px; padding: 8px 0 20px; }
.hero-art {
  width: min(62vw, 250px); height: auto; aspect-ratio: 1; align-self: center;
  border-radius: var(--r-tile); box-shadow: 0 14px 44px rgba(0, 0, 0, 0.5);
}
.hero-art > .icon { width: 38%; height: 38%; }
.hero:not(.hero-rec) .hero-art { width: min(44vw, 190px); }
.hero-text { min-width: 0; }
.hero-kicker {
  display: inline-block; margin-bottom: 6px;
  color: var(--ink); font-weight: 700; font-size: var(--step--1); text-decoration: none;
}
.hero-kicker:hover { text-decoration: underline; }
.hero-title {
  font-size: clamp(2.25rem, 1rem + 6cqi, 5.75rem); font-weight: 800;
  letter-spacing: -0.035em; line-height: 1; text-wrap: balance; hyphens: auto; overflow-wrap: anywhere;
}
.hero-title.is-long { font-size: clamp(1.75rem, 1rem + 3.4cqi, 3.5rem); line-height: 1.08; letter-spacing: -0.025em; }
.hero-meta { margin-top: 12px; color: rgba(255, 255, 255, 0.78); }
.hero-meta strong { color: var(--ink); font-weight: 720; }
.hero-warn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 12px;
  padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.35); color: var(--messing);
  font-size: var(--step--1); font-weight: 650;
}

.actionbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 14px; padding: 6px 0 24px; }
.big-play {
  width: 60px; height: 60px; flex: none; display: grid; place-items: center;
  border: 0; border-radius: 999px; background: var(--messing); color: var(--messing-ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.big-play:hover { background: var(--messing-hi); transform: scale(1.04); }
.big-play .icon { width: 28px; height: 28px; }

/* ==========================================================
   Titelliste (Kategorie, alle Aufnahmen, Suchergebnisse)
   ========================================================== */

.rows { list-style: none; margin: 0; padding: 0; }
.rows-head { display: none; }

.row {
  display: grid; align-items: center; gap: 0 12px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  grid-template-areas: 'play main dur' 'play langs dur';
  padding: 6px 0; border-radius: var(--r-tile);
}
.row-num, .row-date { display: none; }
.row-play {
  grid-area: play; position: relative; padding: 0; border: 0; background: none; border-radius: var(--r-tile);
}
.row-play .tile { width: 52px; height: 52px; }
.row-play .tile > .icon { width: 24px; height: 24px; }
.row-play-icon {
  position: absolute; right: -4px; bottom: -4px;
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  background: var(--messing); color: var(--messing-ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.row-play-icon .icon { width: 14px; height: 14px; }

.row-main { grid-area: main; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.row-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main:hover .row-title { text-decoration: underline; }
.row-sub { color: var(--ink-2); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-langs { grid-area: langs; min-width: 0; margin-top: 4px; }
.row-langs:empty { display: none; }
.row-dur { grid-area: dur; color: var(--ink-2); font-size: var(--step--1); font-variant-numeric: tabular-nums; text-align: right; }

.row.is-current .row-title { color: var(--messing); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  font-size: 0.75rem; font-weight: 700; background: rgba(255, 255, 255, 0.09); color: var(--ink-2);
}

/* Laufende Aufnahme: drei Balken */
.eq { display: none; align-items: flex-end; justify-content: center; gap: 2px; width: 16px; height: 14px; }
.eq i { display: block; width: 3px; height: 35%; border-radius: 1px; background: var(--messing); }
.is-playing .eq i { animation: eq 0.85s ease-in-out infinite alternate; }
.is-playing .eq i:nth-child(2) { animation-delay: -0.4s; }
.is-playing .eq i:nth-child(3) { animation-delay: -0.2s; }
@keyframes eq { from { height: 20%; } to { height: 100%; } }

/* ==========================================================
   Suche
   ========================================================== */

.search { position: relative; }
.search > .icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--ink-2); pointer-events: none; }
.search input {
  width: 100%; min-height: 50px; padding: 0 46px;
  border-radius: 999px; border: 1px solid transparent; background: var(--raise-2); color: var(--ink);
}
.search input:hover { border-color: var(--line-strong); }
.search input:focus { outline: 3px solid var(--focus); outline-offset: 0; }
.search input::placeholder { color: var(--ink-2); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2);
  display: grid; place-items: center;
}
.search-clear:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }

.search-big { max-width: 520px; margin-bottom: 28px; }
.search-big input { min-height: 54px; font-size: var(--step-1); background: var(--ink); color: var(--frame); }
.search-big input::placeholder { color: #6E6366; }
.search-big > .icon { color: #4A4043; }
.search-big .search-clear { color: #4A4043; }
.search-big .search-clear:hover { background: rgba(0, 0, 0, 0.08); color: var(--frame); }

.search-inline { flex: 1 1 220px; max-width: 320px; margin-left: auto; }
.search-inline input { min-height: 44px; background: rgba(255, 255, 255, 0.1); }

.browse {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.browse-tile {
  position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10;
  padding: 14px 16px; border-radius: var(--r-panel);
  background: var(--c, var(--bordeaux)); color: #fff; text-decoration: none;
  font-size: var(--step-1); font-weight: 800; letter-spacing: -0.01em; line-height: 1.15;
}
.browse-tile span { position: relative; z-index: 1; }
.browse-icon {
  position: absolute; right: -8%; bottom: -14%; width: 52%; height: auto; aspect-ratio: 1;
  transform: rotate(20deg); color: rgba(255, 255, 255, 0.28);
}
.browse-tile:hover .browse-icon { color: rgba(255, 255, 255, 0.4); }
.browse-img {
  position: absolute; right: -6%; bottom: -6%; width: 46%; aspect-ratio: 1; height: auto; object-fit: cover;
  border-radius: var(--r-tile); transform: rotate(22deg); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.rows-plain { margin-bottom: 8px; }

/* ==========================================================
   Aufnahme: Tonspuren, Beschreibung
   ========================================================== */

.block { margin: 0 0 32px; }
.block-lead { color: var(--ink-2); margin-bottom: 14px; max-width: 68ch; }
.description { white-space: pre-line; max-width: 68ch; color: var(--ink-2); }

.langs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.lang-row { display: flex; align-items: center; gap: 8px; }
.lang-play {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px;
  min-height: 60px; padding: 0 16px 0 10px; border: 0; border-radius: var(--r-field);
  background: rgba(255, 255, 255, 0.06); color: var(--ink); text-align: left;
  font-size: var(--step-1); font-weight: 700;
}
.lang-play:hover { background: rgba(255, 255, 255, 0.11); }
.lang-icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.lang-icon .icon { width: 20px; height: 20px; }
.lang-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-dur { color: var(--ink-2); font-size: var(--step--1); font-weight: 500; font-variant-numeric: tabular-nums; }
.lang-row.is-active .lang-play { background: rgba(217, 168, 78, 0.14); }
.lang-row.is-active .lang-icon { background: var(--messing); color: var(--messing-ink); }
.lang-row.is-active .lang-name { color: var(--messing); }
.lang-row .round-btn { background: rgba(255, 255, 255, 0.06); }
.lang-row .round-btn:hover { background: rgba(255, 255, 255, 0.12); }

/* „Mehr“-Seite */
.menu-list { list-style: none; margin: 0; padding: 0; border-radius: var(--r-panel); overflow: hidden; background: var(--raise); }
.menu-list li + li { border-top: 1px solid var(--line); }
.menu-list a {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 16px;
  color: var(--ink); text-decoration: none; font-weight: 650;
}
.menu-list a:hover { background: var(--raise-2); }
.menu-list .icon { color: var(--messing); }
.page-more .block > .btn { margin-top: 2px; }

/* ==========================================================
   Knöpfe
   ========================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  font-weight: 700; text-decoration: none; line-height: 1.1; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--messing); border-color: var(--messing); color: var(--messing-ink); }
.btn-primary:hover { background: var(--messing-hi); border-color: var(--messing-hi); }
.btn-quiet { border-color: transparent; }
.btn-quiet:hover { background: rgba(255, 255, 255, 0.08); border-color: transparent; }
.btn-line { border-color: rgba(255, 255, 255, 0.34); min-height: 42px; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.btn-small { min-height: 38px; padding: 0 14px; font-size: var(--step--1); }
.btn-icon { width: 46px; padding: 0; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.topnav .btn-label { display: none; }

.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 650;
  background: rgba(255, 255, 255, 0.08); color: var(--ink-2); white-space: nowrap;
}
.badge-warn { background: var(--accent-soft); color: var(--messing); }

/* ==========================================================
   Fußzeile
   ========================================================== */

.site-footer {
  margin: 8px 16px 0; padding: 22px 0 28px; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: var(--step--1);
  display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between;
}
.site-footer a { color: var(--ink-2); }
.install-tip { display: flex; align-items: flex-start; gap: 10px; color: var(--ink-2); max-width: 60ch; }
.install-tip .icon { margin-top: 2px; color: var(--messing); }

/* ==========================================================
   Player – Handy: schwebende Mini-Leiste über den Tabs
   ========================================================== */

.player {
  position: fixed; z-index: 40;
  left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 4px);
  border-radius: var(--r-panel); overflow: hidden;
  background-color: color-mix(in srgb, var(--p-color) 78%, #000);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  transition: --p-color 0.5s ease;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.player :focus-visible { outline-color: var(--messing); }
.player button { color: inherit; background: none; border: 0; }
.player button[disabled] { opacity: 0.35; }

.player-inner {
  display: grid; align-items: center; gap: 2px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'info right controls';
  padding: 6px 6px 8px;
}
.player-top, .player-timeline, .p-skip, .volume, .p-close { display: none; }

.player-info {
  grid-area: info; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 2px; border-radius: var(--r-tile); text-align: left;
}
.player-tile { width: 44px; height: 44px; border-radius: 4px; }
.player-tile > .icon { width: 22px; height: 22px; }
.player-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.player-text strong { font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-text span { color: rgba(255, 255, 255, 0.74); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.player-controls { grid-area: controls; display: flex; align-items: center; gap: 4px; }
.p-skip { width: 44px; height: 44px; border-radius: 999px; place-items: center; }
.p-skip .icon { width: 28px; height: 28px; }
.p-skip:hover:not([disabled]) { background: rgba(255, 255, 255, 0.1); }
.p-play {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--messing) !important; color: var(--messing-ink) !important;
}
.p-play .icon { width: 22px; height: 22px; }
.p-play:hover { background: var(--messing-hi) !important; }

.player-right { grid-area: right; display: flex; align-items: center; gap: 6px; }
.p-settings {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px;
  font-weight: 700; white-space: nowrap;
}
.p-settings:hover { background: rgba(255, 255, 255, 0.1); }
.p-settings .icon { width: 24px; height: 24px; }
.p-settings-label { display: none; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; }
/* In der Mini-Leiste nur, wenn es Tonspuren zur Auswahl gibt */
.player:not(.is-open) .p-settings:not([data-kind='track']) { display: none; }

.player-mini-progress {
  position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px;
  border-radius: 2px; background: rgba(255, 255, 255, 0.22); overflow: hidden;
}
.player-mini-progress span { display: block; height: 100%; background: var(--messing); transform-origin: left; transform: scaleX(0); }

.time { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; min-width: 3.4em; }

.seek {
  --fill: 0%;
  flex: 1; height: 28px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none; touch-action: none;
}
.seek::-webkit-slider-runnable-track {
  height: 5px; border-radius: 999px;
  background: linear-gradient(to right, var(--messing) var(--fill), rgba(255, 255, 255, 0.24) var(--fill));
}
.seek::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.24); }
.seek::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--messing); }
.seek::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border-radius: 999px;
  background: #fff; border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.seek::-moz-range-thumb { width: 16px; height: 16px; border-radius: 999px; background: #fff; border: 0; }

/* ---------- Handy, aufgeklappt: ganzer Bildschirm in der Farbe der Aufnahme ---------- */

.player.is-open {
  inset: 0; border-radius: 0; z-index: 50; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg,
    var(--p-color) 0%,
    color-mix(in srgb, var(--p-color) 40%, var(--frame)) 58%,
    var(--frame) 100%);
  box-shadow: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: var(--safe-b);
}
.player.is-open .player-mini-progress { display: none; }
.player.is-open .player-inner {
  min-height: 100%; max-width: 520px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto auto auto;
  grid-template-areas: 'top' 'info' 'timeline' 'controls' 'right';
  gap: 16px; padding: 6px 22px 22px;
}
.player.is-open .player-top {
  grid-area: top; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center;
}
.player-collapse { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; }
.player-collapse:hover { background: rgba(255, 255, 255, 0.1); }
.player-collapse .icon { width: 28px; height: 28px; }
.player-context {
  text-align: center; font-weight: 700; font-size: var(--step--1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player.is-open .player-info {
  flex-direction: column; align-items: stretch; justify-content: center; gap: 22px;
  pointer-events: none; padding: 0;
}
.player.is-open .player-tile {
  width: min(100%, 46vh); height: auto; aspect-ratio: 1; align-self: center;
  border-radius: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}
.player.is-open .player-tile > .icon { width: 34%; height: 34%; }
.player.is-open .player-text strong { white-space: normal; font-size: var(--step-2); line-height: 1.2; }
.player.is-open .player-text span { white-space: normal; font-size: var(--step-0); margin-top: 4px; }

.player.is-open .player-timeline {
  grid-area: timeline; display: grid; grid-template-columns: 1fr 1fr;
  grid-template-areas: 'seek seek' 'cur dur'; gap: 0;
}
.player.is-open .seek { grid-area: seek; width: 100%; }
.player.is-open #p-cur { grid-area: cur; }
.player.is-open #p-dur { grid-area: dur; text-align: right; }

.player.is-open .player-controls { justify-content: center; gap: 18px; }
.player.is-open.has-queue .player-controls { justify-content: space-between; gap: 0; }
.player.is-open .p-skip { display: grid; width: 58px; height: 58px; }
.player.is-open .p-skip .icon { width: 36px; height: 36px; }
.player.is-open .p-track { display: none; }
.player.is-open.has-queue .p-track { display: grid; width: 48px; height: 48px; }
.player.is-open.has-queue .p-track .icon { width: 28px; height: 28px; }
.player.is-open .p-play { width: 76px; height: 76px; }
.player.is-open .p-play .icon { width: 34px; height: 34px; }

.player.is-open .player-right { justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.player.is-open .p-settings {
  height: 48px; padding: 0 18px 0 14px; font-size: var(--step-0);
  background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.2);
}
.player.is-open .p-settings-label { display: inline; max-width: 18ch; }
.player.is-open .p-settings[data-kind='track'] .p-settings-label::before { content: 'Tonspur: '; font-weight: 500; color: rgba(255, 255, 255, 0.72); }
.player.is-open .p-settings:not(.has-label) .p-settings-label::before { content: 'Einstellungen'; }
.player.is-open .p-close {
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 999px;
  color: rgba(255, 255, 255, 0.78) !important; font-weight: 650;
}
.player.is-open .p-close:hover { background: rgba(255, 255, 255, 0.1); }
.p-close-text { display: none; white-space: nowrap; }
.player.is-open .p-close-text { display: inline; }

/* ==========================================================
   Einstellungs-Blatt (Zahnrad)
   ========================================================== */

.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--raise);
  width: 100%; max-width: 100%; max-height: 88vh;
  margin: auto 0 0; border-radius: 18px 18px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.5);
}
.sheet::backdrop { background: rgba(5, 3, 4, 0.6); }
.sheet[open] { animation: sheet-up 0.22s ease-out; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.4; } }
.sheet :focus-visible { outline: 3px solid var(--messing); outline-offset: 2px; }
.sheet button { color: inherit; background: none; border: 0; font: inherit; }

.sheet-panel { padding: 8px 18px calc(22px + var(--safe-b)); }
.sheet-grip { width: 42px; height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.28); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { font-size: var(--step-1); font-weight: 780; }
.sheet-x { width: 46px; height: 46px; border-radius: 999px; display: grid; place-items: center; margin-right: -8px; }
.sheet-x:hover { background: rgba(255, 255, 255, 0.1); }

.sheet-section { padding: 12px 0; }
.sheet-section + .sheet-section { border-top: 1px solid var(--line); }
.sheet-section h3 { font-size: var(--step--1); font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }

.sheet-options { display: flex; flex-direction: column; gap: 2px; }
.sheet-options [role='radio'] {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 54px; padding: 0 12px 0 8px; border-radius: var(--r-field); font-size: var(--step-1); font-weight: 650;
}
.sheet-options [role='radio']:hover { background: rgba(255, 255, 255, 0.07); }
.sheet-options [role='radio'][aria-checked='true'] { background: rgba(255, 255, 255, 0.1); color: var(--messing); }
.opt-check { width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: var(--messing); }
.opt-check .icon { width: 24px; height: 24px; }
.opt-text { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex: 1; }
.opt-text small { color: var(--ink-2); font-size: var(--step--1); font-weight: 450; font-variant-numeric: tabular-nums; }

.sheet-options-row { flex-direction: row; flex-wrap: wrap; gap: 8px; }
.sheet-options-row [role='radio'] {
  width: auto; min-height: 46px; padding: 0 16px; border-radius: 999px; font-size: var(--step-0);
  border: 1px solid var(--line-strong);
}
.sheet-options-row .opt-check { display: none; }
.sheet-options-row [role='radio'][aria-checked='true'] { background: var(--messing); color: var(--messing-ink); border-color: var(--messing); }

/* ==========================================================
   Meldungen und Dialoge
   ========================================================== */

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--player-h) + 16px);
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 460px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px; pointer-events: auto;
  padding: 12px 14px 12px 16px; border-radius: var(--r-field);
  background: var(--ink); color: var(--frame); font-weight: 600; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.45);
  animation: toast-in 0.18s ease-out;
}
.toast p { flex: 1; }
.toast.is-error { background: #C9372C; color: #fff; }
.toast button {
  border: 1px solid currentColor; background: transparent; color: inherit;
  border-radius: 999px; min-height: 36px; padding: 0 12px; font-weight: 700;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.dialog {
  border: 0; border-radius: var(--r-panel); padding: 0; width: min(92vw, 480px);
  background: var(--raise); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.dialog::backdrop { background: rgba(5, 3, 4, 0.6); }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-size: var(--step-1); margin-bottom: 8px; }
.dialog-body p { color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ==========================================================
   Tablet und Computer: Seitenleiste, Hauptfenster, Player-Leiste
   ========================================================== */

@media (min-width: 900px) {
  html, body { height: 100%; }
  body { overflow: hidden; }
  .desktop-only { display: inline-grid !important; }
  .tabbar { display: none; }

  .app {
    display: grid; grid-template-columns: clamp(250px, 22vw, 330px) minmax(0, 1fr); gap: 8px;
    height: calc(100dvh - var(--player-h)); padding: 8px;
  }

  .sidebar { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
  .side-box { background: var(--panel); border-radius: var(--r-panel); }
  .side-top { padding: 18px 12px 10px; }
  .side-top .brand { padding: 0 8px 14px; }
  .side-nav { display: flex; flex-direction: column; }
  .side-nav a {
    display: flex; align-items: center; gap: 16px; min-height: 46px; padding: 0 12px; border-radius: var(--r-tile);
    color: var(--ink-2); text-decoration: none; font-weight: 750; font-size: var(--step-0);
  }
  .side-nav a:hover { color: var(--ink); }
  .side-nav a[aria-current='page'] { color: var(--ink); }
  .side-nav .icon { width: 26px; height: 26px; }

  .side-library { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px 8px 8px; }
  .side-h { font-size: var(--step-0); font-weight: 780; color: var(--ink-2); padding: 4px 12px 10px; }
  .side-library .library { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .side-account { border-top: 1px solid var(--line); margin-top: 8px; padding: 12px 12px 6px; font-size: var(--step--1); color: var(--ink-2); }
  .side-user { display: flex; gap: 10px; align-items: center; }
  .side-user strong { color: var(--ink); }
  .side-links { display: flex; gap: 16px; margin: 8px 0 0 30px; }
  .side-links a, .side-login { color: var(--ink-2); font-weight: 650; }
  .side-links a:hover, .side-login:hover { color: var(--ink); }
  .side-login { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }

  .main-panel {
    min-height: 0; overflow-y: auto; border-radius: var(--r-panel); padding-bottom: 0;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  .topbar { padding: 14px 24px; min-height: 64px; }
  .topbar-nav .round-btn { width: 34px; height: 34px; }
  .topbar-nav .round-btn .icon { width: 20px; height: 20px; }
  body.is-root #tb-back { display: inline-grid; }
  body.is-root .topbar .brand-mobile { display: none; }
  body.is-root .topbar-title { visibility: visible; }
  .topnav .btn-label { display: inline; }

  .page { padding: 0 24px 40px; }
  .wrap { padding: 0 24px 32px; }
  .site-footer { margin: 0 24px; }

  .quick { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
  .quick .lib-item { height: 64px; }
  .quick .tile { width: 64px; height: 64px; }

  /* Regale: so viele Karten, wie in eine Reihe passen; Pfeile zum Blättern */
  .shelf-row { margin: 0 -12px; padding: 0 12px 6px; gap: 6px; scroll-padding: 0 12px; grid-auto-columns: calc((100% - 2 * 6px) / 3); }
  @container shelf (min-width: 640px) { .shelf-row { grid-auto-columns: calc((100% - 3 * 6px) / 4); } }
  @container shelf (min-width: 860px) { .shelf-row { grid-auto-columns: calc((100% - 4 * 6px) / 5); } }
  @container shelf (min-width: 1100px) { .shelf-row { grid-auto-columns: calc((100% - 5 * 6px) / 6); } }
  @container shelf (min-width: 1400px) { .shelf-row { grid-auto-columns: calc((100% - 6 * 6px) / 7); } }
  .shelf.can-scroll .shelf-arrows { display: inline-flex; }
  .card { padding: 12px; }
  .card:hover, .card:focus-within { background: var(--raise); }
  .card-link::after { border-radius: 8px; }

  .card-play { width: 46px; height: 46px; right: 10px; bottom: 10px; }
  .card:hover .card-play { transform: scale(1.06); }
  .card-play .icon { width: 22px; height: 22px; }

  .hero { flex-direction: row; align-items: flex-end; gap: 26px; padding: 18px 0 26px; }
  .hero-art { width: clamp(170px, 22cqi, 232px); align-self: flex-end; }
  .actionbar { gap: 14px 18px; }
  .big-play { width: 58px; height: 58px; }

  /* Titelliste als Tabelle */
  .rows-head, .row {
    grid-template-columns: 28px 44px minmax(0, 3fr) minmax(0, 1.5fr) minmax(120px, 1fr) 64px;
    grid-template-areas: 'num play main langs date dur';
    gap: 0 14px; padding: 0 14px;
  }
  .rows-head {
    display: grid; align-items: center; min-height: 36px; margin-bottom: 10px;
    border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: var(--step--1);
  }
  .rows-head span:nth-child(1) { text-align: center; }
  .rows-head span:nth-child(2) { grid-column: 2 / 4; }
  .rows-head span:last-child { text-align: right; }
  .rows-head .icon { width: 18px; height: 18px; }
  .row { min-height: 64px; }
  .row:hover, .row:focus-within { background: rgba(255, 255, 255, 0.07); }
  .row-num { grid-area: num; display: grid; place-items: center; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .row.is-current .num { display: none; }
  .row.is-current .eq { display: flex; }
  .row-play .tile { width: 44px; height: 44px; border-radius: 4px; }
  .row-play .tile > .icon { width: 20px; height: 20px; }
  .row-play-icon { width: 24px; height: 24px; right: -5px; bottom: -5px; }
  .row-play-icon .icon { width: 13px; height: 13px; }
  .row:hover .row-play-icon { background: var(--messing-hi); }
  .row-langs { margin: 0; }
  .row-langs:empty { display: block; }
  .row-date { grid-area: date; display: block; color: var(--ink-2); font-size: var(--step--1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rows-plain .row-date { display: block; }

  .browse { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
  .browse-tile { font-size: var(--step-2); padding: 16px 18px; }

  /* Player-Leiste über die ganze Breite */
  .player {
    left: 0; right: 0; bottom: 0; border-radius: 0; box-shadow: none;
    background: var(--frame); padding-bottom: var(--safe-b);
  }
  .player-mini-progress { display: none; }
  .player-inner {
    min-height: 88px; padding: 8px 16px 10px; gap: 0 16px;
    grid-template-columns: minmax(200px, 1fr) minmax(360px, 1.45fr) minmax(200px, 1fr);
    grid-template-areas: 'info controls right' 'info timeline right';
  }
  .player-info { cursor: pointer; }
  .player-info:hover strong { text-decoration: underline; }
  .player-tile { width: 58px; height: 58px; }
  .player-text span { color: var(--ink-2); }

  .player-controls { justify-content: center; gap: 10px; align-self: end; }
  .p-skip { display: grid; width: 38px; height: 38px; }
  .p-skip .icon { width: 24px; height: 24px; }
  .p-track { display: none; }
  .player.has-queue .p-track { display: grid; width: 34px; height: 34px; }
  .player.has-queue .p-track .icon { width: 20px; height: 20px; }
  .p-play { width: 42px; height: 42px; }
  .p-play .icon { width: 20px; height: 20px; }

  .player-timeline { grid-area: timeline; display: flex; align-items: center; gap: 8px; align-self: start; }
  .player-timeline .time { min-width: 3.2em; color: var(--ink-2); }
  .player-timeline .time:first-child { text-align: right; }
  .player-timeline .seek { height: 20px; }
  .seek::-webkit-slider-runnable-track { height: 4px; }
  .seek::-webkit-slider-thumb { width: 13px; height: 13px; margin-top: -4.5px; }
  .seek::-moz-range-track, .seek::-moz-range-progress { height: 4px; }
  .seek::-moz-range-thumb { width: 13px; height: 13px; }

  .player-right { justify-content: flex-end; gap: 8px; }
  .p-settings, .player:not(.is-open) .p-settings:not([data-kind='track']) {
    display: inline-flex; height: 36px; padding: 0 12px 0 9px; font-size: var(--step--1);
    border: 1px solid var(--line-strong);
  }
  .p-settings:not(.has-label) { width: 36px; padding: 0; min-width: 36px; }
  .p-settings .icon { width: 20px; height: 20px; }
  .p-settings-label { display: inline; }
  .volume { display: flex; align-items: center; gap: 4px; }
  .p-mute { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: var(--ink-2) !important; }
  .p-mute:hover { color: var(--ink) !important; }
  .p-mute .icon { width: 22px; height: 22px; }
  .seek-vol { flex: none; width: clamp(80px, 8vw, 120px); }
  .p-close { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; color: var(--ink-2) !important; }
  .p-close:hover { background: rgba(255, 255, 255, 0.1); color: var(--ink) !important; }

  .toasts { bottom: calc(var(--player-h) + 20px); }

  .sheet { width: 420px; margin: auto; border-radius: 14px; }
  .sheet-grip { display: none; }
  .sheet[open] { animation: none; }
}

@media (min-width: 900px) and (hover: none) {
  .volume { display: none; }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .rows-head, .row {
    grid-template-columns: 28px 44px minmax(0, 3fr) minmax(0, 1.4fr) 64px;
    grid-template-areas: 'num play main langs dur';
  }
  .rows-head span:nth-child(4), .row-date, .rows-plain .row-date { display: none; }
  .seek-vol { width: 72px; }
}

/* ==========================================================
   Anmeldung und Verwaltung
   ========================================================== */

.panel {
  background: var(--raise); border-radius: var(--r-panel);
  padding: 22px; margin-bottom: 18px;
}
.panel h2 { font-size: var(--step-1); font-weight: 780; margin-bottom: 4px; }
.panel-lead { color: var(--ink-2); margin-bottom: 14px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 26px 0 14px;
}
.section-head h1, .section-head h2 { font-size: var(--step-3); font-weight: 800; }
.section-head .count { color: var(--ink-2); font-size: var(--step--1); white-space: nowrap; }
.toolbar { display: flex; gap: 12px; align-items: center; margin: 0 0 14px; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 280px; max-width: 480px; }

/* ---------- Formulare (Verwaltung, Anmeldung) ---------- */

.narrow { max-width: 460px; margin: 24px auto 40px; }
.narrow h1 { font-size: var(--step-3); font-weight: 800; margin-bottom: 8px; }
.narrow .lead { color: var(--ink-2); margin-bottom: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field > label, .field-label { font-weight: 700; }
.field .help { color: var(--ink-2); font-size: var(--step--1); }
.req { color: var(--accent-text); }

.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1px solid var(--line-strong); border-radius: var(--r-field); background: var(--surface-2); color: var(--ink);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-2); }
.input:focus, .select:focus, .textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }

.check { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check span small { display: block; color: var(--ink-2); font-size: var(--step--1); }

.form-error {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--danger-soft); color: var(--danger); border-radius: var(--r-field);
  padding: 12px 14px; margin-bottom: 18px; font-weight: 600;
}

.manage-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 2px 6px; margin: 0 -2px; }
@media (max-width: 640px) {
  .manage-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 4px 16px 6px; }
  .manage-nav::-webkit-scrollbar { display: none; }
}
.manage-nav a {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 650;
  color: var(--ink); border: 1px solid transparent;
}
.manage-nav a:hover { background: var(--surface); border-color: var(--line); }
.manage-nav a[aria-current='page'] { background: var(--ink); color: var(--saal); }

.step-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 22px; margin-bottom: 16px; }
.step-panel > h2 { display: flex; align-items: center; gap: 12px; font-size: var(--step-1); font-weight: 750; margin-bottom: 4px; }
.step-panel > h2 .optional { font-weight: 450; color: var(--ink-2); font-size: var(--step-0); }
.step-no {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; flex: none;
  background: var(--accent); color: var(--on-accent); font-size: 1rem; font-weight: 750;
}
.step-panel > .help { color: var(--ink-2); margin: 0 0 16px 44px; }
@media (max-width: 560px) { .step-panel > .help { margin-left: 0; } }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  border: 2px dashed var(--line-strong); border-radius: var(--r-panel); background: var(--surface-2);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone .icon { width: 36px; height: 36px; color: var(--accent-text); }
.dropzone strong { font-size: var(--step-1); }
.dropzone span { color: var(--ink-2); font-size: var(--step--1); }

.source-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.source-choice .dropzone { justify-content: flex-start; padding: 22px 18px; }
.source-choice .dropzone span { max-width: 36ch; }
@media (max-width: 700px) { .source-choice { grid-template-columns: 1fr; } }

.split-source {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--r-field);
  border: 1px solid var(--line); background: var(--surface-2);
}
.split-source.is-error { border-color: var(--danger); background: var(--danger-soft); }
.split-head { display: flex; align-items: center; gap: 12px; }
.split-head > .icon { color: var(--accent-text); }
.split-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.split-info strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.split-info span { color: var(--ink-2); font-size: var(--step--1); }
.split-source.is-error .split-info span { color: var(--danger); font-weight: 600; }
.split-source .progress-bar { margin: 12px 0 2px; }
.split-mode { margin: 14px 0 0; }
.split-hint { margin-top: 10px; color: var(--ink-2); font-size: var(--step--1); }
.track-edit.is-error { border-color: var(--danger); }
.track-edit.is-error small { color: var(--danger); font-weight: 600; }

.track-edit-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.track-edit {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, 220px) auto; gap: 10px 14px; align-items: center;
  padding: 12px 12px 12px 14px; border: 1px solid var(--line); border-radius: var(--r-field); background: var(--surface);
}
.track-edit:first-child { border-color: var(--messing); box-shadow: inset 4px 0 0 var(--messing); }
.track-edit .file { min-width: 0; }
.track-edit .file strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-edit .file small { color: var(--ink-2); }
.track-edit .order { display: flex; gap: 2px; }
.track-edit .order button { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.track-edit .order button:hover:not([disabled]) { border-color: var(--ink-2); }
.track-edit .order button[disabled] { opacity: 0.35; cursor: default; }
.track-edit .label-input { min-height: 44px; }
.track-edit .default-note { grid-column: 2 / -1; color: var(--ink-2); font-size: var(--step--1); margin-top: -4px; }
@media (max-width: 640px) {
  .track-edit { grid-template-columns: auto minmax(0, 1fr); }
  .track-edit .label-input { grid-column: 1 / -1; }
  .track-edit .order { grid-column: 1 / -1; justify-content: flex-end; }
  .track-edit .default-note { grid-column: 1 / -1; margin-top: 0; }
}

.cat-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-choice label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  min-height: 46px; padding: 0 16px 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 650;
}
.cat-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cat-choice label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cat-choice label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.cat-choice .icon { color: var(--accent-text); }
.cat-choice label:has(input:checked) .icon { color: var(--on-accent); }

.cover-pick { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cover-pick .tile { width: 110px; height: 110px; border-radius: 14px; }
.cover-pick .tile > .icon { width: 40px; height: 40px; }
.cover-pick .actions { display: flex; flex-wrap: wrap; gap: 8px; }

.form-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; margin: 22px 0 10px; }
.form-actions .btn-primary { min-height: 54px; padding: 0 26px; font-size: var(--step-1); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }

/* Upload-Fortschritt */
.progress-overlay {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px;
  background: rgba(15, 10, 14, 0.6);
}
.progress-card { width: min(92vw, 440px); background: var(--surface); border-radius: var(--r-panel); padding: 26px; }
.progress-card h2 { font-size: var(--step-1); margin-bottom: 6px; }
.progress-card p { color: var(--ink-2); }
.progress-bar { height: 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; margin: 18px 0 8px; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }
.progress-num { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Verwaltungslisten */
.admin-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; flex-wrap: wrap; }
.admin-row + .admin-row { border-top: 1px solid var(--line); }
.admin-row .tile { width: 48px; height: 48px; }
.admin-row .tile > .icon { width: 22px; height: 22px; }
.admin-row .grow { flex: 1 1 220px; min-width: 0; }
.admin-row .title { font-weight: 700; }
.admin-row .sub { color: var(--ink-2); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 2px; }
.admin-row .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.icon-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-choice label {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--accent-text);
}
.icon-choice input { position: absolute; opacity: 0; pointer-events: none; }
.icon-choice label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.icon-choice label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

.inline-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.inline-form .field { margin-bottom: 0; flex: 1 1 200px; }

.pw-row { display: flex; gap: 8px; }
.pw-row .input { flex: 1; }


@media (max-width: 640px) {
  .panel, .step-panel { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Name und Logo: Vorschau */
.brand-edit { display: flex; flex-direction: column; gap: 18px; }
.brand-previews { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; }
.brand-previews small { display: block; color: var(--ink-2); font-size: var(--step--1); }
.brand-preview-bar {
  display: flex; flex-direction: column; justify-content: center; gap: 12px;
  padding: 18px; border-radius: var(--r-panel); background: var(--panel); border: 1px solid var(--line);
}
.brand-preview-bar .brand { pointer-events: none; }
.brand-preview-bar .brand-mark { width: 36px; height: 36px; }
.brand-preview-app {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 18px 12px; border-radius: var(--r-panel);
  background: linear-gradient(160deg, #2E4A7D, #5B3D7A);
}
.app-icon {
  width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden;
  border-radius: 15px; background: #18131A; padding: 7px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.app-icon img { width: 100%; height: 100%; object-fit: contain; }
.app-icon.is-plate { background: #fff; }
.app-icon.is-default { padding: 0; background: none; }
.app-icon.is-default .brand-mark { width: 64px; height: 64px; }
.app-name { color: #fff; font-size: 0.8125rem; font-weight: 600; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-preview-app small { color: rgba(255, 255, 255, 0.75); margin-top: 4px; }
.brand-edit .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 560px) {
  .brand-previews { grid-template-columns: 1fr; }
}

.step-panel.plain > .help { margin-left: 0; }
.brand-note { color: var(--messing); font-size: var(--step--1); font-weight: 600; }
.brand-note:empty { display: none; }

/* ---------- Feinschliff für schmale und niedrige Handys ---------- */

@media (max-width: 899px) {
  .topnav .btn { width: 40px; min-height: 40px; padding: 0; border-radius: 999px; }
  .topnav .btn .icon { width: 22px; height: 22px; }
}

@media (max-width: 420px) {
  .quick .lib-item { gap: 10px; padding-right: 8px; }
  .quick .tile { width: 50px; height: 50px; }
  .quick .lib-item { height: 54px; }
  .quick .tile > .icon { width: 22px; height: 22px; }
  .quick .lib-text strong { font-size: 0.875rem; hyphens: auto; }
}

@media (max-width: 899px) and (max-height: 720px) {
  .player.is-open .player-inner { gap: 10px; padding-bottom: 14px; }
  .player.is-open .player-tile { width: min(100%, 34vh); }
  .player.is-open .player-info { gap: 14px; }
  .player.is-open .player-text strong { font-size: var(--step-1); }
  .player.is-open .p-play { width: 66px; height: 66px; }
  .player.is-open .p-skip { width: 52px; height: 52px; }
  .player.is-open .p-settings, .player.is-open .p-close { height: 44px; }
}

/* Bild einer Kategorie (Verwaltung) */
.cover-pick-small .tile { width: 88px; height: 88px; border-radius: 12px; }
.cover-pick-small .tile > .icon { width: 34px; height: 34px; }
.dialog .cover-pick-small { margin-top: 2px; }
