:root {
  color-scheme: dark;
  --page: #07090d;
  --frame: #0e1218;
  --panel: #141922;
  --panel-2: #191f2a;
  --panel-3: #202735;
  --text: #f4f6fa;
  --muted: #aab1bf;
  --muted-2: #7d8594;
  --line: rgba(255,255,255,.075);
  --line-strong: rgba(255,255,255,.12);
  --accent: #8b5cf6;
  --accent-2: #a779ff;
  --accent-soft: rgba(139,92,246,.18);
  --accent-soft-2: rgba(139,92,246,.34);
  --ok: #8ee5a7;
  --warn: #f4d68b;
  --danger: #ff8484;
  --shadow: 0 24px 70px rgba(0,0,0,.38);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 76% 18%, rgba(139,92,246,.08), transparent 31rem),
    linear-gradient(180deg, #05070a 0%, #090c11 100%);
}
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(167,121,255,.42);
  outline-offset: 2px;
}
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.app-frame {
  width: min(1540px, calc(100% - 28px));
  min-height: calc(100vh - 28px);
  margin: 14px auto;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.018), transparent 26%),
    var(--frame);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: 0 28px 100px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.025);
}

.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 25px;
  filter: grayscale(1) brightness(2.2);
}
.brand strong, .brand span { display: block; }
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.brand span { margin-top: 2px; color: var(--muted-2); font-size: 11px; }
.top-actions { display: flex; gap: 8px; }
.top-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
}
.top-icon:hover { background: var(--panel-2); border-color: var(--line); }

.workspace {
  display: grid;
  grid-template-columns: 210px minmax(280px, 330px) minmax(390px, 1fr) minmax(280px, 330px);
  gap: 10px;
  height: calc(100vh - 112px);
  min-height: 650px;
}
.panel {
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.005)),
    var(--panel);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.018);
  overflow: hidden;
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; padding: 12px 0; }
.nav-list { padding: 0 10px 12px; border-bottom: 1px solid var(--line); }
.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d8dce5;
  text-align: left;
  font-size: 14px;
}
.nav-item span { width: 20px; color: #d9dce5; font-size: 21px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.035); }
.nav-item.active {
  color: #cbb6ff;
  background: linear-gradient(90deg, rgba(139,92,246,.28), rgba(139,92,246,.14));
  box-shadow: inset 0 0 0 1px rgba(139,92,246,.12);
  font-weight: 750;
}
.nav-item.active span { color: #b99cff; }
.side-section { padding: 18px 14px; border-bottom: 1px solid var(--line); }
.side-section h2 {
  margin: 0 0 14px;
  color: #cfd4df;
  font-size: 13px;
  font-weight: 650;
}
.source-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: left;
  line-height: 1.25;
}
.source-button > span:first-child { width: 22px; text-align: center; font-size: 20px; }
.source-button.primary {
  border-color: rgba(167,121,255,.5);
  background: linear-gradient(135deg, #9d65f4, #7f4ce4);
  color: #fff;
  box-shadow: 0 8px 24px rgba(101,58,190,.23), inset 0 1px 0 rgba(255,255,255,.17);
  font-weight: 750;
}
.source-button.primary:hover { filter: brightness(1.06); }
.source-button.secondary { background: var(--panel-3); color: #e1e4eb; }
.source-button.secondary:hover { border-color: rgba(167,121,255,.35); }
.source-hint { margin: 12px 2px 0; color: var(--muted-2); font-size: 10px; line-height: 1.45; }
.stats-section { margin-top: auto; }
.stats-list { margin: 0; }
.stats-list div { display: flex; justify-content: space-between; gap: 10px; margin: 11px 0; color: var(--muted); font-size: 12px; }
.stats-list dt, .stats-list dd { margin: 0; }
.stats-list dd { color: #cfd4df; }
.storage-bar { height: 5px; margin: 0 14px 10px; background: #262d3a; border-radius: 99px; overflow: hidden; }
.storage-bar span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* Library */
.library-pane { display: flex; flex-direction: column; padding: 16px 0 0; }
.pane-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 14px 14px; }
.section-kicker { display: block; color: #9c7fe3; font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.pane-title-row h1 { margin: 3px 0 0; font-size: 19px; letter-spacing: -.025em; }
.count-badge { color: var(--muted-2); font-size: 11px; }
.library-tools { display: grid; grid-template-columns: 1fr 38px; gap: 8px; padding: 0 14px 12px; }
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 19px; pointer-events: none; }
.search-wrap input {
  width: 100%;
  height: 38px;
  padding: 0 10px 0 34px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111620;
}
.search-wrap input::placeholder { color: #787f8e; }
.tool-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #111620;
  font-size: 22px;
}
.tool-button:hover { border-color: rgba(167,121,255,.35); }
#librarySection { min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: #343b4a transparent; }
.library-list { padding: 0 10px 14px; }
.book-card {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr 22px;
  align-items: center;
  gap: 10px;
  min-height: 84px;
  padding: 7px;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.book-card:hover { background: rgba(255,255,255,.025); transform: translateY(-1px); }
.book-card.active {
  border-color: rgba(139,92,246,.2);
  background: linear-gradient(90deg, rgba(139,92,246,.2), rgba(139,92,246,.11));
}
.cover {
  width: 64px;
  height: 70px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(145deg, #2d3442, #171c25);
  color: #9c84d8;
  font-size: 25px;
  box-shadow: 0 8px 18px rgba(0,0,0,.24);
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.book-info { min-width: 0; }
.book-info strong, .book-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.book-info strong { margin-bottom: 5px; color: #f0f2f6; font-size: 13px; }
.book-info span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.book-more { color: #b7bdc8; font-size: 22px; text-align: center; }
.progress-track { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.075); }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.empty-state { margin: auto 14px; padding: 42px 18px; color: var(--muted); text-align: center; }
.empty-state h2 { margin: 14px 0 6px; color: var(--text); font-size: 17px; }
.empty-state p { margin: 0; font-size: 12px; line-height: 1.55; }
.empty-icon {
  width: 70px;
  height: 70px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(139,92,246,.22);
  border-radius: 50%;
  color: #b799ff;
  background: rgba(139,92,246,.09);
  font-size: 28px;
}

/* Main player */
.player-pane { position: relative; display: flex; align-items: stretch; justify-content: center; padding: 22px 24px; }
.player-placeholder, .player {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.player-placeholder { padding: 30px; color: var(--muted); }
.player-placeholder h2 { margin: 10px 0 8px; color: var(--text); font-size: clamp(21px, 2.2vw, 31px); }
.player-placeholder p { max-width: 390px; margin: 0; line-height: 1.6; font-size: 13px; }
.placeholder-disc {
  width: min(250px, 62%);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid rgba(139,92,246,.18);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #171c25 0 9%, transparent 10%),
    repeating-radial-gradient(circle at center, rgba(255,255,255,.025) 0 2px, transparent 3px 8px),
    linear-gradient(145deg, #202633, #10141c);
  box-shadow: 0 28px 60px rgba(0,0,0,.32), inset 0 0 40px rgba(139,92,246,.06);
}
.placeholder-disc span { font-size: 50px; color: #8c67dc; }
.player { justify-content: flex-start; overflow: auto; scrollbar-width: none; padding-top: 6px; }
.player::-webkit-scrollbar { display: none; }
.hero-cover-wrap { width: min(300px, 70%); margin: 0 auto 20px; }
.hero-cover {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(145deg, #303847, #151a23);
  color: #9d7ede;
  font-size: 52px;
  box-shadow: 0 24px 46px rgba(0,0,0,.42), 0 0 0 1px rgba(255,255,255,.045);
}
.hero-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-heading { max-width: 520px; }
.track-heading h2 { margin: 7px 0 4px; font-size: clamp(21px, 2.4vw, 30px); letter-spacing: -.035em; }
.track-heading p { margin: 0; color: #c4c8d0; font-size: 14px; line-height: 1.5; }
.transport { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.4vw, 18px); margin: 20px 0 16px; }
.round-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}
.secondary-round { background: #202633; color: #e1e4ea; }
.secondary-round:hover { border-color: rgba(167,121,255,.25); background: #252c3a; }
.play-button {
  width: 70px;
  height: 70px;
  background: linear-gradient(145deg, #995ff2, #7d4ce1);
  box-shadow: 0 14px 34px rgba(108,63,199,.34), inset 0 1px 0 rgba(255,255,255,.2);
  font-size: 25px;
}
.play-button:hover { filter: brightness(1.08); }
.seek-block { width: 100%; max-width: 610px; }
input[type="range"] {
  width: 100%;
  height: 4px;
  accent-color: var(--accent);
  cursor: pointer;
}
.seek-times { display: flex; justify-content: space-between; margin-top: 5px; color: #c2c7d0; font-size: 10px; }
.player-options { width: 100%; max-width: 610px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.option-tile {
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #cfd3dc;
  background: #1d2330;
  font-size: 10px;
}
.option-tile > span { color: var(--muted); }
.option-tile select {
  width: 100%;
  max-width: 135px;
  padding: 0;
  color: #f0f2f6;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 750;
}
.button-tile { cursor: pointer; }
.button-tile strong { font-size: 13px; }
.option-tile:hover { border-color: rgba(167,121,255,.25); }
.sleep-status { min-height: 18px; margin-top: 7px; color: #b999ff; font-size: 10px; }
.volume-row { width: 100%; max-width: 610px; display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; gap: 10px; margin-top: 7px; color: #d8dce3; }
.close-player { margin-top: 12px; padding: 7px 10px; border: 0; color: var(--muted-2); background: transparent; font-size: 10px; }
.close-player:hover { color: var(--text); }

/* Chapters */
.chapters-pane { display: flex; flex-direction: column; padding: 0 0 10px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  height: 48px;
  border: 0;
  background: transparent;
  color: #c6cad3;
  font-size: 12px;
  font-weight: 650;
}
.tab.active { color: #b996ff; }
.tab.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 99px; background: var(--accent); }
.tab-panel { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.chapters-heading { display: none; justify-content: space-between; align-items: center; padding: 12px; }
.chapters-heading h2 { margin: 0; font-size: 15px; }
.chapters-heading span { color: var(--muted-2); font-size: 11px; }
.chapter-list { min-height: 0; flex: 1; overflow: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #353c4b transparent; }
.chapter-row {
  width: 100%;
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #e6e8ed;
  text-align: left;
  font-size: 12px;
}
.chapter-row:hover { background: rgba(255,255,255,.025); }
.chapter-row.active { border-color: rgba(139,92,246,.16); background: linear-gradient(90deg, rgba(139,92,246,.22), rgba(139,92,246,.13)); }
.chapter-number { color: #d9dce4; text-align: center; }
.chapter-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chapter-duration { color: #aab1bf; font-size: 10px; }
.chapters-empty { margin: auto; padding: 30px 20px; color: var(--muted-2); text-align: center; font-size: 12px; line-height: 1.55; }
.mini-player {
  display: grid;
  grid-template-columns: 50px 1fr 35px;
  align-items: center;
  gap: 10px;
  margin: 5px 8px 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #171c25;
}
.mini-cover { width: 50px; height: 50px; display: grid; place-items: center; overflow: hidden; border-radius: 5px; background: #282f3d; color: #9678dc; }
.mini-cover img { width: 100%; height: 100%; object-fit: cover; }
.mini-text { min-width: 0; }
.mini-text strong, .mini-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-text strong { font-size: 11px; }
.mini-text span { margin-top: 4px; color: var(--muted); font-size: 9px; }
#miniPlayBtn { width: 34px; height: 34px; border: 0; border-radius: 50%; background: transparent; font-size: 18px; }

/* Dialog and toast */
dialog {
  width: min(580px, calc(100% - 28px));
  padding: 20px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #151a23;
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head h2 { margin: 5px 0 0; font-size: 21px; }
dialog > p { color: var(--muted); line-height: 1.55; font-size: 12px; }
.dialog-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); font-size: 22px; }
.format-results { display: grid; gap: 7px; margin-top: 16px; }
.format-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #1b212c; font-size: 12px; }
.format-ok { color: var(--ok); }
.format-maybe { color: var(--warn); }
.format-no { color: var(--danger); }
.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: calc(18px + env(safe-area-inset-top));
  max-width: calc(100% - 30px);
  padding: 10px 14px;
  color: var(--text);
  border: 1px solid rgba(167,121,255,.25);
  border-radius: 10px;
  background: #202633;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: .22s ease;
  text-align: center;
  font-size: 12px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1250px) {
  .workspace { grid-template-columns: 190px 280px minmax(360px, 1fr); }
  .chapters-pane { grid-column: 2 / -1; min-height: 330px; }
  .workspace { height: auto; min-height: 0; }
  .sidebar, .library-pane, .player-pane { height: calc(100vh - 112px); min-height: 650px; }
  .chapters-pane { height: 420px; }
  .chapter-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 3px; }
}

@media (max-width: 900px) {
  .app-frame { width: min(100% - 16px, 860px); margin: 8px auto; padding: 10px; }
  .topbar { padding: 2px 4px 10px; }
  .workspace { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; }
  .sidebar { grid-column: 1; height: auto; min-height: 0; }
  .library-pane { grid-column: 2; height: 620px; min-height: 0; }
  .player-pane { grid-column: 1 / -1; height: auto; min-height: 690px; }
  .chapters-pane { grid-column: 1 / -1; height: 430px; min-height: 0; }
  .stats-section { margin-top: 0; }
}

@media (max-width: 640px) {
  body { background: var(--frame); }
  .app-frame { width: 100%; min-height: 100vh; margin: 0; padding: 8px; border: 0; border-radius: 0; box-shadow: none; }
  .topbar { position: sticky; z-index: 20; top: 0; height: 58px; padding: 7px 5px 9px; background: rgba(14,18,24,.93); backdrop-filter: blur(14px); }
  .brand strong { font-size: 16px; }
  .brand span { display: none; }
  .workspace { display: flex; flex-direction: column; }
  .panel { border-radius: 13px; }
  .sidebar, .library-pane, .player-pane, .chapters-pane { width: 100%; height: auto; min-height: 0; }
  .sidebar { padding: 9px 0; }
  .nav-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 8px 9px; overflow-x: auto; }
  .nav-item { min-width: 0; min-height: 54px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px; font-size: 8px; text-align: center; }
  .nav-item span { width: auto; font-size: 20px; }
  .source-section { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .source-section h2, .source-hint { grid-column: 1 / -1; }
  .source-button { margin: 0; min-height: 58px; }
  .source-button span br { display: none; }
  .stats-section, .storage-bar { display: none; }
  .library-pane { max-height: 520px; }
  .library-list { padding-bottom: 10px; }
  .book-card { grid-template-columns: 58px 1fr 20px; min-height: 76px; }
  .cover { width: 58px; height: 63px; }
  .player-pane { padding: 20px 14px; }
  .player-placeholder { min-height: 460px; }
  .player { min-height: 0; overflow: visible; }
  .hero-cover-wrap { width: min(265px, 76%); }
  .transport { gap: 8px; }
  .round-button { width: 43px; height: 43px; font-size: 11px; }
  .play-button { width: 64px; height: 64px; font-size: 22px; }
  .player-options { grid-template-columns: 1fr 1fr; }
  .player-options .option-tile:last-child { grid-column: 1 / -1; }
  .chapters-pane { height: 420px; }
  .chapter-list { display: block; }
}

@media (max-width: 390px) {
  .app-frame { padding: 5px; }
  .brand-mark { width: 28px; font-size: 21px; }
  .top-actions { gap: 2px; }
  .top-icon { width: 36px; height: 36px; }
  .source-section { grid-template-columns: 1fr; }
  .source-section h2, .source-hint { grid-column: 1; }
  .player-pane { padding-inline: 9px; }
  .transport { gap: 5px; }
  .round-button { width: 39px; height: 39px; }
  .play-button { width: 58px; height: 58px; }
}

@media (hover: none) {
  .book-card:hover { transform: none; }
  button, select, input { min-height: 42px; }
  input[type="range"] { min-height: 30px; }
}


/* V8: einklappbare Bereiche */
.collapsible-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: height .22s ease, min-height .22s ease, border-color .18s ease, opacity .18s ease;
}
.panel-collapse-head {
  min-height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}
.panel-collapse-title { min-width: 0; }
.panel-collapse-title strong,
.panel-collapse-title h1 {
  display: block;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: -.02em;
}
.panel-collapse-title h1 { font-size: 19px; }
.panel-head-actions { display: flex; align-items: center; gap: 8px; }
.panel-collapse-button {
  width: 34px;
  height: 34px;
  min-width: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1b212c;
  color: #d8dce5;
  font-size: 19px;
  line-height: 1;
}
.panel-collapse-button:hover {
  border-color: rgba(167,121,255,.4);
  background: #222936;
}
.panel-collapse-button span {
  display: block;
  transition: transform .2s ease;
}
.panel-collapse-content {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
}
.collapsible-panel.is-collapsed {
  height: 55px !important;
  min-height: 55px !important;
  align-self: start;
}
.collapsible-panel.is-collapsed .panel-collapse-head { border-bottom-color: transparent; }
.collapsible-panel.is-collapsed .panel-collapse-content { display: none !important; }
.collapsible-panel.is-collapsed .panel-collapse-button span { transform: rotate(180deg); }

.sidebar > .panel-collapse-content { overflow: auto; scrollbar-width: thin; scrollbar-color: #353c4b transparent; }
.sidebar .nav-list { flex: 0 0 auto; }
.sidebar .stats-section { margin-top: auto; }
.library-pane > .panel-collapse-content { overflow: hidden; }
.library-pane #librarySection { flex: 1; }
.player-pane > .player-panel-content {
  align-items: stretch;
  justify-content: center;
  padding: 16px 24px 22px;
}
.player-panel-content > .player-placeholder,
.player-panel-content > .player { min-height: 100%; }
.chapters-pane > .chapters-panel-content { flex: 1; overflow: hidden; padding-bottom: 10px; }

@media (min-width: 1251px) {
  .workspace {
    --sidebar-col: 210px;
    --library-col: minmax(280px, 330px);
    --player-col: minmax(390px, 1fr);
    --chapters-col: minmax(280px, 330px);
    grid-template-columns: var(--sidebar-col) var(--library-col) var(--player-col) var(--chapters-col);
    transition: grid-template-columns .22s ease;
  }
  .workspace.sidebar-collapsed { --sidebar-col: 55px; }
  .workspace.library-collapsed { --library-col: 55px; }
  .workspace.player-collapsed { --player-col: 55px; }
  .workspace.chapters-collapsed { --chapters-col: 55px; }
  .workspace .collapsible-panel.is-collapsed .panel-collapse-title,
  .workspace .collapsible-panel.is-collapsed .panel-head-actions > :not(.panel-collapse-button) {
    display: none;
  }
  .workspace .collapsible-panel.is-collapsed .panel-collapse-head {
    justify-content: center;
    padding-inline: 9px;
  }
}

@media (max-width: 900px) {
  .collapsible-panel.is-collapsed {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .panel-collapse-head { min-height: 53px; padding: 9px 11px; }
  .panel-collapse-title strong { font-size: 14px; }
  .panel-collapse-title h1 { font-size: 17px; }
  .panel-collapse-button { width: 36px; height: 36px; min-width: 36px; }
  .collapsible-panel.is-collapsed { height: 53px !important; min-height: 53px !important; }
  .sidebar { padding: 0; }
  .library-pane { max-height: none; }
  .library-pane:not(.is-collapsed) { max-height: 560px; }
  .player-pane { padding: 0; }
  .player-pane > .player-panel-content { padding: 18px 14px 22px; }
  .player-placeholder { min-height: 430px; }
  .chapters-pane:not(.is-collapsed) { height: 440px; }
}

@media (max-width: 390px) {
  .player-pane > .player-panel-content { padding-inline: 9px; }
}

/* V9: Lesezeichen, Weiterhören, erweiterte Bibliothek und Sicherung */
.library-tools-extended {
  grid-template-columns: minmax(0, 1fr) minmax(112px, .58fr);
  align-items: center;
}
.sort-wrap select {
  width: 100%;
  height: 38px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #111620;
  font-size: 11px;
}
.compact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 10px;
  cursor: pointer;
}
.library-tools-extended > .compact-toggle { grid-column: 1 / -1; }
.compact-toggle input, .settings-toggle input { accent-color: var(--accent); }

.continue-section { margin: 0 12px 12px; }
.continue-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 7px; }
.continue-heading > span:last-child { color: #c9b4ff; font-size: 10px; font-weight: 800; }
.continue-card {
  width: 100%;
  display: grid;
  grid-template-columns: 55px minmax(0,1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 11px;
  color: var(--text);
  background: linear-gradient(100deg, rgba(139,92,246,.18), rgba(139,92,246,.07));
  text-align: left;
}
.continue-card:hover { border-color: rgba(167,121,255,.48); }
.continue-cover { width: 55px; height: 55px; display: grid; place-items: center; overflow: hidden; border-radius: 7px; background: #282f3d; color: #a68be4; font-size: 22px; }
.continue-cover img { width: 100%; height: 100%; object-fit: cover; }
.continue-copy { min-width: 0; }
.continue-copy strong, .continue-copy span, .continue-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-copy strong { font-size: 12px; }
.continue-copy span { margin-top: 4px; color: #c4c8d0; font-size: 10px; }
.continue-copy small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.continue-play { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); box-shadow: 0 8px 18px rgba(112,66,204,.3); }

.book-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) 31px;
  gap: 5px;
  padding: 5px;
}
.book-open {
  min-width: 0;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  padding: 2px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}
.book-card-actions { display: flex; flex-direction: column; gap: 4px; }
.book-card-actions button {
  width: 29px;
  height: 29px;
  min-height: 29px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #b8bec9;
  background: transparent;
  font-size: 16px;
}
.book-card-actions button:hover { border-color: var(--line-strong); background: rgba(255,255,255,.035); }
.book-card.completed { opacity: .78; }
.book-card.completed .progress-fill { background: linear-gradient(90deg, #65d5ad, #84e3c3); }
.filtered-empty { margin: 20px 4px; padding: 24px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: 12px; }

.track-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.small-action {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #d7dbe3;
  background: #1b212c;
  font-size: 10px;
}
.small-action:hover { border-color: rgba(167,121,255,.35); }
.sleep-tools {
  width: 100%;
  max-width: 610px;
  display: grid;
  grid-template-columns: auto minmax(145px,1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(17,22,32,.7);
}
.sleep-rewind { display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 10px; }
.sleep-rewind select { padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; color: var(--text); background: #171c25; font-size: 10px; }
#extendSleepBtn:disabled { opacity: .4; cursor: not-allowed; }

.bookmark-add-wide { margin: 8px; padding: 9px 10px; border: 1px solid rgba(139,92,246,.25); border-radius: 9px; color: #d9cbff; background: rgba(139,92,246,.1); font-size: 11px; }
.bookmark-list { min-height: 0; flex: 1; overflow: auto; padding: 0 8px 8px; }
.bookmark-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 9px; background: #171c25; }
.bookmark-jump { min-width: 0; padding: 9px 10px; border: 0; color: var(--text); background: transparent; text-align: left; }
.bookmark-jump strong, .bookmark-jump span, .bookmark-jump small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-jump strong { font-size: 11px; }
.bookmark-jump span { margin-top: 4px; color: #bfc4ce; font-size: 10px; }
.bookmark-jump small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.bookmark-actions { display: flex; flex-direction: column; padding: 5px; }
.bookmark-actions button { width: 28px; height: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.bookmark-actions button:hover { color: var(--text); background: rgba(255,255,255,.04); }

.dialog-form { display: grid; gap: 16px; }
.dialog-field { display: grid; gap: 7px; color: var(--muted); font-size: 11px; }
.dialog-field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: #10151e; }
.dialog-actions, .settings-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.primary-dialog-button, .secondary-dialog-button { padding: 9px 12px; border-radius: 9px; font-size: 11px; font-weight: 700; }
.primary-dialog-button { border: 1px solid transparent; background: linear-gradient(145deg,#995ff2,#7d4ce1); }
.secondary-dialog-button { border: 1px solid var(--line); color: var(--text); background: #1b212c; }
.settings-stack { display: grid; gap: 10px; margin-top: 16px; }
.settings-card { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #1a202a; }
.settings-card h3 { margin: 0 0 7px; font-size: 13px; }
.settings-card p { margin: 0 0 10px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.settings-toggle { display: flex; align-items: flex-start; gap: 9px; color: #d8dce4; font-size: 11px; line-height: 1.45; }
.settings-status { display: block; min-height: 17px; margin-top: 8px; color: #b99cff; font-size: 10px; }

@media (max-width: 640px) {
  .library-tools-extended { grid-template-columns: 1fr; }
  .library-tools-extended > .compact-toggle { grid-column: 1; }
  .book-open { grid-template-columns: 58px minmax(0,1fr); }
  .sleep-tools { grid-template-columns: 1fr; justify-items: stretch; }
  .sleep-tools .compact-toggle { justify-content: center; }
  .sleep-rewind { justify-content: space-between; }
  .track-actions { gap: 5px; }
}


/* V10: Bibliotheks- und Speicherverwaltung */
.book-card-actions .book-delete { color: #ff9aa8; }
.book-card-actions .book-delete:hover { border-color: rgba(255,105,125,.45); background: rgba(255,80,105,.1); }
.storage-summary-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 10px; }
.storage-summary-grid > div { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #151a22; }
.storage-summary-grid span, .storage-summary-grid strong { display: block; }
.storage-summary-grid span { color: var(--muted); font-size: 10px; }
.storage-summary-grid strong { margin-top: 4px; color: #f1f3f7; font-size: 14px; }
.storage-book-list { display: grid; gap: 6px; max-height: 230px; margin: 8px 0 10px; overflow: auto; }
.storage-book-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #151a22; }
.storage-book-row span { min-width: 0; }
.storage-book-row strong, .storage-book-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-book-row strong { color: #e9ecf2; font-size: 11px; }
.storage-book-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.storage-book-row button, .danger-dialog-button { min-height: 36px; padding: 0 11px; border: 1px solid rgba(255,105,125,.32); border-radius: 9px; background: rgba(255,75,100,.08); color: #ffabb6; font-size: 10px; font-weight: 750; }
.storage-book-row button:hover, .danger-dialog-button:hover { background: rgba(255,75,100,.15); border-color: rgba(255,105,125,.55); }
.danger-dialog-button { width: 100%; }
.danger-dialog-button:disabled { cursor: not-allowed; opacity: .42; }
.storage-empty { margin: 0; padding: 10px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); text-align: center; font-size: 10px; }
@media (max-width: 640px) {
  .storage-summary-grid { grid-template-columns: 1fr; }
}

/* V11: Metadaten, CUE- und manuelle Kapitel */
.player-meta {
  min-height: 18px;
  margin: 4px 0 0;
  color: #aeb4c1;
  font-size: 11px;
  line-height: 1.45;
}
.book-tag-meta { color: #b9a5e8 !important; }
.chapter-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
}
.chapter-entry .chapter-row { min-width: 0; }
.chapter-source {
  display: inline-block;
  margin-left: 6px;
  color: #a986ff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .08em;
  vertical-align: 1px;
}
.chapter-manual-delete {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border: 1px solid rgba(255,105,125,.26);
  border-radius: 8px;
  background: rgba(255,75,100,.06);
  color: #ffabb6;
  font-size: 17px;
}
.chapter-manual-delete:hover {
  border-color: rgba(255,105,125,.5);
  background: rgba(255,75,100,.13);
}
.dialog-note {
  margin: -2px 0 14px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #151a22;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}


/* V12: Sleep-Timer, getrennte Sicherungen und APK-SMB-Bridge */
.source-button small { display: inline-block; margin-left: 5px; padding: 2px 5px; border: 1px solid rgba(185,156,255,.28); border-radius: 99px; color: #cbb8ff; font-size: 8px; font-weight: 800; letter-spacing: .06em; vertical-align: middle; }
.backup-actions { justify-content: flex-start; }
.backup-progress { width: 100%; height: 8px; margin-top: 10px; accent-color: var(--accent); }
.backup-progress.hidden { display: none; }
.smb-field-grid { display: grid; grid-template-columns: minmax(0,2fr) minmax(90px,.7fr); gap: 10px; }
.smb-field-grid .dialog-field:nth-child(3), .smb-field-grid .dialog-field:nth-child(4), .smb-field-grid .dialog-field:nth-child(5), .smb-field-grid .dialog-field:nth-child(6), .smb-field-grid .dialog-field:nth-child(7) { grid-column: 1 / -1; }
.dialog-field input:invalid:not(:placeholder-shown) { border-color: rgba(255,105,125,.55); }
#smbDialog { width: min(560px, calc(100vw - 24px)); }
#smbStatus.error { color: #ff9aaa; }
#smbStatus.success { color: #78d8b3; }
@media (max-width: 640px) {
  .smb-field-grid { grid-template-columns: 1fr; }
  .smb-field-grid .dialog-field { grid-column: 1 !important; }
  .backup-actions > button { flex: 1 1 100%; }
}


/* V13: mobile Player-Hauptansicht und Navigationsmenü */
.mobile-only,
.mobile-backdrop,
.mobile-bookmark-tile,
.chapter-remaining { display: none; }
.remaining-time { color: var(--muted-2); font-size: 10px; text-align: center; }

.mobile-menu-dialog { width: min(520px, calc(100% - 20px)); }
.mobile-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 18px;
}
.mobile-menu-grid button {
  min-height: 88px;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #1b212c;
  text-align: left;
}
.mobile-menu-grid button:hover { border-color: rgba(167,121,255,.42); background: #222936; }
.mobile-menu-grid button > span { grid-row: 1 / 3; font-size: 25px; text-align: center; }
.mobile-menu-grid button strong { font-size: 13px; }
.mobile-menu-grid button small { color: var(--muted); font-size: 10px; }

@media (max-width: 640px) {
  html { background: #eef1f5; }
  body {
    min-height: 100svh;
    overflow-x: hidden;
    background: #eef1f5;
  }
  .mobile-only { display: grid; }
  .mobile-backdrop {
    position: fixed;
    z-index: 0;
    inset: -90px -90px auto;
    display: block;
    height: 69svh;
    background-position: 50% 25%;
    background-size: cover;
    opacity: 0;
    filter: blur(52px) saturate(.9);
    transform: scale(1.12);
    transition: opacity .3s ease, background-image .3s ease;
    pointer-events: none;
  }
  .mobile-backdrop.has-cover { opacity: .44; }
  .mobile-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(238,241,245,.14), #eef1f5 91%);
  }
  .app-frame {
    position: relative;
    z-index: 1;
    min-height: 100svh;
    padding: 0;
    background: transparent;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: calc(68px + env(safe-area-inset-top));
    display: grid;
    grid-template-columns: 48px minmax(0,1fr) auto;
    align-items: end;
    padding: env(safe-area-inset-top) 12px 8px;
    background: linear-gradient(180deg, rgba(238,241,245,.78), rgba(238,241,245,.28));
    color: #0a1725;
    backdrop-filter: blur(18px);
  }
  .brand { justify-content: center; text-align: center; }
  .brand-mark { display: none; }
  .brand strong { color: #0a1725; font-size: 15px; }
  .brand span { display: none; }
  .top-actions { justify-content: flex-end; }
  .top-actions > :not(.mobile-menu-button) { display: none !important; }
  .top-icon {
    width: 44px;
    height: 44px;
    min-height: 44px;
    color: #0a1725;
    border-color: rgba(10,23,37,.08);
    background: rgba(255,255,255,.34);
    font-size: 27px;
    backdrop-filter: blur(10px);
  }
  .mobile-library-button { font-size: 34px; line-height: 1; }
  .mobile-menu-button { font-size: 30px; }
  .workspace { display: block; }
  .workspace > .panel { display: none; }
  html[data-mobile-section="player"] .player-pane,
  html[data-mobile-section="library"] .library-pane,
  html[data-mobile-section="chapters"] .chapters-pane,
  html[data-mobile-section="sources"] .sidebar { display: flex; }

  html[data-mobile-section="player"] .topbar { background: linear-gradient(180deg, rgba(238,241,245,.7), rgba(238,241,245,.08)); }
  html[data-mobile-section="player"] .player-pane {
    border: 0;
    border-radius: 0;
    color: #0a1725;
    background: transparent;
    box-shadow: none;
  }
  .player-pane > .player-panel-head { display: none; }
  .player-pane > .player-panel-content {
    min-height: calc(100svh - 68px - env(safe-area-inset-top));
    padding: 8px 22px calc(30px + env(safe-area-inset-bottom));
    overflow: visible;
  }
  .player-placeholder {
    min-height: calc(100svh - 105px);
    color: #526173;
  }
  .player-placeholder h2 { color: #0a1725; }
  .placeholder-disc {
    border-color: rgba(10,23,37,.08);
    background: rgba(255,255,255,.55);
    box-shadow: 0 26px 70px rgba(31,58,82,.16);
  }
  .player {
    min-height: calc(100svh - 90px);
    align-items: center;
    justify-content: flex-start;
    color: #0a1725;
    overflow: visible;
  }
  .hero-cover-wrap {
    order: 1;
    width: min(73vw, 330px);
    margin: clamp(15px, 4.5vh, 42px) auto clamp(28px, 5vh, 54px);
  }
  .hero-cover {
    border-radius: 20px;
    background: rgba(255,255,255,.56);
    color: #32475f;
    box-shadow: 0 25px 65px rgba(31,58,82,.24), 0 0 0 1px rgba(255,255,255,.52);
  }
  .track-heading {
    order: 2;
    width: 100%;
    display: flex;
    flex-direction: column;
    max-width: 520px;
    color: #0a1725;
  }
  .track-heading .section-kicker { display: none; }
  .track-heading h2 {
    order: 2;
    margin: 7px 0 0;
    color: #4f6074;
    font-size: 13px;
    font-weight: 650;
  }
  .track-heading .player-meta { order: 3; margin-top: 3px; color: #6d7a89; font-size: 11px; }
  .track-heading #playerChapter {
    order: 1;
    margin: 0;
    color: #0a1725;
    font-size: 21px;
    font-weight: 750;
    letter-spacing: -.02em;
  }
  .track-heading #playerChapter::before { content: "☷"; margin-right: 12px; font-size: 20px; }
  .track-actions { order: 4; display: none; }
  .seek-block {
    order: 3;
    width: 100%;
    max-width: 620px;
    margin-top: 34px;
  }
  input[type="range"] { accent-color: #ff8117; }
  .seek-block input[type="range"] {
    height: 5px;
    min-height: 34px;
  }
  .seek-times {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    margin-top: 0;
    color: #30445a;
    font-size: 12px;
  }
  .seek-times #duration { display: none; }
  .remaining-time { display: block; color: #40546b; font-size: 12px; white-space: nowrap; }
  .chapter-remaining { display: block; color: #30445a; font-size: 12px; }
  .transport {
    order: 4;
    width: 100%;
    max-width: 540px;
    justify-content: space-between;
    gap: 7px;
    margin: 27px 0 24px;
  }
  .round-button {
    width: 52px;
    height: 52px;
    color: #061421;
    border: 0;
    background: transparent;
    font-size: 13px;
  }
  .secondary-round:hover { background: rgba(10,23,37,.06); }
  .play-button {
    width: 88px;
    height: 88px;
    color: #fff;
    background: #061421;
    box-shadow: 0 18px 38px rgba(6,20,33,.24);
    font-size: 30px;
  }
  .play-button:hover { background: #061421; filter: none; }
  .player-options {
    order: 5;
    width: 100%;
    max-width: 620px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 4px;
    margin-top: 0;
  }
  .option-tile,
  .mobile-bookmark-tile {
    min-height: 88px;
    padding: 9px 3px;
    border: 0;
    border-radius: 14px;
    color: #32475f;
    background: transparent;
    font-size: 11px;
  }
  .option-tile > span { order: 2; color: #32475f; font-size: 10px; }
  .option-tile select,
  .option-tile strong {
    order: 1;
    min-height: 38px;
    color: #32475f;
    background: transparent;
    font-size: 16px;
    font-weight: 750;
  }
  .option-tile select { max-width: 82px; text-align-last: center; }
  .button-tile strong { display: grid; place-items: center; }
  .mobile-bookmark-tile { display: flex; }
  .mobile-bookmark-tile strong { font-size: 28px; }
  .sleep-tools {
    order: 6;
    width: 100%;
    max-width: 620px;
    grid-template-columns: 1fr 1fr;
    margin-top: 15px;
    border-color: rgba(10,23,37,.08);
    color: #3d5066;
    background: rgba(255,255,255,.42);
  }
  .sleep-tools > :last-child { grid-column: 1 / -1; }
  .sleep-rewind, .compact-toggle { color: #4f6074; }
  .sleep-rewind select { color: #0a1725; border-color: rgba(10,23,37,.1); background: rgba(255,255,255,.6); }
  .sleep-status { order: 7; color: #c45d00; }
  .volume-row { order: 8; margin-top: 12px; color: #32475f; }
  .close-player { order: 9; color: #6c7886; }

  html[data-mobile-section="library"] body,
  html[data-mobile-section="chapters"] body,
  html[data-mobile-section="sources"] body { background: var(--frame); }
  html[data-mobile-section="library"] .app-frame,
  html[data-mobile-section="chapters"] .app-frame,
  html[data-mobile-section="sources"] .app-frame { background: var(--frame); }
  html[data-mobile-section="library"] .topbar,
  html[data-mobile-section="chapters"] .topbar,
  html[data-mobile-section="sources"] .topbar {
    color: var(--text);
    background: rgba(14,18,24,.95);
  }
  html[data-mobile-section="library"] .brand strong,
  html[data-mobile-section="chapters"] .brand strong,
  html[data-mobile-section="sources"] .brand strong { color: var(--text); }
  html[data-mobile-section="library"] .top-icon,
  html[data-mobile-section="chapters"] .top-icon,
  html[data-mobile-section="sources"] .top-icon {
    color: var(--text);
    border-color: var(--line);
    background: rgba(255,255,255,.035);
  }
  .library-pane,
  .chapters-pane,
  .sidebar {
    min-height: calc(100svh - 68px - env(safe-area-inset-top));
    border: 0;
    border-radius: 0;
    background: var(--frame);
  }
  .library-pane:not(.is-collapsed) { max-height: none; }
  .library-pane > .panel-collapse-content { overflow: visible; }
  .library-pane #librarySection { overflow: visible; }
  .chapters-pane:not(.is-collapsed) { height: calc(100svh - 68px - env(safe-area-inset-top)); }
  .sidebar > .panel-collapse-content { overflow: visible; }
  .panel-collapse-head { cursor: default; }
  .panel-collapse-button { display: none; }
  .collapsible-panel.is-collapsed {
    height: auto !important;
    min-height: calc(100svh - 68px - env(safe-area-inset-top)) !important;
  }
  .collapsible-panel.is-collapsed .panel-collapse-content { display: flex !important; }
  .mobile-menu-dialog {
    width: 100%;
    max-width: none;
    max-height: min(86svh, 760px);
    margin: auto 0 0;
    padding: 20px 14px calc(18px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
  }
  .mobile-menu-grid { grid-template-columns: 1fr; max-height: 65svh; overflow: auto; }
  .mobile-menu-grid button { min-height: 72px; }
}

@media (max-width: 390px) {
  .player-pane > .player-panel-content { padding-inline: 15px; }
  .hero-cover-wrap { width: min(76vw, 290px); margin-top: 12px; margin-bottom: 30px; }
  .track-heading #playerChapter { font-size: 19px; }
  .remaining-time { font-size: 10px; }
  .transport { gap: 2px; }
  .round-button { width: 45px; height: 45px; }
  .play-button { width: 78px; height: 78px; }
  .option-tile, .mobile-bookmark-tile { min-height: 80px; }
}
