/* ==========================================================================
   Bookly — дизайн-система (редизайн v2). Токены из design_handoff.
   Свет/тёмная тема через класс .dark на <html>.
   ========================================================================== */
:root {
  --bg: #f9fafb; --surface: #ffffff; --surface-2: #f3f4f6;
  --ink: #111827; --ink-soft: #4b5563; --ink-faint: #9ca3af;
  --line: #e9ebef; --line-strong: #e5e7eb;
  --indigo: #6366f1; --indigo-strong: #4f46e5; --indigo-soft: #eef2ff;
  --star: #f59e0b;
  --shadow-card: 0 1px 2px rgba(17,24,39,.04), 0 8px 24px -12px rgba(17,24,39,.12);
  --shadow-hover: 0 8px 18px -6px rgba(79,70,229,.18), 0 24px 44px -20px rgba(17,24,39,.28);
  --font-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
html.dark {
  --bg: #1d1d1f; --surface: #28282a; --surface-2: #303032;
  --ink: #f4f4f6; --ink-soft: #a4a4a6; --ink-faint: #7f7f81;
  --line: #3a3a3c; --line-strong: #434345;
  --indigo: #818cf8; --indigo-strong: #6366f1; --indigo-soft: rgba(129,140,248,.14);
  --star: #fbbf24;
  --shadow-card: 0 2px 4px rgba(0,0,0,.28), 0 12px 28px -14px rgba(0,0,0,.5);
  --shadow-hover: 0 10px 22px -8px rgba(0,0,0,.5), 0 28px 50px -22px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
input, textarea { font-family: inherit; }
::selection { background: var(--indigo); color: #fff; }
input:focus, button:focus { outline: none; }
.bk-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.bk-scroll::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; }
.hidden { display: none !important; }
html.modal-open, body.modal-open { overflow: hidden; }
.container { max-width: 2800px; margin: 0 auto; padding: 0 clamp(28px, 8vw, 240px); }
.tnum { font-variant-numeric: tabular-nums; }

@keyframes bkxIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes bkxPop { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes bkxOverlay { from { opacity: 0; } to { opacity: 1; } }
@keyframes bkxSpin { to { transform: rotate(360deg); } }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line-strong); border-top-color: var(--indigo); animation: bkxSpin .8s linear infinite; }

/* ---------- NAV ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px rgba(17,24,39,.04);
}
.nav-inner { height: 60px; display: flex; align-items: center; gap: 30px; }
.logo { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.logo i { color: var(--indigo); font-size: 22px; }
.logo span { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.nav-links { display: flex; gap: 4px; margin-left: 6px; }
.nav-link { cursor: pointer; padding: 8px 13px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--ink-soft); background: transparent; transition: all .16s ease; border: none; white-space: nowrap; }
.nav-link:hover { color: var(--ink); }
.nav-link.active { font-weight: 600; color: var(--ink); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.icon-btn { position: relative; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--ink-soft); cursor: pointer; font-size: 14px; transition: all .16s ease; }
.icon-btn:hover { background: color-mix(in srgb, var(--indigo) 12%, var(--surface-2)); color: var(--ink); }
.icon-btn .badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.profile-pill { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 5px; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }
.profile-pill .ava { width: 28px; height: 28px; border-radius: 50%; background: var(--indigo); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; overflow: hidden; }
.profile-pill .ava img { width: 100%; height: 100%; object-fit: cover; }
.profile-pill .pname { font-size: 13.5px; color: var(--ink); font-weight: 500; }
.plan-tag { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; color: var(--indigo); background: var(--indigo-soft); border-radius: 5px; padding: 2px 6px; text-transform: uppercase; }
.btn-login { padding: 8px 18px; border-radius: 10px; border: none; background: var(--indigo); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-login:hover { background: var(--indigo-strong); }

/* ---------- HERO ---------- */
.hero { padding: 64px 0 40px; text-align: center; }
.hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 20px; background: var(--indigo-soft); color: var(--indigo-strong); font-size: 12.5px; font-weight: 600; margin-bottom: 22px; }
.hero h1 { font-size: 48px; line-height: 1.08; letter-spacing: -.025em; font-weight: 800; color: var(--ink); margin: 0 auto 18px; max-width: 820px; text-wrap: balance; }
.hero p { font-size: 19px; color: var(--ink-soft); margin: 0 auto 32px; max-width: 540px; }
.search-box { max-width: 540px; margin: 0 auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 6px 6px 6px 18px; box-shadow: var(--shadow-card); }
.search-box i { color: var(--ink-faint); font-size: 14px; }
.search-box input { flex: 1; border: none; background: transparent; color: var(--ink); font-size: 15px; padding: 11px 4px; }
.search-box .find { padding: 11px 22px; border: none; border-radius: 10px; background: var(--indigo); color: #fff; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: background .16s ease; }
.search-box .find:hover { background: var(--indigo-strong); }

/* ---------- GENRE CHIPS ---------- */
.genres-row { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; align-items: center; padding: 12px 0 4px; }
.fav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; transition: all .16s ease; flex-shrink: 0; }
.fav-btn i { color: #f5a623; }
.fav-btn.active { border-color: #f5a623; background: #fff7e6; }
html.dark .fav-btn.active { background: rgba(245,166,35,.18); border-color: #f5a623; }
.chip { padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .16s ease; white-space: nowrap; }
.chip:hover { border-color: color-mix(in srgb, var(--indigo) 45%, var(--line-strong)); }
.chip.active { background: var(--indigo); color: #fff; border-color: var(--indigo); }

/* ---------- SECTION HEADER + SORT ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.section-head h2 { font-size: 24px; font-weight: 700; color: var(--ink); margin: 0; letter-spacing: -.01em; }
.dropdown { position: relative; }
.dd-btn { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.dd-btn .fa-chevron-down { font-size: 10px; }
.dd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 190px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-hover); overflow: hidden; padding: 5px; }
.dd-menu.left { left: 0; right: auto; width: 220px; max-height: 300px; overflow-y: auto; }
.dd-item { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 9px 12px; border: none; border-radius: 8px; background: transparent; color: var(--ink-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.dd-item.active { background: var(--indigo-soft); color: var(--ink); font-weight: 600; }
.dd-item i { font-size: 11px; color: var(--indigo); opacity: 0; }
.dd-item.active i { opacity: 1; }

/* ---------- BOOK GRID + POSTER CARD ---------- */
.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 22px; }
.book-card { position: relative; aspect-ratio: 2/3; border-radius: 15px; overflow: hidden; border: 1px solid var(--line-strong); box-shadow: var(--shadow-card); cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.book-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
/* Плавное появление карточек (fill-mode backwards: до старта держит opacity:0, после — отдаёт transform ховеру). */
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.book-card.card-in { animation: cardIn .42s cubic-bezier(.22,.61,.36,1) backwards; }
@media (prefers-reduced-motion: reduce) { .book-card.card-in { animation: none; } }
.book-card .ph { position: absolute; top: 34%; left: 50%; transform: translate(-50%,-50%); font-size: 40px; color: rgba(255,255,255,.22); }
.book-card .cover { position: absolute; inset: 0; background-size: cover; background-position: center; }
.book-card .genre-badge { position: absolute; top: 10px; left: 10px; font-size: 10px; font-weight: 600; backdrop-filter: blur(6px); border-radius: 7px; padding: 4px 9px; box-sizing: border-box; max-width: calc(100% - 54px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card .star-over { position: absolute; top: 5px; right: 9px; width: 30px; height: 30px; border: none; background: transparent; cursor: pointer; font-size: 19px; display: flex; align-items: center; justify-content: center; padding: 0; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); transition: transform .14s ease; }
.book-card .star-over:hover { transform: scale(1.12); }
.book-card .lock { position: absolute; inset: 0; background: rgba(17,24,39,.6); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; backdrop-filter: blur(1px); }
.book-card .lock i { font-size: 20px; margin-bottom: 8px; }
.book-card .lock span { font-size: 11.5px; font-weight: 600; }
.book-card .scrim { position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 14px 14px; background: linear-gradient(to top, rgba(8,6,18,.95) 0%, rgba(8,6,18,.74) 44%, rgba(8,6,18,0) 100%); }
.book-card .bt { font-size: 15px; font-weight: 700; color: #fff; line-height: 1.22; }
.book-card .ba { font-size: 12px; color: rgba(255,255,255,.72); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-card .bm { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 11px; color: rgba(255,255,255,.62); }
.book-card .bm i { font-size: 10px; }
.book-card .bm .bl { display: flex; align-items: center; gap: 7px; min-width: 0; }
.book-card .bm .v { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.book-card .read-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px 2px 6px; border-radius: 6px; background: rgba(52,211,153,.2); color: #6ee7b7; font-size: 10px; font-weight: 600; white-space: nowrap; }
.book-card .read-tag i { font-size: 9px; }
.show-more-wrap { text-align: center; margin-top: 36px; }
.show-more { padding: 12px 28px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-card); transition: all .16s ease; }
.show-more:hover { border-color: var(--indigo); color: var(--indigo); }
/* Адаптивная сетка: чем шире экран — тем больше книг в ряд (до 9). */
@media (min-width: 1500px) { .book-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 2050px) { .book-grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 2400px) { .book-grid { grid-template-columns: repeat(8, 1fr); } }
@media (min-width: 2700px) { .book-grid { grid-template-columns: repeat(9, 1fr); } }

.empty { text-align: center; padding: 60px 20px; color: var(--ink-faint); }
.empty i { font-size: 26px; margin-bottom: 12px; display: block; }

/* ---------- PRICING ---------- */
.pricing { max-width: 1160px; margin: 60px auto 80px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 24px; padding: 56px 40px; }
.pricing-head { text-align: center; margin-bottom: 44px; }
.pricing-head h2 { font-size: 32px; font-weight: 800; color: var(--ink); margin: 0 0 10px; letter-spacing: -.02em; }
.pricing-head p { font-size: 16px; color: var(--ink-soft); margin: 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: stretch; max-width: 960px; margin: 0 auto; }
.plan { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 30px 26px; display: flex; flex-direction: column; }
.plan.pro { border: 2px solid var(--indigo); box-shadow: 0 18px 40px -20px rgba(79,70,229,.4); }
.plan .pop { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--indigo); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; border-radius: 16px; padding: 4px 14px; box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.plan .pn { font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--ink); }
.plan.pro .pn { color: var(--indigo); }
.plan .pt { font-size: 13px; color: var(--ink-soft); margin: 5px 0 20px; }
.plan .pp { display: flex; align-items: baseline; gap: 5px; margin-bottom: 22px; }
.plan .pp b { font-size: 40px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.plan .pp span { font-size: 14px; color: var(--ink-faint); }
.plan .feats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; flex: 1; }
.plan .feat { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.plan .feat i { font-size: 13px; margin-top: 2px; }
.plan .feat.on { color: var(--ink-soft); } .plan .feat.on i { color: #22c55e; }
.plan .feat.off { color: var(--ink-faint); } .plan .feat.off i { color: var(--ink-faint); }
.plan .pcta { width: 100%; padding: 12px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; transition: all .16s ease; }
.plan.pro .pcta { border: none; background: var(--indigo); color: #fff; }
.plan.unlim .pcta { border: none; background: var(--ink); color: var(--bg); }

/* ---------- PAGE HEADERS (catalog/authors/news) ---------- */
.page { max-width: 2800px; margin: 0 auto; padding: 48px clamp(28px, 8vw, 240px) 80px; }
.page-head { text-align: center; margin-bottom: 26px; }
.page-head h1 { font-size: 38px; font-weight: 800; color: var(--ink); margin: 0 0 10px; letter-spacing: -.02em; }
.page-head p { font-size: 16px; color: var(--ink-soft); margin: 0; }

/* ---------- CATALOG TOOLBAR + TABLE ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 16px; }
.tb-search { position: relative; display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 11px; padding: 0 16px; min-width: 320px; box-shadow: var(--shadow-card); }
.tb-search i { color: var(--ink-faint); font-size: 13px; margin-right: 10px; }
.tb-search input { flex: 1; border: none; background: transparent; color: var(--ink); font-size: 14px; padding: 11px 0; }
.tb-dd { display: flex; align-items: center; gap: 9px; padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-card); }
.tb-dd > i:first-child { font-size: 12px; color: var(--indigo); }
.tb-dd .fa-chevron-down { font-size: 10px; }
.cat-stats { display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 13px; color: var(--ink-faint); margin-bottom: 20px; }
.cat-stats b { color: var(--ink); }
.cat-stats .sep { color: var(--line-strong); }
.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trow { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; box-shadow: var(--shadow-card); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.trow:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--indigo) 35%, var(--line)); }
.tb-book { display: flex; align-items: center; gap: 14px; min-width: 0; }
.tb-meta { min-width: 0; }
.mini-cover { position: relative; width: 40px; height: 57px; border-radius: 6px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); background-size: cover; background-position: center; }
.mini-cover > i { font-size: 13px; color: rgba(255,255,255,.4); }
.mini-cover .mlock { position: absolute; inset: 0; background: rgba(17,24,39,.5); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; }
.tb-title { font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-author { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.genre-chip-sm { display: inline-block; font-size: 12px; color: var(--indigo); background: var(--indigo-soft); border-radius: 7px; padding: 4px 10px; white-space: nowrap; }
.tb-year { font-size: 13px; color: var(--ink-soft); }
.tb-views { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-faint); }
.tb-views i { font-size: 11px; }
.tb-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.fav-sq { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-faint); cursor: pointer; font-size: 12px; flex-shrink: 0; }
.fav-sq.on { border-color: var(--indigo); background: var(--indigo-soft); color: var(--star); }
.btn-summary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 9px; border: none; background: var(--indigo); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-btn { min-width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font-weight: 600; font-size: 14px; cursor: pointer; }
.page-btn.active { border-color: var(--indigo); background: var(--indigo); color: #fff; }

/* ---------- AUTHORS (master–detail) ---------- */
.authors-layout { display: grid; grid-template-columns: 320px 1fr; gap: 26px; align-items: start; }

/* left: searchable author list */
.authors-list { position: sticky; top: 86px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.al-search { position: relative; padding: 12px; border-bottom: 1px solid var(--line); }
.al-search i { position: absolute; left: 25px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-size: 13px; pointer-events: none; }
.al-search input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink); font-size: 14px; outline: none; transition: border-color .14s ease, background .14s ease; }
.al-search input:focus { border-color: var(--indigo); background: var(--surface); }
.al-scroll { overflow-y: auto; max-height: calc(100vh - 220px); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.author-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: none; background: transparent; border-radius: 11px; cursor: pointer; text-align: left; transition: background .14s ease; }
.author-item:hover { background: var(--surface-2); }
.author-item.active { background: var(--indigo-soft); }
.author-item .av { width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; flex-shrink: 0; transition: background .14s ease, color .14s ease; }
.author-item:hover .av { background: var(--surface); }
.author-item.active .av { background: var(--indigo); color: #fff; }
.author-item .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.author-item .an { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.author-item .as { font-size: 11.5px; color: var(--ink-faint); margin-top: 1px; }
.author-item .caret { font-size: 11px; color: var(--ink-faint); opacity: 0; flex-shrink: 0; transition: opacity .14s ease; }
.author-item:hover .caret { opacity: .6; }
.author-item.active .caret { opacity: 1; color: var(--indigo); }
.al-empty { padding: 26px 16px; text-align: center; color: var(--ink-faint); font-size: 13.5px; }

/* right: selected author + their books as poster cards */
.authors-detail { min-width: 0; }
.author-detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.author-detail-head .av-lg { width: 60px; height: 60px; border-radius: 50%; background: var(--indigo); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; flex-shrink: 0; }
.author-detail-head .adh-meta { min-width: 0; }
.author-detail-head h2 { font-size: 26px; font-weight: 800; color: var(--ink); margin: 0 0 3px; letter-spacing: -.01em; }
.author-detail-head .cnt { font-size: 14px; color: var(--ink-soft); }
.author-books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }

/* ---------- NEWS ---------- */
.news-list { display: flex; flex-direction: column; gap: 18px; }
.news-card { display: grid; grid-template-columns: 150px 1fr; gap: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; align-items: center; box-shadow: var(--shadow-card); transition: border-color .2s ease; }
.news-card:hover { border-color: color-mix(in srgb, var(--indigo) 35%, var(--line)); }
.news-cover { aspect-ratio: 4/3; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.9); font-size: 30px; background-size: cover; background-position: center; }
.news-meta { display: flex; align-items: center; gap: 11px; margin-bottom: 9px; }
.news-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--indigo); background: var(--indigo-soft); border-radius: 6px; padding: 3px 9px; }
.news-date { font-size: 12px; color: var(--ink-faint); }
.news-card h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 7px; line-height: 1.25; }
.news-card p { font-size: 14px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.55; }
.news-foot { display: flex; align-items: center; gap: 18px; font-size: 12.5px; color: var(--ink-faint); }
.news-foot span { display: flex; align-items: center; gap: 6px; }
.news-like { display: flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 12.5px; }
.news-like.on { color: #ef4444; }

/* ---------- FOOTER ---------- */
.footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 20px; }
.footer-grid { max-width: 1180px; margin: 0 auto; padding: 44px 24px; display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.3fr; gap: 36px; }
.footer-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.footer-brand i { color: var(--indigo); font-size: 20px; }
.footer-brand span { font-size: 19px; font-weight: 800; color: var(--ink); }
.footer p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; max-width: 260px; margin: 0; }
.footer .fh { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 13px; }
.footer .fcol { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; color: var(--ink-soft); }
.footer .fcol span { cursor: pointer; }
.footer-bottom { border-top: 1px solid var(--line); padding: 18px 24px; max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-faint); }
.footer-bottom .duetly { display: inline-flex; align-items: center; gap: 6px; }
.footer-bottom .duetly a { color: var(--ink-soft); font-weight: 500; }
.footer-bottom .duetly a:hover { color: var(--indigo); }
.duetly-heart { position: relative; border: none; background: transparent; color: #ef4444; cursor: pointer; font-size: 13px; line-height: 1; padding: 2px; display: inline-flex; transition: transform .15s ease; }
.duetly-heart:hover { transform: scale(1.35); }
.duetly-heart.liked { cursor: default; }
.duetly-heart i { color: #ef4444; }
.duetly-plus { position: absolute; left: 50%; top: -3px; transform: translateX(-50%); color: #ef4444; font-size: 11px; font-weight: 700; pointer-events: none; animation: bkPlusOne .9s ease-out forwards; }
@keyframes bkPlusOne { 0% { opacity: 0; transform: translate(-50%, 0) scale(.7); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -22px) scale(1.1); } }

/* ---------- MODALS (shared) ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay .backdrop { position: absolute; inset: 0; background: rgba(17,24,39,.55); backdrop-filter: blur(5px); }
.modal { position: relative; width: 100%; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: 0 40px 90px -36px rgba(0,0,0,.6); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
.bm-scroll, .pf-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.x-btn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; }

/* Book modal */
.book-modal { max-width: 800px; min-height: min(600px, 88vh); }
.bm-head { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.bm-head-titles { position: relative; flex: 1; min-width: 0; display: grid; align-items: center; }
.bm-head-default { grid-area: 1 / 1; font-size: 16px; font-weight: 600; color: var(--ink); transition: opacity .12s ease; }
.bm-head-compact { grid-area: 1 / 1; display: flex; align-items: center; justify-content: flex-start; gap: 11px; min-width: 0; opacity: 0; pointer-events: none; transition: opacity .12s ease; }
.bm-head-cover { width: 26px; height: 37px; border-radius: 5px; flex-shrink: 0; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 3px 8px -3px rgba(0,0,0,.5); }
.bm-head-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-head-meta { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.bm-head-title { font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bm-head-sub { font-size: 11.5px; color: var(--ink-faint); line-height: 1.2; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bm-titlerow { display: flex; align-items: flex-start; gap: 14px; }
.bm-titlerow h2 { flex: 1; min-width: 0; }
.fav-round { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-faint); font-size: 15px; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .16s ease; }
.fav-round:hover { border-color: color-mix(in srgb, var(--indigo) 45%, var(--line-strong)); }
.fav-round.on { border-color: var(--indigo); background: var(--indigo-soft); color: var(--star); }
.bm-body { padding: 28px 32px 24px; }
.bm-top { display: flex; gap: 26px; margin-bottom: 26px; }
.bm-cover { flex-shrink: 0; width: 130px; height: 196px; border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; box-shadow: 0 18px 36px -18px rgba(0,0,0,.5); background-size: cover; background-position: center; }
.bm-cover > i { font-size: 30px; color: rgba(255,255,255,.4); }
.bm-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-info { flex: 1; min-width: 0; }
.bm-info h2 { font-size: 27px; font-weight: 800; color: var(--ink); margin: 0 0 6px; line-height: 1.15; letter-spacing: -.01em; }
.bm-info .au { font-size: 15px; color: var(--ink-soft); margin-bottom: 14px; }
.bm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.bm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); background: var(--surface-2); border-radius: 8px; padding: 6px 11px; }
.bm-chip i { font-size: 11px; color: var(--indigo); }
.bm-actions { display: flex; gap: 10px; align-items: center; }
.btn-listen { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 11px; border: none; background: var(--indigo); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-listen:disabled { opacity: .6; cursor: default; }
.fav-lg { width: 44px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-faint); font-size: 15px; cursor: pointer; }
.fav-lg.on { border-color: var(--indigo); background: var(--indigo-soft); color: var(--star); }
.tts-bar { margin-top: 14px; display: flex; align-items: center; gap: 11px; }
.tts-bar .tts-seek { flex: 1; padding: 10px 0; cursor: pointer; }
.tts-bar .track { position: relative; height: 5px; border-radius: 5px; background: var(--surface-2); overflow: hidden; transition: height .12s ease; }
.tts-bar .tts-seek:hover .track { height: 7px; }
.tts-bar .buffer { position: absolute; left: 0; top: 0; height: 100%; width: 0%; border-radius: 5px; background: var(--ink-faint); opacity: .5; transition: width .3s ease; }
.tts-bar .fill { position: absolute; left: 0; top: 0; height: 100%; width: 0%; border-radius: 5px; background: var(--indigo); transition: width .2s linear; }
.tts-bar .time { font-size: 11.5px; color: var(--ink-faint); }
.summary { border-top: 1px solid var(--line); padding-top: 24px; }
/* Состояния пересказа (генерация / ошибка) — по центру, чтобы короткий текст не сплющивал окно. */
.bm-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 15px; padding: 40px 24px; color: var(--ink-soft); }
.bm-state .spin { margin: 0; }
.bm-state-ic { font-size: 40px; color: var(--ink-faint); }
.bm-state.error .bm-state-ic { color: var(--indigo); }
.bm-state-msg { font-size: 15.5px; line-height: 1.55; max-width: 440px; }
.bm-retry { margin-top: 4px; }
.summary:has(.bm-state) { border-top: none; padding-top: 0; }
.summary h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 22px 0 10px; }
.summary > :first-child { margin-top: 0; }
.summary p { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 15px; max-width: 64ch; }
.summary strong { color: var(--ink); font-weight: 700; }
.summary em { font-style: italic; }
.summary ul, .summary ol { margin: 0 0 15px; padding-left: 22px; max-width: 64ch; }
.summary li { font-size: 15.5px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 6px; }
.summary li strong { color: var(--ink); }
.bm-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg); border-top: 1px solid var(--line); padding: 9px 20px 9px 24px; font-size: 13px; color: var(--ink-soft); transition: transform .25s ease; }
.bm-foot.collapsed { transform: translateY(100%); pointer-events: none; }
.bm-foot-info { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--ink-faint); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-foot-info i { color: var(--indigo); font-size: 11px; }
.btn-soft { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 9px; border: none; background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }

/* Profile modal */
.profile-modal { max-width: 600px; border-radius: 20px; }
.pf-banner { position: relative; height: 120px; background: radial-gradient(120% 160% at 50% -40%, var(--indigo) 0%, var(--indigo-strong) 60%, color-mix(in srgb, var(--indigo-strong) 70%, #000) 100%); overflow: hidden; }
.pf-banner .glow { position: absolute; inset: 0; background-image: radial-gradient(circle at 18% 30%, rgba(255,255,255,.14) 0, transparent 42%), radial-gradient(circle at 82% 70%, rgba(255,255,255,.10) 0, transparent 40%); }
.pf-banner .x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; border: none; background: rgba(0,0,0,.22); color: #fff; cursor: pointer; font-size: 14px; backdrop-filter: blur(4px); }
.pf-id { text-align: center; padding: 0 32px; }
.pf-ava { position: relative; z-index: 2; width: 96px; height: 96px; border-radius: 50%; margin: -52px auto 0; background: linear-gradient(135deg, var(--indigo), var(--indigo-strong)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 38px; border: 5px solid var(--bg); box-shadow: 0 12px 28px -12px rgba(79,70,229,.6); overflow: hidden; }
.pf-ava img { width: 100%; height: 100%; object-fit: cover; }
.pf-name { font-size: 23px; font-weight: 800; color: var(--ink); margin-top: 14px; letter-spacing: -.01em; }
.pf-email { font-size: 13.5px; color: var(--ink-soft); margin-top: 3px; }
.pf-plan { display: inline-flex; align-items: center; gap: 6px; margin-top: 11px; font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--indigo); background: var(--indigo-soft); border-radius: 20px; padding: 6px 13px; text-transform: uppercase; }
.pf-plan i { font-size: 10px; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 22px 32px 4px; }
.pf-stat { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 8px; }
.pf-stat > i { color: var(--indigo); font-size: 16px; }
.pf-stat .val { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 8px; }
.pf-stat .lbl { font-size: 11.5px; color: var(--ink-faint); margin-top: 2px; }
.pf-tabs { padding: 20px 32px 0; }
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 4px; }
.seg-btn { flex: 1; padding: 9px 10px; border: none; border-radius: 9px; background: transparent; color: var(--ink-soft); font-weight: 500; font-size: 13.5px; cursor: pointer; transition: all .16s ease; }
.seg-btn.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(17,24,39,.14); }
.pf-content { padding: 22px 32px 32px; }
.pf-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-field { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.pf-field .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--indigo-soft); color: var(--indigo); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.pf-field .l { font-size: 11px; color: var(--ink-faint); margin-bottom: 2px; }
.pf-field .v { font-size: 14.5px; color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-edit { width: 100%; margin-top: 14px; padding: 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.pf-edit i { font-size: 12px; color: var(--indigo); }
.sub-card { border: 1.5px solid var(--indigo); border-radius: 16px; padding: 22px; background: linear-gradient(160deg, var(--indigo-soft), transparent); }
.sub-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.sub-top .l { font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--ink-faint); }
.sub-top .plan-row { display: flex; align-items: center; gap: 9px; margin-top: 5px; }
.sub-top .pn { font-size: 26px; font-weight: 800; color: var(--ink); }
.sub-top .pp { font-size: 13px; color: var(--ink-faint); }
.sub-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: #16a34a; background: rgba(34,197,94,.14); border-radius: 8px; padding: 6px 12px; }
.sub-badge i { font-size: 7px; }
.sub-meter .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.sub-meter .row b { font-weight: 600; color: var(--ink); }
.sub-meter .track { height: 9px; border-radius: 9px; background: var(--surface-2); overflow: hidden; }
.sub-meter .fill { height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--indigo), var(--indigo-strong)); }
.sub-renew { font-size: 12px; color: var(--ink-faint); margin-top: 14px; }
.sub-actions { display: flex; gap: 10px; margin-top: 14px; }
.sub-actions .up { flex: 1; padding: 12px; border-radius: 12px; border: none; background: var(--indigo); color: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.sub-actions .cancel { padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); font-weight: 500; font-size: 14px; cursor: pointer; }
.hist-list { display: flex; flex-direction: column; gap: 9px; }
.hist-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px; cursor: pointer; transition: border-color .16s ease; }
.hist-item:hover { border-color: color-mix(in srgb, var(--indigo) 40%, var(--line)); }
.hist-item .mc { width: 40px; height: 57px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); background-size: cover; background-position: center; }
.hist-item .mc i { font-size: 13px; color: rgba(255,255,255,.4); }
.hist-item .ht { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item .ha { font-size: 12px; color: var(--ink-soft); }
.hist-item .hd { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-faint); flex-shrink: 0; margin-left: auto; }

/* Chat modal */
.chat-modal { max-width: 880px; height: 72vh; display: grid; grid-template-columns: 260px 1fr; overflow: hidden; }
.chat-side { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.chat-side .title { padding: 17px 18px 12px; font-size: 18px; font-weight: 700; color: var(--ink); }
.chat-friends { flex: 1; overflow-y: auto; padding: 0 8px 8px; }
.friend { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: none; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; margin-bottom: 2px; }
.friend.active { background: var(--indigo-soft); }
.friend .av { position: relative; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--ink-soft); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.friend .av.bot { background: var(--indigo); color: #fff; }
.friend .av img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.friend .dot { position: absolute; bottom: 1px; right: 1px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--surface); background: var(--ink-faint); box-sizing: border-box; }
.friend .dot.online { background: #22c55e; }
.friend .fn { display: block; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend .fp { display: block; font-size: 12px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.chat-head .av { width: 38px; height: 38px; border-radius: 50%; background: var(--indigo); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; overflow: hidden; }
.chat-head .av img { width: 100%; height: 100%; object-fit: cover; }
.chat-head .nm { font-size: 15px; font-weight: 600; color: var(--ink); }
.chat-head .st { font-size: 12px; color: #22c55e; }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 11px; }
.bubble { max-width: 72%; padding: 10px 14px; font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.bubble.them { align-self: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 14px 14px 14px 4px; }
.bubble.me { align-self: flex-end; background: var(--indigo); color: #fff; border-radius: 14px 14px 4px 14px; }
.bubble .tm { font-size: 10px; margin-top: 5px; text-align: right; }
.bubble .tm .st { margin-left: 5px; font-size: 10px; }
.bubble.me .tm .st.read { color: #a5d8ff; }
.bubble .tm .st.fail { color: #fecaca; }
.bubble.them .tm { color: var(--ink-faint); } .bubble.me .tm { color: rgba(255,255,255,.7); }
.chat-input { padding: 15px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.chat-input input { flex: 1; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 11px; padding: 11px 15px; font-size: 14px; }
.chat-send { width: 46px; border-radius: 11px; border: none; background: var(--indigo); color: #fff; font-size: 15px; cursor: pointer; }

/* Auth modal */
.auth-modal { max-width: 460px; border-radius: 20px; padding: 0; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); position: relative; }
.auth-tab { flex: 1; padding: 20px; border: none; background: transparent; color: var(--ink-faint); font-size: 16px; font-weight: 600; cursor: pointer; }
.auth-tab.active { color: var(--indigo); }
.auth-tab.active::after { content: ''; position: absolute; bottom: -1px; height: 2px; background: var(--indigo); border-radius: 2px; }
.auth-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px; border: none; background: transparent; color: var(--ink-faint); cursor: pointer; font-size: 16px; z-index: 3; }
.auth-body { padding: 26px 28px 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.field label .req { color: #ef4444; }
.field input { width: 100%; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 12px 14px; font-size: 15px; }
.field input:focus { border-color: var(--indigo); }
.field .err { font-size: 12.5px; color: #ef4444; margin-top: 6px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-size: 13.5px; }
.auth-row a { color: var(--indigo); cursor: pointer; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); cursor: pointer; }
.btn-primary { width: 100%; padding: 13px; border-radius: 11px; border: none; background: var(--indigo); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: var(--indigo-strong); }
.btn-primary:disabled { opacity: .6; cursor: default; }

/* About modal */
.about-modal { max-width: 600px; border-radius: 20px; }
.about-x { position: absolute; top: 16px; right: 16px; z-index: 2; }
.about-body { flex: 1; min-height: 0; overflow-y: auto; padding: 34px 34px 30px; }
.about-logo { width: 88px; height: 88px; border-radius: 50%; background: var(--indigo-soft); display: flex; align-items: center; justify-content: center; margin: 4px auto 18px; cursor: pointer; transition: transform .16s ease; }
.about-logo:hover { transform: scale(1.05); }
.about-logo img { width: 62px; height: 62px; object-fit: contain; }
.about-body h3 { font-size: 22px; font-weight: 800; color: var(--ink); text-align: center; margin: 0 0 16px; letter-spacing: -.01em; }
.about-health { display: none; text-align: center; font-size: 12.5px; color: var(--ink-faint); background: var(--surface-2); border-radius: 9px; padding: 8px 12px; margin: 0 auto 16px; max-width: 380px; }
.about-health.shown { display: block; }
.about-health b { color: #16a34a; }
.about-body p { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 14px; }
.about-body p b { color: var(--ink); }
.about-body ul { margin: 0 0 6px; padding-left: 22px; }
.about-body li { font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 6px; }
.about-studio { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; text-align: center; }
.about-studio h4 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.about-studio-desc { font-size: 12.5px; color: var(--ink-faint); margin: 0 auto 12px; max-width: 460px; }
.about-link { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-soft); font-weight: 500; }
.about-link i { color: var(--indigo); }
.about-link:hover { color: var(--indigo); }
.about-ok { width: auto; margin: 24px auto 0; padding: 12px 32px; display: block; }

/* Toast */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 11px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-hover); animation: bkxIn .25s ease; max-width: 90vw; }
.toast.err { background: #ef4444; color: #fff; }
.toast.ok { background: #16a34a; color: #fff; }

/* Responsive */
@media (max-width: 1080px) { .book-grid { grid-template-columns: repeat(4, 1fr); } .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 980px) { .cat-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .authors-layout { grid-template-columns: 1fr; gap: 16px; }
  .authors-list { position: static; }
  .al-scroll { max-height: 300px; }
}
@media (max-width: 820px) {
  .hero h1 { font-size: 36px; } .nav-links { display: none; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; }
  .chat-modal { grid-template-columns: 1fr; } .chat-side { display: none; }
  .news-card { grid-template-columns: 1fr; } .news-cover { max-height: 160px; }
  .pf-fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) { .trow .tb-genre { display: none; } }
@media (max-width: 560px) { .book-grid, .author-books-grid { grid-template-columns: repeat(2, 1fr); } .container { padding: 0 16px; } .bm-top { flex-direction: column; } }
