/* Свои шрифты для читалки там, где нет системных (Android, Windows): загружаются, только если выбраны */
@font-face { font-family: 'Fixa Lora'; src: url(/fonts/lora.woff) format('woff'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Fixa Bitter'; src: url(/fonts/bitter.woff) format('woff'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fixa Montserrat'; src: url(/fonts/montserrat.woff) format('woff'); font-weight: 100 900; font-display: swap; }
/* Fixa — стили. Только системные шрифты, без внешних ресурсов. */
:root {
  --accent: #ff614a; --accent-2: #7c3aed; --accent-rgb: 255 97 74;
  --bg: #f4f4f6; --surface: #ffffff; --surface-2: #ececf1; --text: #121214; --muted: #6c6c78;
  --border: rgb(0 0 0 / .08); --shadow: 0 10px 30px rgb(20 20 40 / .10);
  --r-bg: #fdfdfc; --r-fg: 21 21 23;
  --radius: 18px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ui-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rd-size: 19px; --rd-lh: 1.7; --rd-font: var(--ui-font); --rd-dim: .75;
  color-scheme: light;
}
/* Тёмный интерфейс (тема auto в тёмном режиме, Quiet, Night, OLED) */
:root[data-ui="dark"] {
  --bg: #0e0e11; --surface: #1a1a1f; --surface-2: #26262d; --text: #f2f2f5; --muted: #9a9aa6;
  --border: rgb(255 255 255 / .08); --shadow: 0 10px 30px rgb(0 0 0 / .5);
  --r-bg: #121215; --r-fg: 236 236 240; color-scheme: dark;
}
:root { --rd-weight: 700; --rd-ls: 0em; --rd-ws: 0em; --rd-ps: .9em; --rd-align: justify; --rd-hyph: auto; --rd-px: 28px; --rd-dimmer: 0; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; background: var(--bg); color: var(--text); font: 16px/1.45 var(--ui-font); }
body { overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
:focus-visible { outline: 3px solid rgb(var(--accent-rgb) / .55); outline-offset: 2px; border-radius: 10px; }
.ic { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.spacer { flex: 1; }
.row { display: flex; align-items: center; gap: 10px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 14px; background: var(--surface-2); font-weight: 600; transition: transform .12s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ff7a59); color: #fff; box-shadow: 0 8px 20px rgb(var(--accent-rgb) / .3); }
.btn.big { width: 100%; height: 56px; font-size: 17px; border-radius: 18px; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--text); transition: background .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn.round { border-radius: 50%; background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; font-size: 14px; }
.pill .ic { stroke: none; fill: currentColor; }
.pro-tag { font-weight: 800; font-size: 12px; letter-spacing: .08em; padding: 6px 10px; border-radius: 99px; background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.badge { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .04em; padding: 3px 7px; border-radius: 99px; background: var(--accent); color: #fff; margin-left: 8px; vertical-align: middle; }
.chip { padding: 8px 14px; border-radius: 99px; background: var(--surface-2); font-size: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.eyebrow.light { color: rgb(255 255 255 / .85); }

/* Библиотека */
.library { min-height: 100%; padding-bottom: calc(110px + var(--safe-b)); }
.lib-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(10px + var(--safe-t)) 14px 10px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); }
.lib-bar h1 { flex: 1; margin: 0; font-size: 28px; letter-spacing: -.02em; }
.lib-main { max-width: 760px; margin: 0 auto; padding: 4px 16px; display: grid; gap: 14px; }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--text); font-size: 16px; }
.continue { display: grid; gap: 8px; text-align: left; width: 100%; padding: 20px; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--accent), #ff8a5c 45%, var(--accent-2)); box-shadow: var(--shadow); }
.continue strong { font-size: 20px; line-height: 1.25; }
.continue small { opacity: .85; }
.continue-progress { display: flex; align-items: center; gap: 10px; font-size: 13px; font-variant-numeric: tabular-nums; }
.continue-progress .bar { flex: 1; height: 5px; border-radius: 9px; background: rgb(255 255 255 / .3); overflow: hidden; }
.continue-progress .bar span, .mini-progress span { display: block; height: 100%; background: #fff; transform-origin: left; }
.limit, .install { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 var(--border); }
.limit-text, .install-text { flex: 1; display: grid; gap: 2px; }
.limit-text small, .install-text small { color: var(--muted); }
.ring { --p: 0; width: 34px; height: 34px; border-radius: 50%; flex: none; background: conic-gradient(var(--accent) calc(var(--p) * 360deg), var(--surface-2) 0); mask: radial-gradient(circle, transparent 52%, #000 53%); -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); }
.chev { color: var(--muted); font-size: 22px; line-height: 1; }
.install-ic { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.doc-list { display: grid; gap: 10px; }
.doc-row { display: flex; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: 0 1px 0 var(--border); }
.doc-open { flex: 1; min-width: 0; display: flex; gap: 14px; align-items: center; padding: 14px; text-align: left; }
.doc-ic { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 13px; background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.doc-meta { min-width: 0; display: grid; gap: 3px; }
.doc-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.doc-sub { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.doc-foot { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mini-progress { width: 60px; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mini-progress span { background: var(--accent); }
.fav { color: #f5b400; margin-left: 6px; } .fav .ic { fill: currentColor; stroke: none; }
.doc-more { color: var(--muted); margin-right: 6px; }
.fab { position: fixed; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 16px 26px; border-radius: 99px; color: #fff; font-weight: 700; font-size: 17px; background: linear-gradient(135deg, var(--accent), #ff7a59); box-shadow: 0 12px 30px rgb(var(--accent-rgb) / .4); z-index: 6; transition: transform .15s; }
.fab:active { transform: translateX(-50%) scale(.96); }
.empty { text-align: center; padding: 70px 20px; display: grid; justify-items: center; gap: 10px; }
.empty h2 { margin: 6px 0 0; } .empty p { color: var(--muted); max-width: 360px; margin: 0 0 10px; }
.empty-ic { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.drop-hint { display: none; }
.library.dragging .drop-hint { display: grid; place-items: center; position: fixed; inset: 12px; border: 3px dashed var(--accent); border-radius: 26px; background: rgb(var(--accent-rgb) / .08); font-size: 20px; font-weight: 700; color: var(--accent); z-index: 20; pointer-events: none; }

/* Читалка */
.reader-view { position: fixed; inset: 0; background: var(--r-bg); color: rgb(var(--r-fg)); overflow: hidden; }
.rd-body { position: absolute; inset: 0; }
.rd-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: calc(6px + var(--safe-t)) 8px 0; background: color-mix(in srgb, var(--r-bg) 88%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); color: rgb(var(--r-fg)); transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s; }
.rd-bar .icon-btn { color: rgb(var(--r-fg)); }
.rd-bar .icon-btn:hover { background: rgb(var(--r-fg) / .07); }
.rd-bar .icon-btn[aria-pressed="true"] { color: var(--accent); }
.rd-title { flex: 1; min-width: 0; display: grid; text-align: center; line-height: 1.2; }
.rd-title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.rd-time { font-size: 12px; opacity: .6; }
.rd-actions { display: flex; }
.progress { flex-basis: 100%; height: 3px; margin: 6px -8px 0; background: rgb(var(--r-fg) / .07); }
.progress-fill { height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.reader-view.immersive .rd-bar { transform: translateY(-105%); opacity: 0; pointer-events: none; }
.rd-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; justify-content: space-between; gap: 16px; padding: 0 var(--rd-px) calc(12px + var(--safe-b)); font: 12px/1.2 var(--ui-font); color: rgb(var(--r-fg) / .45); pointer-events: none; font-variant-numeric: tabular-nums; }
.rd-foot-ch { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rd-foot-page { flex: none; }
.rd-dimmer { position: absolute; inset: 0; z-index: 9; background: #000; opacity: var(--rd-dimmer); pointer-events: none; transition: opacity .2s; }

/* Типографика текста книги */
.rd-text { font-family: var(--rd-font); font-size: var(--rd-size); line-height: var(--rd-lh); color: rgb(var(--r-fg)); overflow-wrap: break-word; letter-spacing: var(--rd-ls); word-spacing: var(--rd-ws); text-align: var(--rd-align); hyphens: var(--rd-hyph); -webkit-hyphens: var(--rd-hyph); }
.rd-text h1, .rd-text h2 { text-align: left; hyphens: manual; letter-spacing: -.01em; }
.rd-text h1 { font-size: 1.55em; line-height: 1.2; margin: .2em 0 .6em; }
.rd-text h2 { font-size: 1.3em; line-height: 1.25; margin: 1.2em 0 .9em; }
.rd-text p { margin: 0 0 var(--rd-ps); color: rgb(var(--r-fg) / var(--rd-dim)); }
.rd-text p b { color: rgb(var(--r-fg)); font-weight: var(--rd-weight); }
.rd-text p::selection, .rd-text b::selection { background: rgb(var(--accent-rgb) / .3); }
.rd-author { font-style: italic; text-align: left !important; margin-top: -.4em !important; }

/* Лента */
.reader { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; outline: none; }
.reader .rd-text { max-width: 720px; margin: 0 auto; padding: calc(78px + var(--safe-t)) var(--rd-px) calc(90px + var(--safe-b)); }
.rd-prev { display: block; margin: 0 auto 20px; }
.rd-end { min-height: 40px; }

/* Страницы */
.pg-stage { position: absolute; inset: 0; overflow: hidden; background: var(--r-bg); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; perspective: 2200px; cursor: default; }
.pg-frame { position: absolute; inset: 0; overflow: hidden; background: var(--r-bg); padding: calc(64px + var(--safe-t)) var(--rd-px) calc(46px + var(--safe-b)); }
@media (min-width: 900px) { .pg-frame { padding-left: max(var(--rd-px), calc(50vw - 360px)); padding-right: max(var(--rd-px), calc(50vw - 360px)); } }
.pg-pages { position: relative; height: 100%; column-fill: auto; will-change: transform; }
.pg-pages p { orphans: 2; widows: 2; }
.pg-pages h1, .pg-pages h2 { break-after: avoid; margin-top: 0; }
.pg-pages .pg-title { padding-top: .6em; }
.pg-end { height: 0; }
.pg-snap { z-index: 3; transform-origin: left center; backface-visibility: hidden; -webkit-backface-visibility: hidden; will-change: transform; }
.pg-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(to left, rgb(0 0 0 / .22), rgb(0 0 0 / .06) 30%, rgb(0 0 0 / 0) 60%); }

/* Flow */
.flow { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--r-bg); color: rgb(var(--r-fg)); opacity: 0; transform: scale(1.02); transition: opacity .2s, transform .2s; padding-bottom: var(--safe-b); }
.flow.open { opacity: 1; transform: none; }
.fl-top { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + var(--safe-t)) 16px 0; }
.fl-time { font-size: 13px; opacity: .6; font-variant-numeric: tabular-nums; }
.fl-stage { flex: 1; display: grid; align-content: center; justify-items: center; gap: 14px; cursor: pointer; user-select: none; }
.fl-tick { width: 2px; height: 14px; background: var(--accent); opacity: .7; }
.fl-word { width: 100%; box-sizing: border-box; padding: 0 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: baseline; font-size: 48px; line-height: 1.2; font-weight: 600; white-space: pre; }
.fl-left { text-align: right; overflow: hidden; min-width: 0; } .fl-right { text-align: left; overflow: hidden; min-width: 0; }
.fl-pivot { color: var(--accent); font-weight: 800; }
.fl-panel { margin: 0 16px 16px; padding: 18px 20px; border-radius: 26px; background: rgb(var(--r-fg) / .06); display: grid; gap: 14px; justify-items: center; }
.fl-controls { display: flex; align-items: center; gap: 30px; }
.fl-controls .icon-btn { color: rgb(var(--r-fg)); }
.fl-play { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; box-shadow: 0 10px 24px rgb(var(--accent-rgb) / .4); }
.fl-play .ic { fill: currentColor; stroke: none; }
.fl-wpm { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fl-panel input[type=range] { width: 100%; }

/* Bottom sheet */
dialog.sheet { margin: 0; padding: 0; border: 0; max-width: none; max-height: none; width: 100%; height: 100%; background: transparent; display: flex; align-items: flex-end; justify-content: center; }
dialog.sheet::backdrop { background: rgb(0 0 0 / .4); animation: fade .2s; opacity: var(--bd, 1); }
dialog.sheet.closing-drag::backdrop { opacity: 0; transition: opacity .22s; }
.sheet-panel { width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; will-change: transform; background: var(--surface); color: var(--text); border-radius: 26px 26px 0 0; padding: 8px 20px calc(22px + var(--safe-b)); animation: up .28s cubic-bezier(.2,.8,.2,1); }
dialog.sheet.tall .sheet-panel { min-height: 60vh; }
dialog.sheet.closing .sheet-panel { animation: down .18s ease-in forwards; }
dialog.sheet.closing::backdrop { opacity: 0; transition: opacity .18s; }
@media (min-width: 700px) { dialog.sheet { align-items: center; } .sheet-panel { border-radius: 26px; max-height: 86vh; } }
.grabber-zone { position: sticky; top: -8px; z-index: 2; margin: -8px -20px 0; padding: 10px 0 12px; cursor: grab; touch-action: none; background: linear-gradient(var(--surface) 70%, transparent); }
.grabber { width: 40px; height: 5px; border-radius: 9px; background: var(--muted); opacity: .35; margin: 0 auto; }
.sheet-title { margin: 6px 0 14px; font-size: 20px; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes down { to { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.menu { display: grid; gap: 6px; }
.menu-item { position: relative; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; text-align: left; font-weight: 600; background: var(--surface-2); }
.menu-item small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.menu-item .ic { color: var(--accent); }
.menu-item.danger, .menu-item.danger .ic { color: #e5484d; }
.input { width: 100%; padding: 13px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 16px; outline: none; }
.input:focus { border-color: var(--accent); }
.input.area { min-height: 40vh; resize: vertical; line-height: 1.5; margin-top: 10px; }
.compose { display: grid; gap: 12px; }
.alert p { color: var(--muted); }
.alert .btn { width: 100%; margin-top: 8px; }

/* Оформление */
.appearance { display: grid; gap: 16px; }
.preview { margin: 0; padding: 18px; border-radius: 16px; background: var(--r-bg); color: rgb(var(--r-fg) / var(--rd-dim)); border: 1px solid var(--border); text-align: var(--rd-align); hyphens: var(--rd-hyph); }
.preview b { color: rgb(var(--r-fg)); font-weight: var(--rd-weight); }
.field { display: grid; gap: 8px; }
.field-label { font-weight: 600; font-size: 14px; }
.slider-row { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.slider-row input { flex: 1; }
.slider-legend { display: flex; justify-content: space-between; color: var(--muted); }
input[type=range] { accent-color: var(--accent); height: 28px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; font-weight: 600; padding: 4px 0; }
input[role=switch] { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 99px; background: var(--surface-2); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
input[role=switch]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transition: transform .2s; }
input[role=switch]:checked { background: #34c759; }
input[role=switch]:checked::after { transform: translateX(20px); }
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 8px; }
.choice { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; }
.choice.selected { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.choice small { font-size: 11px; color: var(--muted); }
.choice-aa { font-size: 20px; font-weight: 600; }
.choice .lock { position: absolute; top: 5px; right: 6px; color: var(--muted); }
.swatch { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid var(--border); }
.swatch-paper { background: #fdfdfc; color: #151515; }
.swatch-sepia { background: #f6eddb; color: #45331f; }
.swatch-night { background: #191b22; color: #e6e6e6; }
.swatch-oled { background: #000; color: #d9d9d9; }

/* Главы */
.chapter-list { display: grid; gap: 4px; max-height: 70vh; overflow-y: auto; }
.chapter-item { display: flex; gap: 12px; align-items: baseline; text-align: left; padding: 12px; border-radius: 12px; }
.chapter-item:hover { background: var(--surface-2); }
.chapter-item.current { background: rgb(var(--accent-rgb) / .12); font-weight: 600; }
.chapter-num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2ch; }

/* Пейвол */
.paywall { display: grid; gap: 20px; }
.pw-hero { display: grid; justify-items: center; text-align: center; gap: 8px; padding-top: 10px; }
.pw-hero h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.app-badge { width: 60px; height: 60px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgb(var(--accent-rgb) / .35); margin-bottom: 4px; }
.app-badge .ic { fill: currentColor; stroke: none; }
.pw-demo { margin: 4px 0 0; color: rgb(var(--r-fg) / .7); font-size: 17px; }
.pw-demo b { color: rgb(var(--r-fg)); }
.pw-features { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.pw-features li { display: flex; gap: 14px; align-items: center; }
.pw-features div { display: grid; }
.pw-features small { color: var(--muted); }
.pw-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.plans { display: grid; gap: 10px; }
.plan { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 2px solid transparent; text-align: left; transition: border-color .15s, background .15s; }
.plan[aria-checked="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .08); }
.plan-radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; color: transparent; flex: none; }
.plan[aria-checked="true"] .plan-radio { background: var(--accent); border-color: var(--accent); color: #fff; }
.plan-main { flex: 1; display: grid; gap: 2px; }
.plan-name { font-weight: 700; }
.plan-main small { color: var(--muted); }
.plan-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.pw-footer { display: grid; gap: 10px; }
.pw-legal, .pw-status { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.pw-status:empty { display: none; }
.pw-links { display: flex; justify-content: center; gap: 18px; font-size: 13px; }
.pw-links a { color: var(--muted); text-decoration: none; }

/* Настройки */
.settings { display: grid; gap: 16px; }
.group { background: var(--bg); border-radius: 16px; overflow: hidden; }
.group-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.group-row:last-child { border-bottom: 0; }
.group-row .ic { color: var(--accent); }
.group-row > :nth-last-child(1).chev { margin-left: auto; }
.group-row select { margin-left: auto; width: auto; padding: 6px 10px; }
.group-row > span:first-child { flex: 1; }
.pro-row { font-weight: 700; color: var(--accent); }
.restore { padding: 4px 16px 16px; display: grid; gap: 8px; }

/* Онбординг */
.onboarding { position: fixed; inset: 0; z-index: 60; background: var(--surface); display: flex; flex-direction: column; padding: calc(20px + var(--safe-t)) 24px calc(16px + var(--safe-b)); gap: 16px; animation: fade .25s; }
.onboarding.closing { opacity: 0; transition: opacity .25s; }
.ob-stage { flex: 1; overflow-y: auto; display: flex; align-items: center; }
.ob-page { width: 100%; max-width: 520px; margin: 0 auto; display: grid; gap: 14px; animation: up .35s cubic-bezier(.2,.8,.2,1); }
.ob-page h1 { margin: 6px 0 0; font-size: 38px; line-height: 1.08; letter-spacing: -.02em; font-family: ui-rounded, var(--ui-font); }
.ob-page .app-badge { width: 60px; height: 60px; border-radius: 18px; }
.ob-list { list-style: none; padding: 18px; margin: 0; display: grid; gap: 14px; border-radius: 18px; background: var(--surface-2); font-weight: 500; }
.ob-list li { display: flex; gap: 12px; align-items: center; } .ob-list .ic { color: var(--accent); }
.dots { display: flex; justify-content: center; gap: 8px; }
.dots span { width: 7px; height: 7px; border-radius: 9px; background: var(--surface-2); transition: width .2s, background .2s; }
.dots span.on { width: 22px; background: var(--accent); }
.onboarding .btn.big { max-width: 520px; margin: 0 auto; }

/* Прочее */
.busy { position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; justify-items: center; gap: 14px; background: rgb(0 0 0 / .35); color: #fff; font-weight: 600; backdrop-filter: blur(4px); }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgb(255 255 255 / .3); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translate(-50%, 20px); width: max-content; padding: 12px 18px; border-radius: 14px; background: #1c1c1e; color: #fff; font-size: 14px; line-height: 1.35; opacity: 0; transition: .25s; z-index: 80; pointer-events: none; max-width: min(90vw, 460px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 900px) { .lib-bar { padding-left: max(14px, calc(50vw - 380px)); padding-right: max(14px, calc(50vw - 380px)); } }

/* ---------- v1.1: оформление, поддержка ---------- */
dialog.sheet.peek::backdrop { background: rgb(0 0 0 / .08); }
dialog.sheet.peek .sheet-panel { max-height: 58vh; box-shadow: 0 -10px 40px rgb(0 0 0 / .18); }
.btn.ghost { background: transparent; color: var(--muted); }
.block { display: block; }
.disabled { opacity: .4; pointer-events: none; }
.appearance { gap: 18px; }
.ap-group { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); }
.ap-title { margin: 0; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field-head { display: flex; justify-content: space-between; align-items: baseline; }
.field-val { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); }
.segmented button { padding: 9px 6px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgb(0 0 0 / .12); }
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatch-btn { display: grid; justify-items: center; gap: 5px; }
.swatch-btn small { font-size: 11px; color: var(--muted); }
.swatch-btn .swatch { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font: 600 17px/1 ui-serif, Georgia, serif; border: 1px solid var(--border); transition: transform .15s, box-shadow .15s; }
.swatch-btn.selected .swatch { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); transform: scale(1.04); }
.swatch-btn .swatch-auto { position: relative; overflow: hidden; border: 0; background: linear-gradient(135deg, #fdfdfc 0 50%, #2a2a2e 50% 100%); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .14); }
.swatch-auto-text { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(135deg, #2a2a2e 0 50%, #fdfdfc 50% 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.swatch-btn.selected .swatch-auto { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.font-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.font-btn { display: grid; justify-items: center; gap: 3px; padding: 10px 2px 8px; border-radius: 14px; background: var(--surface-2); border: 2px solid transparent; }
.font-btn.selected { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.font-aa { font-size: 22px; line-height: 1.1; }
.font-btn small { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stepper { display: flex; align-items: center; justify-content: space-between; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.stepper button { flex: 1; height: 46px; display: grid; place-items: center; font-family: ui-serif, Georgia, serif; }
.stepper button:active { background: rgb(var(--accent-rgb) / .12); }
.a-small { font-size: 14px; } .a-big { font-size: 24px; }
.size-val { min-width: 70px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--muted); }
.reset { justify-self: center; }
.support { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 6px 0 4px; }
.support h2 { margin: 4px 0 0; font-size: 24px; }
.support p { margin: 0 0 8px; max-width: 420px; }
.support .btn { width: 100%; }
.support-heart { width: 70px; height: 70px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #ff5f6d, #ff8a5c); box-shadow: 0 12px 28px rgb(255 95 109 / .35); }
.support-heart .ic, .pill .ic, .group-row .ic.heart, .support-banner-ic .ic { fill: currentColor; stroke: none; }
.support .btn.primary .ic { fill: currentColor; stroke: none; }
.support-banner { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 14px; border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 var(--border); }
.support-banner-ic { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #ff5f6d; background: rgb(255 95 109 / .12); }
.support-banner-text { flex: 1; display: grid; text-align: left; gap: 1px; }
.support-banner-text small { color: var(--muted); }
.support-group .group-row .ic { color: #ff5f6d; fill: currentColor; stroke: none; }
.pill { background: linear-gradient(135deg, #ff5f6d, #ff8a5c); }
.reader-view.paged .rd-text { text-align: var(--rd-align); }

/* ---------- v1.2: обложки, виды библиотеки, отступы ---------- */
.sheet-panel:focus, .sheet-panel:focus-visible { outline: none; }
.lib-content, .view-list, .view-shelf, .view-grid, .view-carousel, .view-compact { display: grid; gap: 14px; min-width: 0; }
.lib-main { gap: 16px; padding-top: 6px; width: 100%; box-sizing: border-box; }
.lib-content > * { min-width: 0; }
.lib-bar { gap: 6px; }
.lib-bar h1 { font-size: 27px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn.tinted { background: var(--surface); box-shadow: 0 1px 0 var(--border); }
.pill { flex: none; white-space: nowrap; }
@media (max-width: 400px) { .pill { padding: 9px; } .pill-text { display: none; } }

/* Обложка */
.cover { position: relative; flex: none; aspect-ratio: 2 / 3; border-radius: 3px 7px 7px 3px; overflow: hidden; background: #ccc; box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 8px 18px -6px rgb(0 0 0 / .35); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cover::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; background: linear-gradient(90deg, rgb(0 0 0 / .28) 0, rgb(255 255 255 / .22) 2.2%, rgb(0 0 0 / .1) 4.5%, rgb(0 0 0 / 0) 9%), linear-gradient(180deg, rgb(255 255 255 / .08), rgb(0 0 0 / .06)); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; pointer-events: none; }
.cover.has-img img { opacity: 1; }
.cover-ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 6%; padding: 13% 11% 11%; background: var(--c-bg); color: var(--c-fg); container-type: inline-size; overflow: hidden; }
.ph-author { font: 650 6.8cqw/1.2 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; color: var(--c-ac); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-title { flex: 1; display: flex; align-items: center; font: 700 13cqw/1.08 ui-serif, "New York", Georgia, serif; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; }
.ph-title.mid { font-size: 11cqw; }
.ph-title.long { font-size: 8.6cqw; }
.ph-orn { height: 1.6cqw; min-height: 1px; width: 34%; background: var(--c-ac); border-radius: 2px; }
.ph-frame { box-shadow: inset 0 0 0 4cqw var(--c-bg), inset 0 0 0 4.8cqw var(--c-ac); }
.ph-band { background: linear-gradient(var(--c-bg) 0 70%, var(--c-ac) 70% 72%, var(--c-bg) 72%); }
.ph-band .ph-orn { opacity: 0; }
.cover-xs { width: 46px; }
.cover-mini { width: 34px; border-radius: 2px 4px 4px 2px; }
.cover-sm { width: 66px; }

/* 1. Список */
.continue { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.continue-text { display: grid; gap: 8px; min-width: 0; }
.continue-text strong { font-size: 20px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.continue-cover { box-shadow: 0 10px 24px -6px rgb(0 0 0 / .45); }
.doc-list { gap: 12px; }
.doc-open { gap: 14px; padding: 12px 6px 12px 12px; }
.doc-more { flex: none; }

/* 2. Книжная полка */
.view-shelf { gap: 6px; }
.shelf-row { padding-top: 14px; }
.shelf-books { display: grid; grid-template-columns: repeat(var(--per), minmax(0, 1fr)); gap: 0 18px; align-items: end; padding: 0 12px; }
.shelf-book { position: relative; display: block; width: 100%; min-width: 0; transition: transform .2s; }
.shelf-book:active { transform: translateY(-6px) scale(1.02); }
.shelf-book .cover { width: 100%; border-radius: 2px 5px 5px 2px; box-shadow: 0 2px 3px rgb(0 0 0 / .25), 6px 0 12px -6px rgb(0 0 0 / .35); }
.shelf-badge { position: absolute; top: 6px; right: -4px; z-index: 3; padding: 2px 6px; border-radius: 99px; font-size: 10.5px; font-weight: 700; color: #fff; background: var(--accent); box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.shelf-badge.done { background: #34c759; padding: 3px; }
.shelf-plank { position: relative; height: 15px; margin-top: -1px; border-radius: 3px 3px 5px 5px; background: linear-gradient(#d4ab7c, #b4875a 45%, #8a613b); box-shadow: 0 14px 18px -10px rgb(0 0 0 / .45), inset 0 1px 0 rgb(255 255 255 / .45), inset 0 -2px 0 rgb(0 0 0 / .15); }
.shelf-plank::after { content: ""; position: absolute; left: 4%; right: 4%; top: 100%; height: 10px; background: linear-gradient(rgb(0 0 0 / .18), transparent); filter: blur(2px); }
:root[data-ui="dark"] .shelf-plank { background: linear-gradient(#6b4a2e, #553820 50%, #3d2714); box-shadow: 0 14px 18px -10px rgb(0 0 0 / .8), inset 0 1px 0 rgb(255 255 255 / .18); }

/* 3. Сетка обложек */
.cover-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 18px; }
.grid-item { display: grid; gap: 4px; width: 100%; text-align: left; align-content: start; min-width: 0; }
.grid-item .cover { width: 100%; margin-bottom: 8px; }
.grid-title { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.grid-author { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-status { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); }
.grid-status.reading { color: var(--accent); }
.grid-more { display: grid; place-items: center; width: 28px; height: 22px; margin-right: -6px; color: var(--muted); }

/* 4. Карусель */
.view-carousel { gap: 6px; }
.car-track { position: relative; display: flex; gap: 14px; margin: 0 -16px; padding: 18px calc(50% - min(29vw, 120px)) 22px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.car-track::-webkit-scrollbar { display: none; }
.car-item { flex: none; width: min(58vw, 240px); scroll-snap-align: center; transform: scale(.84); opacity: .55; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s; }
.car-item.active { transform: none; opacity: 1; }
.car-item .cover { width: 100%; box-shadow: 0 18px 40px -14px rgb(0 0 0 / .55); }
.car-info { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 0 12px 10px; }
.car-title { margin: 0; font-size: 22px; line-height: 1.2; }
.car-author { margin: 0; color: var(--muted); }
.car-progress { width: min(240px, 70%); margin-top: 6px; }
.car-bar { display: block; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.car-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.car-meta { color: var(--muted); }
.car-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.car-read { min-width: 150px; }

/* 5. Компактно */
.compact-list { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 1px 0 var(--border); }
.compact-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.compact-row:last-child { border-bottom: 0; }
.compact-meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.compact-meta strong, .compact-meta small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compact-meta small { color: var(--muted); font-size: 12px; }
.ring-wrap { position: relative; width: 34px; height: 34px; flex: none; display: grid; place-items: center; }
.ring-wrap svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring-wrap small { font-size: 9px; font-weight: 700; color: var(--muted); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 3; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }

/* Выбор вида */
.view-picker .menu-item { padding: 12px 14px; }
.view-picker .menu-item.selected { box-shadow: inset 0 0 0 2px var(--accent); }
.vp-ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgb(var(--accent-rgb) / .12); }
.vp-check { margin-left: auto; color: var(--accent); }
.menu-item > span:not(.vp-ic):not(.vp-check) { display: grid; gap: 1px; }

/* Загиб страницы */
.pg-curl { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pg-curl .curl-page { position: absolute; inset: 0; }
.curl-flap-wrap { position: absolute; inset: 0; will-change: filter; }
.curl-flap-wrap .curl-page { transform-origin: 0 0; will-change: transform, clip-path; }
.curl-paper { position: absolute; inset: 0; background: var(--r-bg); opacity: .84; }
:root[data-ui="dark"] .curl-paper { opacity: .86; }
.curl-shade, .curl-cast { position: absolute; inset: 0; pointer-events: none; }

/* Невидимая «проба» цвета для статус-бара iOS 26+ (см. look.js) */
.tint-probe { position: fixed; top: 0; left: 0; width: 100%; height: max(8px, env(safe-area-inset-top, 0px)); z-index: -1; pointer-events: none; }
.tint-probe.flash { z-index: 2147483000; }

/* ---------- Цель дня в библиотеке ---------- */
.goal-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 10px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: left; color: var(--text); transition: transform .12s; }
.goal-card:active { transform: scale(.985); }
.goal-card-ring { position: relative; width: 46px; height: 46px; flex: none; display: grid; place-items: center; }
.goal-card-ring svg, .stats-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.gr-center { position: relative; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.goal-ring .gr-bg { fill: none; stroke: var(--surface-2); }
.goal-ring .gr-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .6s cubic-bezier(.2,.8,.2,1); }
.goal-ring .gr-fg.done { stroke: #34c759; }
.goal-card-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.goal-card-text strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-card-text small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goal-card-streak { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.goal-card-streak span { filter: grayscale(1); opacity: .55; }
.goal-card-streak.on { background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.goal-card-streak.on span { filter: none; opacity: 1; }
.goal-card .chev { flex: none; color: var(--muted); font-size: 22px; line-height: 1; }

/* ---------- Статистика ---------- */
.stats { display: grid; gap: 16px; }
.stats .sheet-title { margin-bottom: 0; }
.stats-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 18px; padding: 4px 2px; }
.stats-ring { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.stats-ring-center { position: relative; display: grid; justify-items: center; line-height: 1.1; }
.stats-ring-center strong { font-size: 40px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats-ring-center small { font-size: 13px; color: var(--muted); }
.stats-streak { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.stats-streak strong { font-size: 20px; line-height: 1.2; }
.stats-streak small { color: var(--muted); }
.streak-flame { font-size: 36px; line-height: 1; filter: grayscale(1); opacity: .45; }
.streak-flame.on { filter: none; opacity: 1; animation: flame 2.4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.1) rotate(3deg); } }
.week-chart { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; height: 150px; }
.week-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.week-val { height: 14px; font-size: 11px; line-height: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-bar { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: rgb(var(--accent-rgb) / .4); transition: height .5s cubic-bezier(.2,.8,.2,1); }
.week-bar.met { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.week-col small { height: 18px; line-height: 18px; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.week-col.today small { color: var(--accent); font-weight: 800; }
.week-goal { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed rgb(var(--accent-rgb) / .55); pointer-events: none; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar > small { text-align: center; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.cal-cell { aspect-ratio: 1; max-height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); background: var(--surface-2); }
.cal-cell.l1 { background: rgb(var(--accent-rgb) / .18); color: var(--text); }
.cal-cell.l2 { background: rgb(var(--accent-rgb) / .38); color: var(--text); }
.cal-cell.l3 { background: rgb(var(--accent-rgb) / .62); color: #fff; }
.cal-cell.l4 { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 700; }
.cal-cell.future { background: transparent; box-shadow: inset 0 0 0 1px var(--border); opacity: .6; }
.cal-cell.now { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.stat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.stat-ic { font-size: 18px; line-height: 1.3; }
.stat-tile strong { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.stat-tile small { color: var(--muted); font-size: 12.5px; }
.test-card { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-radius: 18px; background: linear-gradient(135deg, rgb(var(--accent-rgb) / .14), rgb(124 58 237 / .14)); }
.test-card-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.test-card-text small { color: var(--muted); font-size: 13px; }
.test-card .btn { flex: none; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.badge-tile { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 12px 6px 10px; border-radius: 16px; background: var(--surface-2); text-align: center; color: var(--muted); transition: transform .12s; }
.badge-tile:active { transform: scale(.95); }
.badge-ic { font-size: 30px; line-height: 1.1; filter: grayscale(1); opacity: .32; }
.badge-tile small { max-width: 100%; font-size: 11.5px; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
.badge-tile.got { background: linear-gradient(160deg, rgb(var(--accent-rgb) / .16), rgb(124 58 237 / .12)); color: var(--text); }
.badge-tile.got .badge-ic { filter: none; opacity: 1; }
.badge-tile.got small { font-weight: 600; }

/* ---------- Праздник: конфетти и новые достижения ---------- */
/* Не прижаты к верхнему краю на всю ширину — иначе iOS 26 может взять их цвет для статус-бара */
.confetti { position: fixed; left: 0; right: 0; top: 16px; bottom: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: 0; display: block; will-change: transform; }
.badge-toast { position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 95; display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(360px, 76vw); padding: 10px 18px 10px 10px; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 18px 44px rgb(0 0 0 / .24), 0 0 0 1px var(--border); opacity: 0; transform: translate(-50%, -24px) scale(.96); transition: transform .45s cubic-bezier(.2,1.3,.4,1), opacity .3s; pointer-events: none; }
.badge-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.badge-toast-ic { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px; font-size: 28px; background: linear-gradient(135deg, rgb(var(--accent-rgb) / .22), rgb(124 58 237 / .2)); }
.badge-toast-text { display: grid; min-width: 0; }
.badge-toast-text small { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.badge-toast-text strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Тест скорости ---------- */
.speedtest { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--r-bg); color: rgb(var(--r-fg)); padding: var(--safe-t) 0 var(--safe-b); opacity: 0; transform: translateY(14px); transition: opacity .22s, transform .22s; }
.speedtest.open { opacity: 1; transform: none; }
.st-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.st-step { font-size: 14px; font-weight: 600; color: rgb(var(--r-fg) / .6); }
.st-stage { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.st-intro, .st-read, .st-quiz, .st-result { max-width: 640px; margin: 0 auto; padding: 8px 22px 28px; display: grid; gap: 16px; }
.st-intro { justify-items: center; text-align: center; padding-top: 9vh; }
.st-intro h2, .st-result h2 { margin: 0; font-size: 27px; letter-spacing: -.01em; }
.st-intro p { margin: 0; max-width: 460px; line-height: 1.5; }
.st-mode { justify-self: start; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgb(var(--r-fg) / .08); }
.st-intro .st-mode { justify-self: center; }
.st-mode.fixa { background: rgb(var(--accent-rgb) / .16); color: var(--accent); }
.st-text p:last-child { margin-bottom: 0; }
.st-text.normal p { color: rgb(var(--r-fg)); }
.st-quiz { padding-top: 6vh; }
.st-quiz h3 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; }
.st-answers { display: grid; gap: 10px; }
.st-answer { padding: 16px 18px; border-radius: 16px; background: rgb(var(--r-fg) / .07); text-align: left; font-size: 16px; font-weight: 600; line-height: 1.35; transition: background .2s, box-shadow .2s, transform .1s; }
.st-answer:active { transform: scale(.985); }
.st-answer:disabled { cursor: default; }
.st-answer.right { background: rgb(52 199 89 / .2); box-shadow: inset 0 0 0 2px #34c759; }
.st-answer.wrong { background: rgb(255 59 48 / .16); box-shadow: inset 0 0 0 2px #ff3b30; }
.st-result { padding-top: 4vh; }
.st-bar { display: grid; gap: 8px; }
.st-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; }
.st-bar-head strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.st-bar-track { height: 14px; border-radius: 99px; background: rgb(var(--r-fg) / .08); overflow: hidden; }
.st-bar-track span { display: block; height: 100%; border-radius: inherit; background: rgb(var(--r-fg) / .35); transform-origin: left; animation: st-grow .9s cubic-bezier(.2,.8,.2,1) both; }
.st-bar.fixa .st-bar-track span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation-delay: .15s; }
@keyframes st-grow { from { transform: scaleX(0); } }
.st-verdict { margin: 6px 0 0; font-size: 21px; font-weight: 800; line-height: 1.3; }
.st-verdict.good { color: var(--accent); }
.st-result > p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .streak-flame.on { animation: none; }
  .st-bar-track span { animation: none; }
  .badge-toast { transition: opacity .2s; }
}

/* ---------- Вкладки внизу ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: grid; grid-template-columns: repeat(3, 1fr); padding: 6px max(10px, env(safe-area-inset-left)) calc(6px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.8) blur(20px); -webkit-backdrop-filter: saturate(1.8) blur(20px); box-shadow: 0 -1px 0 var(--border); }
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 4px 4px; border-radius: 14px; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .2s, transform .12s; }
.tab:active { transform: scale(.94); }
.tab.on { color: var(--accent); }
.tab .ic { transition: transform .35s cubic-bezier(.2,1.4,.4,1); }
.tab.on .ic { transform: translateY(-1px) scale(1.06); }
.tab .avatar { box-shadow: 0 0 0 2px transparent; transition: box-shadow .2s; }
.tab.on .avatar { box-shadow: 0 0 0 2px var(--accent); }
.library, .page { padding-bottom: calc(150px + var(--safe-b)); }
.library .fab { bottom: calc(76px + var(--safe-b)); }
.page { min-height: 100%; }
.page .group { background: var(--surface); }
.lib-bar .small-title { font-size: 20px; }
.me-btn { padding: 0; overflow: hidden; }
.block { display: block; }
.center-row { justify-content: center; flex-wrap: wrap; }
.center-block { display: grid; justify-items: center; }
.btn.danger { background: rgb(229 72 77 / .12); color: #e5484d; }
.group-row.danger, .group-row.danger .ic { color: #e5484d; }

/* ---------- Аватарки ---------- */
.avatar { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--av1), var(--av2)); line-height: 1; user-select: none; }

/* ---------- Каталог портала ---------- */
.plist { display: grid; gap: 10px; }
.pcard { display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: left; color: var(--text); transition: transform .12s, box-shadow .2s; }
.pcard:active { transform: scale(.985); }
.cover-p { width: 58px; flex: none; }
.pcard-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pcard-title { font-size: 16px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-author { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.pcard-owner { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard-stat { flex: none; display: inline-flex; align-items: center; gap: 3px; font-variant-numeric: tabular-nums; }
.pcard-stat:first-of-type { margin-left: auto; }
.pcard.skeleton { pointer-events: none; }
.pcard.skeleton .cover { aspect-ratio: 2 / 3; border-radius: 6px; background: var(--surface-2); }
.pcard.skeleton i { display: block; height: 11px; border-radius: 6px; background: var(--surface-2); }
.pcard.skeleton i:nth-child(1) { width: 70%; height: 14px; } .pcard.skeleton i:nth-child(2) { width: 45%; } .pcard.skeleton i:nth-child(3) { width: 60%; }
.pcard.skeleton .cover, .pcard.skeleton i { background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--surface-2) 55%, var(--surface)) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.pstate { display: grid; justify-items: center; gap: 10px; padding: 48px 18px; text-align: center; }
.pstate h2 { margin: 6px 0 0; font-size: 20px; }
.pstate p { margin: 0; max-width: 360px; }
.btn.more { justify-self: center; }

/* ---------- Страница книги ---------- */
.pbook { display: grid; gap: 16px; }
.pbook-loading { display: grid; place-items: center; min-height: 240px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.pbook-head { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: end; padding-top: 4px; }
.cover-pbig { width: 112px; box-shadow: 0 18px 40px -12px rgb(0 0 0 / .45); }
.pbook-titles h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.22; overflow-wrap: anywhere; }
.pbook-titles p { margin: 0; }
.main-action { position: relative; overflow: hidden; }
.main-action .dl-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgb(255 255 255 / .25); opacity: 0; transition: opacity .2s; }
.main-action .dl-bar span { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .15s; }
.main-action.loading .dl-bar { opacity: 1; }
.main-action.done { animation: pop-ok .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop-ok { 40% { transform: scale(1.03); } }
.pactions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; transition: background .2s, color .2s, transform .12s; }
.pill-btn:active { transform: scale(.95); }
.like-btn.on { color: #ff375f; background: rgb(255 55 95 / .12); }
.like-btn.on .ic { fill: currentColor; }
.like-btn.pop .ic { animation: heart-pop .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes heart-pop { 0% { transform: scale(.6); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchips .chip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; font-size: 13px; color: var(--muted); }
.chip.warn { color: #c2410c; background: rgb(251 146 60 / .16); }
.pbook-desc { margin: 0; white-space: pre-line; line-height: 1.5; }
.owner-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 16px; background: var(--bg); text-align: left; color: var(--text); }
.owner-row > span:nth-child(2) { flex: 1; display: grid; min-width: 0; }
.owner-row .chev { color: var(--muted); font-size: 22px; }
.radio-list { display: grid; gap: 8px; }
.radio-list button { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; background: var(--bg); text-align: left; font-weight: 600; color: var(--text); }
.radio-dot { width: 20px; height: 20px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--border); transition: box-shadow .2s; }
.radio-list [aria-checked="true"] .radio-dot { box-shadow: inset 0 0 0 6px var(--accent); }
.report, .publish, .auth, .edit-profile, .backup, .confirm { display: grid; gap: 14px; }
.publish-head { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.publish-head .cover { width: 64px; }
.publish-head p { margin: 0; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgb(255 255 255 / .35); border-top-color: #fff; animation: spin .8s linear infinite; }
.pick-row .cover { width: 34px; }
.pick-text { flex: 1; min-width: 0; display: grid; }
.pick-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mod-item { display: grid; gap: 8px; padding: 12px; border-radius: 16px; background: var(--bg); }
.mod-open { display: grid; gap: 3px; text-align: left; color: var(--text); }

/* ---------- Вход и профиль ---------- */
.auth-hero { display: grid; justify-items: center; text-align: center; gap: 6px; }
.auth-hero .sheet-title { margin: 6px 0 0; }
.auth-hero p { margin: 0; max-width: 420px; font-size: 14px; }
.auth-badge { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 12px 28px rgb(var(--accent-rgb) / .3); }
.auth-badge.big { width: 76px; height: 76px; border-radius: 26px; }
.auth-pane { display: grid; gap: 14px; animation: fx-fade .25s ease both; }
.auth-err { margin: 0; min-height: 1em; color: #e5484d; font-size: 14px; text-align: center; }
.auth-err:empty { display: none; }
.auth-confirm { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--bg); }
.auth-confirm > span { display: grid; }
.handle-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); padding-left: 14px; }
.handle-input:focus-within { border-color: var(--accent); }
.handle-input > span { color: var(--muted); font-weight: 600; }
.handle-input .input { border: 0; background: none; padding-left: 4px; }
.avatar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.avatar-grid button { aspect-ratio: 1; border-radius: 14px; font-size: 24px; background: var(--bg); transition: transform .15s, box-shadow .2s; }
.avatar-grid [aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--accent); transform: scale(1.06); }
.color-row { display: flex; flex-wrap: wrap; gap: 10px; }
.color-row button { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--av1), var(--av2)); transition: transform .15s, box-shadow .2s; }
.color-row [aria-checked="true"] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); transform: scale(1.05); }
.edit-preview .avatar { box-shadow: 0 10px 30px -8px rgb(0 0 0 / .35); }
.profile-head { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 10px 0 6px; }
.profile-head h2 { margin: 10px 0 0; font-size: 24px; }
.profile-head > p { margin: 0; }
.profile-bio { max-width: 460px; white-space: pre-line; margin-top: 6px !important; }
.profile-stats { display: flex; gap: 26px; margin: 12px 0 6px; }
.profile-stats span { display: grid; }
.profile-stats strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.profile-stats small { color: var(--muted); font-size: 12px; }
.profile-head .row { margin-top: 10px; }
.me-hero { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 18px 0; }
.me-hero h2 { margin: 6px 0 0; }
.me-hero p { margin: 0; max-width: 420px; }
.me-hero .ob-list { text-align: left; width: 100%; max-width: 460px; background: var(--surface); }
.me-hero .btn.big { max-width: 460px; }
.cloud-card, .storage-card { display: grid; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.backup .storage-card { background: var(--bg); }
.cloud-head { display: flex; align-items: center; gap: 12px; }
.cloud-ic, .storage-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; color: var(--accent); background: rgb(var(--accent-rgb) / .12); }
.cloud-ic.spin .ic { animation: spin 1s linear infinite; }
.cloud-text { display: grid; min-width: 0; }
.cloud-bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.cloud-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform-origin: left; transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.cloud-card .row { flex-wrap: wrap; }
.storage-card { grid-template-columns: auto 1fr auto; align-items: center; }
.storage-card > span:nth-child(2) { display: grid; gap: 2px; }
.storage-card.ok .storage-ic { color: #1f9d55; background: rgb(52 199 89 / .14); }
.storage-card.warn .storage-ic { color: #c2410c; background: rgb(251 146 60 / .16); }
.trash-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg); }
.trash-row .cover { width: 34px; flex: none; }

/* ---------- Подсказка с действием ---------- */
.toast-action { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 85; display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(92vw, 480px); padding: 10px 10px 10px 18px; border-radius: 16px; background: #1c1c1e; color: #fff; font-size: 14px; box-shadow: 0 14px 34px rgb(0 0 0 / .3); opacity: 0; transform: translate(-50%, 16px); transition: opacity .25s, transform .3s cubic-bezier(.2,1.2,.4,1); }
.toast-action.show { opacity: 1; transform: translate(-50%, 0); }
.toast-action button { padding: 8px 14px; border-radius: 10px; background: rgb(255 255 255 / .14); color: #ffb4a6; font-weight: 700; }

/* ---------- Автопрокрутка ---------- */
.as-pill { position: absolute; left: 50%; bottom: calc(40px + var(--safe-b)); z-index: 6; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 99px; background: color-mix(in srgb, rgb(var(--r-fg)) 10%, var(--r-bg)); color: rgb(var(--r-fg)); box-shadow: 0 10px 30px rgb(0 0 0 / .18), 0 0 0 1px rgb(var(--r-fg) / .08); transform: translateX(-50%); transition: opacity .4s, transform .3s; animation: as-in .35s cubic-bezier(.2,1.2,.4,1) both; }
.as-pill[hidden] { display: none; }
.as-pill.idle { opacity: .28; }
.as-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: inherit; transition: background .15s, transform .12s; }
.as-btn:active { transform: scale(.9); background: rgb(var(--r-fg) / .1); }
.as-stop { background: var(--accent); color: #fff; }
.as-speed { min-width: 92px; text-align: center; font: 600 14px/1 var(--ui-font); font-variant-numeric: tabular-nums; }
@keyframes as-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.rd-actions .icon-btn[aria-pressed="true"] { color: var(--accent); }

/* ---------- Плавное появление ---------- */
.fx-rise { animation: fx-rise .5s cubic-bezier(.2,.8,.2,1) backwards; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes fx-rise { from { opacity: 0; transform: translateY(10px); } }
/* Только прозрачность: transform на странице сломал бы position: fixed у нижней панели */
.fx-enter { animation: fx-enter .3s ease backwards; }
@keyframes fx-enter { from { opacity: 0; } }
@keyframes fx-fade { from { opacity: 0; } }

/* Переходы между экранами (Safari 18+, Chrome): обложка раскрывается в книгу */
::view-transition-group(fx-book) { animation-duration: .46s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
::view-transition-old(fx-book), ::view-transition-new(fx-book) { width: 100%; height: 100%; object-fit: cover; overflow: clip; }
::view-transition-old(fx-book) { animation: fx-vt-out .26s ease both; }
::view-transition-new(fx-book) { animation: fx-vt-in .34s .06s ease both; }
:root[data-vt="book"]::view-transition-old(root) { animation: fx-vt-out .3s ease both; }
:root[data-vt="book"]::view-transition-new(root) { animation: fx-vt-in .32s ease both; }
:root[data-vt="tab"]::view-transition-old(root) { animation: fx-vt-out .16s ease both; }
:root[data-vt="tab"]::view-transition-new(root) { animation: fx-vt-rise .3s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fx-vt-out { to { opacity: 0; } }
@keyframes fx-vt-in { from { opacity: 0; } }
@keyframes fx-vt-rise { from { opacity: 0; transform: translateY(8px); } }

/* Тема меняется мягко */
.reader-view { transition: background-color .35s ease, color .35s ease; }
.rd-bar { transition: transform .3s cubic-bezier(.2,.8,.2,1), opacity .3s, background-color .35s ease, color .35s ease; }

@media (prefers-reduced-motion: reduce) {
  .fx-rise, .fx-enter, .as-pill { animation: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Переезд на основной адрес */
.move-banner { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.move-code { font: 700 28px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 16px 12px; margin: 4px 0 12px; border-radius: 14px; background: var(--surface-2, rgba(127,127,127,.12)); user-select: all; -webkit-user-select: all; }
.move-input { text-align: center; font: 600 22px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.move .btn.big + .btn.big { margin-top: 8px; }
.move a.btn { text-decoration: none; }
.support-mail { margin-top: 14px; text-align: center; }

/* Клавиатура открыта (поле ввода в фокусе): нижняя панель и кнопка «Добавить» не перекрывают текст — особенно на Android */
body:has(:is(input:not([type=checkbox], [type=radio], [type=range], [type=file]), textarea):focus) :is(.tabbar, .library .fab) { visibility: hidden; }

/* Онбординг: выбор языка и установка */
.ob-langs { display: grid; gap: 10px; margin-top: 4px; }
.ob-lang { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 58px; padding: 0 18px; border-radius: 16px; background: var(--surface-2); color: var(--text); font: 600 18px/1.2 var(--ui-font); text-align: left; border: 2px solid transparent; transition: border-color .2s, background-color .2s, transform .12s; }
.ob-lang:active { transform: scale(.98); }
.ob-lang.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ob-lang .ic { color: var(--accent); }
.inst { display: grid; gap: 12px; }
.inst-steps { list-style: none; margin: 0; padding: 14px; display: grid; gap: 12px; border-radius: 18px; background: var(--surface-2); }
.inst-steps li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; font-weight: 500; line-height: 1.35; }
.inst-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font: 700 14px/1 var(--ui-font); }
.inst-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--accent); }
.inst-ic .rot90 { transform: rotate(90deg); }
.inst-or { margin: 4px 0 -4px; }
.inst-sheet .inst { margin-top: 8px; }
.app-badge.stroke .ic { fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- Портал 1.6: фильтры, подборка, комментарии, уведомления ---------- */
.segmented.seg-4 button { font-size: 13px; padding: 9px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gchips { display: flex; gap: 6px; overflow-x: auto; margin: -3px -16px; padding: 5px 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gchips::-webkit-scrollbar { display: none; }
.gchip { flex: none; padding: 7px 13px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.gchip[aria-pressed="true"], .gchip.gsel.on { background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.gchip.gsel { border: 0; appearance: none; -webkit-appearance: none; font-family: inherit; padding-right: 26px; max-width: 150px; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.portal-top { display: grid; gap: 14px; }
.portal-top:empty { display: none; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px 12px 14px; border-radius: 16px; background: rgb(var(--accent-rgb) / .1); border: 1px solid rgb(var(--accent-rgb) / .25); }
.notice > div { flex: 1; min-width: 0; display: grid; gap: 2px; }
.notice p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 14.5px; }
.notice-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: rgb(var(--accent-rgb) / .16); color: var(--accent); }
.feat { display: grid; gap: 10px; min-width: 0; }
.feat .ap-title { display: flex; align-items: center; gap: 6px; }
.feat .ap-title .ic { color: #f5a524; fill: currentColor; stroke: none; }
.feat-row { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 4px 16px 10px; scroll-snap-type: x proximity; scrollbar-width: none; }
.feat-row::-webkit-scrollbar { display: none; }
.sheet .feat-row { margin: 0 -4px; padding: 4px 4px 10px; }
.feat-card { flex: none; width: 104px; display: grid; gap: 4px; align-content: start; text-align: left; color: var(--text); scroll-snap-align: start; transition: transform .12s; }
.feat-card:active { transform: scale(.96); }
.feat-card strong { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-card small { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cover-feat { width: 104px; box-shadow: 0 10px 22px -10px rgb(0 0 0 / .4); margin-bottom: 4px; }
.feat-mark .ic, .feat-chip .ic { color: #f5a524; fill: currentColor; stroke: none; }
.pcard-stat:first-of-type { margin-left: auto; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; display: grid; place-items: center; border-radius: 99px; background: #ff375f; color: #fff; font-size: 10.5px; font-weight: 800; box-shadow: 0 0 0 2px var(--bg); }
.slot { display: contents; }
.icon-btn.roll .ic { animation: dice-roll .5s cubic-bezier(.3,1.4,.5,1); }
@keyframes dice-roll { from { transform: rotate(0) scale(.8); } to { transform: rotate(360deg) scale(1); } }
.tab { position: relative; }
.tab-dot { position: absolute; top: 4px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #ff375f; box-shadow: 0 0 0 2px var(--bg); }
.uname { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
h2.uname { justify-content: center; }
.staff { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--accent); color: #fff; flex: none; }
.staff .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.count { min-width: 20px; padding: 2px 7px; border-radius: 99px; background: #ff375f; color: #fff; font-size: 12px; font-weight: 800; text-align: center; margin-left: auto; }
.count + .chev { margin-left: 8px !important; }
.banned-card { display: grid; gap: 6px; padding: 14px 16px; border-radius: 18px; background: rgb(229 72 77 / .1); border: 1px solid rgb(229 72 77 / .3); }
.banned-card strong { display: flex; align-items: center; gap: 8px; color: #e5484d; }
.banned-card p { margin: 0; overflow-wrap: anywhere; }
.follow-btn[aria-pressed="true"] { color: var(--muted); }

.cmts { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); min-width: 0; }
.cmts .ap-title { display: flex; align-items: center; gap: 6px; }
.cmt-form { display: grid; gap: 6px; }
.cmt-row { display: flex; align-items: flex-end; gap: 8px; }
.cmt-row .avatar { margin-bottom: 7px; }
.cmt-input { resize: none; min-height: 46px; max-height: 160px; line-height: 1.4; border-radius: 18px; padding: 11px 14px; }
.cmt-send { flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; transition: opacity .2s, transform .12s; }
.cmt-send .ic { fill: currentColor; stroke: none; }
.cmt-send:disabled { opacity: .35; }
.cmt-send:active { transform: scale(.92); }
.cmt-reply { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 12px; border-radius: 12px; background: var(--bg); font-size: 13px; color: var(--muted); }
.cmt-reply[hidden] { display: none; }
.cmt-reply span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmt-reply .icon-btn { width: 32px; height: 32px; }
.cmt-list { display: grid; gap: 14px; }
.cmt-list:empty { display: none; }
.cmt { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.cmt.fresh { animation: cmt-in .35s cubic-bezier(.2,.9,.3,1); }
@keyframes cmt-in { from { opacity: 0; transform: translateY(-8px); } }
.cmt-av { align-self: start; border-radius: 50%; }
.cmt-main { display: grid; gap: 3px; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cmt-head .uname { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; align-self: center; }
.cmt-head small { flex: none; font-size: 12px; }
.cmt-to { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.cmt-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: 1.45; font-size: 15px; }
.cmt-actions { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.cmt-actions button { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 0; display: inline-flex; align-items: center; }
.cmt-actions button:active { color: var(--accent); }
.cmt-empty[hidden] { display: none; }
.btn.small.more { justify-self: center; }

.notes { display: grid; gap: 6px; }
.note { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; border-radius: 16px; text-align: left; color: var(--text); background: var(--bg); }
.note.new { background: rgb(var(--accent-rgb) / .1); }
.note-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.note-text strong { font-size: 14.5px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.note-quote { color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.note-ic { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.note-ic.small { width: 28px; height: 28px; }
select.input { appearance: none; -webkit-appearance: none; font-family: inherit; }

/* ---------- Панель модератора ---------- */
.adm-tabs { position: sticky; top: calc(62px + var(--safe-t)); z-index: 4; display: flex; gap: 6px; overflow-x: auto; padding: 6px 16px 10px; max-width: 760px; margin: 0 auto; box-sizing: border-box; scrollbar-width: none; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.adm-tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.adm-tabs .count { margin-left: 2px; background: #fff; color: #e5484d; padding: 1px 6px; min-width: 0; }
.adm-tabs button:not([aria-selected="true"]) .count { background: #ff375f; color: #fff; }
.adm-tabs .count[hidden] { display: none; }
.adm-view { display: grid; gap: 14px; min-width: 0; }
.adm-view > .muted.small { margin: 0; }
.adm-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 620px) { .adm-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.adm-stat { display: grid; gap: 2px; padding: 13px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); text-align: left; color: var(--text); min-width: 0; }
.adm-stat strong { font-size: 25px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.adm-stat small { font-size: 12.5px; font-weight: 600; }
.adm-stat span { font-size: 12px; line-height: 1.3; }
button.adm-stat:active { transform: scale(.98); }
.adm-card { display: grid; gap: 12px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.adm-card p { margin: 0; }
.adm-card .gchips { margin: 0 -16px; }
.adm-card-head > div { display: flex; align-items: baseline; gap: 8px; }
.adm-total { font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.adm-bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; height: 132px; align-items: end; }
.adm-bar { height: 100%; display: grid; grid-template-rows: 1fr auto; gap: 4px; align-items: end; justify-items: stretch; color: var(--muted); }
.adm-bar span { display: block; border-radius: 5px 5px 2px 2px; background: rgb(var(--accent-rgb) / .35); transition: height .35s cubic-bezier(.2,.9,.3,1), background .2s; }
.adm-bar.today span, .adm-bar.picked span { background: var(--accent); }
.adm-bar small { font-size: 10px; text-align: center; font-variant-numeric: tabular-nums; }
.adm-bar.picked small { color: var(--text); font-weight: 700; }
.cloud-bar.hot span { background: #e5484d; }
.adm-flags { display: flex; align-items: center; gap: 10px; width: 100%; box-sizing: border-box; margin: 0; padding: 12px 14px; border-radius: 16px; background: rgb(251 146 60 / .14); color: #c2410c; font-weight: 600; font-size: 14px; text-align: left; }
.adm-flags > span:not(.chev) { flex: 1; min-width: 0; }
:root[data-ui="dark"] .adm-flags, :root[data-ui="dark"] .chip.warn { color: #fdba74; }
.adm-list { display: grid; gap: 6px; min-width: 0; }
.adm-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: left; color: var(--text); min-width: 0; box-sizing: border-box; }
.adm-card .adm-row, .sheet .adm-row { background: var(--bg); border-color: transparent; }
.adm-row:active { transform: scale(.99); }
.adm-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.adm-row-main strong { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 15px; line-height: 1.25; overflow-wrap: anywhere; }
.adm-row-main small { font-size: 12.5px; line-height: 1.35; overflow-wrap: anywhere; }
.adm-row-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-nums { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.adm-nums .ic:not(:first-child) { margin-left: 5px; }
.chip.mini { padding: 2px 8px; font-size: 11.5px; font-weight: 700; line-height: 1.5; }
.chip.accent { background: rgb(var(--accent-rgb) / .14); color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }
button.chip.mini:disabled { opacity: 1; }
.row.wrap { flex-wrap: wrap; gap: 8px; }
.admin .mod-item, .adm-user .mod-item { background: var(--surface); border: 1px solid var(--border); }
.sheet .adm-user .mod-item, .adm-card .mod-item { background: var(--bg); border-color: transparent; }
.adm-reports { margin: 0; padding: 0 0 0 18px; display: grid; gap: 4px; font-size: 13.5px; overflow-wrap: anywhere; }
.adm-filters { display: flex; align-items: center; gap: 6px; min-width: 0; }
.adm-filters .gchips { flex: 1; margin: 0 -16px 0 0; padding-left: 0; }
.adm-empty { padding: 28px 0; }
.adm-log { display: grid; gap: 1px; padding: 9px 12px; border-radius: 12px; background: var(--surface); border-left: 3px solid var(--surface-2); font-size: 13.5px; overflow-wrap: anywhere; }
.sheet .adm-log { background: var(--bg); }
.adm-log.mod { border-left-color: var(--accent); }
.adm-log.warn { border-left-color: #f59e0b; }
.adm-log small { font-size: 11.5px; }
.adm-user { display: grid; gap: 14px; }
.adm-user-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.adm-user-head h3 { margin: 0; font-size: 21px; overflow-wrap: anywhere; }
.adm-user-head p { margin: 0 0 6px; }
.adm-user > p { margin: 0; overflow-wrap: anywhere; }
.adm-facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.adm-facts div { padding: 9px 12px; border-radius: 12px; background: var(--bg); min-width: 0; }
.adm-facts dt { font-size: 11.5px; color: var(--muted); }
.adm-facts dd { margin: 0; font-weight: 600; font-size: 14.5px; overflow-wrap: anywhere; }
.adm-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.adm-form { display: grid; gap: 14px; }
.adm-form p { margin: 0; }
.danger-btn { background: #e5484d !important; box-shadow: 0 8px 20px rgb(229 72 77 / .3) !important; }
.adm-switch { align-items: center; gap: 12px; }
.adm-switch > span { display: grid; gap: 2px; min-width: 0; }
.adm-switch small { font-weight: 400; font-size: 12.5px; line-height: 1.35; }
.adm-card .field small { font-size: 12.5px; line-height: 1.35; }
.mod-row .ic { color: var(--accent); }
.slot-block:empty, .plist:empty { display: none; }
.feat-row { padding-bottom: 4px; }
.adm-switch strong { font-weight: 600; }

/* ---------- Поиск по книге ---------- */
::highlight(fx-find) { background-color: rgb(255 204 0 / .42); }
::highlight(fx-find-cur) { background-color: #ff9500; color: #111; }
.fx-flash { animation: fx-flash 1.6s ease-out; border-radius: 6px; }
@keyframes fx-flash { 0%, 35% { background-color: rgb(255 204 0 / .45); } 100% { background-color: transparent; } }
/* В «Ленте» у книги с главами на узком телефоне шесть кнопок не помещаются — поиск остаётся в листе оглавления */
@media (max-width: 430px) { .reader-view:not(.paged) .rd-bar.has-ch .rd-search-btn { display: none; } }
@media (max-width: 380px) { .rd-actions .icon-btn { width: 38px; } }
.find-pill { position: absolute; left: 50%; bottom: calc(40px + var(--safe-b)); z-index: 6; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 99px; background: color-mix(in srgb, rgb(var(--r-fg)) 10%, var(--r-bg)); color: rgb(var(--r-fg)); box-shadow: 0 10px 30px rgb(0 0 0 / .18), 0 0 0 1px rgb(var(--r-fg) / .08); transform: translateX(-50%); transition: opacity .4s, transform .3s; animation: as-in .35s cubic-bezier(.2,1.2,.4,1) both; }
.find-pill { gap: 2px; animation: none; }
.find-pill[hidden] { display: none; }
.find-count { min-width: 76px; padding: 0 6px; height: 40px; border-radius: 99px; text-align: center; color: inherit; font: 600 14px/1 var(--ui-font); font-variant-numeric: tabular-nums; }
.find-count:active { background: rgb(var(--r-fg) / .1); }
.find-next .ic { transform: rotate(180deg); }
.bs { display: grid; gap: 12px; min-width: 0; }
.bs .search { background: var(--bg); }
.bs-out { max-height: calc(92dvh - 190px); overflow-y: auto; overscroll-behavior: contain; margin: 0 -6px; padding: 0 6px; }
.bs .chapter-list { max-height: none; overflow: visible; }
.bs-count { margin: 0 0 8px; }
.bs-list { display: grid; gap: 6px; }
.bs-hit { display: grid; gap: 4px; width: 100%; padding: 11px 13px; border-radius: 14px; background: var(--bg); text-align: left; color: var(--text); }
.bs-hit:active { transform: scale(.99); }
.bs-hit.current { box-shadow: inset 0 0 0 2px var(--accent); }
.bs-text { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.bs-text mark { background: rgb(255 204 0 / .5); color: inherit; border-radius: 3px; padding: 0 1px; font-weight: 600; }
.bs-hit small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bs-none { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 34px 10px; }
.bs-none p, .bs-hint { margin: 0; }
.bs-hint { padding: 30px 10px; }

/* ---------- «Резинка» на краях прокрутки и «потянуть, чтобы обновить» ---------- */
.sheet-panel, .bs-out, .ob-stage, .st-stage { overscroll-behavior: none; }
.gchips, .feat-row, .adm-tabs, .car-track { overscroll-behavior-x: none; }
.fx-bounce > * { translate: var(--bx, 0px) var(--by, 0px); will-change: translate; }
.sheet-panel.fx-bounce > .grabber-zone { translate: none; }
.lib-main { position: relative; }
.ptr { --p: 0; position: absolute; left: 50%; top: -46px; width: 36px; height: 36px; margin-left: -18px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); box-shadow: 0 4px 14px rgb(0 0 0 / .14), 0 0 0 1px var(--border); opacity: var(--p); transform: scale(calc(.55 + .45 * var(--p))); pointer-events: none; z-index: 1; }
.ptr span { width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid var(--surface-2); border-top-color: var(--muted); transform: rotate(calc(var(--p) * 300deg)); transition: border-color .15s; }
.ptr.ready span { border-top-color: var(--accent); border-right-color: var(--accent); }
.ptr.busy span { animation: spin .7s linear infinite; }

/* Длинные списки: строки за пределами экрана браузер не отрисовывает, пока до них не долистали */
.pcard, .bs-hit, .adm-row, .adm-log, .cmt, .mod-item { content-visibility: auto; contain-intrinsic-size: auto 92px; }
.lib-bar h1 { cursor: default; }
.reader { overscroll-behavior: none; }

/* ---------- Читалка: закладки, «вернуться», ползунок по книге, время глав ---------- */
.rd-foot-right { flex: none; display: inline-flex; align-items: center; gap: 2px; }
.rd-mark { pointer-events: auto; display: inline-grid; place-items: center; width: 38px; height: 38px; margin: -13px 0 -13px -8px; border-radius: 50%; color: rgb(var(--r-fg) / .38); transition: color .2s, transform .15s; }
.rd-mark:active { transform: scale(.88); }
.rd-mark[aria-pressed="true"] { color: var(--accent); }
.rd-mark[aria-pressed="true"] .ic { fill: currentColor; }
.rd-mark.pop .ic { animation: heart-pop .45s cubic-bezier(.2,1.6,.4,1); }
.back-pill { position: absolute; left: 50%; bottom: calc(40px + var(--safe-b)); z-index: 6; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 99px; background: color-mix(in srgb, rgb(var(--r-fg)) 10%, var(--r-bg)); color: rgb(var(--r-fg)); box-shadow: 0 10px 30px rgb(0 0 0 / .18), 0 0 0 1px rgb(var(--r-fg) / .08); transform: translateX(-50%); transition: opacity .4s, transform .3s; animation: as-in .35s cubic-bezier(.2,1.2,.4,1) both; }
.back-pill { gap: 0; padding: 5px 5px 5px 6px; animation: none; }
.back-pill[hidden] { display: none; }
.back-go { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 10px; border-radius: 99px; color: inherit; font: 600 14px/1 var(--ui-font); }
.back-go:active { background: rgb(var(--r-fg) / .1); }
.chapter-item { align-items: baseline; }
.chapter-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.chapter-time { flex: none; color: var(--muted); font-size: 12.5px; font-weight: 400; font-variant-numeric: tabular-nums; }
.chapter-item.done .chapter-name, .chapter-item.done .chapter-num { color: var(--muted); }
.bs-seek { display: grid; gap: 4px; padding: 10px 14px 6px; border-radius: 16px; background: var(--bg); }
.bs-seek[hidden] { display: none; }
.bs-seek-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14px; }
.bs-seek-label { min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.bs-seek input { width: 100%; margin: 0; }
.bs.browse .bs-out { max-height: calc(92dvh - 330px); }
.bs-mark { display: flex; align-items: center; gap: 4px; }
.bs-mark .bs-hit { flex: 1; min-width: 0; }
.bs-mark .bs-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bs-mark .icon-btn { flex: none; color: var(--muted); }

.mix { display: grid; gap: 8px; }
.mix hr { border: 0; border-top: 1px solid var(--border); margin: 2px 0; }
.mix-row { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr) 3.2em; align-items: center; gap: 10px; font-size: 14px; }
.mix-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix-bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mix-bar span { display: block; height: 100%; background: var(--accent); transform-origin: left; border-radius: 99px; }
.mix-row strong { text-align: right; font-variant-numeric: tabular-nums; }
