  /* Единственный источник токенов: компоненты используют только семантические роли ниже. */
  :root {
    /* Цветовые роли — светлая тема. */
    --bg: #fbfafc; --bg-card: #ffffff; --bg-elev: #f1eef5;
    --text: #201d24; --text-2: #77727f; --icon: #5d4b68; --border: #e7e3ea;
    --accent: #25212a; --on-accent: #ffffff; --accent-soft: #e3ddea;
    --generation-bg: #eee8f2; --chip-bg: #f0edf3; --search-bg: var(--chip-bg);
    --chip-active: var(--accent); --chip-active-text: var(--on-accent);
    --control-primary-bg: var(--accent); --control-primary-fg: var(--on-accent); --control-primary-border: transparent;
    --control-secondary-bg: var(--chip-bg); --control-secondary-fg: var(--icon); --control-secondary-border: var(--border);
    --status-ready-bg: #ecfdf5; --status-ready-text: #059669;
    --status-missing-bg: #fff7ed; --status-missing-text: #d97706;
    --elevation-none: none;
    --elevation-floating: 0 6px 20px rgba(0,0,0,.2);
    --elevation-overlay: 0 10px 28px rgba(0,0,0,.18);
    --elevation-docked: 0 -6px 20px rgba(0,0,0,.12);
    --focus-ring: 0 0 0 3px var(--accent-soft);

    /* Типографика. Обе роли сейчас используют Inter, но семантика сохраняется. */
    --font-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --heading-1-line-height: 1.15;

    /* Шкала отступов и производная шкала радиусов. */
    --sp-2xs: 1px; --sp-xs: 2px; --sp-s: 4px; --sp-m: 8px; --sp-l: 12px;
    --sp-xl: 16px; --sp-2xl: 20px; --sp-3xl: 24px; --sp-4xl: 32px; --sp-5xl: 40px; --sp-6xl: 48px;
    --r1: var(--sp-s); --r2: var(--sp-m); --r3: var(--sp-l); --r4: var(--sp-xl); --r5: var(--sp-2xl);
    --r6: var(--sp-3xl); --r7: var(--sp-4xl); --r8: var(--sp-5xl); --r9: var(--sp-6xl); --radius-full: 999px;
    --control-height-s: 38px; --control-height-m: 44px; --control-height-l: 56px; --chip-height: 32px;
    --button-label-size-m: 1rem; --button-label-size-l: 1.25rem; --button-label-size-secondary: var(--button-label-size-m);
    --button-label-weight-primary: 560; --button-label-weight-secondary: 540;
    --icon-size-s: 1rem; --icon-size-m: 1.5rem; --icon-size-l: 1.5rem;
    --play-control-size: var(--control-height-m); --play-icon-size: var(--icon-size-m);
    --symbol-fill: 0; --symbol-weight: 400; --symbol-grade: 0; --symbol-optical-size: 24;
    --dock-inset: var(--sp-xl); --dock-gap: var(--sp-m);
    /* Компенсация для 44px header/play control: центр совпадает с контентной осью. */
    --header-control-inset: calc(var(--sp-xl) - var(--sp-xs));
  }
  html[data-theme="dark"] {
    --bg: #17151a; --bg-card: #211e25; --bg-elev: #2b2730;
    --text: #f5f1f7; --text-2: #bcb5c3; --icon: #c59bd9; --border: #3a353f;
    --accent: #f5f1f7; --on-accent: #17151a; --accent-soft: #4a4155;
    --generation-bg: #332d3a; --chip-bg: #302b35; --search-bg: var(--chip-bg);
    --chip-active: var(--accent); --chip-active-text: var(--on-accent);
    --control-primary-bg: var(--accent); --control-primary-fg: var(--on-accent); --control-primary-border: transparent;
    --control-secondary-bg: var(--chip-bg); --control-secondary-fg: var(--icon); --control-secondary-border: var(--border);
    --status-ready-bg: #153b32; --status-ready-text: #79d6b0;
    --status-missing-bg: #402f1e; --status-missing-text: #f6c47e;
    --elevation-none: none;
    --elevation-floating: 0 6px 20px rgba(0,0,0,.32);
    --elevation-overlay: 0 10px 28px rgba(0,0,0,.36);
    --elevation-docked: 0 -6px 20px rgba(0,0,0,.28);
    --focus-ring: 0 0 0 3px var(--accent-soft);
  }
  * { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
  html {
    /* Динамическая типографика по HIG: база = 1rem; корень масштабируется от системного размера текста. */
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
  }
  @supports (font: -apple-system-body) {
    html { font: -apple-system-body; }
  }
  html, body { height: 100%; }
  body {
    font-family: var(--font-sans);
    background: var(--bg); color: var(--text); font-size: 1rem; line-height: 1.4;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }
  .wrap { max-width: 680px; margin: 0 auto; padding: 4px 16px 112px; }
  header {
    position: relative; z-index: 10; background: var(--bg);
    padding: 20px 16px 12px; max-width: 680px; margin: 0 auto;
  }
  .topbar { display: flex; align-items: flex-start; gap: 10px; }
  /* Режим относится к заголовку: верхняя граница 44px-control совмещена
     с верхом текстового блока, а не центрируется между строками заголовка. */
  .topbar #themeBtn { flex: 0 0 var(--control-height-m); }
  .brand { font-family: var(--font-serif); font-weight: 700; font-size: 2.125rem; line-height: var(--heading-1-line-height); letter-spacing: -.02em; flex: 1; }

  .icon-btn {
    background: transparent; border: 0; color: var(--icon);
    width: var(--control-height-m); height: var(--control-height-m); border-radius: var(--radius-full); font-size: 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }
  @font-face {
    font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 400;
    src: url('./material-symbols-rounded.ttf') format('truetype');
  }
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-variable-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-variable-latin.woff2') format('woff2');
  unicode-range: U+0020-007E, U+00A0, U+00AB, U+00BB, U+2013-2014, U+2018-201D, U+2022, U+2026;
}












  .material-symbols-rounded {
    font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal;
    font-size: 1.15em; line-height: 1; letter-spacing: normal; text-transform: none;
    display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
    font-variation-settings: 'FILL' var(--symbol-fill), 'wght' var(--symbol-weight), 'GRAD' var(--symbol-grade), 'opsz' var(--symbol-optical-size);
    vertical-align: -.18em;
  }
  .icon-btn .material-symbols-rounded,
  .mini-btn .material-symbols-rounded,
  .play-btn .material-symbols-rounded,
  .card-btn .material-symbols-rounded,
  .search-close .material-symbols-rounded { font-size: var(--icon-size-m); vertical-align: 0; }
  .search-fab .material-symbols-rounded,
  .btn .material-symbols-rounded { font-size: var(--icon-size-l); vertical-align: 0; }
  .mini.search-open .mini-btn .material-symbols-rounded { font-size: var(--icon-size-l); vertical-align: 0; }
  .clear-search .material-symbols-rounded { font-size: var(--icon-size-s); vertical-align: 0; }
  .with-icon { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
  .search { position: relative; margin-top: 10px; }
  .search input {
    width: 100%; height: var(--control-height-l); padding: 16px 46px 16px 44px; border-radius: var(--r5); border: 1px solid var(--border);
    background: var(--search-bg); color: var(--text); font-size: 1rem; outline: none;
  }
  .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--icon); font-size: var(--icon-size-l); pointer-events: none; }
  .search input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
  .search input::placeholder { color: var(--text-2); }
  .clear-search {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border: 0; border-radius: var(--radius-full); display: none;
    align-items: center; justify-content: center; background: var(--chip-bg); color: var(--icon);
    line-height: 1; cursor: pointer;
  }
  .clear-search.visible { display: flex; }
  .clear-search:active { transform: translateY(-50%) scale(.93); }
  .chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .chips::-webkit-scrollbar { display: none; }
  #bottomSearch {
    position: fixed; z-index: 15; left: 50%; width: min(632px, calc(100% - 48px));
    bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  }
  #bottomSearch .search { margin-top: 0; }
  #bottomSearch { transition: bottom .3s cubic-bezier(.32,.72,.24,1), opacity .3s; }
  #bottomSearch.collapsed .search { display: none; }
  body.mini-on #bottomSearch { bottom: calc(var(--control-height-l) + var(--sp-4xl) - var(--sp-s) + env(safe-area-inset-bottom)); }
  /* Активный поиск без мини-плеера: поле заполняет ширину, справа floating-close. */
  body.search-active:not(.mini-on) #bottomSearch:not(.collapsed) {
    left: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset)));
    right: calc(max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))) + var(--control-height-l) + var(--dock-gap));
    width: auto; transform: none;
    bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
  }
  /* Активный поиск при открытом мини-плеере: слева play/pause, справа floating-close. */
  body.mini-on.search-active #bottomSearch:not(.collapsed) {
    left: calc(max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))) + var(--control-height-l) + var(--dock-gap));
    right: calc(max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))) + var(--control-height-l) + var(--dock-gap));
    width: auto; transform: none;
    bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
  }
  .search-fab {
    position: fixed; z-index: 21; right: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))); left: auto; bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
    width: var(--control-height-l); height: var(--control-height-l); border-radius: var(--radius-full); border: 1px solid var(--control-primary-border); cursor: pointer;
    background: var(--control-primary-bg); color: var(--control-primary-fg);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--elevation-floating);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(calc(100% + var(--dock-inset)));
    transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s linear .32s;
  }
  .search-fab.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s; }
  body.mini-on .search-fab { bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom)); }
  /* Плавающая кнопка сворачивания режима поиска. */
  .search-close {
    position: fixed; z-index: 21; right: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset)));
    bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
    width: var(--control-height-l); height: var(--control-height-l); border: 1px solid var(--control-primary-border); border-radius: var(--radius-full);
    background: var(--control-primary-bg); color: var(--control-primary-fg); cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--elevation-floating);
    opacity: 0; visibility: hidden; pointer-events: none;
    transform: translateY(calc(100% + var(--dock-inset)));
    transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s linear .32s;
  }
  body.search-active .search-close { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s; }
  /* На desktop поле поиска постоянно; дублирующий floating-close не нужен. */
  @media (min-width: 681px) {
    .search-close { display: none; }
    body.search-active:not(.mini-on) #bottomSearch:not(.collapsed),
    body.mini-on.search-active #bottomSearch:not(.collapsed) {
      right: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset)));
    }
  }
  .chip {
    flex: 0 0 auto; height: var(--chip-height); padding: 0 14px; border-radius: var(--radius-full); font-size: 1rem;
    display: inline-flex; align-items: center; line-height: 1;
    background: var(--chip-bg); color: var(--text-2); cursor: pointer; white-space: nowrap;
    border: 1px solid transparent;
  }
  .chip.active { background: var(--chip-active); color: var(--chip-active-text); font-weight: 600; }
  .chip .cnt { opacity: .6; margin-left: 4px; font-size: .8125rem; }
  .status-bar { color: var(--text-2); font-size: .9375rem; padding: 6px 0 10px; }
  .book {
    position: relative; overflow: hidden; isolation: isolate;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r5);
    padding: 16px; margin-bottom: 12px; cursor: pointer; box-shadow: var(--elevation-none);
  }
  .book .title { font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 650; line-height: 1.3; }
  /* Генерация: обычная белая карточка выключена; голубой слой растёт по времени. */
  .book.generating { background: var(--bg-card); border-color: var(--border); color: var(--text); cursor: default; pointer-events: none; }
  .book.generating::before {
    content: ""; position: absolute; z-index: 0; inset: 0 auto 0 0;
    width: var(--generation-progress, 0%); background: var(--generation-bg); transition: width .45s ease;
  }
  .book.generating > * { position: relative; z-index: 1; }
  .book.generating > .progress-percent { position: absolute; }
  .progress-percent {
    position: absolute; top: 14px; right: 16px; padding: 3px 7px;
    border-radius: var(--radius-full); background: var(--bg-card); color: var(--accent); font-size: .8125rem; font-weight: 750;
  }
  .book.generating .title { padding-right: 126px; }
  .book.generating .card-btn.secondary { opacity: .64; }
  .book-actions { margin-top: 16px; }
  .card-btn { width: 100%; min-height: var(--control-height-m); border: 0; border-radius: var(--radius-full); padding: 10px 13px; font-family: inherit; font-size: var(--button-label-size-m); font-weight: var(--button-label-weight-secondary); cursor: pointer; }
  .card-btn.primary { background: var(--accent); color: var(--chip-active-text); font-weight: var(--button-label-weight-primary); }
  .card-btn.secondary { background: var(--chip-bg); color: var(--text-2); cursor: default; font-weight: var(--button-label-weight-secondary); }
  .card-btn.secondary.actionable { cursor: pointer; }
  .progress-copy { display: flex; justify-content: space-between; gap: 10px; color: var(--text-2); font-size: .75rem; margin-top: 7px; }
  .progress-track { height: 4px; overflow: hidden; border-radius: var(--radius-full); background: var(--chip-bg); margin-top: 6px; }
  .progress-fill { height: 100%; background: var(--accent); border-radius: inherit; transition: width .35s ease; }
  .progress-fill.waiting { width: 35%; animation: waiting 1.1s ease-in-out infinite alternate; }
  @keyframes waiting { to { transform: translateX(160%); } }
  .completion {
    position: fixed; z-index: 45; left: 16px; right: 16px; bottom: 20px; max-width: 648px; margin: auto;
    display: none; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--border);
    border-radius: var(--r5); background: var(--bg-elev); color: var(--text); box-shadow: var(--elevation-overlay);
  }
  .completion.show { display: flex; }
  .completion-copy { flex: 1; font-size: .875rem; }
  .completion .card-btn { width: auto; min-height: var(--control-height-s); white-space: nowrap; }
  .book .author { color: var(--text-2); font-size: .9375rem; margin-top: 4px; }
  .book .meta { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
  .badge { font-size: .8125rem; padding: 5px 10px; border-radius: var(--r3); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
  .badge.gray { background: var(--chip-bg); color: var(--text-2); }
  .badge.ready { background: var(--status-ready-bg); color: var(--status-ready-text); }
  .badge.missing { background: var(--status-missing-bg); color: var(--status-missing-text); }
  .empty, .loading { text-align: center; color: var(--text-2); padding: 40px 0; }
  .more {
    text-align: center; padding: 14px; color: var(--accent); font-weight: 600;
    cursor: pointer; border: 0; border-radius: var(--radius-full); margin-top: 4px; background: transparent;
  }
  .sheet { position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; background: var(--bg); }
  .sheet.open { display: flex; }
  .sheet .inner { max-width: 680px; width: 100%; margin: 0 auto; padding: calc(var(--control-height-m) + env(safe-area-inset-top) + var(--sp-m)) 16px 12px; flex: 1; overflow-y: auto; }

  .nav-bar {
    position: absolute; z-index: 2; top: 0; left: 50%; transform: translateX(-50%); display: flex; justify-content: flex-end; align-items: center; max-width: 680px; width: 100%; height: calc(var(--control-height-m) + env(safe-area-inset-top)); margin: 0 auto;
    padding: env(safe-area-inset-top) var(--header-control-inset) 0; background: transparent; border: 0;
  }
  .nav-bar::after {
    content: ""; position: absolute; z-index: 0; top: 0; left: 0; width: 100%; height: calc(var(--control-height-m) + env(safe-area-inset-top) + var(--sp-4xl));
    background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 34%, transparent 100%); pointer-events: none;
  }
  .nav-bar > * { position: relative; z-index: 1; }
  .nav-title {
    position: absolute; left: calc(var(--header-control-inset) + var(--control-height-m)); right: calc(var(--header-control-inset) + var(--control-height-m));
    min-width: 0; text-align: center; font-family: var(--font-serif); font-size: 1.0625rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(3px); transition: opacity .15s ease, transform .15s ease;
  }
  .nav-bar.collapsed .nav-title { opacity: 1; transform: translateY(0); }
  .sheet h1 { font-family: var(--font-serif); font-size: 2.125rem; font-weight: 700; letter-spacing: -.02em; line-height: var(--heading-1-line-height); margin-top: 8px; }
  .sheet .author { color: var(--text-2); font-size: .9375rem; margin-top: 6px; }
  .sheet .badges { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
  .sheet .files { margin-top: 18px; font-size: .8125rem; color: var(--text-2); }
  .generation-note { display: grid; gap: var(--sp-m); margin-top: var(--sp-3xl); padding: var(--sp-xl); background: var(--chip-bg); border: 1px solid var(--border); border-radius: var(--r5); color: var(--text-2); font-size: .9375rem; line-height: 1.45; }
  .generation-note p:first-child { color: var(--text); font-weight: 600; }
  .sheet .files li { list-style: none; padding: 6px 0; border-top: 1px solid var(--border); word-break: break-all; }
  .actions { max-width: 680px; width: 100%; margin: 0 auto; padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--border); }
  .btn { width: 100%; min-height: var(--control-height-l); padding: 12px 18px; border-radius: var(--radius-full); border: none; font-family: inherit; font-size: var(--button-label-size-l); font-weight: var(--button-label-weight-primary); cursor: pointer; background: var(--accent); color: var(--on-accent); }
  .btn.secondary, .btn:disabled { background: var(--chip-bg); color: var(--text); font-size: var(--button-label-size-secondary); font-weight: var(--button-label-weight-secondary); }
  .mini {
    position: fixed; z-index: 20; left: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))); right: auto; bottom: calc(var(--dock-inset) + env(safe-area-inset-bottom));
    width: min(572px, calc(100% - (var(--dock-inset) + var(--dock-inset) + var(--control-height-l) + var(--dock-gap)))); height: var(--control-height-l);
    transform: translateY(calc(100% + var(--dock-inset)));
    display: flex; align-items: center; gap: var(--dock-gap);
    padding: var(--sp-s) var(--sp-s) var(--sp-s) var(--sp-xl);
    background: var(--control-primary-bg); color: var(--control-primary-fg); border: 1px solid var(--control-primary-border); border-radius: var(--radius-full);
    box-shadow: var(--elevation-docked); cursor: pointer;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s linear .32s;
  }
  .mini.show { transform: translateY(0); opacity: 1; visibility: visible; pointer-events: auto; transition: transform .32s cubic-bezier(.32,.72,.24,1), opacity .32s cubic-bezier(.32,.72,.24,1), visibility 0s; }
  .mini-info { flex: 1; min-width: 0; }
  .mini-title { font-family: var(--font-serif); font-size: 1rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mini-author { font-size: .8125rem; color: var(--control-primary-fg); opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
  .mini-btn,
  .play-btn {
    width: var(--play-control-size); height: var(--play-control-size); border-radius: var(--radius-full); border: 1px solid var(--control-secondary-border); cursor: pointer; flex: 0 0 auto;
    background: var(--control-secondary-bg); color: var(--control-secondary-fg); font-size: var(--play-icon-size);
    display: flex; align-items: center; justify-content: center;
  }
  /* Мини-плеер — самостоятельный primary control на primary-плашке;
     chapter controls остаются secondary. */
  .mini .mini-btn {
    background: var(--control-primary-bg); color: var(--control-primary-fg);
    border-color: var(--control-primary-border);
  }
  .mini.search-open {
    left: max(var(--dock-inset), calc(50% - 340px + var(--dock-inset))); right: auto;
    width: var(--control-height-l); padding: 0; gap: 0; border-radius: var(--radius-full);
  }
  .mini.search-open .mini-info { display: none; }
  .mini.search-open .mini-btn { width: 100%; height: 100%; }
  .toast {
    position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
    background: var(--bg-elev); color: var(--text); border: 1px solid var(--border);
    padding: 11px 18px; border-radius: var(--r4); font-size: .8125rem; opacity: 0; transition: .25s;
    z-index: 40; pointer-events: none; box-shadow: var(--elevation-none); max-width: 90vw;
  }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  /* Chapter cards inherit the book-card surface: background, border, radius, and progress fill. */
  .chapter-row { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 16px; margin: 12px 0; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r5); touch-action: pan-y; }
  .chapter-row::before { content: ""; position: absolute; z-index: 0; inset: 0 auto 0 0; width: var(--chapter-progress, 0%); background: var(--generation-bg); transition: width .35s ease; }
  .chapter-row.is-scrubbing::before { transition: none; }
  .chapter-row > * { position: relative; z-index: 1; }
  .play-btn.playing { background: var(--accent-soft); color: var(--control-secondary-fg); }
  .ch-info { flex: 1; min-width: 0; padding-top: 2px; padding-right: 62px; }
  .ch-title { font-size: .9375rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chapter-scrub { appearance: none; -webkit-appearance: none; position: absolute; z-index: 2; inset: 0 0 0 60px; width: auto; height: auto; margin: 0; background: transparent; cursor: ew-resize; touch-action: none; opacity: 0; pointer-events: none; }
  .chapter-scrub::-webkit-slider-runnable-track { background: transparent; }
  .chapter-scrub::-moz-range-track { background: transparent; }
  .chapter-scrub::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 1px; height: 1px; border: 0; background: transparent; }
  .chapter-scrub::-moz-range-thumb { width: 1px; height: 1px; border: 0; background: transparent; }
  .ch-dur { position: absolute; z-index: 3; top: 14px; right: 16px; padding: 3px 7px; border-radius: var(--radius-full); background: var(--bg-card); color: var(--accent); font-size: .6875rem; font-weight: 750; font-variant-numeric: tabular-nums; pointer-events: none; }
  .ch-head { margin: 18px 0 6px; font-size: .875rem; font-weight: 700; }