/* BookVault — front-end styles. Dark by default (matches the old site), light via toggle or OS. */

:root {
  --bg: #000000;
  --bg-2: #131318;
  --surface: #17171d;
  --surface-2: #1f1f27;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f4f4f6;
  --text-2: #a1a1ab;
  --text-3: #6e6e78;
  --accent: #0a84ff;
  --accent-ink: #fff;
  --accent-soft: rgba(10, 132, 255, .14);
  --star: #ffb800;
  --header: rgba(11, 11, 15, .82);
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --serif: "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --wrap: 1400px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f6f6f8;
  --surface: #ffffff;
  --surface-2: #f2f2f5;
  --line: rgba(0, 0, 0, .08);
  --line-2: rgba(0, 0, 0, .14);
  --text: #111114;
  --text-2: #5c5c66;
  --text-3: #8e8e98;
  --accent: #0066d6;
  --accent-soft: rgba(0, 102, 214, .1);
  --header: rgba(255, 255, 255, .85);
  --shadow: 0 10px 30px rgba(20, 20, 40, .14);
  --shadow-sm: 0 4px 14px rgba(20, 20, 40, .12);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #ffffff; --bg-2: #f6f6f8; --surface: #ffffff; --surface-2: #f2f2f5;
    --line: rgba(0, 0, 0, .08); --line-2: rgba(0, 0, 0, .14);
    --text: #111114; --text-2: #5c5c66; --text-3: #8e8e98;
    --accent: #0066d6; --accent-soft: rgba(0, 102, 214, .1);
    --header: rgba(255, 255, 255, .85);
    --shadow: 0 10px 30px rgba(20, 20, 40, .14); --shadow-sm: 0 4px 14px rgba(20, 20, 40, .12);
    color-scheme: light;
  }
}

/* ── Base (scoped: the old site's Tailwind sheet owns html/body/typography) ── */
/* The hidden attribute must win over Tailwind display utilities (grid, block, inline-flex…). */
[hidden] { display: none !important; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bv-main h1, .bv-main h2, .bv-main h3, .bv-reader h1 { line-height: 1.15; letter-spacing: -.02em; }

.bv-container { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (min-width: 1024px) { .bv-container { padding: 0 48px; } }
.bv-container--narrow { max-width: 780px; }
.bv-main { min-height: 70vh; padding-bottom: 40px; }

.bv-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.bv-search input { width: 100%; height: 38px; padding: 0 14px 0 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); outline: none; transition: border-color .15s, background .15s; }
.bv-search input:focus { border-color: var(--accent); background: var(--surface); }
.bv-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.bv-search--big { max-width: 560px; margin: 18px 0 0; }
.bv-search--big input { height: 48px; font-size: 16px; padding-left: 44px; border-radius: 12px; }
.bv-search--big .bv-search__icon { left: 15px; }
.bv-main .bv-icon-btn, .bv-reader .bv-icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); display: inline-grid; place-items: center; cursor: pointer; color: var(--text-2); flex-shrink: 0; transition: color .15s, border-color .15s; }
.bv-icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.bv-icon-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
/* ── Buttons, chips, links ────────────────────────────────────────────── */
.bv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 600; font-size: 14px; cursor: pointer; transition: transform .1s, background .15s, border-color .15s; white-space: nowrap; }
.bv-btn:hover { border-color: var(--text-3); }
.bv-btn:active { transform: scale(.98); }
.bv-btn--primary { background: var(--text); color: var(--bg); border-color: transparent; }
.bv-btn--primary:hover { opacity: .9; border-color: transparent; }
.bv-btn--ghost { background: transparent; }
.bv-btn--lg { height: 48px; padding: 0 26px; font-size: 15px; }
.bv-btn--block { width: 100%; margin-top: 14px; border-radius: 12px; }
.bv-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.bv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.bv-link { color: var(--accent); font-size: 14px; font-weight: 500; background: none; border: 0; padding: 0; cursor: pointer; }
.bv-link:hover { text-decoration: underline; }
.bv-chip { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); transition: color .15s, border-color .15s; }
.bv-chip:hover { color: var(--text); border-color: var(--line-2); }
.bv-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.bv-eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.bv-empty { color: var(--text-3); padding: 24px 0; }
.bv-count { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; vertical-align: middle; margin-left: 6px; }

/* ── Breadcrumbs ──────────────────────────────────────────────────────── */
.bv-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 18px 0 0; font-size: 13px; color: var(--text-3); }
.bv-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.bv-crumbs a:hover { color: var(--text); }
.bv-crumbs [aria-current] { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; display: inline-block; vertical-align: bottom; }

/* ── Covers ───────────────────────────────────────────────────────────── */
.bv-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--cover-bg, #1e3a5f); box-shadow: var(--shadow-sm); }
.bv-cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); background: linear-gradient(90deg, rgba(0,0,0,.18), transparent 6%, transparent 94%, rgba(0,0,0,.08)); pointer-events: none; }
.bv-cover img { width: 100%; height: 100%; object-fit: cover; }
.bv-cover__gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14% 10%; color: #fff; background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(0,0,0,.3)), var(--cover-bg); }
.bv-cover__title { font-family: var(--serif); font-weight: 700; font-size: clamp(11px, 1.1em, 22px); line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.bv-cover__author { font-size: .75em; opacity: .8; text-transform: uppercase; letter-spacing: .06em; }
.bv-cover--sm { font-size: 10px; border-radius: 4px; }
.bv-cover--md { font-size: 13px; }
.bv-cover--lg { font-size: 22px; border-radius: 10px; box-shadow: var(--shadow); }

/* ── Cards, shelves, grids ────────────────────────────────────────────── */
.bv-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bv-card .bv-cover { transition: transform .2s ease, box-shadow .2s ease; margin-bottom: 8px; }
.bv-card:hover .bv-cover { transform: translateY(-4px); box-shadow: var(--shadow); }
.bv-card__title { font-size: 14px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bv-card__author { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bv-shelf { margin-top: 40px; }
.bv-shelf__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bv-shelf__head h2 { font-size: 22px; font-weight: 700; }
.bv-shelf__actions { display: flex; align-items: center; gap: 8px; }
.bv-shelf__nav { width: 32px; height: 32px; border-radius: 50%; }
.bv-shelf__track { display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 18px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding: 0 20px; padding: 6px 20px 14px; margin: 0 -20px; scrollbar-width: none; }
.bv-shelf__track::-webkit-scrollbar { display: none; }
.bv-shelf__track > * { scroll-snap-align: start; }

.bv-grid-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 28px 20px; }
.bv-section-title { font-size: 20px; margin: 36px 0 16px; }

/* ── Home hero ────────────────────────────────────────────────────────── */
.bv-hero { position: relative; overflow: hidden; margin-top: 24px; border-radius: 22px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 32px; padding: 44px 48px; background: var(--cover-bg); color: #fff; isolation: isolate; }
.bv-hero__bg { position: absolute; inset: -40px; z-index: -1; background-size: cover; background-position: center; filter: blur(40px) saturate(1.4); opacity: .55; }
.bv-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0,0,0,.72), rgba(0,0,0,.2)); }
.bv-hero .bv-eyebrow { color: rgba(255,255,255,.7); }
.bv-hero__title { font-family: var(--serif); font-size: clamp(28px, 4vw, 48px); max-width: 18ch; }
.bv-hero__author { margin: 10px 0 0; font-size: 17px; color: rgba(255,255,255,.8); }
.bv-hero__desc { max-width: 56ch; color: rgba(255,255,255,.78); margin: 16px 0 0; }
.bv-hero .bv-btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); color: #fff; }
.bv-hero .bv-btn--primary { background: #fff; color: #111; }
.bv-hero__cover { width: 190px; transform: rotate(3deg); transition: transform .3s; }
.bv-hero__cover:hover { transform: rotate(0) scale(1.02); }

/* ── Page heads ───────────────────────────────────────────────────────── */
.bv-pagehead { padding: 28px 0 24px; }
.bv-pagehead h1 { font-size: clamp(28px, 4vw, 40px); }
.bv-pagehead__meta { color: var(--text-2); margin: 8px 0 0; }
.bv-pagehead__desc { color: var(--text-2); max-width: 70ch; }
.bv-pagehead--center { text-align: center; }
.bv-pagehead--genre { position: relative; margin: 16px 0 32px; padding: 36px 32px; border-radius: 20px; color: #fff; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--g) 90%, #fff 10%), color-mix(in srgb, var(--g) 55%, #000 45%)); }
.bv-pagehead--genre .bv-eyebrow, .bv-pagehead--genre .bv-pagehead__meta, .bv-pagehead--genre .bv-pagehead__desc { color: rgba(255,255,255,.8); }

/* ── Genres page ──────────────────────────────────────────────────────── */
.bv-genres { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.bv-genre { position: relative; overflow: hidden; min-height: 190px; padding: 22px; border-radius: 18px; color: #fff; display: flex; flex-direction: column; background: linear-gradient(145deg, color-mix(in srgb, var(--g) 92%, #fff 8%), color-mix(in srgb, var(--g) 55%, #000 45%)); transition: transform .2s, box-shadow .2s; }
.bv-genre:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bv-genre__name { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1.1; letter-spacing: normal; max-width: 70%; }
.bv-genre__count { font-size: 13px; opacity: .8; margin-top: 6px; }
.bv-genre__fan { display: flex; margin-top: auto; padding-top: 18px; }
.bv-genre__fan .bv-cover { width: 58px; flex-shrink: 0; transform: rotate(-4deg); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.bv-genre__fan .bv-cover + .bv-cover { margin-left: -10px; }
.bv-genre__fan .bv-cover:nth-child(2) { transform: rotate(2deg) translateY(-4px); }
.bv-genre__fan .bv-cover:nth-child(3) { transform: rotate(-2deg); }
.bv-genre__fan .bv-cover:nth-child(4) { transform: rotate(5deg) translateY(-2px); }
.bv-genre:hover .bv-genre__fan .bv-cover { transform: none; }
.bv-genre__fan .bv-cover { transition: transform .25s; }

/* ── Book page ────────────────────────────────────────────────────────── */
.bv-book { position: relative; isolation: isolate; }
.bv-book__backdrop { position: absolute; top: 0; left: 0; right: 0; height: 520px; z-index: -1; background-color: var(--cover-bg); background-size: cover; background-position: center; filter: blur(60px) saturate(1.3); opacity: .35; mask-image: linear-gradient(to bottom, #000 20%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent); }
.bv-book__head { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: end; padding: 28px 0 8px; }
.bv-book__title { font-family: var(--serif); font-size: clamp(30px, 4.4vw, 52px); margin-top: 12px; }
.bv-book__author { margin: 10px 0 0; font-size: 18px; color: var(--text-2); }
.bv-book__author a { color: var(--accent); }
.bv-book__author a:hover { text-decoration: underline; }
.bv-book__rating { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--text-2); font-size: 14px; }
.bv-stars { display: inline-flex; gap: 1px; font-size: 16px; letter-spacing: 0; }
.bv-star { color: var(--line-2); }
.bv-star.full { color: var(--star); }
.bv-star.half { background: linear-gradient(90deg, var(--star) 50%, var(--line-2) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bv-stats { display: flex; flex-wrap: wrap; gap: 0; margin: 20px 0 0; }
.bv-stats div { padding: 0 22px; border-left: 1px solid var(--line-2); }
.bv-stats div:first-child { padding-left: 0; border-left: 0; }
.bv-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.bv-stats dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; }
.bv-book__body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin-top: 36px; align-items: start; }
.bv-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.bv-panel h2 { font-size: 19px; margin-bottom: 14px; }
.bv-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bv-panel__head h2 { margin: 0; }
.bv-panel--compact { padding: 20px; }
.bv-book__side { position: sticky; top: 80px; }
.bv-details { margin: 0; }
.bv-details div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.bv-details div:first-child { border-top: 0; padding-top: 0; }
.bv-details dt { color: var(--text-3); }
.bv-details dd { margin: 0; text-align: right; font-weight: 500; }
.bv-details a { color: var(--accent); }
.bv-filter { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); outline: none; min-width: 0; width: 200px; }
.bv-filter:focus { border-color: var(--accent); }

.bv-chapters { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.bv-chapters a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; font-size: 14px; transition: border-color .15s, background .15s; }
.bv-chapters a:hover { border-color: var(--line-2); }
.bv-chapters a.is-read .bv-chapters__n { background: var(--accent-soft); color: var(--accent); }
.bv-chapters a.is-current { border-color: var(--accent); }
.bv-chapters__n { flex-shrink: 0; display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: var(--bg-2); color: var(--text-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bv-chapters__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-chapters.is-collapsed li:nth-child(n+25) { display: none; }

.bv-faq details { border-top: 1px solid var(--line); }
.bv-faq details:first-child { border-top: 0; }
.bv-faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.bv-faq summary::after { content: "+"; color: var(--text-3); font-size: 20px; line-height: 1; }
.bv-faq details[open] summary::after { content: "−"; }
.bv-faq summary::-webkit-details-marker { display: none; }

.bv-prose { line-height: 1.7; color: var(--text); }
.bv-prose p { margin: 0 0 1em; }
.bv-prose a { color: var(--accent); }
.bv-prose h2, .bv-prose h3 { margin: 1.4em 0 .6em; }
.bv-clamp.is-clamped { max-height: 11.5em; overflow: hidden; mask-image: linear-gradient(to bottom, #000 60%, transparent); -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent); }

/* ── Author page ──────────────────────────────────────────────────────── */
.bv-author { display: grid; grid-template-columns: 120px 1fr; gap: 28px; align-items: start; padding: 28px 0 8px; }
.bv-author h1 { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); }
.bv-author__avatar { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--accent), #5e5ce6); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.bv-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bv-author__avatar span { color: #fff; font-size: 40px; font-weight: 700; font-family: var(--serif); }
.bv-author .bv-prose { color: var(--text-2); margin-top: 14px; max-width: 75ch; }

/* ── Reader ───────────────────────────────────────────────────────────── */
.bv-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; pointer-events: none; }
.bv-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #0a84ff, #38bdf8); box-shadow: 0 0 10px rgba(10, 132, 255, .7); border-radius: 0 2px 2px 0; transition: width .1s linear; }
.bv-reader { --paper: var(--bg); --ink: var(--text); --reader-size: 19px; --reader-width: 720px; --reader-font: var(--serif); background: var(--paper); color: var(--ink); }
.bv-reader__wrap { max-width: var(--reader-width); margin: 0 auto; padding: 0 20px; transition: max-width .2s; }
.bv-reader[data-paper="light"] { --paper: #ffffff; --ink: #1c1c1e; }
.bv-reader[data-paper="sepia"] { --paper: #f6efe1; --ink: #3b2f22; }
.bv-reader[data-paper="dark"] { --paper: #0b0b0f; --ink: #e8e8ea; }
/* A chosen page color brings its own full palette, independent of the site's light/dark theme,
   so controls stay readable on every combination (e.g. dark page while the site is light). */
body.bv-paper-light { --bg: #ffffff; --bg-2: #f6f6f8; --surface: #ffffff; --surface-2: #f0f0f3; --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.14); --text: #111114; --text-2: #5c5c66; --text-3: #8e8e98; --accent: #0066d6; --accent-soft: rgba(0,102,214,.1); --shadow: 0 10px 30px rgba(20,20,40,.14); --shadow-sm: 0 4px 14px rgba(20,20,40,.12); background: #ffffff; color-scheme: light; }
body.bv-paper-sepia { --bg: #f6efe1; --bg-2: #efe5d2; --surface: #fbf6ec; --surface-2: #ebe0cb; --line: rgba(59,47,34,.12); --line-2: rgba(59,47,34,.2); --text: #3b2f22; --text-2: #6b5a45; --text-3: #8f7d66; --accent: #9a5b13; --accent-soft: rgba(154,91,19,.12); --shadow: 0 10px 30px rgba(59,47,34,.16); --shadow-sm: 0 4px 14px rgba(59,47,34,.12); background: #f6efe1; color-scheme: light; }
body.bv-paper-dark { --bg: #000000; --bg-2: #131318; --surface: #17171d; --surface-2: #1f1f27; --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14); --text: #f4f4f6; --text-2: #a1a1ab; --text-3: #6e6e78; --accent: #0a84ff; --accent-soft: rgba(10,132,255,.14); --shadow: 0 10px 30px rgba(0,0,0,.45); --shadow-sm: 0 4px 14px rgba(0,0,0,.35); background: #000000; color-scheme: dark; }
.bv-reader, .bv-reader__book .bv-reader__booktitle, .bv-select select, .bv-settings { color: var(--text); }
.bv-reader[data-width="wide"] { --reader-width: 900px; }
.bv-reader[data-family="sans"] { --reader-font: var(--font); }
.bv-reader__head { padding: 20px 0 8px; text-align: center; }
/* Book above the chapter title: cover, then the title (max 2 lines) no wider than the cover — no box behind it. */
.bv-reader__book { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 112px; margin: 0 auto 22px; text-align: center; }
.bv-reader__cover { display: block; width: 112px; }
.bv-reader__book .bv-reader__booktitle { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-family: var(--reader-font); font-size: 13px; font-weight: 600; line-height: 1.35; letter-spacing: normal; color: var(--text); transition: color .15s; }
.bv-reader__book:hover .bv-reader__booktitle { color: var(--accent); }
.bv-reader__title { font-family: var(--serif); font-size: clamp(28px, 4vw, 42px); margin-top: 6px; }
/* The old site's CSS sets overflow-x:hidden on html+body, which turns body into a scroll box and
   breaks position:sticky. `clip` still stops sideways scrolling but keeps sticky working. */
html, body, #main-content > div { overflow-x: clip !important; }
.bv-toolbar { position: sticky; top: var(--bv-header-offset, 0px); transition: top .25s ease; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 10px 0; margin: 18px 0 8px; background: var(--paper); border-bottom: 1px solid var(--line); }
.bv-toolbar__spacer { flex: 1; }
.bv-toolbar__sep { width: 1px; height: 24px; background: var(--line-2); margin: 0 2px; }
.bv-icon-btn.is-disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
.bv-toolbar__pn { display: flex; gap: 8px; }
.bv-pn-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; transition: border-color .15s, color .15s; }
.bv-pn-btn:hover { border-color: var(--accent); color: var(--accent); }
.bv-pn-btn.is-disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }
/* Contents button + sidebar */
.bv-toc-btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; transition: border-color .15s; min-width: 0; }
.bv-toc-btn:hover { border-color: var(--line-2); }
.bv-toc-btn__pos { color: var(--text-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.bv-toc-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.bv-toc { position: fixed; top: 0; bottom: 0; left: 0; z-index: 95; width: min(380px, 88vw); display: flex; flex-direction: column; background: var(--bg-2); color: var(--text); border-right: 1px solid var(--line-2); box-shadow: var(--shadow); transform: translateX(-100%); transition: transform .28s ease; }
.bv-toc.is-open { transform: none; }
.bv-toc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.bv-toc__titles { min-width: 0; }
.bv-toc__head h2 { font-family: var(--reader-font, var(--serif)); font-size: 22px; margin: 0; }
.bv-toc__head a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: 13px; color: var(--text-2); }
.bv-toc__head a:hover { color: var(--accent); }
.bv-toc__search { position: relative; margin: 12px 16px 4px; }
.bv-toc__search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.bv-toc__search input { width: 100%; height: 38px; padding: 0 12px 0 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); outline: none; font-size: 14px; }
.bv-toc__search input:focus { border-color: var(--accent); }
.bv-toc__list { list-style: none; margin: 0; padding: 8px 8px 24px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.bv-toc__list a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--text); transition: background .15s; }
.bv-toc__list a:hover { background: var(--surface-2); }
.bv-toc__list a.is-current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.bv-toc__n { flex-shrink: 0; min-width: 26px; font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bv-toc__list a.is-current .bv-toc__n { color: var(--accent); }
.bv-toc__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-toc__done { display: none; color: var(--accent); flex-shrink: 0; }
.bv-toc__list a.is-read .bv-toc__done { display: inline-flex; }
.bv-toc__empty { padding: 16px 24px; color: var(--text-3); font-size: 14px; }
@media (max-width: 640px) { .bv-toc-btn__label { display: none; } .bv-toc-btn { padding: 0 10px; } }

/* Phones: the chapter dropdown takes whatever room the 5 buttons leave, so nothing overflows. */
@media (max-width: 640px) {
  .bv-toolbar { gap: 6px; }
  .bv-reader .bv-icon-btn { width: 34px; height: 34px; border-radius: 9px; }
  .bv-toolbar { flex-wrap: wrap; }
  .bv-toolbar__sep { display: none; }
  .bv-toolbar__pn { order: 10; flex-basis: 100%; }
  .bv-toolbar__pn .bv-pn-btn { flex: 1; height: 40px; }
}
.bv-select select { height: 38px; max-width: min(52vw, 360px); padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e8e98' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; -webkit-appearance: none; appearance: none; cursor: pointer; text-overflow: ellipsis; }
.bv-settings { position: absolute; right: 0; top: calc(100% + 6px); width: 300px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); color: var(--text); }
.bv-settings { background: var(--bg-2); }
.bv-settings__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.bv-settings__row + .bv-settings__row { border-top: 1px solid var(--line); }
.bv-seg { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.bv-seg button { border: 0; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; }
.bv-seg button.is-on { background: var(--bg); box-shadow: var(--shadow-sm); }
.bv-seg output { min-width: 44px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.bv-seg--swatches button { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 2px solid var(--line-2); }
.bv-seg--swatches [data-bv-paper="light"] { background: #fff; }
.bv-seg--swatches [data-bv-paper="sepia"] { background: #f6efe1; }
.bv-seg--swatches [data-bv-paper="dark"] { background: #111; }
.bv-seg--swatches button.is-on { border-color: var(--accent); box-shadow: none; }
.bv-reader__text { font-family: var(--reader-font); font-size: var(--reader-size); line-height: 1.75; color: var(--ink); padding: 18px 0 8px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
.bv-reader__text p { margin: 0 0 1.15em; }
.bv-reader__text h1, .bv-reader__text h2, .bv-reader__text h3 { font-family: var(--reader-font); text-align: center; margin: 1.6em 0 1em; }
.bv-reader__text img { margin: 1.5em auto; border-radius: 6px; }
.bv-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 36px 0 20px; }
.bv-pager__link { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); transition: border-color .15s, color .15s; min-width: 0; }
.bv-pager__link:hover { border-color: var(--accent); color: var(--accent); }
.bv-pager__link:hover small { color: var(--accent); }
.bv-pager__link small { color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.bv-pager__link span { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-pager__link--next { text-align: right; grid-column: 2; }
.bv-reader { padding-bottom: 56px; }
/* A chosen page color fills the whole page, not just the article box. */
body.bv-paper-light #main-content > div, body.bv-paper-sepia #main-content > div, body.bv-paper-dark #main-content > div { background: var(--bg); color: var(--text); }
/* …and the site's Tailwind colour variables follow it, so header, footer and book rows stay readable. */
body.bv-paper-light { --background: 0 0% 100%; --foreground: 0 0% 3.9%; --card: 0 0% 98%; --muted-foreground: 0 0% 45.1%; --border: 0 0% 89.8%; --theme-bg-primary: rgba(255,255,255,.25); --theme-bg-secondary: rgba(0,0,0,.04); --theme-bg-hover: rgba(0,0,0,.08); --theme-border-primary: rgba(0,0,0,.08); }
body.bv-paper-sepia { --background: 40 58% 92%; --foreground: 31 27% 18%; --card: 40 50% 95%; --muted-foreground: 33 20% 38%; --border: 36 30% 80%; --theme-bg-primary: rgba(246,239,225,.6); --theme-bg-secondary: rgba(59,47,34,.06); --theme-bg-hover: rgba(59,47,34,.1); --theme-border-primary: rgba(59,47,34,.12); }
body.bv-paper-dark { --background: 0 0% 0%; --foreground: 0 0% 100%; --card: 0 0% 11%; --muted-foreground: 0 0% 60%; --border: 0 0% 22%; --theme-bg-primary: rgba(0,0,0,.25); --theme-bg-secondary: rgba(255,255,255,.1); --theme-bg-hover: rgba(255,255,255,.2); --theme-border-primary: rgba(255,255,255,.1); }
.bv-finish { margin: 12px 0 8px; padding: 28px 24px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface-2); text-align: center; }
.bv-finish h2 { font-family: var(--reader-font); font-size: 26px; line-height: 1.2; }
.bv-finish p { margin: 6px 0 0; color: var(--text-2); }
.bv-finish .bv-eyebrow { margin: 0 0 8px; }
.bv-finish .bv-actions { justify-content: center; }
.bv-keep-reading { border-top: 1px solid var(--line); }

/* ── Library page ─────────────────────────────────────────────────────── */
.bv-resume-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.bv-resume { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.bv-resume:hover { border-color: var(--line-2); }
.bv-resume .bv-cover { width: 56px; }
.bv-resume strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-resume small { display: block; color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-resume__bar { height: 4px; border-radius: 4px; background: var(--surface-2); margin-top: 8px; overflow: hidden; }
.bv-resume__bar span { display: block; height: 100%; background: var(--accent); }
.bv-resume__rm { border: 0; background: none; color: var(--text-3); cursor: pointer; font-size: 18px; padding: 6px; }
.bv-resume__rm:hover { color: var(--text); }

/* ── Pagination ───────────────────────────────────────────────────────── */
.bv-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 40px 0 0; }
.bv-pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.bv-pagination a.page-numbers:hover { border-color: var(--line-2); }
.bv-pagination .current { background: var(--text); color: var(--bg); border-color: transparent; }
.bv-pagination .dots { border: 0; }

/* ── Static pages, 404 ────────────────────────────────────────────────── */
.bv-page { font-size: 16px; }
.bv-404 { text-align: center; padding: 60px 20px; }
.bv-404__code { font-family: var(--serif); font-size: 96px; font-weight: 700; margin: 0; line-height: 1; background: linear-gradient(135deg, var(--accent), #bf5af2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bv-404 h1 { margin: 12px 0; }
.bv-404 p { color: var(--text-2); }
.bv-404 .bv-search--big { margin: 24px auto; }
.bv-seo-text { margin-top: 40px; color: var(--text-2); }

/* Toast */
.bv-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 100; transition: opacity .2s, transform .2s; pointer-events: none; }
.bv-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bv-book__body { grid-template-columns: 1fr; }
  .bv-book__side { position: static; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .bv-search { max-width: none; }
  .bv-shelf__track { grid-auto-columns: 116px; gap: 14px; padding: 6px 16px 12px; margin: 0 -16px; scroll-padding: 0 16px; }
  .bv-shelf__nav { display: none; }
  .bv-shelf { margin-top: 32px; }
  .bv-shelf__head h2 { font-size: 19px; }
  .bv-grid-books { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 22px 14px; }
  .bv-card__title { font-size: 13px; }
  .bv-card__author { font-size: 12px; }
  .bv-hero { grid-template-columns: 1fr; padding: 28px 22px; border-radius: 18px; margin-top: 16px; }
  .bv-hero__cover { display: none; }
  .bv-book__head { grid-template-columns: 1fr; gap: 20px; text-align: center; justify-items: center; padding-top: 16px; }
  .bv-book__cover { width: 170px; }
  .bv-book__rating, .bv-stats, .bv-actions { justify-content: center; }
  .bv-stats div { padding: 0 14px; }
  .bv-book .bv-actions .bv-btn--primary { width: 100%; }
  .bv-panel { padding: 18px; border-radius: 12px; }
  .bv-panel__head { flex-wrap: wrap; }
  .bv-filter { width: 100%; }
  .bv-chapters { grid-template-columns: 1fr; }
  .bv-author { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 16px; }
  .bv-author__avatar { width: 96px; height: 96px; }
  .bv-genres { grid-template-columns: 1fr 1fr; gap: 12px; }
  .bv-genre { min-height: 160px; padding: 16px; border-radius: 14px; }
  .bv-genre__name { font-size: 18px; max-width: none; }
  .bv-genre__fan .bv-cover { width: 40px; }
  .bv-pagehead--genre { padding: 26px 20px; }
  .bv-reader__text { line-height: 1.7; }
  .bv-settings { width: min(300px, calc(100vw - 32px)); }
  .bv-pager { gap: 8px; margin: 28px 0 16px; }
  .bv-pager__link { padding: 12px 14px; gap: 2px; }
  .bv-pager__link small { font-size: 11px; }
  .bv-pager__link span { font-size: 14px; line-height: 1.3; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .bv-resume-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Library page: saved chapters */
.bv-saved-chapters { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.bv-saved-chapters a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.bv-saved-chapters a:hover { border-color: var(--accent); }
.bv-saved-chapters strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bv-saved-chapters span { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Header: pinned to the top; slides out while scrolling down, back in when scrolling up. */
header.bv-site-header { position: sticky; top: 0; transition: transform .25s ease; will-change: transform; }
header.bv-site-header.is-hidden { transform: translateY(-100%); }
body.bv-reader header.bv-site-header { background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* Footer: every genre */
@media (min-width: 1024px) { .bv-footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.bv-footer-genres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
@media (min-width: 640px) { .bv-footer-genres { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .bv-footer-genres { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* Chapter share dropdown */
.bv-share-wrap { position: relative; display: inline-flex; }
.bv-share-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 45; min-width: 200px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); box-shadow: var(--shadow); }
.bv-share-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.bv-share-menu button:hover, .bv-share-menu button:focus-visible { background: var(--surface-2); outline: none; }

/* Selection toolbar (highlight / underline / bookmark) — same look as the old site */
.bv-seltb { position: fixed; z-index: 9999; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 12px; background: #111827; border: 1px solid #374151; box-shadow: 0 25px 50px -12px rgba(0,0,0,.5); color: #fff; }
.bv-seltb button { border: 0; cursor: pointer; touch-action: manipulation; }
.bv-seltb__sep { width: 1px; height: 24px; background: #374151; }
.bv-seltb__erase, .bv-seltb__close { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: none; color: #9ca3af; }
.bv-seltb__erase:hover, .bv-seltb__close:hover { color: #fff; background: #1f2937; }
.bv-seltb__color { width: 32px; height: 32px; border-radius: 50%; transition: transform .12s, box-shadow .12s; }
.bv-seltb__color:hover { transform: scale(1.1); box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.bv-seltb__color:active { transform: scale(.95); }
.bv-seltb__underline { display: grid; place-items: center; background: #374151; }
.bv-seltb__underline span { font-size: 12px; font-weight: 700; color: #fff; padding: 0 4px; border-bottom: 2px solid #ef4444; line-height: 1.2; }
.bv-seltb__bookmark { display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px; border-radius: 8px; background: #16a34a; color: #fff; font-size: 12px; font-weight: 600; }
.bv-seltb__bookmark:hover { background: #22c55e; }
.bv-seltb.is-editing .bv-seltb__erase { color: #f87171; }
@media (max-width: 480px) { .bv-seltb { gap: 5px; padding: 6px; } .bv-seltb__color { width: 28px; height: 28px; } .bv-seltb__bookmark span { display: none; } }
.bv-seltb--guest { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px; width: 260px; }
.bv-seltb__guest-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.bv-seltb__guest-head span { display: inline-flex; align-items: center; gap: 8px; }
.bv-seltb__signin { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 8px; background: #fff; color: #000; font-size: 14px; font-weight: 600; }
.bv-seltb__signin:hover { background: #f3f4f6; }
.bv-reader__text .highlight-wrap { border-radius: 2px; cursor: pointer; }
.bv-hl-item { border-left-width: 4px !important; }
.bv-hl-yellow { border-left-color: #fde047 !important; } .bv-hl-green { border-left-color: #86efac !important; } .bv-hl-blue { border-left-color: #93c5fd !important; }
.bv-hl-purple { border-left-color: #c4b5fd !important; } .bv-hl-pink { border-left-color: #f9a8d4 !important; } .bv-hl-red-underline { border-left-color: #ef4444 !important; }

/* Header search: same fill/border as the reader's Previous/Next buttons, rounder, narrower, centred. */
.bv-hsearch input[type="search"] { height: 40px; border-radius: 16px !important; background: var(--surface-2) !important; border: 1px solid var(--line) !important; color: var(--text) !important; transition: border-color .15s, background .15s; }
.bv-hsearch input[type="search"]:hover { border-color: var(--line-2) !important; }
.bv-hsearch input[type="search"]:focus { border-color: var(--accent) !important; background: var(--surface) !important; }
.bv-hsearch input[type="search"]::placeholder { color: var(--text-3); }
@media (min-width: 768px) {
  /* 3 columns: left group | search (true centre of the header) | right icons */
  header.bv-site-header { display: grid; grid-template-columns: minmax(max-content, 1fr) minmax(200px, 360px) minmax(max-content, 1fr); }
  header.bv-site-header > :first-child { justify-self: start; }
  header.bv-site-header > .bv-hsearch { width: 100%; max-width: 360px; justify-self: center; }
  header.bv-site-header > :last-child { justify-self: end; }
}

/* Sign In buttons: blue with white text (header, mobile icon, drawer) */
.bv-signin { background: #0a84ff !important; color: #fff !important; border-color: transparent !important; font-weight: 600; }
.bv-signin:hover { background: #0077ed !important; color: #fff !important; }
.bv-signin:not(.bv-signin--icon) { padding-left: 14px; padding-right: 14px; border-radius: 10px; }

/* Account dropdown */
.bv-account__btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: none; }
.bv-account__btn:focus-visible { outline: 2px solid #0a84ff; outline-offset: 2px; }
.bv-account__initial { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #9333ea); color: #fff; font-size: 12px; font-weight: 700; }
.bv-account__menu { position: fixed; z-index: 120; min-width: 230px; padding: 6px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); }
.bv-account__who { display: flex; flex-direction: column; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bv-account__who strong { font-size: 14px; }
.bv-account__who span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 210px; }
.bv-account__menu a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; color: var(--text); }
.bv-account__menu a:hover, .bv-account__menu a:focus-visible { background: var(--surface-2); outline: none; }
.bv-account__sep { display: block; height: 1px; background: var(--line); margin: 4px 0; }
.bv-account__out { color: #ef4444 !important; }

/* Account pages */
.bv-account-tabs { display: flex; gap: 6px; margin: 0 0 24px; border-bottom: 1px solid var(--line); }
.bv-account-tabs a { padding: 10px 14px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-weight: 600; font-size: 14px; }
.bv-account-tabs a:hover { color: var(--text); }
.bv-account-tabs a[aria-current] { color: var(--text); border-bottom-color: #0a84ff; }
.bv-account-guest { max-width: 420px; margin: 24px auto 40px; padding: 32px 24px; text-align: center; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.bv-account-guest__icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-3); }
.bv-account-guest h2 { font-family: var(--serif); font-size: 22px; margin-bottom: 8px; }
.bv-account-guest p { color: var(--text-2); margin: 0 0 20px; font-size: 14px; }
.bv-profile-card { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.bv-profile-card__avatar { width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #9333ea); color: #fff; font-size: 28px; font-weight: 700; }
.bv-profile-card__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bv-profile-card h2 { font-size: 20px; margin: 0; }
.bv-profile-card p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }
.bv-profile-card__since { color: var(--text-3) !important; font-size: 13px !important; }
.bv-profile-card__out { margin-left: auto; }
.bv-profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 8px; }
.bv-profile-stats div { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.bv-profile-stats dt { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.bv-profile-stats dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; }
.bv-profile-stats dd a:hover { color: #0a84ff; }
.bv-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 36px 0 16px; }
.bv-section-head .bv-section-title { margin: 0; }
.bv-section-head .bv-link { font-size: 14px; flex-shrink: 0; }
.bv-resume--link { grid-template-columns: 56px minmax(0, 1fr); }
.bv-resume--link > span { min-width: 0; }
.bv-resume__bar { display: block; }
@media (max-width: 640px) { .bv-profile-card { flex-wrap: wrap; } .bv-profile-card__out { margin-left: 0; } }

/* Profile: edit name */
.bv-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.bv-name__edit { font-size: 13px; }
.bv-name__form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.bv-name__form input { height: 40px; min-width: 0; flex: 1 1 200px; max-width: 320px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-size: 15px; outline: none; }
.bv-name__form input:focus { border-color: #0a84ff; }
.bv-name__form .bv-btn { height: 40px; }
.bv-name__err { width: 100%; margin: 0; color: #ef4444; font-size: 13px; }

/* Continue-reading cards: text column may shrink (long titles truncate), bar + % stay inside the card */
.bv-resume > a, .bv-resume > span { min-width: 0; }
.bv-resume__progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bv-resume__progress .bv-resume__bar { flex: 1; min-width: 0; margin-top: 0; height: 5px; }
.bv-resume__progress b { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
