@charset "UTF-8";
/* ==========================================================================
   ИНСТИТУТ КНИГИ — тема «Альма-матер»
   Единственный слой оформления сайта. Грузится последним, поэтому
   перебивает скомпилированные бандлы Vite/Bootstrap.
   Палитра: кремовая бумага + бутылочная зелень + золото.
   Шрифты: Old Standard TT (заголовки) / Literata (текст) / Golos Text (интерфейс).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Old+Standard+TT:ital,wght@0,400;0,700;1,400&family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,500;0,7..72,600;0,7..72,700;1,7..72,400&family=Golos+Text:wght@400;500;600;700&display=swap');

:root,
html[data-bs-theme="light"],
html[data-bs-theme="dark"] {
  --bi-paper: #f6f1e3;
  --bi-paper-deep: #efe8d5;
  --bi-card: #fffdf4;
  --bi-ink: #241f16;
  --bi-ink-soft: #4a4233;
  --bi-muted: #6f6753;
  --bi-green: #1d4a38;
  --bi-green-deep: #122f24;
  --bi-green-soft: #e3ece5;
  --bi-gold: #b8923c;
  --bi-gold-soft: #e8d9ae;
  --bi-line: #d8cfb4;
  --bi-red: #8c3b2e;

  /* Роли, которые в ночной теме расходятся с заливками:
     зелёный как ТЕКСТ и тёмно-зелёный как ЗАГОЛОВОК. В светлой теме —
     ровно те же цвета, что и раньше, поэтому вид не меняется. */
  --bi-green-text: #1d4a38;
  --bi-title: #122f24;

  /* переопределяем токены бутстрапа движка */
  --bs-body-bg: var(--bi-paper);
  --bs-body-color: var(--bi-ink);
  --bs-primary: var(--bi-green);
  --bs-primary-rgb: 29, 74, 56;
  --bs-link-color: var(--bi-green-text);
  --bs-link-hover-color: var(--bi-title);
  --bs-border-color: var(--bi-line);
  --bs-secondary-color: var(--bi-muted);
  --bs-emphasis-color: var(--bi-ink);
  --bs-heading-color: var(--bi-title);
}

/* ==========================================================================
   НОЧНАЯ ТЕМА «АЛЬМА-МАТЕР» (08.09.2026).

   Переключатель в шапке был спрятан, потому что тёмной палитры не
   существовало: `html[data-bs-theme="dark"]` получал те же бумажные токены,
   и нажатие ничего не меняло. Теперь у ночи свои значения.

   ⚠️ Зелёные ПЛАШКИ (шапка, подвал, кнопки, бейджи) намеренно остаются
   прежними: на тёмной бумаге они читаются как поверхность, а кремовый текст
   на них сохраняет контраст. Меняется только зелёный, который был ТЕКСТОМ, —
   для него отдельные токены `--bi-green-text` / `--bi-title`.
   ========================================================================== */
html[data-bs-theme="dark"] {
  --bi-paper: #131c18;
  --bi-paper-deep: #0e1613;
  --bi-card: #1b2721;
  --bi-ink: #ece3cb;
  --bi-ink-soft: #cdc4ab;
  --bi-muted: #9aa89c;
  --bi-green: #1d4a38;
  --bi-green-deep: #122f24;
  --bi-green-soft: #21382d;
  --bi-green-text: #8cc7a8;
  --bi-title: #f4ecd6;
  --bi-gold: #c5a256;
  --bi-gold-soft: #ecdfb8;
  --bi-line: #2f3e35;
  --bi-red: #c4705f;
}

/* ⚠️ У бумаги страницы в ночи ОДИН перебиваемый противник: донорское
   `[data-bs-theme="dark"] .bg-body-tertiary` с !important и весом (0,2,0).
   Наше `[data-bs-theme] body` — (0,1,1), проигрывает. Поднимаем до (0,2,2). */
html[data-bs-theme] body.bg-body-tertiary,
html[data-bs-theme="dark"] body.bg-body-tertiary {
  background-color: var(--bi-paper) !important;
}

/* Гашеные стрелки пагинации донор красит серым #e5e7eb — на тёмной бумаге
   это яркое пятно. */
html[data-bs-theme="dark"] .pagination .page-item.disabled .page-link,
html[data-bs-theme="dark"] .pagination .page-link.disabled,
html[data-bs-theme="dark"] .pagination span.page-link {
  background: var(--bi-paper-deep) !important;
  color: var(--bi-muted) !important;
  border-color: var(--bi-line) !important;
}
html[data-bs-theme="dark"] .pagination .page-item.active .page-link {
  background: var(--bi-gold) !important;
  border-color: var(--bi-gold) !important;
  color: var(--bi-green-deep) !important;
}

/* --------------------------------------------------------------- основа */
html { font-size: 17px; }
@media (max-width: 575.98px) { html { font-size: 16px; } }

body,
[data-bs-theme] body {
  background-color: var(--bi-paper) !important;
  color: var(--bi-ink) !important;
  font-family: 'Literata', Georgia, serif !important;
  line-height: 1.6;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(184, 146, 60, .05), transparent 42%),
    radial-gradient(circle at 85% 92%, rgba(29, 74, 56, .05), transparent 42%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5,
.card-title, .section-title {
  font-family: 'Old Standard TT', 'Literata', Georgia, serif !important;
  color: var(--bi-title);
  letter-spacing: .005em;
}

.btn, .nav-link, .badge, .form-control, .form-select, .dropdown-item,
.pagination, .breadcrumb, input, select, textarea, button, label, small {
  font-family: 'Golos Text', system-ui, sans-serif !important;
}

a { color: var(--bi-green-text); }
a:hover { color: var(--bi-title); }

/* легаси-утилиты тёмной темы движка переводим на бумагу */
[data-bs-theme] .bg-dark-card,
[data-bs-theme] .bg-dark,
.bg-dark-card { background-color: var(--bi-card) !important; }
[data-bs-theme] .text-white:not(.btn):not(.navbar-brand *):not(.footer *):not(.site-navbar *),
[data-bs-theme] .text-white-50:not(.site-navbar *):not(.footer *) { color: var(--bi-ink) !important; }
[data-bs-theme] .border-white-10:not(.site-navbar):not(.footer *) { border-color: var(--bi-line) !important; }
[data-bs-theme] .text-muted { color: var(--bi-muted) !important; }
[data-bs-theme] .text-primary { color: var(--bi-green-text) !important; }
[data-bs-theme] .text-secondary { color: var(--bi-muted) !important; }

/* ----------------------------------------------------- лента с девизом */
.bi-motto-bar {
  background: var(--bi-green-deep);
  color: #cfe0d3;
  font-family: 'Golos Text', sans-serif;
  font-size: .66rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-align: center;
  padding: 7px 12px;
  border-bottom: 1px solid rgba(184, 146, 60, .5);
}
.bi-motto-bar b { color: var(--bi-gold-soft); font-weight: 600; }
@media (max-width: 767.98px) { .bi-motto-bar { font-size: .58rem; letter-spacing: .14em; } }

/* ---------------------------------------------------------------- шапка */
.site-navbar,
[data-bs-theme] .navbar.site-navbar {
  background: var(--bi-green) !important;
  border-bottom: 3px double var(--bi-gold) !important;
  padding-top: .85rem !important;
  padding-bottom: .85rem !important;
}
.site-navbar .container-fluid { max-width: 1400px; }

/* герб-щит вместо словесного логотипа донора */
.bookinstitute-wordmark {
  /* Лого в две строки: щит слева на всю высоту, «Институт» сверху,
     «Книги» снизу вразрядку — так подпись выравнивается по ширине верхней
     строки и связка читается как единый знак, а не как два слова подряд. */
  display: grid !important;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: .55rem;
  row-gap: 0;
  text-decoration: none;
  line-height: 1;
}
.bookinstitute-wordmark__pro,
.bookinstitute-wordmark__books {
  display: block !important;
  grid-column: 2;
  font-family: 'Old Standard TT', serif !important;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.06;
}
.bookinstitute-wordmark__pro {
  grid-row: 1;
  color: #fbf6e6 !important;
  font-size: 1.12rem;
  letter-spacing: .02em;
  margin-right: 0;
}
.bookinstitute-wordmark__books {
  grid-row: 2;
  color: var(--bi-gold-soft) !important;
  font-size: .74rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  margin-top: .12rem;
}
.bookinstitute-wordmark::before {
  content: "ИК";
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 36px; height: 41px; flex: 0 0 auto;
  background: linear-gradient(170deg, #f8f2df, #e9dfc2);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Old Standard TT', serif; font-weight: 700; font-size: .82rem;
  letter-spacing: .01em;
  color: var(--bi-green);
  box-shadow: inset 0 0 0 2px var(--bi-green), inset 0 0 0 4px var(--bi-gold);
}
@media (max-width: 991.98px) {
  .bookinstitute-wordmark__pro { font-size: .98rem; }
  .bookinstitute-wordmark__books { font-size: .64rem; letter-spacing: .3em; }
  .bookinstitute-wordmark::before { width: 32px; height: 37px; font-size: .74rem; }
}

/* пункты меню */
.site-navbar .navbar-nav { gap: 0; }
.site-navbar .nav-link,
[data-bs-theme] .site-navbar .nav-link {
  color: #d9e7dc !important;
  font-size: .84rem;
  font-weight: 500;
  padding: .42rem .38rem !important;
  border-radius: 3px;
  white-space: nowrap;
}
.site-navbar .nav-link:hover,
[data-bs-theme] .site-navbar .nav-link:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff !important;
}
.site-navbar .nav-link.active,
[data-bs-theme] .site-navbar .nav-link.active,
[data-bs-theme] .site-navbar .nav-link.active.text-primary {
  background: var(--bi-gold);
  color: var(--bi-green-deep) !important;
  font-weight: 600;
}
.site-navbar .dropdown-menu {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
}
.site-navbar .dropdown-item,
[data-bs-theme] .site-navbar .dropdown-item.text-white { color: var(--bi-ink) !important; }
.site-navbar .dropdown-item:hover { background: var(--bi-green-soft) !important; }

/* поиск в шапке */
.site-navbar form[role="search"] .input-group-text {
  background: rgba(255, 255, 255, .12) !important;
  color: var(--bi-gold-soft) !important;
  border-radius: 3px 0 0 3px !important;
}
.site-navbar form[role="search"] .form-control {
  background: rgba(255, 255, 255, .12) !important;
  color: #fbf6e6 !important;
  font-family: 'Literata', serif !important;
}
.site-navbar form[role="search"] .form-control::placeholder { color: #a8c2b0 !important; }

/* кнопки входа */
.bookinstitute-login-btn,
[data-bs-theme] .site-navbar .btn-outline-light.bookinstitute-login-btn {
  border: 1px solid var(--bi-gold) !important;
  color: var(--bi-gold-soft) !important;
  background: transparent !important;
  border-radius: 3px !important;
  font-weight: 600;
}
.bookinstitute-login-btn:hover {
  background: var(--bi-gold) !important;
  color: var(--bi-green-deep) !important;
}
.bookinstitute-register-btn,
[data-bs-theme] .site-navbar .btn-primary.bookinstitute-register-btn {
  background: var(--bi-gold) !important;
  border: 1px solid var(--bi-gold) !important;
  color: var(--bi-green-deep) !important;
  border-radius: 3px !important;
  font-weight: 600;
}
.bookinstitute-register-btn:hover { background: var(--bi-gold-soft) !important; }
.bookinstitute-theme-toggle {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border: 1px solid rgba(232, 217, 174, .35) !important;
  border-radius: 3px !important;
  color: #ece3cb !important;
  background: transparent !important;
}
.bookinstitute-theme-toggle:hover { background: rgba(255, 255, 255, .1) !important; border-color: var(--bi-gold) !important; }
.bookinstitute-theme-toggle i { font-size: .95rem; line-height: 1; }
.site-navbar .navbar-toggler { color: var(--bi-gold-soft); }
.site-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23e8d9ae' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---------------------------------------------------------------- герой */
.bookinstitute-home-hero {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 3.2rem 0 1.4rem !important;
  text-align: center;
}
.bookinstitute-home-hero__main {
  display: block !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
.bookinstitute-home-hero__feature { display: none !important; }
.bookinstitute-home-hero__copy { max-width: 760px; margin: 0 auto; text-align: center; }

.bookinstitute-home-hero__eyebrow {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .66rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--bi-muted) !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
  margin-bottom: 1.1rem;
}
/* печать института над заголовком */
.bookinstitute-home-hero__copy::before {
  content: "ИК";
  display: flex; align-items: center; justify-content: center;
  width: 88px; height: 88px; margin: 0 auto 1.2rem;
  border-radius: 50%;
  border: 2px solid var(--bi-gold);
  outline: 1px solid var(--bi-gold);
  outline-offset: 4px;
  background: var(--bi-card);
  color: var(--bi-green-text);
  font-family: 'Old Standard TT', serif;
  font-weight: 700;
  font-size: 1.6rem;
}
.bookinstitute-home-hero__title {
  font-family: 'Old Standard TT', serif !important;
  font-size: 2.9rem !important;
  font-weight: 600 !important;
  line-height: 1.12 !important;
  color: var(--bi-title) !important;
  margin-bottom: .8rem;
}
.bookinstitute-home-hero__title em,
.bookinstitute-home-hero__title .bi-accent { font-style: italic; color: var(--bi-gold); }
.bookinstitute-home-hero__text {
  font-size: 1.04rem !important;
  color: var(--bi-muted) !important;
  max-width: 640px;
  margin: 0 auto;
}
@media (max-width: 767.98px) {
  .bookinstitute-home-hero__title { font-size: 2rem !important; }
  .bookinstitute-home-hero { padding-top: 2rem !important; }
}

/* виньетка-разделитель */
.bookinstitute-home-hero__signals {
  justify-content: center !important;
  margin-top: 1.6rem !important;
  gap: 1.4rem !important;
  flex-wrap: wrap;
}
.bookinstitute-home-hero__signals span {
  background: transparent !important;
  border: none !important;
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem !important;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.bookinstitute-home-hero__signals span i { color: var(--bi-gold); }

.bookinstitute-home-hero__actions { justify-content: center !important; margin-top: 1.6rem !important; }
.bookinstitute-home-hero__primary {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border: 1px solid var(--bi-green) !important;
  border-radius: 3px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-weight: 600;
  padding: .8rem 1.7rem !important;
}
.bookinstitute-home-hero__primary:hover { background: var(--bi-green-deep) !important; }
.bookinstitute-home-hero__secondary {
  background: transparent !important;
  color: var(--bi-green-text) !important;
  border: 1px solid var(--bi-green) !important;
  border-radius: 3px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-weight: 600;
  padding: .8rem 1.7rem !important;
}
.bookinstitute-home-hero__secondary:hover { background: var(--bi-green-soft) !important; }

/* --------------------------------------------- статистика фонда (герой) */
.bi-fond-stats {
  display: flex;
  max-width: 760px;
  margin: 2.2rem auto 0;
  border: 1px solid var(--bi-line);
  background: var(--bi-card);
  border-radius: 4px;
}
.bi-fond-stats__item {
  flex: 1;
  padding: 1.05rem .6rem;
  text-align: center;
  border-right: 1px solid var(--bi-line);
}
.bi-fond-stats__item:last-child { border-right: none; }
.bi-fond-stats__num {
  display: block;
  font-family: 'Old Standard TT', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--bi-green-text);
  line-height: 1.15;
}
.bi-fond-stats__label {
  font-family: 'Golos Text', sans-serif;
  font-size: .64rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--bi-muted);
}
@media (max-width: 575.98px) {
  .bi-fond-stats { flex-wrap: wrap; }
  .bi-fond-stats__item { flex: 1 1 50%; border-bottom: 1px solid var(--bi-line); }
}

/* ------------------------------------------------------- кафедры (жанры) */
.bookinstitute-home-routes {
  display: flex !important;
  flex-wrap: wrap;
  gap: .6rem !important;
  justify-content: center;
  margin-top: 2.6rem !important;
}
.bookinstitute-home-routes__item {
  display: flex !important;
  align-items: center;
  gap: .6rem;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 3px !important;
  padding: .55rem 1rem .55rem .6rem !important;
  min-height: 0 !important;
  box-shadow: none !important;
}
.bookinstitute-home-routes__item:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 4px 12px rgba(29, 55, 44, .08) !important;
  transform: none !important;
}
.bookinstitute-home-routes__icon {
  width: 30px !important; height: 30px !important;
  min-width: 30px;
  background: var(--bi-green) !important;
  color: var(--bi-card) !important;
  border-radius: 2px !important;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}
.bookinstitute-home-routes__label {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .86rem !important;
  font-weight: 600 !important;
  color: var(--bi-ink) !important;
}
.bookinstitute-home-routes__meta {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem !important;
  color: var(--bi-muted) !important;
}

/* --------------------------------------------------- заголовки разделов */
.bookinstitute-catalog-head,
.section-head {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 1.3rem;
}
.bookinstitute-catalog-head__eyebrow {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .66rem !important;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--bi-muted) !important;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}
.bookinstitute-catalog-head__title {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.65rem !important;
  font-weight: 600 !important;
  color: var(--bi-title) !important;
}

/* ------------------------------------------------------ фильтры каталога */
.catalog-filter-toolbar,
.bookinstitute-filter-bar {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  padding: .8rem 1rem !important;
  box-shadow: none !important;
}
.catalog-filter-toolbar .btn,
.catalog-sort-toolbar .btn {
  font-family: 'Golos Text', sans-serif !important;
  border-radius: 3px !important;
  font-weight: 500;
}
[data-bs-theme] .catalog-filter-toolbar .btn-outline-light,
[data-bs-theme] .catalog-sort-toolbar .btn-outline-light,
[data-bs-theme] .btn-outline-light {
  color: var(--bi-green-text) !important;
  border-color: var(--bi-line) !important;
  background: var(--bi-card) !important;
}
[data-bs-theme] .catalog-filter-toolbar .btn-outline-light:hover,
[data-bs-theme] .btn-outline-light:hover {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border-color: var(--bi-green) !important;
}
[data-bs-theme] .btn-primary,
.btn-primary {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
}
[data-bs-theme] .btn-primary:hover { background: var(--bi-green-deep) !important; }
.btn[data-period] { display: inline-flex; align-items: center; justify-content: center; }
[data-bs-theme] .btn[data-period].btn-outline-light { color: var(--bi-green-text) !important; }
.catalog-layout-switch { background: var(--bi-paper-deep) !important; border: 1px solid var(--bi-line) !important; }
.catalog-layout-switch__button { color: var(--bi-muted) !important; }
.catalog-layout-switch__button.is-active { background: var(--bi-green) !important; color: var(--bi-card) !important; }

/* -------------------------------------------------------- карточки книг */
.bookinstitute-book-card,
.card.bookinstitute-book-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}
.bookinstitute-book-card:hover {
  box-shadow: 0 14px 30px rgba(29, 55, 44, .14) !important;
  transform: translateY(-3px);
}
.bookinstitute-book-card__cover-link,
.bookinstitute-book-card .book-cover-link { border-radius: 0 !important; }
.bookinstitute-book-card img { border-radius: 0 !important; }
.bookinstitute-book-card .card-title,
.bookinstitute-book-card .book-card-title {
  font-family: 'Literata', serif !important;
  font-weight: 700 !important;
  font-size: .95rem !important;
  color: var(--bi-ink) !important;
  line-height: 1.3;
}
.bookinstitute-book-card .card-body { padding: .75rem .85rem .9rem !important; }
.bookinstitute-book-card a { color: var(--bi-ink); }
.bookinstitute-book-card a:hover { color: var(--bi-green-text); }
.bookinstitute-book-card .text-muted,
.bookinstitute-book-card small { color: var(--bi-muted) !important; font-family: 'Golos Text', sans-serif !important; }

/* бейджи/чипы карточек */
.bookinstitute-stat-badge,
[data-bs-theme] .bookinstitute-stat-badge {
  background: var(--bi-green-soft) !important;
  color: var(--bi-green-text) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-weight: 600;
}
.badge.bg-primary, [data-bs-theme] .badge.bg-primary { background: var(--bi-green) !important; color: #f3eeda !important; }
.badge.bg-warning, [data-bs-theme] .badge.bg-warning { background: var(--bi-gold) !important; color: var(--bi-green-deep) !important; }
.badge.bg-success, [data-bs-theme] .badge.bg-success { background: var(--bi-green) !important; }
.badge.bg-danger, [data-bs-theme] .badge.bg-danger { background: var(--bi-red) !important; }

/* -------------------------------------------- списки авторов/циклов/жанров */
.author-list-card, .series-list-card, .collection-list-card, .genre-index-card,
[data-bs-theme] .author-list-card, [data-bs-theme] .series-list-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
.author-list-card:hover, .series-list-card:hover, .collection-list-card:hover, .genre-index-card:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 8px 20px rgba(29, 55, 44, .1) !important;
}
.author-list-card::before, .series-list-card::before, .collection-list-card::before {
  background: var(--bi-green) !important;
}
[data-bs-theme="light"] .author-badge.author-badge--books,
[data-bs-theme="dark"] .author-badge.author-badge--books,
[data-bs-theme="light"] .series-badge.series-badge--books,
[data-bs-theme="dark"] .series-badge.series-badge--books {
  background: var(--bi-green) !important;
  color: #f6f1e3 !important;
  border-color: var(--bi-green) !important;
}
[data-bs-theme="light"] .author-badge.author-badge--views,
[data-bs-theme="dark"] .author-badge.author-badge--views,
[data-bs-theme="light"] .series-badge.series-badge--views,
[data-bs-theme="dark"] .series-badge.series-badge--views {
  background: transparent !important;
  color: var(--bi-muted) !important;
  border: 1px solid var(--bi-line) !important;
}
[data-bs-theme="light"] .author-badge.author-badge--comments,
[data-bs-theme="dark"] .author-badge.author-badge--comments,
[data-bs-theme="light"] .series-badge.series-badge--comments,
[data-bs-theme="dark"] .series-badge.series-badge--comments {
  background: rgba(184, 146, 60, .16) !important;
  color: #85641f !important;
  border-color: var(--bi-gold) !important;
}
.alphabet-filter { display: inline-flex; align-items: center; }
.alphabet-filter .btn { color: var(--bi-green-text) !important; }

/* -------------------------------------------------------------- страницы */
.card, [data-bs-theme] .card {
  background: var(--bi-card);
  border: 1px solid var(--bi-line);
  border-radius: 4px;
}
.breadcrumb, .breadcrumb a { font-family: 'Golos Text', sans-serif !important; color: var(--bi-muted) !important; }
.breadcrumb a:hover { color: var(--bi-green-text) !important; }
.pagination .page-link,
[data-bs-theme] .pagination .page-link {
  color: var(--bi-green-text) !important;
  background: var(--bi-card) !important;
  border-color: var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.pagination .page-item.active .page-link,
[data-bs-theme] .pagination .page-item.active .page-link {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
}
.form-control, .form-select,
[data-bs-theme] .form-control, [data-bs-theme] .form-select {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-ink) !important;
  border-radius: 3px !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 0 0 .18rem rgba(184, 146, 60, .18) !important;
}

/* SEO-текст внизу главной = «Об институте» */
.bi-about-box,
.home-bottom-text {
  background: var(--bi-card);
  border: 1px solid var(--bi-line);
  border-radius: 4px;
  padding: 2.2rem 2.6rem;
  box-shadow: inset 0 0 0 4px var(--bi-paper), inset 0 0 0 5px var(--bi-line);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bi-ink-soft);
}
.bi-about-box h1, .bi-about-box h2, .home-bottom-text h1, .home-bottom-text h2 {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.5rem !important;
  color: var(--bi-title) !important;
  margin-bottom: .8rem;
}
@media (max-width: 575.98px) { .bi-about-box, .home-bottom-text { padding: 1.4rem 1.2rem; } }

/* ---------------------------------------------------------------- подвал */
.footer-shell,
.footer-shell--bookinstitute {
  background: var(--bi-green-deep) !important;
  border: none !important;
  border-top: 3px double var(--bi-gold) !important;
  border-radius: 0 !important;
  color: #a9bfae;
}
.footer-shell__glow, .footer-shell__orb { display: none !important; }
.footer-command__brand .footer-brand-mark,
.footer-brand-mark--wide {
  background: linear-gradient(170deg, #f8f2df, #e9dfc2) !important;
  color: var(--bi-green-text) !important;
  font-family: 'Old Standard TT', serif !important;
  font-weight: 700;
  clip-path: polygon(0 0, 100% 0, 100% 68%, 50% 100%, 0 68%);
  border-radius: 0 !important;
  box-shadow: inset 0 0 0 3px var(--bi-green), inset 0 0 0 5px var(--bi-gold);
  font-size: 0 !important;
}
.footer-brand-mark--wide::after {
  content: "ИК";
  font-size: 1.05rem;
}
.footer-command__eyebrow {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .64rem !important;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--bi-gold-soft) !important;
}
.footer-command__title {
  font-family: 'Old Standard TT', serif !important;
  color: #fbf6e6 !important;
  font-size: 1.25rem !important;
}
.footer-command__text, .footer-status-card__text, .footer-contact-card__hint {
  color: #88a08e !important;
  font-family: 'Literata', serif !important;
  font-size: .88rem !important;
}
.footer-route-group__label, .footer-contact-card__label {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .64rem !important;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--bi-gold) !important;
}
.footer-route-link, .footer-info-link, .footer-contact-card__email {
  color: #b9ccbd !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .84rem !important;
  background: transparent !important;
  border: 0 !important;
}
.footer-route-link:hover, .footer-info-link:hover, .footer-contact-card__email:hover {
  color: #fff !important;
  background: transparent !important;
}
.footer-route-link i, .footer-info-link i { color: var(--bi-gold) !important; }
.footer-chip {
  background: rgba(184, 146, 60, .14) !important;
  color: var(--bi-gold-soft) !important;
  border: 1px solid rgba(184, 146, 60, .3) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.footer-chip--accent { background: var(--bi-gold) !important; color: var(--bi-green-deep) !important; }
.footer-partner__badge { background: var(--bi-gold) !important; color: var(--bi-green-deep) !important; }
.footer-partner__eyebrow, .footer-partner__title { color: #b9ccbd !important; }
.footer-bottom-strip {
  border-top: 1px solid rgba(184, 146, 60, .3) !important;
  color: #7c957f !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .7rem !important;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.footer-status-card, .footer-contact-card {
  background: rgba(255, 255, 255, .03) !important;
  border: 1px solid rgba(184, 146, 60, .22) !important;
  border-radius: 3px !important;
}

/* ------------------------------------------------------- модалка входа */
.bookinstitute-auth-prompt__dialog {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  color: var(--bi-ink) !important;
}
.bookinstitute-auth-prompt__title { font-family: 'Old Standard TT', serif !important; color: var(--bi-title) !important; }
.bookinstitute-auth-prompt__primary { background: var(--bi-green) !important; color: #f3eeda !important; border-radius: 3px !important; }
.bookinstitute-auth-prompt__secondary { border: 1px solid var(--bi-green) !important; color: var(--bi-green-text) !important; border-radius: 3px !important; }


/* ==========================================================================
   ВНУТРЕННИЕ СТРАНИЦЫ — «Альма-матер»
   Слой грузится последним в <body>, поэтому перебивает инлайновые
   <style> блейдов донора (голубой/бирюзовый) без правки самих блейдов.
   ========================================================================== */

/* ------------------------------------------- общие шапки всех разделов */
.genres-index-hero, .collections-hero, .top100-hero,
.genre-page-header, .author-profile-card, .series-profile-card,
.book-orders-hero, .reader-race-hero, .search-page-form {
  background: linear-gradient(160deg, var(--bi-card), var(--bi-paper-deep)) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  color: var(--bi-ink) !important;
  box-shadow: none !important;
}
.genres-index-hero::before, .genres-index-hero::after,
.collections-hero::before, .collections-hero::after,
.top100-hero::before, .top100-hero::after,
.reader-race-hero__spotlight, .genre-glow { display: none !important; }

.genres-index-title, .collections-hero__title, .top100-page-title,
.genre-page-title, .author-profile-name, .series-profile-name,
.book-orders-hero h1, .reader-race-hero__title, .book-page-title,
.genres-index-hero h1, .collections-hero h1, .top100-hero h1 {
  font-family: 'Old Standard TT', 'Literata', serif !important;
  color: var(--bi-title) !important;
  letter-spacing: .005em !important;
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}
.genres-index-subtitle, .collections-hero__text, .top100-hero__text,
.genres-index-total, .search-results-count, .genre-results-count,
.book-orders-lead, .reader-race-hero__text, .author-bio-content,
.series-description-content {
  color: var(--bi-muted) !important;
  font-family: 'Literata', Georgia, serif !important;
}
.genres-index-hero__eyebrow, .collections-hero__eyebrow, .top100-hero__eyebrow,
.book-orders-kicker, .reader-race-hero__eyebrow {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .68rem !important;
  letter-spacing: .22em !important;
  text-transform: uppercase !important;
  color: var(--bi-gold) !important;
  background: none !important;
  border: 0 !important;
  padding: 0 !important;
}

/* ---------------------- фильтры/сортировки/переключатели во всех разделах */
.genre-sort-btn, .collections-sort-btn, .catalog-sort-controls .btn,
.top100-filter-chip, .btn[data-period], .idea-sort-controls .btn,
.book-orders-sort .btn, .catalog-layout-switch__button,
.collection-layout-switch__button, .catalog-filter-toolbar .btn {
  font-family: 'Golos Text', sans-serif !important;
  border-radius: 3px !important;
  border: 1px solid var(--bi-line) !important;
  background: var(--bi-card) !important;
  color: var(--bi-green-text) !important;
  font-weight: 500 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.genre-sort-btn:hover, .collections-sort-btn:hover, .catalog-sort-controls .btn:hover,
.top100-filter-chip:hover, .btn[data-period]:hover,
.catalog-layout-switch__button:hover, .catalog-filter-toolbar .btn:hover {
  border-color: var(--bi-gold) !important;
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
}
.genre-sort-btn--active, .genre-sort-btn.is-active,
.collections-sort-btn.active, .collections-sort-btn.btn-primary,
.top100-filter-chip-active, .top100-filter-chip.btn-primary,
.btn[data-period].active, .btn[data-period].btn-primary,
.catalog-sort-controls .btn.active, .catalog-sort-controls .btn.btn-primary,
.catalog-layout-switch__button.is-active,
.collection-layout-switch__button.is-active,
.catalog-filter-toolbar .btn.btn-primary {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  font-weight: 600 !important;
}
.catalog-layout-switch, .collection-layout-switch {
  background: var(--bi-paper-deep) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
}

/* «показать ещё» / загрузчики */
.top100-load-more-btn, .catalog-load-more-btn, #load-more-btn, .btn-load-more {
  background: transparent !important;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
  font-size: .8rem !important;
}
.top100-load-more-btn:hover, .catalog-load-more-btn:hover, #load-more-btn:hover {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}
.catalog-section-loader__box {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
}
.catalog-section-loader__text { color: var(--bi-muted) !important; font-family: 'Golos Text', sans-serif !important; }
.spinner-border, [data-bs-theme] .spinner-border.text-primary { color: var(--bi-green-text) !important; }

/* ------------------------------------------- ТОП-100 = «Учёный совет» */
.top100-page { --top100-ink: var(--bi-ink) !important; --top100-blue: var(--bi-green) !important;
  --top100-teal: var(--bi-gold) !important; --top100-soft: var(--bi-green-soft) !important; }
.top100-card, [data-bs-theme] .top100-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: hidden !important;
}
.top100-card::before {
  content: "" !important;
  position: absolute !important; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bi-green) !important;
}
.top100-card:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 10px 26px rgba(29, 55, 44, .12) !important;
  transform: none !important;
}
.rank-number, .top100-card .rank-number {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-green-text) !important;
  font-size: 1.9rem !important;
  line-height: 1.05 !important;
  background: none !important;
  -webkit-text-fill-color: currentColor !important;
}
.top100-rank-label {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .58rem !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  color: var(--bi-muted) !important;
}
#top100-list > div:nth-child(1) .rank-number { color: #a8801f !important; }
#top100-list > div:nth-child(2) .rank-number { color: #6f7780 !important; }
#top100-list > div:nth-child(3) .rank-number { color: #96603a !important; }
#top100-list > div:nth-child(1) .top100-card::before { background: var(--bi-gold) !important; }
#top100-list > div:nth-child(2) .top100-card::before { background: #9aa2ab !important; }
#top100-list > div:nth-child(3) .top100-card::before { background: #b07a4c !important; }
.top100-book-title, .top100-card .top100-book-title a {
  font-family: 'Old Standard TT', 'Literata', serif !important;
  color: var(--bi-title) !important;
  font-size: 1.08rem !important;
}
.top100-card .top100-book-title a:hover { color: var(--bi-gold) !important; }
.top100-book-date, .top100-book-authors, .top100-book-genre, .top100-book-meta,
.top100-book-authors a, .top100-card .text-muted {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .8rem !important;
}
.top100-inline-icon { color: var(--bi-gold) !important; }
.top100-cover-image {
  border-radius: 2px !important;
  border: 1px solid var(--bi-line) !important;
  box-shadow: 0 6px 16px rgba(29, 55, 44, .16) !important;
}
.top100-read-btn {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
}

/* ---------------------------------------------- ЖАНРЫ = «Кафедры» */
.genres-index-page .genre-index-card, .genre-index-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
.genres-index-page .genre-index-card:hover { border-color: var(--bi-gold) !important; }
.genres-index-page .genre-title, .genre-index-card .genre-title {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
  font-size: 1.12rem !important;
}
.genre-index-card__icon, .genres-index-page .genre-index-card__icon {
  background: var(--bi-green) !important;
  color: var(--bi-card) !important;
  border-radius: 2px !important;
  border: 0 !important;
}
.genres-index-page .genre-index-card__meta,
.genre-index-card__meta.badge, .genre-index-card__meta {
  background: var(--bi-green) !important;
  color: #f6f1e3 !important;
  border: 0 !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.genre-index-card__followers, .genre-index-card__week {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
}
.genre-index-card__follow-btn, .genre-page-follow__button {
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  background: transparent !important;
  border-radius: 3px !important;
}
.genre-index-card__follow-btn:hover, .genre-page-follow__button:hover,
.genre-index-card__follow-btn.is-active, .genre-page-follow__button.is-active {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}
.genre-index-card__arrow { color: var(--bi-gold) !important; }

/* ------------------------------------------- ПОДБОРКИ = «Комплекты» */
.collections-page .collection-list-card, .collection-list-card,
.collection-showcase-card, .collection-book-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
}
.collection-list-card__title, .collection-list-card__title-link,
.collection-list-card__books-title, .collection-showcase-card__title,
.collection-book-card__title {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.collection-list-card__title-link:hover { color: var(--bi-gold) !important; }
.collection-list-card__description, .collection-showcase-card__description {
  color: var(--bi-ink-soft) !important; font-family: 'Literata', serif !important;
}
.collection-metric-chip, .collection-metric-chip--hero,
.collection-showcase-card__stat, .collection-book-card__meta {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.collections-hero__cta, .collection-show-action-btn,
.collection-showcase-card__action {
  background: var(--bi-green) !important;
  border: 1px solid var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
}
.collections-hero__cta:hover, .collection-show-action-btn:hover { background: var(--bi-green-deep) !important; }
.collections-empty-state, .collection-showcase-card__empty {
  background: var(--bi-card) !important;
  border: 1px dashed var(--bi-line) !important;
  color: var(--bi-muted) !important;
  border-radius: 4px !important;
}
.collection-genre-dropdown__button, .collection-sort-dropdown__button {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
}
.collection-books-grid.row { gap: 0 !important; }
.collection-showcase-card__nav {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
}

/* -------------------------------------------------------------- ПОИСК */
.search-page-field {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 3px !important;
}
.search-page-input {
  background: transparent !important;
  color: var(--bi-ink) !important;
  font-family: 'Literata', serif !important;
}
.search-page-input::placeholder { color: #a49a80 !important; font-style: italic; }
.search-page-icon { color: var(--bi-gold) !important; }
.search-page-submit {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-weight: 600 !important;
}
.search-results-toolbar, .search-results-list .card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
}

/* ------------------ SHOW-страницы: автор / цикл / жанр / подборка */
.author-profile-card, .series-profile-card, .author-bio-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  color: var(--bi-ink) !important;
  box-shadow: inset 0 0 0 4px var(--bi-paper), inset 0 0 0 5px var(--bi-line) !important;
}
.author-profile-avatar, .avatar {
  border: 1px solid var(--bi-line) !important;
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
}
.author-profile-stats, .series-profile-badge {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.author-book-row-card, .series-book-row-card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
.author-book-row-card:hover, .series-book-row-card:hover { border-color: var(--bi-gold) !important; }
.author-book-row-title, .series-book-row-title,
.author-book-row-title a, .series-book-row-title a {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.author-book-row-title a:hover, .series-book-row-title a:hover { color: var(--bi-gold) !important; }
.author-book-row-date, .author-book-row-genre, .author-book-row-meta,
.series-book-row-date, .series-book-row-genre, .series-book-row-meta,
.series-book-row-authors {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
}
.author-book-inline-icon, .series-book-inline-icon { color: var(--bi-gold) !important; }
.author-book-cover, .series-book-cover {
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
}
/* номер тома в цикле — «инвентарная бирка» */
.series-book-order-badge {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border: 0 !important;
  border-radius: 2px !important;
  font-family: 'Old Standard TT', serif !important;
}
.series-book-order-label {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .58rem !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}

/* ------------------------------------------------------ СТРАНИЦА КНИГИ */
.book-page-title {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.book-primary-meta, .book-secondary-meta, .book-description-wrap,
.book-actions-section, .book-page-collections-section {
  color: var(--bi-ink) !important;
}
.book-description-content, .book-description-paragraph {
  font-family: 'Literata', Georgia, serif !important;
  color: var(--bi-ink-soft) !important;
  line-height: 1.7 !important;
}
.book-description-toggle, .book-description-more {
  color: var(--bi-green-text) !important;
  font-family: 'Golos Text', sans-serif !important;
}
.card-cover img, .book-cover img {
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 12px 30px rgba(29, 55, 44, .2) !important;
}
.book-status-stamp {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
  letter-spacing: .1em !important;
  text-transform: uppercase !important;
  font-size: .66rem !important;
}
.book-cycle-tag, .book-series-block {
  background: var(--bi-paper-deep) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 3px !important;
  color: var(--bi-ink) !important;
}
.book-genre-block .btn {
  background: var(--bi-green-soft) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-title) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.book-genre-block .btn:hover { background: var(--bi-green) !important; color: #f3eeda !important; }
.book-primary-action {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 3px !important;
  font-weight: 600 !important;
}
.book-secondary-action, .download-link, .book-favorite-toggle {
  background: transparent !important;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
}
.book-secondary-action:hover, .download-link:hover,
.book-favorite-toggle:hover, .book-favorite-toggle.is-active {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}
.book-series-list__item[hidden], .book-series-list__item[hidden].d-flex { display: none !important; }
.book-rating-row .progress { background: var(--bi-paper-deep) !important; border-radius: 2px !important; }
.book-rating-row .progress-bar { background: var(--bi-gold) !important; }
.book-page-collections-slider-nav {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
}
.book-status-strip--compact, .book-status-strip {
  background: var(--bi-paper-deep) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  color: var(--bi-ink-soft) !important;
}

/* ------------------------------------------------------------- ЧИТАЛКА */
body.reader-page { background: #fffdf7 !important; color: var(--bi-ink) !important; }
body.reader-page .reader-container { background: transparent !important; }
body.reader-page .reader-content, body.reader-page .chapter-content {
  color: var(--bi-ink) !important;
}
/* Межстрочный интервал НЕ фиксируем: его задаёт ползунок «Интервал» инлайн-стилем,
   а !important в теме перебивал инлайн и делал кнопки бесполезными.
   Шрифт «Literata» оставляем только варианту по умолчанию (в списке он так и подписан),
   иначе выбор в «Шрифт» тоже ни на что не влиял. */
body.reader-page .reader-content.font-sans, body.reader-page .chapter-content.font-sans {
  font-family: 'Literata', Georgia, serif !important;
}
body.reader-page .reader-heading, body.reader-page .chapter-title {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
body.reader-page .reader-nav-btn, body.reader-page .reader-page-jump-button,
body.reader-page .reader-scroll-toggle, body.reader-page .reader-bookmark-btn,
body.reader-page .reader-mobile-settings-toggle {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
  font-family: 'Golos Text', sans-serif !important;
}
body.reader-page .reader-nav-btn:hover, body.reader-page .reader-page-jump-button:hover {
  background: var(--bi-green) !important; color: #f3eeda !important;
}
body.reader-page .reader-finish-button {
  background: var(--bi-green) !important; border-color: var(--bi-green) !important;
  color: #f3eeda !important; border-radius: 3px !important;
}
body.reader-page .reader-navigation-menu, body.reader-page .reader-bookmarks-menu,
body.reader-page .reader-setting-block {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-ink) !important;
  border-radius: 4px !important;
}
body.reader-page .reader-navigation-section-title {
  font-family: 'Golos Text', sans-serif !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
  color: var(--bi-muted) !important;
  font-size: .62rem !important;
}
body.reader-page .reader-chapter-item, body.reader-page .reader-bookmark-item {
  border-color: var(--bi-line) !important;
  color: var(--bi-ink) !important;
}
body.reader-page .reader-chapter-item:hover { background: var(--bi-green-soft) !important; }
/* тёмная и сепийная темы читалки — свои, чтобы текст был читаем */
body.reader-page.theme-dark { background: #1a1710 !important; color: #ece3cd !important; }
body.reader-page.theme-dark .reader-content, body.reader-page.theme-dark .chapter-content { color: #ece3cd !important; }
body.reader-page.theme-dark .reader-heading, body.reader-page.theme-dark .chapter-title { color: #e8c98a !important; }
body.reader-page.theme-dark .reader-nav-btn, body.reader-page.theme-dark .reader-navigation-menu,
body.reader-page.theme-dark .reader-bookmarks-menu, body.reader-page.theme-dark .reader-setting-block,
body.reader-page.theme-dark .reader-page-jump-button, body.reader-page.theme-dark .reader-scroll-toggle,
body.reader-page.theme-dark .reader-mobile-settings-toggle {
  background: #241f16 !important; border-color: #40381f !important; color: #ece3cd !important;
}
body.reader-page.theme-sepia { background: #f3e7cf !important; color: #3b3222 !important; }
body.reader-page.theme-sepia .reader-content, body.reader-page.theme-sepia .chapter-content { color: #3b3222 !important; }
body.reader-page.theme-sepia .reader-nav-btn, body.reader-page.theme-sepia .reader-navigation-menu,
body.reader-page.theme-sepia .reader-bookmarks-menu, body.reader-page.theme-sepia .reader-setting-block {
  background: #fbf3e2 !important; border-color: #d9c9a6 !important; color: #3b3222 !important;
}

/* --------------------------------------------------- ПРОФИЛЬ / ПОЛКА */
.profile-overview-panel, .profile-favorite-genres-panel, .profile-edit-form,
.achievement-rank-card, .profile-auto-delete-alert {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  color: var(--bi-ink) !important;
}
.profile-avatar-circle, .profile-avatar-letter {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border: 1px solid var(--bi-line) !important;
}
.achievement-rank-card__title, .achievement-rank-card__score-value {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.achievement-rank-card__progress .progress-bar { background: var(--bi-gold) !important; }
.profile-edit-form__control, .profile-edit-form__textarea, .profile-edit-form__date {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-ink) !important;
  border-radius: 3px !important;
}
.profile-edit-form__choice-label {
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
}
.profile-edit-form__choice-input:checked + .profile-edit-form__choice-label {
  background: var(--bi-green) !important; color: #f3eeda !important;
}
#library-tabs .nav-link, .library-tabs .nav-link {
  color: var(--bi-green-text) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 3px !important;
  background: var(--bi-card) !important;
  font-family: 'Golos Text', sans-serif !important;
}
#library-tabs .nav-link.active, .library-tabs .nav-link.active {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border-color: var(--bi-green) !important;
}
.progress { background: var(--bi-paper-deep) !important; }
.progress-bar { background: var(--bi-green) !important; }
.reading-chart__bar { background: var(--bi-green-soft) !important; }
.reading-chart__bar--active, .reading-chart__bar--peak { background: var(--bi-gold) !important; }

/* ------------------- ТУРНИР / ИДЕИ / СТОЛ ЗАКАЗОВ / ПРЕДЛОЖИТЬ КНИГУ */
.reader-race-result-card, .reader-race-list-shell, .idea-my-item,
.book-order-card, .book-orders-panel, .book-orders-form, .book-orders-empty {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  color: var(--bi-ink) !important;
  box-shadow: none !important;
}
.reader-race-hero__badge, .reader-race-comments-chip, .book-orders-hero-stat,
.book-order-votes, .book-order-status {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
}
.reader-race-hero__badge--accent, .book-order-status--moderation {
  background: rgba(184, 146, 60, .18) !important;
  color: #85641f !important;
  border-color: var(--bi-gold) !important;
}
.reader-race-hero__leader-name, .reader-race-result-card__name, .book-order-name {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.reader-race-result-card__meta, .reader-race-hero__leader-meta,
.book-order-meta, .book-order-date, .book-order-author {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
}
.reader-race-result-card__avatar, .reader-race-comment__avatar,
.reader-race-result-card__avatar-fallback, .reader-race-comment__avatar-fallback {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border: 1px solid var(--bi-line) !important;
}
.reader-race-wide-card__stats { flex-wrap: wrap !important; }
.idea-stars-vote__button { color: var(--bi-gold) !important; background: transparent !important; border: 0 !important; }
.idea-stars-vote__hint { color: var(--bi-muted) !important; font-family: 'Golos Text', sans-serif !important; }
.book-orders-search, .book-orders-form textarea, .book-orders-form input {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-ink) !important;
  border-radius: 3px !important;
}
.book-orders-form-note, .book-order-note { color: var(--bi-muted) !important; }
.book-order-answer {
  background: var(--bi-green-soft) !important;
  border-left: 3px solid var(--bi-green) !important;
  color: var(--bi-ink) !important;
}

/* ------------------------------------ АВТОРИЗАЦИЯ / ОШИБКИ / ДОКУМЕНТЫ */
.page-content, .page-content p, .page-content li {
  font-family: 'Literata', Georgia, serif !important;
  color: var(--bi-ink-soft) !important;
  line-height: 1.72 !important;
}
.page-content h1, .page-content h2, .page-content h3 {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-title) !important;
}
.btn-social-vk, .social-btn--vk { background: #4a76a8 !important; border-color: #4a76a8 !important; color: #fff !important; }
.btn-social-ok, .social-btn--ok { background: #ee8208 !important; border-color: #ee8208 !important; color: #fff !important; }
.btn-social-tg, .social-btn--tg { background: #2ba0da !important; border-color: #2ba0da !important; color: #fff !important; }


/* -------------------------------- раскладка шапки при полном меню (7 пунктов) */
@media (min-width: 992px) {
  .site-navbar .navbar-nav .nav-link { padding-left: .5rem !important; padding-right: .5rem !important; font-size: .8rem !important; white-space: nowrap; }
  .site-navbar .navbar-brand { margin-right: 1rem !important; }
  .site-navbar form[role="search"] { min-width: 150px; margin-left: .6rem !important; margin-right: .6rem !important; }
  .bookinstitute-navbar-actions { gap: .3rem !important; margin-left: .4rem !important; }
  .site-navbar .bookinstitute-login-btn,
  .site-navbar .bookinstitute-register-btn { padding: .42rem .85rem !important; font-size: .76rem !important; margin-right: 0 !important; }
  .site-navbar .bookinstitute-theme-toggle { width: 30px; height: 30px; }
}
@media (min-width: 1400px) {
  .site-navbar .navbar-nav .nav-link { padding-left: .5rem !important; padding-right: .5rem !important; font-size: .84rem !important; }
  .site-navbar form[role="search"] { min-width: 240px; }
}
.site-navbar form[role="search"] .form-control,
.site-navbar form[role="search"] .input-group-text {
  border: 1px solid rgba(232, 217, 174, .35) !important;
  background: rgba(255, 255, 255, .1) !important;
}
.site-navbar form[role="search"] .input-group-text { border-right: 0 !important; }
.site-navbar form[role="search"] .form-control { border-left: 0 !important; }

/* счётчик разделов в шапке раздела не должен свисать за край */
.genres-index-total {
  position: static !important;
  display: inline-flex !important;
  align-items: center !important;
  background: var(--bi-green) !important;
  color: #f6f1e3 !important;
  border: 0 !important;
  border-radius: 2px !important;
  padding: .25rem .7rem !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .78rem !important;
  box-shadow: none !important;
}


/* ---------------------------------- читаемость ссылок в подвале (контраст) */
.footer-shell .footer-info-link,
.footer-shell .footer-route-link,
.footer-shell .footer-contact-card__email,
.footer-shell .footer-contact-card__hint,
.footer-shell .footer-route-group__label,
.footer-shell .footer-status-card__text,
[data-bs-theme] .footer-shell .footer-info-link,
[data-bs-theme] .footer-shell .footer-route-link {
  color: #c2d5c6 !important;
  font-family: 'Golos Text', sans-serif !important;
}
.footer-shell .footer-info-link:hover,
.footer-shell .footer-route-link:hover,
.footer-shell .footer-contact-card__email:hover { color: #ffffff !important; }
.footer-shell .footer-route-group__label,
.footer-shell .footer-contact-card__label {
  color: var(--bi-gold-soft) !important;
  letter-spacing: .2em !important;
  text-transform: uppercase !important;
  font-size: .64rem !important;
}
.footer-shell .footer-info-link i,
.footer-shell .footer-route-link i { color: var(--bi-gold) !important; }


/* --------------------------- добивка донорских цветов (по аудиту контраста) */
/* ссылки-действия в герое и «показать ещё» — донорский небесный #0ea5e9 */
.bookinstitute-home-hero__primary, .bookinstitute-home-hero__secondary,
.bookinstitute-home-hero__signals a, .bookinstitute-home-hero__signals span,
a.text-sky, .text-sky { color: var(--bi-green-text) !important; }
.bookinstitute-home-hero__primary { color: #f3eeda !important; }
[data-bs-theme] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link):not(.footer-info-link):not(.footer-route-link) {
  color: var(--bi-green-text);
}
[data-bs-theme] a:not(.btn):hover { color: var(--bi-gold) !important; }

/* счётчик разделов: внутренние span/i красились донорским #174a76 */
.genres-index-total i, .genres-index-total span,
.genres-index-page .genres-index-total i, .genres-index-page .genres-index-total span {
  color: #f6f1e3 !important;
}
/* «+N за неделю» у кафедр — донорский слейт */
.genre-index-card__week, .genres-index-page .genre-index-card__week { color: var(--bi-muted) !important; }

/* подпись под брендом в подвале */
.footer-command__text, .footer-shell .footer-command__text { color: #c2d5c6 !important; }

/* мобильное меню-«ещё»: слейт-пункты выпадашки */
.site-navbar .dropdown-menu .dropdown-item,
.site-navbar .dropdown-menu .dropdown-item i { color: var(--bi-ink) !important; }
.site-navbar .dropdown-menu .dropdown-item i { color: var(--bi-gold) !important; }

/* «Показать ещё» на списках разделов */
.genres-index-page .btn-outline-primary, .btn-outline-primary {
  color: var(--bi-green-text) !important;
  border-color: var(--bi-green) !important;
  background: transparent !important;
}
.btn-outline-primary:hover { background: var(--bi-green) !important; color: #f3eeda !important; }


/* --------------- добивка: Стол заказов и Турнир (донорские #174a76/#64748b) */
.book-orders-empty strong, .book-order-votes strong,
.book-orders-tab.is-active, .book-orders-sort a.is-active,
.book-order-status--new, .book-order-guest-vote:hover, .book-order-guest-vote:focus {
  color: var(--bi-title) !important;
}
.book-orders-tab.is-active, .book-orders-sort a.is-active, .book-order-status--new {
  background: var(--bi-green-soft) !important;
  border-color: var(--bi-line) !important;
}
.book-orders-empty span, .book-orders-form-note,
.reader-race-hero__text, .reader-race-hero__leader-note,
.reader-race-result-card__meta, .reader-race-hero__spotlight-label {
  color: var(--bi-muted) !important;
}
.reader-race-wide-card__actions .btn-outline-primary,
.reader-race-wide-card__profile-link {
  background: var(--bi-card) !important;
  border-color: var(--bi-green) !important;
  color: var(--bi-green-text) !important;
}
.reader-race-wide-card__stats i, .reader-race-wide-card__stats .bi-heart-fill { color: var(--bi-gold) !important; }


/* ----------------------------- добивка: страница книги и читалка */
/* ссылка на цикл и размеры файлов у кнопок скачивания */
.book-cycle-tag a, .book-series-block a, .book-series-block__link,
a.text-info, .text-info { color: var(--bi-title) !important; }
.download-link small, .download-link .text-muted,
.book-download-size, .download-size { color: var(--bi-muted) !important; }
.btn-outline-primary, [data-bs-theme] .btn-outline-primary {
  border-color: var(--bi-green) !important;
  color: var(--bi-green-text) !important;
}
.reviews-empty, .book-reviews-empty, .review-empty-text { color: var(--bi-muted) !important; }

/* читалка: подписи панели настроек и пагинации */
body.reader-page .reader-setting-block label,
body.reader-page .reader-setting-block span,
body.reader-page .reader-setting-value,
body.reader-page .reader-page-indicator,
body.reader-page .reader-navigation-section-title,
body.reader-page .reader-mobile-settings-toggle span,
body.reader-page .reader-nav-wrapper span,
body.reader-page .text-muted {
  color: var(--bi-muted) !important;
}
body.reader-page.theme-dark .reader-setting-block label,
body.reader-page.theme-dark .reader-setting-block span,
body.reader-page.theme-dark .reader-page-indicator,
body.reader-page.theme-dark .text-muted { color: #c3b795 !important; }
body.reader-page.theme-sepia .reader-setting-block label,
body.reader-page.theme-sepia .reader-page-indicator,
body.reader-page.theme-sepia .text-muted { color: #6b5c3f !important; }


/* ---- утилиты движка с «жирными» донорскими правилами (нужна специфичность) */
[data-bs-theme] a.text-info, [data-bs-theme] span.text-info,
[data-bs-theme] div.text-info, [data-bs-theme] p.text-info {
  color: var(--bi-title) !important;
}
[data-bs-theme] div.text-muted, [data-bs-theme] p.text-muted,
[data-bs-theme] span.text-muted, [data-bs-theme] small.text-muted,
[data-bs-theme] a.text-muted, [data-bs-theme] li.text-muted,
[data-bs-theme] td.text-muted, [data-bs-theme] th.text-muted {
  color: var(--bi-muted) !important;
}
[data-bs-theme] a.text-muted:hover { color: var(--bi-green-text) !important; }


[data-bs-theme] .text-muted p, [data-bs-theme] .text-muted span,
[data-bs-theme] .text-muted small, [data-bs-theme] .reviews-list p,
[data-bs-theme] .reviews-list .text-muted p { color: var(--bi-muted) !important; }


/* ==========================================================================
   ПОДВАЛ — собственная раскладка.
   Донорский слой оформления (gold.css) удалён вместе с его вёрсткой,
   поэтому сетку, отступы и размеры подвала задаём здесь целиком.
   ========================================================================== */
.footer-shell > .position-relative { padding: 2.4rem 2.6rem 1.6rem !important; }

.footer-command {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 40px;
  align-items: start;
  padding-bottom: 1.7rem;
  margin-bottom: 1.7rem;
  border-bottom: 1px solid rgba(184, 146, 60, .28);
}
.footer-command__brand { display: flex !important; gap: 18px; align-items: flex-start; }
.footer-command__eyebrow { display: block !important; margin-bottom: .3rem; }
.footer-command__title { font-size: 1.25rem !important; line-height: 1.25; margin: 0 0 .5rem !important; }
.footer-command__text { font-size: .88rem !important; max-width: 44rem; margin: 0 !important; line-height: 1.6; }

.footer-contact-card {
  display: flex !important;
  flex-direction: column;
  gap: .3rem;
  padding: 16px 18px !important;
  border-radius: 4px !important;
}
.footer-contact-card__label { display: block !important; margin-bottom: .15rem; }
.footer-contact-card__email { display: inline-block !important; font-size: .95rem !important; }
.footer-contact-card__hint { display: block !important; font-size: .78rem !important; line-height: 1.5; }

.footer-route-board {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  gap: 36px;
  align-items: start;
}
.footer-route-group { display: block !important; }
.footer-route-group__label { display: block !important; margin-bottom: .8rem; }
.footer-route-stack { display: flex !important; flex-direction: column; gap: .55rem; }
.footer-route-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: .55rem 1.2rem;
}
.footer-route-link, .footer-info-link {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  border: 0 !important;
  background: none !important;
  padding: 0 !important;
  font-size: .86rem !important;
  line-height: 1.45;
}
.footer-status-card {
  display: flex !important;
  flex-direction: column;
  gap: .7rem;
  padding: 16px 18px !important;
  border-radius: 4px !important;
}
.footer-status-card__top { display: flex !important; gap: .5rem; flex-wrap: wrap; }
.footer-status-card__text { font-size: .8rem !important; margin: 0 !important; line-height: 1.55; }
.footer-chip {
  display: inline-flex !important;
  align-items: center;
  padding: .25rem .7rem !important;
  font-size: .72rem !important;
  border-radius: 2px !important;
}
.footer-bottom-strip {
  display: flex !important;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 1.9rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(184, 146, 60, .28);
  font-size: .7rem !important;
}
@media (max-width: 991.98px) {
  .footer-shell > .position-relative { padding: 1.6rem 1.4rem 1.2rem !important; }
  .footer-command { grid-template-columns: 1fr; gap: 22px; }
  .footer-route-board { grid-template-columns: 1fr; gap: 22px; }
}

/* ---------------------------------------- ссылки без «подчёркнутых кнопок» */
a, [data-bs-theme] a { text-decoration: none !important; }
.btn, a.btn, button, .nav-link, .dropdown-item,
.footer-route-link, .footer-info-link, .page-link,
.bookinstitute-home-hero__primary, .bookinstitute-home-hero__secondary,
.bookinstitute-home-hero__signals a { text-decoration: none !important; }
/* подчёркивание оставляем только у ссылок внутри текстовых блоков */
.bi-about-box a, .home-bottom-text a, .page-content a,
.book-description-content a, .footer-contact-card__email {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}


/* ==========================================================================
   ФИНАЛЬНАЯ ЗАЧИСТКА ХОЛОДНЫХ ТОНОВ ДОНОРА
   Селекторы с префиксом html[data-bs-theme] body — чтобы перебить
   правила движка вида [data-bs-theme=light] .foo{...!important}.
   ========================================================================== */

/* значки-суффиксы у кнопок сортировки (были голубые подложки) */
html[data-bs-theme] body .btn i.bi,
html[data-bs-theme] body .genre-sort-btn i,
html[data-bs-theme] body .collections-sort-btn i,
html[data-bs-theme] body .catalog-sort-controls .btn i,
html[data-bs-theme] body .book-orders-sort a i,
html[data-bs-theme] body .book-orders-tab i {
  background: transparent !important;
  color: inherit !important;
  border-radius: 0 !important;
}

/* крупные иконки пустых состояний */
html[data-bs-theme] body .bi.fs-1,
html[data-bs-theme] body .collections-empty-state .bi,
html[data-bs-theme] body .book-orders-empty .bi,
html[data-bs-theme] body .reader-race-list-shell .bi.fs-1,
html[data-bs-theme] body .reviews-list .bi.fs-1 {
  background: var(--bi-paper-deep) !important;
  color: var(--bi-green-text) !important;
  border-radius: 4px !important;
}

/* поля ввода и подписи форм */
html[data-bs-theme] body .form-control,
html[data-bs-theme] body input,
html[data-bs-theme] body textarea,
html[data-bs-theme] body select {
  color: var(--bi-ink) !important;
  border-color: var(--bi-line) !important;
}
html[data-bs-theme] body .form-control::placeholder,
html[data-bs-theme] body input::placeholder { color: #a49a80 !important; }
html[data-bs-theme] body .form-label,
html[data-bs-theme] body .form-check-label,
html[data-bs-theme] body .form-text,
html[data-bs-theme] body label {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', system-ui, sans-serif !important;
}
html[data-bs-theme] body .input-group-text,
html[data-bs-theme] body .input-group-text-dark {
  background: var(--bi-paper-deep) !important;
  border-color: var(--bi-line) !important;
  color: var(--bi-green-text) !important;
}
html[data-bs-theme] body .input-group-text i,
html[data-bs-theme] body .input-group-text .bi { color: var(--bi-green-text) !important; }

/* приглушённый текст: донорские правила бьют по специфичности */
html[data-bs-theme] body .text-muted,
html[data-bs-theme] body .text-muted *:not(a):not(.badge):not(.btn) {
  color: var(--bi-muted) !important;
}

/* цветные иконки-акценты движка (бирюза/голубой) → золото темы */
html[data-bs-theme] body .bi-trophy-fill,
html[data-bs-theme] body .bi-fire,
html[data-bs-theme] body .bi-chat-dots,
html[data-bs-theme] body .bi-lightning-charge,
html[data-bs-theme] body .bi-stars,
html[data-bs-theme] body .text-info,
html[data-bs-theme] body .text-sky { color: var(--bi-gold) !important; }

/* поисковая строка внутри списков (авторы/циклы) */
html[data-bs-theme] body .catalog-inline-search__input {
  background: var(--bi-card) !important;
  color: var(--bi-ink) !important;
  border-color: var(--bi-line) !important;
}


/* счётчики-плашки во вкладках «Стола заказов» */
html[data-bs-theme] body .book-orders-tab span,
html[data-bs-theme] body .book-orders-sort a span,
html[data-bs-theme] body .book-orders-tab.is-active span {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border-radius: 2px !important;
}
html[data-bs-theme] body .book-orders-tab,
html[data-bs-theme] body .book-orders-sort a { border-color: var(--bi-line) !important; }

/* заголовок кафедры (инлайн-цвет донора убран из блейда) */
html[data-bs-theme] body .genre-title,
html[data-bs-theme] body .genres-index-page .genre-title {
  color: var(--bi-title) !important;
  font-family: 'Old Standard TT', 'Literata', serif !important;
}


/* донорское [data-bs-theme=light] .bg-dark-card .text-muted (0,3,0) —
   перебиваем весом (0,3,2) */
html[data-bs-theme] body .bg-dark-card .text-muted,
html[data-bs-theme] body .bg-dark-card .text-muted *,
html[data-bs-theme] body .card .text-muted,
html[data-bs-theme] body .reader-race-list-shell .text-muted {
  color: var(--bi-muted) !important;
}
/* ⚠️ шапку и подвал исключаем: у .site-navbar тоже класс .bg-dark-card,
   и без исключения пункты меню красились в цвет фона (становились невидимы) */
html[data-bs-theme] body .bg-dark-card:not(.site-navbar):not(.footer-shell) a:not(.btn):not(.badge):not(.nav-link) {
  color: var(--bi-green-text) !important;
}
html[data-bs-theme] body .bg-dark-card:not(.site-navbar):not(.footer-shell) a:not(.btn):not(.nav-link):hover {
  color: var(--bi-gold) !important;
}

/* цвета пунктов меню — задаём явно и с запасом по специфичности */
html[data-bs-theme] body .site-navbar .navbar-nav .nav-link,
html[data-bs-theme] body .site-navbar .navbar-nav .nav-link span,
html[data-bs-theme] body .site-navbar a.nav-link {
  color: #e4eee6 !important;
}
html[data-bs-theme] body .site-navbar .navbar-nav .nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, .09) !important;
}
html[data-bs-theme] body .site-navbar .navbar-nav .nav-link.active,
html[data-bs-theme] body .site-navbar .navbar-nav .nav-link.active.text-primary,
html[data-bs-theme] body .site-navbar .navbar-nav span.nav-link.active {
  background: var(--bi-gold) !important;
  color: var(--bi-green-deep) !important;
  font-weight: 600 !important;
}
html[data-bs-theme] body .site-navbar .navbar-brand,
html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__pro { color: #fbf6e6 !important; }
html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__books { color: var(--bi-gold-soft) !important; }

/* кнопка поиска в «Столе заказов» (была донорская синяя) */
html[data-bs-theme] body .book-orders-search button,
html[data-bs-theme] body .catalog-inline-search button {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
}
html[data-bs-theme] body .book-orders-search button i { color: #f3eeda !important; }


/* кнопки входа через соцсети — фирменные цвета площадок
   (движок отдаёт VK как .btn-primary, наша перекраска его «озеленяла») */
html[data-bs-theme] body .btn:has(.bi-vk) {
  background: #0077ff !important;
  border-color: #0077ff !important;
  color: #fff !important;
}
html[data-bs-theme] body .btn:has(.bi-vk) i { color: #fff !important; }


/* ==========================================================================
   УЧЁНЫЙ СОВЕТ (Топ-100) — вариант A «Табель успеваемости»
   Десктоп: колонки место / обложка / произведение / кафедра / оценка / кнопка.
   Мобильный: обложка слева, всё остальное — колонкой справа.
   ========================================================================== */
#top100-list { --tbl-cols: 66px 54px minmax(0,1fr) 150px 92px 112px; }

html[data-bs-theme] body .tbl-row {
  display: grid;
  grid-template-columns: var(--tbl-cols);
  align-items: center;
  gap: 16px;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  padding: 12px 18px;
  position: relative;
  overflow: hidden;
  transition: border-color .18s, box-shadow .18s;
}
html[data-bs-theme] body .tbl-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bi-green);
}
html[data-bs-theme] body .tbl-row:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 8px 22px rgba(29, 55, 44, .12) !important;
}
/* медали первой тройки */
.tbl-row--m1::before { background: var(--bi-gold) !important; }
.tbl-row--m2::before { background: #9aa2ab !important; }
.tbl-row--m3::before { background: #b07a4c !important; }
.tbl-row--m1 .tbl-pos__num { color: #a8801f !important; }
.tbl-row--m2 .tbl-pos__num { color: #6f7780 !important; }
.tbl-row--m3 .tbl-pos__num { color: #96603a !important; }

.tbl-pos { text-align: center; }
html[data-bs-theme] body .tbl-pos__num {
  display: block;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--bi-green-text) !important;
  letter-spacing: .02em;
}
html[data-bs-theme] body .tbl-pos__label {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .56rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bi-muted) !important;
}

.tbl-cover { display: block; line-height: 0; }
html[data-bs-theme] body .tbl-cover img {
  width: 54px; height: 78px; object-fit: cover;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  box-shadow: 0 4px 12px rgba(29, 55, 44, .16) !important;
}

.tbl-main { min-width: 0; }
html[data-bs-theme] body .tbl-title {
  display: block;
  font-family: 'Old Standard TT', 'Literata', serif !important;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .tbl-title:hover { color: var(--bi-gold) !important; }
html[data-bs-theme] body .tbl-author,
html[data-bs-theme] body .tbl-author a {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .78rem;
  color: var(--bi-muted) !important;
  margin-top: 2px;
}
html[data-bs-theme] body .tbl-author a:hover { color: var(--bi-green-text) !important; }

/* строка мелких метрик: на десктопе прячем то, что уже есть в колонках */
html[data-bs-theme] body .tbl-sub {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .tbl-sub i { color: var(--bi-gold) !important; }
html[data-bs-theme] body .tbl-sub .tbl-sub__dep,
html[data-bs-theme] body .tbl-sub .tbl-sub__mark { display: none !important; }

.tbl-state { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
html[data-bs-theme] body .top100-user-chip {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 2px !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .68rem !important;
  font-weight: 500 !important;
  padding: .22rem .5rem !important;
}
html[data-bs-theme] body .top100-user-chip--fav {
  background: rgba(184, 146, 60, .16) !important;
  border-color: var(--bi-gold) !important;
  color: #85641f !important;
}
html[data-bs-theme] body .top100-user-chip i { color: inherit !important; }

html[data-bs-theme] body .tbl-dep {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .8rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .tbl-mark {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.28rem;
  text-align: center;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-gold) !important;
  background: rgba(184, 146, 60, .1);
  border-radius: 2px;
  padding: 2px 0;
}
html[data-bs-theme] body .tbl-act .top100-read-btn {
  display: block; text-align: center;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .78rem;
  padding: 7px 0;
  border: 1px solid var(--bi-green) !important;
  border-radius: 3px !important;
  color: var(--bi-green-text) !important;
  background: transparent !important;
}
html[data-bs-theme] body .tbl-act .top100-read-btn:hover {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}

/* ---------------------------------- планшет: убираем колонку «кафедра» */
@media (max-width: 1199.98px) {
  #top100-list { --tbl-cols: 58px 50px minmax(0,1fr) 84px 104px; }
  html[data-bs-theme] body .tbl-dep { display: none; }
}

/* ---------------------------------- мобильный: обложка + колонка текста */
@media (max-width: 767.98px) {
  html[data-bs-theme] body .tbl-row {
    grid-template-columns: 58px minmax(0, 1fr);
    grid-template-areas:
      "cover pos"
      "cover main"
      "cover act";
    grid-template-rows: auto auto auto;
    gap: 2px 14px;
    padding: 12px 14px 12px 16px;
    align-items: start;
  }
  html[data-bs-theme] body .tbl-cover { grid-area: cover; align-self: start; }
  html[data-bs-theme] body .tbl-cover img { width: 58px; height: 84px; }
  html[data-bs-theme] body .tbl-pos {
    grid-area: pos;
    display: flex; align-items: baseline; gap: 6px;
    text-align: left;
  }
  html[data-bs-theme] body .tbl-pos__num { font-size: 1rem; }
  html[data-bs-theme] body .tbl-pos__label { font-size: .52rem; }
  html[data-bs-theme] body .tbl-main { grid-area: main; display: flex; flex-direction: column; }
  html[data-bs-theme] body .tbl-act { grid-area: act; margin-top: 10px; }
  html[data-bs-theme] body .tbl-act .top100-read-btn { display: inline-block; padding: 7px 22px; }

  /* колонки «кафедра» и «оценка» уезжают в строку метрик */
  html[data-bs-theme] body .tbl-mark,
  html[data-bs-theme] body .tbl-dep { display: none; }
  html[data-bs-theme] body .tbl-sub .tbl-sub__dep,
  html[data-bs-theme] body .tbl-sub .tbl-sub__mark { display: inline-flex !important; }
  html[data-bs-theme] body .tbl-sub__mark { color: #85641f !important; font-weight: 600; }
  html[data-bs-theme] body .tbl-sub__mark::before { content: "\2605 "; color: var(--bi-gold); }
  html[data-bs-theme] body .tbl-sub__dep {
    background: var(--bi-green-soft) !important;
    color: var(--bi-title) !important;
    border-radius: 2px; padding: 1px 6px;
  }
  html[data-bs-theme] body .tbl-sub__date { display: none; }
  html[data-bs-theme] body .tbl-title { font-size: 1rem; }
}
@media (max-width: 400px) {
  html[data-bs-theme] body .tbl-row { grid-template-columns: 48px minmax(0, 1fr); padding-left: 12px; }
  html[data-bs-theme] body .tbl-cover img { width: 48px; height: 70px; }
  html[data-bs-theme] body .tbl-sub { gap: 7px; font-size: .68rem; }
}


/* панель периодов на Топ-100: убираем донорскую голубую рамку-«таблетку» */
html[data-bs-theme] body #top100-filter-bar,
html[data-bs-theme] body .top100-filter-bar {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
/* метрики в строке табеля — ровные, без «пилюль» донора */
html[data-bs-theme] body .tbl-sub span {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  color: var(--bi-muted) !important;
  font-size: .74rem !important;
  min-height: 0 !important;
  gap: .28rem;
}
html[data-bs-theme] body .tbl-sub .tbl-sub__dep {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  padding: 1px 7px !important;
  border-radius: 2px !important;
}
html[data-bs-theme] body .tbl-sub .tbl-sub__mark { color: #85641f !important; font-weight: 600 !important; }


/* ==========================================================================
   ФИЛЬТРЫ КАТАЛОГА — вкладки вместо «коробки с пилюлями»
   Тонкая линия-основание, у активной вкладки золотая черта снизу.
   ========================================================================== */
html[data-bs-theme] body .bi-tabs {
  display: block !important;
  width: 100%;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  justify-content: flex-start !important;
}
html[data-bs-theme] body .bi-tabs__row {
  width: 100%;
  justify-content: flex-start !important;
  display: flex !important;
  align-items: stretch;
  gap: 2px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--bi-line);
  padding: 0 !important;
}
html[data-bs-theme] body .bi-tab {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  padding: .62rem 1.05rem .7rem;
  margin-bottom: -1px;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  font-family: 'Golos Text', system-ui, sans-serif !important;
  font-size: .88rem !important;
  font-weight: 500 !important;
  color: var(--bi-muted) !important;
  letter-spacing: .01em;
  transition: color .16s, border-color .16s, background .16s;
  white-space: nowrap;
}
html[data-bs-theme] body .bi-tab i {
  font-size: .82em;
  color: var(--bi-line) !important;
  transition: color .16s;
}
html[data-bs-theme] body .bi-tab:hover {
  color: var(--bi-title) !important;
  background: rgba(29, 74, 56, .05) !important;
  border-bottom-color: var(--bi-line) !important;
}
html[data-bs-theme] body .bi-tab:hover i { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-tab.is-active {
  color: var(--bi-title) !important;
  font-weight: 600 !important;
  border-bottom-color: var(--bi-gold) !important;
  background: transparent !important;
  cursor: default;
}
html[data-bs-theme] body .bi-tab.is-active i { color: var(--bi-gold) !important; }

/* «Золотая сотня» — акцентная вкладка справа */
html[data-bs-theme] body .bi-tab--gold {
  margin-left: auto;
  color: var(--bi-green-text) !important;
}
html[data-bs-theme] body .bi-tab--gold i { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-tab--gold:hover {
  color: var(--bi-title) !important;
  border-bottom-color: var(--bi-gold) !important;
}

@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-tabs__row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0;
  }
  html[data-bs-theme] body .bi-tabs__row::-webkit-scrollbar { display: none; }
  html[data-bs-theme] body .bi-tab { padding: .55rem .8rem .62rem; font-size: .82rem !important; }
  html[data-bs-theme] body .bi-tab--gold { margin-left: 0; }
}


/* ------------------------- герой главной: раскладка кнопок и подписей
   (донорский слой держал эти flex-контейнеры; после его удаления
   элементы стали block и наезжали друг на друга на узких экранах) */
html[data-bs-theme] body .bookinstitute-home-hero__actions {
  display: flex !important;
  flex-wrap: wrap;
  gap: .7rem;
  justify-content: center;
  align-items: center;
  margin-top: 1.4rem;
}
html[data-bs-theme] body .bookinstitute-home-hero__primary,
html[data-bs-theme] body .bookinstitute-home-hero__secondary {
  display: inline-flex !important;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border-radius: 3px !important;
  font-family: 'Golos Text', system-ui, sans-serif !important;
  font-weight: 600;
  font-size: .88rem;
  white-space: nowrap;
}
html[data-bs-theme] body .bookinstitute-home-hero__primary {
  background: var(--bi-green) !important;
  border: 1px solid var(--bi-green) !important;
  color: #f3eeda !important;
}
html[data-bs-theme] body .bookinstitute-home-hero__primary:hover { background: var(--bi-green-deep) !important; }
html[data-bs-theme] body .bookinstitute-home-hero__secondary {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
}
html[data-bs-theme] body .bookinstitute-home-hero__secondary:hover { border-color: var(--bi-gold) !important; }

html[data-bs-theme] body .bookinstitute-home-hero__signals {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.4rem;
  margin-top: 1.1rem;
}
html[data-bs-theme] body .bookinstitute-home-hero__signals > * {
  display: inline-flex !important;
  align-items: center;
  gap: .4rem;
}
@media (max-width: 575.98px) {
  html[data-bs-theme] body .bookinstitute-home-hero__actions { flex-direction: column; align-items: stretch; }
  html[data-bs-theme] body .bookinstitute-home-hero__primary,
  html[data-bs-theme] body .bookinstitute-home-hero__secondary { justify-content: center; white-space: normal; }
}


/* ==========================================================================
   ЦИКЛЫ — вариант B «Программа курса»
   Карточка цикла раскрыта списком первых томов + полоса прочитанного.
   ========================================================================== */
html[data-bs-theme] body .bi-courses { display: flex; flex-direction: column; gap: 16px; }

html[data-bs-theme] body .bi-course {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  overflow: hidden;
  box-shadow: none !important;
}
html[data-bs-theme] body .bi-course:hover { border-color: var(--bi-gold) !important; }

html[data-bs-theme] body .bi-course__head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  background: var(--bi-paper-deep) !important;
  border-bottom: 1px solid var(--bi-line);
}
html[data-bs-theme] body .bi-course__idx {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.02rem;
}
html[data-bs-theme] body .bi-course__title { min-width: 0; }
html[data-bs-theme] body .bi-course__name {
  display: block;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.14rem;
  line-height: 1.25;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .bi-course__name:hover { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-course__sub {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-muted) !important;
  margin-top: 2px;
}
html[data-bs-theme] body .bi-course__meta {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
html[data-bs-theme] body .bi-course__progress-label {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
  white-space: nowrap;
}
html[data-bs-theme] body .bi-course__progress {
  display: block; width: 118px; height: 5px;
  background: var(--bi-paper) !important;
  border: 1px solid var(--bi-line);
  border-radius: 3px; overflow: hidden;
}
html[data-bs-theme] body .bi-course__progress i { display: block; height: 100%; background: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-course__follow {
  display: inline-flex !important; align-items: center; gap: .4rem;
  border: 1px solid var(--bi-green) !important;
  background: transparent !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
  padding: .4rem .8rem !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem !important;
}
html[data-bs-theme] body .bi-course__follow:hover,
html[data-bs-theme] body .bi-course__follow.is-active {
  background: var(--bi-green) !important; color: #f3eeda !important;
}

html[data-bs-theme] body .bi-course__items { padding: 6px 18px 12px; }
html[data-bs-theme] body .bi-course__item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 64px 54px 92px;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--bi-line);
}
html[data-bs-theme] body .bi-course__item:last-child { border-bottom: none; }
html[data-bs-theme] body .bi-course__num {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-gold) !important;
  text-align: center;
  font-size: .98rem;
}
html[data-bs-theme] body .bi-course__book {
  font-family: 'Literata', Georgia, serif !important;
  font-size: .96rem;
  color: var(--bi-ink) !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[data-bs-theme] body .bi-course__book:hover { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .bi-course__year,
html[data-bs-theme] body .bi-course__rate {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-muted) !important;
  text-align: center;
}
html[data-bs-theme] body .bi-course__rate { color: #85641f !important; font-weight: 600; }
html[data-bs-theme] body .bi-course__read {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px;
  padding: 5px 0;
  text-align: center;
}
html[data-bs-theme] body .bi-course__read:hover { background: var(--bi-green) !important; color: #f3eeda !important; }
html[data-bs-theme] body .bi-course__more {
  display: inline-block;
  margin-top: 8px;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .76rem;
  color: var(--bi-gold) !important;
}
html[data-bs-theme] body .bi-course__desc {
  padding: 0 18px 14px;
  margin: 0;
  font-family: 'Literata', Georgia, serif !important;
  font-size: .85rem;
  color: var(--bi-muted) !important;
}

@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-course__head { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  html[data-bs-theme] body .bi-course__meta { margin-left: 0; width: 100%; }
  html[data-bs-theme] body .bi-course__progress { flex: 1; min-width: 90px; width: auto; }
  html[data-bs-theme] body .bi-course__items { padding: 4px 14px 12px; }
  html[data-bs-theme] body .bi-course__item {
    grid-template-columns: 26px minmax(0, 1fr) 46px;
    gap: 8px;
  }
  html[data-bs-theme] body .bi-course__year,
  html[data-bs-theme] body .bi-course__read { display: none; }
  html[data-bs-theme] body .bi-course__book { white-space: normal; }
  html[data-bs-theme] body .bi-course__desc { padding: 0 14px 12px; }
}


/* ==========================================================================
   СТРАНИЦА ЦИКЛА — вариант A «Учебный план»
   Тома на вертикальной оси: пройденные — зелёный узел, текущий — золотой.
   ========================================================================== */
html[data-bs-theme] body .bi-plan {
  position: relative;
  padding-left: 34px;
}
html[data-bs-theme] body .bi-plan::before {
  content: "";
  position: absolute;
  left: 12px; top: 14px; bottom: 14px;
  border-left: 2px dotted var(--bi-line);
}
html[data-bs-theme] body .bi-plan__item {
  position: relative;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .bi-plan__item:hover { border-color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-plan__item::before {
  content: "";
  position: absolute;
  left: -28px; top: 26px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--bi-card);
  border: 2px solid var(--bi-line);
  z-index: 1;
}
html[data-bs-theme] body .bi-plan__item.is-done::before {
  background: var(--bi-green); border-color: var(--bi-green);
}
html[data-bs-theme] body .bi-plan__item.is-now::before {
  background: var(--bi-gold); border-color: var(--bi-gold);
  box-shadow: 0 0 0 4px rgba(184, 146, 60, .22);
}
html[data-bs-theme] body .bi-plan__here,
html[data-bs-theme] body .bi-plan__done {
  position: absolute;
  top: 10px; right: 12px;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 2px;
  z-index: 2;
}
html[data-bs-theme] body .bi-plan__here { background: var(--bi-gold) !important; color: var(--bi-green-deep) !important; }
html[data-bs-theme] body .bi-plan__done {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
  border: 1px solid var(--bi-line);
  font-weight: 500;
}
/* номер тома — «бирка» цикла */
html[data-bs-theme] body .bi-plan .series-book-order-badge {
  background: var(--bi-green) !important;
  border: 0 !important;
  border-radius: 2px !important;
  color: #f3eeda !important;
}
html[data-bs-theme] body .bi-plan .series-book-order-label {
  color: rgba(243, 238, 218, .75) !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .54rem !important;
  letter-spacing: .16em;
}
@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-plan { padding-left: 22px; }
  html[data-bs-theme] body .bi-plan::before { left: 6px; }
  html[data-bs-theme] body .bi-plan__item::before { left: -22px; top: 20px; width: 11px; height: 11px; }
  html[data-bs-theme] body .bi-plan__here,
  html[data-bs-theme] body .bi-plan__done { top: 8px; right: 8px; font-size: .56rem; }
}


/* ==========================================================================
   АВТОРЫ — вариант B «Ящик картотеки»
   Плотный алфавитный список: буквы-разделители, мини-корешки, подписки.
   ========================================================================== */
html[data-bs-theme] body .bi-kart {
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  background: var(--bi-card) !important;
  overflow: hidden;
}
html[data-bs-theme] body .bi-kart__letter {
  background: var(--bi-green-deep) !important;
  color: var(--bi-gold-soft) !important;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.08rem;
  letter-spacing: .1em;
  padding: 6px 18px;
}
html[data-bs-theme] body .bi-kart__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 150px 118px;
  gap: 16px;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--bi-line);
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .bi-kart__row:last-child { border-bottom: none; }
html[data-bs-theme] body .bi-kart__row:hover { background: var(--bi-green-soft) !important; }

html[data-bs-theme] body .bi-kart__name {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.02rem;
  color: var(--bi-title) !important;
  min-width: 0;
}
html[data-bs-theme] body .bi-kart__name:hover { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-kart__name small {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
  margin-top: 1px;
}

html[data-bs-theme] body .bi-kart__spines {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 34px;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--bi-green-deep);
}
html[data-bs-theme] body .bi-kart__spines i {
  display: block;
  width: 9px;
  border-radius: 1px 1px 0 0;
  background: var(--bi-green);
}
html[data-bs-theme] body .bi-kart__spines i:nth-child(2) { background: #7d3b2e; }
html[data-bs-theme] body .bi-kart__spines i:nth-child(3) { background: #31466b; }
html[data-bs-theme] body .bi-kart__spines i:nth-child(4) { background: #8a6d2b; }
html[data-bs-theme] body .bi-kart__spines i:nth-child(5) { background: #54346b; }
html[data-bs-theme] body .bi-kart__spines i:nth-child(6) { background: #4a6b52; }

html[data-bs-theme] body .bi-kart__followers {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-kart__followers b { color: var(--bi-green-text) !important; font-weight: 600; margin-left: .25rem; }

html[data-bs-theme] body .bi-kart__follow {
  display: inline-flex !important;
  align-items: center;
  gap: .4rem;
  width: 100%;
  justify-content: center;
  border: 1px solid var(--bi-green) !important;
  background: transparent !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
  padding: .38rem .6rem !important;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem !important;
}
html[data-bs-theme] body .bi-kart__follow:hover,
html[data-bs-theme] body .bi-kart__follow.is-active {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}

@media (max-width: 991.98px) {
  html[data-bs-theme] body .bi-kart__row { grid-template-columns: minmax(0, 1fr) 74px 108px; gap: 12px; }
  html[data-bs-theme] body .bi-kart__followers { display: none; }
}
@media (max-width: 575.98px) {
  html[data-bs-theme] body .bi-kart__row { grid-template-columns: minmax(0, 1fr) 100px; padding: 9px 14px; }
  html[data-bs-theme] body .bi-kart__spines { display: none; }
  html[data-bs-theme] body .bi-kart__letter { padding: 5px 14px; }
}


/* ==========================================================================
   СТРАНИЦА АВТОРА — вариант D «По циклам»
   Циклы автора с томами по порядку, затем блок «вне циклов».
   ========================================================================== */
html[data-bs-theme] body .bi-authcycles { margin-bottom: 26px; }
html[data-bs-theme] body .bi-authcycles__title {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 14px;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.3rem;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .bi-authcycles__title--single { margin-top: 26px; }
html[data-bs-theme] body .bi-authcycles__line { flex: 1; border-top: 1px solid var(--bi-line); transform: translateY(-6px); }
html[data-bs-theme] body .bi-authcycles__count {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  border-radius: 2px;
  padding: 2px 9px;
}

html[data-bs-theme] body .bi-authcycle {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  overflow: hidden;
  margin-bottom: 14px;
}
html[data-bs-theme] body .bi-authcycle:hover { border-color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-authcycle__head {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  background: var(--bi-paper-deep) !important;
  border-bottom: 1px solid var(--bi-line);
}
html[data-bs-theme] body .bi-authcycle__mark {
  width: 32px; height: 32px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  font-family: 'Old Standard TT', serif !important;
}
html[data-bs-theme] body .bi-authcycle__name {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.05rem;
  color: var(--bi-title) !important;
  min-width: 0;
}
html[data-bs-theme] body .bi-authcycle__name small {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-authcycle__go {
  margin-left: auto;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-gold) !important;
  white-space: nowrap;
}
html[data-bs-theme] body .bi-authcycle__items { padding: 5px 18px 11px; }
html[data-bs-theme] body .bi-authcycle__item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 66px 52px 88px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--bi-line);
}
html[data-bs-theme] body .bi-authcycle__item:last-child { border-bottom: none; }
html[data-bs-theme] body .bi-authcycle__n {
  font-family: 'Old Standard TT', serif !important;
  color: var(--bi-gold) !important;
  text-align: center;
}
html[data-bs-theme] body .bi-authcycle__book {
  font-family: 'Literata', Georgia, serif !important;
  font-size: .96rem;
  color: var(--bi-ink) !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[data-bs-theme] body .bi-authcycle__book:hover { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .bi-authcycle__y {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem; color: var(--bi-muted) !important; text-align: center;
}
html[data-bs-theme] body .bi-authcycle__m {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .76rem; color: #85641f !important; font-weight: 600; text-align: center;
}
html[data-bs-theme] body .bi-authcycle__read {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px; padding: 5px 0; text-align: center;
}
html[data-bs-theme] body .bi-authcycle__read:hover { background: var(--bi-green) !important; color: #f3eeda !important; }
html[data-bs-theme] body .bi-authcycle__more {
  display: inline-block; margin-top: 8px;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .76rem; color: var(--bi-gold) !important;
}

@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-authcycle__head { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  html[data-bs-theme] body .bi-authcycle__go { margin-left: 0; }
  html[data-bs-theme] body .bi-authcycle__items { padding: 4px 14px 10px; }
  html[data-bs-theme] body .bi-authcycle__item { grid-template-columns: 26px minmax(0, 1fr) 46px; gap: 8px; }
  html[data-bs-theme] body .bi-authcycle__y,
  html[data-bs-theme] body .bi-authcycle__read { display: none; }
  html[data-bs-theme] body .bi-authcycle__book { white-space: normal; }
}


/* ==========================================================================
   КАФЕДРЫ — вариант C «Предметный указатель»
   Все кафедры как оглавление книги: три колонки, отточия, счётчики.
   ========================================================================== */
html[data-bs-theme] body .bi-index-shell {
  display: block !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  background: var(--bi-card) !important;
  padding: 10px 6px;
  margin: 0 !important;
}
html[data-bs-theme] body .bi-index {
  columns: 3;
  column-gap: 34px;
  padding: 8px 18px;
}
html[data-bs-theme] body .bi-index__letter {
  break-inside: avoid;
  break-after: avoid;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.1rem;
  color: var(--bi-gold) !important;
  padding: 12px 0 4px;
  border-bottom: 1px solid var(--bi-line);
  margin-bottom: 4px;
}
html[data-bs-theme] body .bi-index__row {
  break-inside: avoid;
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--bi-line);
}
html[data-bs-theme] body .bi-index__row:hover .bi-index__name { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-index__name {
  font-family: 'Literata', Georgia, serif !important;
  font-size: .98rem;
  color: var(--bi-ink) !important;
  min-width: 0;
}
html[data-bs-theme] body .bi-index__dots {
  flex: 1;
  border-bottom: 1px dotted var(--bi-line);
  transform: translateY(-4px);
  min-width: 12px;
}
html[data-bs-theme] body .bi-index__week {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .68rem;
  color: var(--bi-gold) !important;
}
html[data-bs-theme] body .bi-index__followers {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .68rem;
  color: var(--bi-muted) !important;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
html[data-bs-theme] body .bi-index__followers i { font-size: .62rem; color: var(--bi-line) !important; }
html[data-bs-theme] body .bi-index__count {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .78rem;
  font-weight: 600;
  color: var(--bi-green-text) !important;
  min-width: 42px;
  text-align: right;
}
html[data-bs-theme] body .bi-index__form { display: inline; margin: 0; }
html[data-bs-theme] body .bi-index__follow {
  border: 0 !important;
  background: transparent !important;
  color: var(--bi-line) !important;
  padding: 0 0 0 2px !important;
  font-size: .78rem;
  line-height: 1;
}
html[data-bs-theme] body .bi-index__follow:hover { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-index__follow.is-active { color: var(--bi-gold) !important; }

@media (max-width: 991.98px) {
  html[data-bs-theme] body .bi-index { columns: 2; column-gap: 26px; }
}
@media (max-width: 575.98px) {
  html[data-bs-theme] body .bi-index { columns: 1; padding: 6px 12px; }
  html[data-bs-theme] body .bi-index__followers { display: none; }
}


/* ==========================================================================
   СТРАНИЦА КАФЕДРЫ — вариант D «По авторам кафедры»
   ========================================================================== */
html[data-bs-theme] body .bi-gauth { margin-bottom: 24px; }
html[data-bs-theme] body .bi-gauth__title {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 14px;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.28rem;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .bi-gauth__title--rest { margin-top: 26px; }
html[data-bs-theme] body .bi-gauth__line { flex: 1; border-top: 1px solid var(--bi-line); transform: translateY(-6px); }

html[data-bs-theme] body .bi-gauth__card {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  overflow: hidden;
  margin-bottom: 12px;
}
html[data-bs-theme] body .bi-gauth__card:hover { border-color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-gauth__head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--bi-paper-deep) !important;
  border-bottom: 1px solid var(--bi-line);
}
html[data-bs-theme] body .bi-gauth__ini {
  width: 30px; height: 30px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 2px;
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  font-family: 'Old Standard TT', serif !important;
}
html[data-bs-theme] body .bi-gauth__name {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.02rem;
  color: var(--bi-title) !important;
  min-width: 0;
}
html[data-bs-theme] body .bi-gauth__name small {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-gauth__go {
  margin-left: auto;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-gold) !important;
  white-space: nowrap;
}
html[data-bs-theme] body .bi-gauth__items { padding: 4px 18px 10px; }
html[data-bs-theme] body .bi-gauth__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 50px 84px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px dashed var(--bi-line);
}
html[data-bs-theme] body .bi-gauth__item:last-child { border-bottom: none; }
html[data-bs-theme] body .bi-gauth__book {
  font-family: 'Literata', Georgia, serif !important;
  font-size: .95rem;
  color: var(--bi-ink) !important;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
html[data-bs-theme] body .bi-gauth__book:hover { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .bi-gauth__y {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem; color: var(--bi-muted) !important; text-align: center;
}
html[data-bs-theme] body .bi-gauth__m {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .76rem; color: #85641f !important; font-weight: 600; text-align: center;
}
html[data-bs-theme] body .bi-gauth__read {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px; padding: 5px 0; text-align: center;
}
html[data-bs-theme] body .bi-gauth__read:hover { background: var(--bi-green) !important; color: #f3eeda !important; }

@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-gauth__head { flex-wrap: wrap; gap: 8px; padding: 10px 14px; }
  html[data-bs-theme] body .bi-gauth__go { margin-left: 0; }
  html[data-bs-theme] body .bi-gauth__items { padding: 4px 14px 10px; }
  html[data-bs-theme] body .bi-gauth__item { grid-template-columns: minmax(0, 1fr) 46px; gap: 8px; }
  html[data-bs-theme] body .bi-gauth__y,
  html[data-bs-theme] body .bi-gauth__read { display: none; }
  html[data-bs-theme] body .bi-gauth__book { white-space: normal; }
}


/* ==========================================================================
   ПОДБОРКИ — вариант D «Ведомость подборок»
   ========================================================================== */
html[data-bs-theme] body .bi-colls { display: flex; flex-direction: column; gap: 10px; }

html[data-bs-theme] body .bi-coll {
  display: grid;
  grid-template-columns: 54px 96px minmax(0, 1fr) 92px 108px 116px;
  gap: 16px;
  align-items: center;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  padding: 12px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: none !important;
}
html[data-bs-theme] body .bi-coll::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--bi-green);
}
html[data-bs-theme] body .bi-coll:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 8px 22px rgba(29, 55, 44, .12) !important;
}
html[data-bs-theme] body .bi-coll__no {
  text-align: center;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.32rem;
  color: var(--bi-green-text) !important;
  line-height: 1.1;
}
html[data-bs-theme] body .bi-coll__no small {
  display: block;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .5rem;
  letter-spacing: .18em;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-coll__covers { display: flex; align-items: center; }
html[data-bs-theme] body .bi-coll__covers img {
  width: 34px; height: 48px; object-fit: cover;
  border: 1px solid var(--bi-line);
  border-radius: 2px;
  box-shadow: 0 3px 8px rgba(29, 55, 44, .18);
}
html[data-bs-theme] body .bi-coll__covers img + img { margin-left: -13px; }
html[data-bs-theme] body .bi-coll__covers-empty {
  width: 34px; height: 48px;
  border: 1px dashed var(--bi-line);
  border-radius: 2px;
  display: block;
}
html[data-bs-theme] body .bi-coll__main { min-width: 0; }
html[data-bs-theme] body .bi-coll__name {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.06rem;
  color: var(--bi-title) !important;
  display: block;
}
html[data-bs-theme] body .bi-coll__name:hover { color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-coll__by {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  color: var(--bi-muted) !important;
  margin-top: 2px;
}
html[data-bs-theme] body .bi-coll__desc {
  font-family: 'Literata', Georgia, serif !important;
  font-size: .82rem;
  color: var(--bi-muted) !important;
  margin-top: 4px;
}
html[data-bs-theme] body .bi-coll__num { text-align: center; }
html[data-bs-theme] body .bi-coll__num b {
  display: block;
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.12rem;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .bi-coll__num span {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-coll__act {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
}
html[data-bs-theme] body .bi-coll__rate {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .74rem;
  font-weight: 600;
  color: #85641f !important;
  text-align: center;
}
html[data-bs-theme] body .bi-coll__rate::before { content: "★ "; color: var(--bi-gold); }
html[data-bs-theme] body .bi-coll__open {
  font-family: 'Golos Text', sans-serif !important;
  font-size: .76rem;
  border: 1px solid var(--bi-green) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px;
  padding: 6px 0;
  text-align: center;
}
html[data-bs-theme] body .bi-coll__open:hover { background: var(--bi-green) !important; color: #f3eeda !important; }

@media (max-width: 1199.98px) {
  html[data-bs-theme] body .bi-coll { grid-template-columns: 48px 88px minmax(0, 1fr) 84px 112px; }
  html[data-bs-theme] body .bi-coll__num--views { display: none; }
}
@media (max-width: 767.98px) {
  html[data-bs-theme] body .bi-coll {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-areas: "covers main" "covers meta";
    gap: 6px 14px;
    padding: 12px 14px 12px 16px;
    align-items: start;
  }
  html[data-bs-theme] body .bi-coll__covers { grid-area: covers; }
  html[data-bs-theme] body .bi-coll__main { grid-area: main; }
  html[data-bs-theme] body .bi-coll__no { display: none; }
  html[data-bs-theme] body .bi-coll__num {
    grid-area: meta;
    display: inline-flex; align-items: baseline; gap: .3rem;
    text-align: left;
  }
  html[data-bs-theme] body .bi-coll__num b { display: inline; font-size: .95rem; }
  html[data-bs-theme] body .bi-coll__act { grid-area: meta; justify-self: end; flex-direction: row; align-items: center; gap: 10px; }
  html[data-bs-theme] body .bi-coll__open { padding: 5px 14px; }
  html[data-bs-theme] body .bi-coll__desc { display: none; }
}


/* ==========================================================================
   СТРАНИЦА ПОДБОРКИ — вариант D «Карточка и книги»
   Слева карточка подборки (липкая), справа фильтры и книги.
   ========================================================================== */
html[data-bs-theme] body .bi-collshow {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
html[data-bs-theme] body .bi-collshow > .card {
  position: sticky;
  top: 18px;
  margin-bottom: 0 !important;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: inset 0 0 0 4px var(--bi-paper), inset 0 0 0 5px var(--bi-line) !important;
}
html[data-bs-theme] body .bi-collshow .collection-show-card-body { padding: 18px !important; }
html[data-bs-theme] body .bi-collshow .collection-show-card-top {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 10px !important;
}
html[data-bs-theme] body .bi-collshow .collection-show-title {
  font-family: 'Old Standard TT', serif !important;
  font-size: 1.3rem !important;
  line-height: 1.2;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .bi-collshow .collection-show-actions {
  flex-direction: column;
  align-items: stretch;
}
html[data-bs-theme] body .bi-collshow .collection-show-actions > * { width: 100%; text-align: center; }
html[data-bs-theme] body .bi-collshow__main { min-width: 0; }

/* фильтры внутри правой колонки не должны растягиваться на всю ширину экрана */
html[data-bs-theme] body .bi-collshow__main .collection-genre-filter,
html[data-bs-theme] body .bi-collshow__main .collection-sort,
html[data-bs-theme] body .bi-collshow__main .collection-layout-switch { flex-wrap: wrap; }

/* сетка книг в правой колонке — по 4 в ряд */
@media (min-width: 1200px) {
  html[data-bs-theme] body .bi-collshow__main .collection-books-grid > * { width: 25% !important; }
}
@media (max-width: 1199.98px) and (min-width: 992px) {
  html[data-bs-theme] body .bi-collshow__main .collection-books-grid > * { width: 33.333% !important; }
}

@media (max-width: 991.98px) {
  html[data-bs-theme] body .bi-collshow { grid-template-columns: 1fr; gap: 18px; }
  html[data-bs-theme] body .bi-collshow > .card { position: static; }
  html[data-bs-theme] body .bi-collshow .collection-show-card-top { flex-direction: row !important; flex-wrap: wrap; }
  html[data-bs-theme] body .bi-collshow .collection-show-actions { flex-direction: row; }
  html[data-bs-theme] body .bi-collshow .collection-show-actions > * { width: auto; }
}


/* панель фильтров подборки, вынесенная в правую колонку */
html[data-bs-theme] body .bi-collshow__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .bi-collshow__toolbar .collection-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
}
html[data-bs-theme] body .bi-collshow__toolbar .collection-layout-switch { margin-left: auto; }


/* ⚠️ донорский .collections-grid — сетка в 2 колонки; «Ведомости подборок»
   нужна вся ширина, иначе колонки строки схлопываются в ноль */
html[data-bs-theme] body .collections-grid {
  display: block !important;
  grid-template-columns: none !important;
  gap: 0 !important;
}


/* переключатели разделов (подборки, идеи и т.п.) — без донорской «таблетки» */
html[data-bs-theme] body .collections-sort,
html[data-bs-theme] body .collections-type-switch,
html[data-bs-theme] body .idea-sort-controls {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* ------------------------------------------ иконки
   Полный набор Bootstrap Icons 1.13.1 уже есть в собранном бандле движка,
   свои правила не дублируем. Не хватает только VK — рисуем текстом. */
.bi-vk::before{content:"VK";font-family:'Golos Text',system-ui,sans-serif;font-weight:700;font-size:.82em;letter-spacing:.02em}

/* --------------------------------------------------------------------------
   КАФЕДРЫ — починка строки-оглавления (01.09.2026)

   Что было не так: кнопка «следить» (.bi-index__follow) растягивалась на весь
   остаток строки — 242 из 392 px — и тащила за собой карточную тень. Получалась
   светлая плашка во всю ширину, наезжающая на соседнюю колонку, а колокольчик
   висел в её середине. Отточию при этом оставался только min-width: 12px, из-за
   чего название прилипало к числу («Приключения139»), а длинные названия
   («Современная проза») ломались на две строки без нужды.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .bi-index__row { gap: 10px; align-items: center; }
html[data-bs-theme] body .bi-index__name { flex: 0 1 auto; }
html[data-bs-theme] body .bi-index__dots {
  flex: 1 1 auto;
  min-width: 18px;
  align-self: baseline;
  transform: translateY(-2px);
}
html[data-bs-theme] body .bi-index__count { min-width: 2.2em; }
html[data-bs-theme] body .bi-index__follow {
  flex: 0 0 auto !important;
  width: 1.55rem !important;
  height: 1.55rem !important;
  min-width: 0 !important;
  max-width: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
  border-radius: 50% !important;
  padding: 0 !important;
  margin-left: 2px;
}
html[data-bs-theme] body .bi-index__follow:hover { background: rgba(0, 0, 0, .05) !important; }

/* --------------------------------------------------------------------------
   КАФЕДРЫ, доводка (01.09.2026): убраны отточия, добавлены подписки

   Отточия между названием и числом читались как случайные полосы, а колонки
   «следят» и «+за неделю» вообще не выводились, пока счётчик равен нулю —
   на новом сайте это все кафедры. Теперь распорка без линии, а метрики
   показываются всегда: +N за неделю (золотом), N следят (иконка людей),
   N книг (зелёным).
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .bi-index__dots {
  border-bottom: 0 !important;
  transform: none !important;
  min-width: 10px;
}
html[data-bs-theme] body .bi-index__row {
  border-bottom: 1px solid color-mix(in srgb, var(--bi-line) 45%, transparent);
  gap: 8px;
}
html[data-bs-theme] body .bi-index__week {
  flex: 0 0 auto;
  min-width: 2.1em;
  text-align: right;
  font-size: .72rem !important;
  font-variant-numeric: tabular-nums;
  opacity: .85;
}
html[data-bs-theme] body .bi-index__followers {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  gap: .22rem;
  min-width: 2.9em;
  justify-content: flex-end;
  font-size: .72rem !important;
  font-variant-numeric: tabular-nums;
}
html[data-bs-theme] body .bi-index__followers i { font-size: .68rem; }
html[data-bs-theme] body .bi-index__count {
  min-width: 3.1em;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 575.98px) {
  /* на телефоне колонка узкая — прирост прячем, подписки оставляем */
  html[data-bs-theme] body .bi-index__week { display: none; }
}

/* Легенда над указателем кафедр: расшифровка колонок цифр */
html[data-bs-theme] body .bi-index-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 10px;
  padding: 0 18px;
  font-family: 'Golos Text', sans-serif !important;
  font-size: .72rem;
  color: var(--bi-muted) !important;
}
html[data-bs-theme] body .bi-index-legend span { display: inline-flex; align-items: center; gap: .3rem; }
html[data-bs-theme] body .bi-index-legend b { font-weight: 600; color: var(--bi-gold) !important; }
html[data-bs-theme] body .bi-index-legend i { font-size: .68rem; }
html[data-bs-theme] body .bi-index-legend .bi-index-legend__count { color: var(--bi-green-text) !important; }
@media (max-width: 575.98px) {
  html[data-bs-theme] body .bi-index-legend { padding: 0 12px; gap: 2px 12px; }
}

/* Ужимаем колонки цифр: с прежними min-width длинные названия
   («Космическая фантастика», «Современные любовные романы») переносились на две строки */
html[data-bs-theme] body .bi-index__row { gap: 6px; }
html[data-bs-theme] body .bi-index__week { min-width: 1.8em; }
html[data-bs-theme] body .bi-index__followers { min-width: 2.4em; gap: .18rem; }
html[data-bs-theme] body .bi-index__count { min-width: 2.6em; }

/* --------------------------------------------------------------------------
   ШАПКА И КНОПКИ — почин 01.09.2026

   1. Шапка не помещалась. При `navbar-expand-lg` полное меню разворачивается
      уже с 992px, а его содержимое (8 пунктов + поиск + кнопки, а у залогиненного
      ещё «Полка» и «Администратор») требует ~1200px. Страница расширялась
      (scrollWidth 1196 при окне 1000) и весь сайт уезжал вправо.
      Порог поднят до xl в разметке, здесь — ужимаем содержимое на 1200–1400,
      где места впритык, и запрещаем флекс-детям распирать строку.

   2. У .btn-outline-primary при наведении пропадал текст. Виноват порядок:
      правило `[data-bs-theme] .btn-outline-primary { color: var(--bi-green-text) }`
      стоит в файле ПОЗЖЕ, чем `.btn-outline-primary:hover { color: #f3eeda }`,
      а специфичность у них одинаковая (0,2,0) — при равной специфичности и
      обоих !important побеждает последнее. Фон становился зелёным, текст
      оставался зелёным. Ниже — правило с большей специфичностью.
   -------------------------------------------------------------------------- */

html[data-bs-theme] body .site-navbar .navbar-collapse { min-width: 0; }
html[data-bs-theme] body .site-navbar form[role="search"] { min-width: 0; }
html[data-bs-theme] body .site-navbar .navbar-nav { flex-wrap: nowrap; }

@media (min-width: 1200px) and (max-width: 1439.98px) {
  html[data-bs-theme] body .site-navbar .navbar-nav .nav-link {
    padding-left: .5rem !important;
    padding-right: .5rem !important;
    font-size: .95rem;
  }
  html[data-bs-theme] body .site-navbar form[role="search"] { max-width: 260px; }
  html[data-bs-theme] body .site-navbar .btn { padding-left: 1rem !important; padding-right: 1rem !important; }
}

html[data-bs-theme] body .btn-outline-primary:hover,
html[data-bs-theme] body .btn-outline-primary:focus-visible,
html[data-bs-theme] body .btn-outline-primary:active,
html[data-bs-theme] body a.btn-outline-primary:hover {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
}

/* Шапка на 1200–1440: место освобождаем за счёт логотипа и меню, поиск НЕ жмём.
   Раньше поиск схлопывался до иконки (39px), потому что он единственный
   flex-элемент, готовый уступать. Теперь у него гарантированный минимум,
   а недостающие ~180px забраны у названия сайта и отступов пунктов меню. */
@media (min-width: 1200px) and (max-width: 1439.98px) {
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__pro,
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__books {
    font-size: 15.5px !important;
    letter-spacing: 0 !important;
  }
  html[data-bs-theme] body .site-navbar .navbar-brand { margin-right: .4rem !important; }
  html[data-bs-theme] body .site-navbar .navbar-nav .nav-item .nav-link {
    font-size: .75rem !important;
    padding-left: .22rem !important;
    padding-right: .22rem !important;
  }
  html[data-bs-theme] body .site-navbar .btn {
    padding-left: .6rem !important;
    padding-right: .6rem !important;
    font-size: .78rem !important;
  }
  html[data-bs-theme] body .site-navbar form[role="search"] { min-width: 205px !important; }
}

/* --------------------------------------------------------------------------
   Шапка, заход 2 (01.09.2026): поиск был мал не из-за нехватки места.

   У меню стоит `me-auto` — авто-отступ забирал ВЕСЬ свободный остаток строки,
   поэтому поиск с его `flex-grow-1` никогда не рос: при 1600px в шапке было
   больше 300px свободного места, а поле оставалось 183px. Убираем авто-отступ
   и даём полю расти. Логотип уменьшен на всех десктопных ширинах (по просьбе
   владельца — «можно уменьшить сильно»).
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__pro { font-size: 16.5px !important; }
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__books { font-size: 10.5px !important; }
  html[data-bs-theme] body .site-navbar .navbar-brand { margin-right: .5rem !important; }
}
html[data-bs-theme] body .site-navbar .navbar-nav.me-auto { margin-right: 0 !important; }
html[data-bs-theme] body .site-navbar form[role="search"] {
  flex: 1 1 auto !important;
  min-width: 220px !important;
}

/* --------------------------------------------------------------------------
   Кафедры: три колонки включались уже с 992px — колонка выходила ~290px,
   названия ломались на две строки и липли к цифрам. Три колонки теперь
   только с 1400px, а название не переносится: длинное подрезается многоточием,
   строки одинаковой высоты, цифры выстроены в ровные столбцы.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1399.98px) {
  html[data-bs-theme] body .bi-index { columns: 2 !important; column-gap: 28px !important; }
}
html[data-bs-theme] body .bi-index__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[data-bs-theme] body .bi-index__row { gap: 10px; }
html[data-bs-theme] body .bi-index__dots { min-width: 14px; }

/* Кафедры: порог трёх колонок поднят с 1400 до 1700.
   При 1400–1700 колонка ~200px под название, и длинные («Современные любовные
   романы», «Документальная литература») подрезались многоточием. Две широкие
   колонки читаются лучше обрезанных трёх. */
@media (min-width: 992px) and (max-width: 1699.98px) {
  html[data-bs-theme] body .bi-index { columns: 2 !important; column-gap: 28px !important; }
}

/* --------------------------------------------------------------------------
   Кафедры, откат многоточия (01.09.2026).

   Многоточие было ошибкой: `.bi-index__name` — флекс-элемент с min-width:0,
   и распорка с flex-grow забирала место первой, а имя схлопывалось до
   «При…», «Б…». Название важнее — оно должно помещаться целиком.
   Решение по указанию владельца: ДВЕ колонки на всех десктопных ширинах,
   название не режем и не переносим без нужды.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .bi-index__name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  flex: 0 1 auto;
}

@media (min-width: 576px) {
  html[data-bs-theme] body .bi-index { columns: 2 !important; column-gap: 30px !important; }
}

/* --------------------------------------------------------------------------
   ⚠️ КРИТИЧНО: в собранном bootstrap этого сайта НЕТ утилит уровня xl.
   В разметке использовались только `*-lg-*`, поэтому `d-xl-none` и `mx-xl-4`
   при сборке не попали в css. После перевода шапки на navbar-expand-xl
   элементы с `d-xl-none` (дубли пунктов для свёрнутого меню, бургер, иконки)
   перестали скрываться и вылезали второй строкой поверх основного меню.
   Определяем недостающие утилиты вручную — только внутри шапки.
   -------------------------------------------------------------------------- */
@media (min-width: 1200px) {
  html[data-bs-theme] body .site-navbar .d-xl-none { display: none !important; }
  html[data-bs-theme] body .site-navbar .mx-xl-4 {
    margin-left: 1.5rem !important;
    margin-right: 1.5rem !important;
  }
}

/* --------------------------------------------------------------------------
   ШАПКА, итоговый вариант (01.09.2026).

   ⚠️ ПОЧЕМУ НЕ navbar-expand-xl: в собранном bootstrap этого сайта НЕТ классов
   уровня xl — ни утилит (`d-xl-none`, `mx-xl-4`), ни самого `navbar-expand-xl`.
   Попытка поднять порог ломала шапку: дубли пунктов для свёрнутого меню
   переставали скрываться, а сама шапка разъезжалась на две строки. Разметка
   возвращена на `navbar-expand-lg`, всё лечится стилями.

   Что делаем на 992–1200, где полное меню не помещалось (страница расширялась
   до 1224px при окне 1000): убираем поле поиска и показываем вместо него
   компактную иконку (она уже есть в шапке для мобильных), плюс слегка ужимаем
   меню, кнопки и логотип. Бургер при этом остаётся скрытым — меню-то развёрнуто.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  html[data-bs-theme] body .site-navbar form[role="search"] { display: none !important; }
  html[data-bs-theme] body .site-navbar > .container-fluid > div.d-lg-none { display: flex !important; }
  html[data-bs-theme] body .site-navbar .navbar-toggler { display: none !important; }
  html[data-bs-theme] body .site-navbar .navbar-nav .nav-item .nav-link {
    font-size: .78rem !important;
    padding-left: .28rem !important;
    padding-right: .28rem !important;
  }
  html[data-bs-theme] body .site-navbar .btn {
    padding-left: .65rem !important;
    padding-right: .65rem !important;
    font-size: .78rem !important;
  }
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__pro { font-size: 15px !important; }
  html[data-bs-theme] body .site-navbar .bookinstitute-wordmark__books { font-size: 9.5px !important; letter-spacing: .28em !important; }
}

/* --------------------------------------------------------------------------
   «Полка» пропадала на страницах жанров и книг (01.09.2026).

   Ссылка на библиотеку размечена как `d-none d-lg-inline-flex`, а слово
   «Полка» внутри — как `d-none d-xxl-inline`. На главной грузится app-*.css,
   где эти утилиты есть, а на страницах жанра и книги — отдельный бандл
   `genre-shell-*.css`, в котором из адаптивных утилит остались только
   `d-lg-none` и `d-lg-block`. Без `d-lg-inline-flex` побеждает `d-none`,
   и ссылка не показывается вообще.

   ⚠️ Не полагаться на bootstrap-утилиты в этой теме: набор классов зависит
   от того, какой бандл грузится на конкретной странице. Нужное — дублировать
   здесь, тема подключена на всех страницах.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  html[data-bs-theme] body .site-navbar .bookinstitute-library-link { display: inline-flex !important; }
  html[data-bs-theme] body .site-navbar .dropdown.d-lg-block { display: block !important; }
}
@media (min-width: 1400px) {
  html[data-bs-theme] body .site-navbar .bookinstitute-library-link .d-xxl-inline { display: inline !important; }
}

/* --------------------------------------------------------------------------
   Плашки-полосы убраны (01.09.2026, по просьбе владельца):
   бежевый градиент за заголовком жанра и за строкой «Серия: …» на карточке книги.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .genre-page-header,
html[data-bs-theme] body .book-series-block {
  background: none !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* --------------------------------------------------------------------------
   Иконки шапки на страницах жанров и книг.

   ⚠️ Там грузится бандл `genre-shell-*.css`, в котором НЕТ глифов bootstrap-icons
   (правил `.bi-*::before { content: … }`). Шрифт подключён, а сопоставление
   символов — нет, поэтому иконка «Полки», «Входа» и «Регистрации» просто
   отсутствовала (у элемента ширина 0). Нужные глифы прописываем здесь, в теме,
   которая грузится на всех страницах.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .bi-bookshelf::before { content: "\f1a5"; }
html[data-bs-theme] body .bi-box-arrow-in-right::before { content: "\f1be"; }
html[data-bs-theme] body .bi-box-arrow-right::before { content: "\f1c3"; }
html[data-bs-theme] body .bi-person-plus::before { content: "\f4dd"; }
html[data-bs-theme] body .bi-person-circle::before { content: "\f4d7"; }
html[data-bs-theme] body .bi-journal-bookmark::before { content: "\f43d"; }
html[data-bs-theme] body .bi-moon-stars-fill::before { content: "\f495"; }
html[data-bs-theme] body .bi-sun-fill::before { content: "\f5a1"; }

/* 07.09.2026: в подвале на странице книги и жанра пропали иконки «Кафедры»,
   «Золотая сотня», «Идеи», «Турнир» — та же причина, глифов нет в бандлах
   `book-shell-*.css` / `genre-shell-*.css`. Кодпоинты сняты с app-*.css. */
html[data-bs-theme] body .bi-award::before { content: "\f154"; }
html[data-bs-theme] body .bi-compass::before { content: "\f2d1"; }
html[data-bs-theme] body .bi-lightning-charge::before { content: "\f46d"; }
html[data-bs-theme] body .bi-stars::before { content: "\f589"; }
html[data-bs-theme] body .bi-vector-pen::before { content: "\f604"; }
html[data-bs-theme] body .bi-lock::before { content: "\f47b"; }
html[data-bs-theme] body .bi-shield-check::before { content: "\f52f"; }

/* Плашка над списком кафедр («Книги по жанрам») — убрана по просьбе владельца.
   Тот же бежевый градиент с рамкой, что у .genre-page-header и .book-series-block. */
html[data-bs-theme] body .genres-index-hero {
  background: none !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Топ-100: текст в кнопке «Читать» стоял на 6px выше центра (блочный элемент,
   line-height меньше высоты кнопки — строка прижималась к верху контент-бокса).
   Кнопку и ячейку с оценкой центрируем флексом по обеим осям. */
html[data-bs-theme] body .top100-read-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}
html[data-bs-theme] body .tbl-mark {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Возврат ширины кнопки «Читать»: `inline-flex` сжал её по содержимому
   (112px → 47px) и текст упирался в рамку. Раньше кнопка была блочной и
   занимала всю ячейку — возвращаем это, центрирование сохраняем. */
html[data-bs-theme] body .top100-read-btn {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
}

/* ЧИТАЛКА 02.09.2026: светлая тема — чистый белый, блоки настроек без рамок */
body.reader-page:not(.theme-dark):not(.theme-sepia) { background: #ffffff !important; }
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-toolbar {
  background: #ffffff !important;
  border-bottom: 1px solid var(--bi-line) !important;
}
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-settings-drawer {
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 1px solid var(--bi-line) !important;
  box-shadow: none !important;
}
body.reader-page .reader-settings-drawer .reader-setting-block,
body.reader-page.theme-dark .reader-settings-drawer .reader-setting-block,
body.reader-page.theme-sepia .reader-settings-drawer .reader-setting-block {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-settings-drawer .btn-outline-secondary,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-settings-drawer .form-select,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-nav-btn,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-page-jump-button,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-bookmark-btn,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-scroll-toggle,
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-settings-reset {
  background: #ffffff !important;
}
/* активная кнопка темы — зелёная, как активное состояние на сайте (было золото) */
body.reader-page:not(.theme-dark):not(.theme-sepia) .reader-settings-drawer .reader-theme-group .btn.active,
body.reader-page.theme-dark .reader-settings-drawer .reader-theme-group .btn.active,
body.reader-page.theme-sepia .reader-settings-drawer .reader-theme-group .btn.active {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
  -webkit-text-fill-color: #f3eeda !important;
}

/* Рейтинг поверх обложки (02.09.2026): белая плашка + белая цифра = ничего не видно.
   Делаем тёмно-зелёную плашку темы с кремовой цифрой и золотой звездой. */
html[data-bs-theme] body .badge.bookinstitute-book-card__rating,
html[data-bs-theme] body .badge.bookinstitute-cover-rating {
  background: rgba(18, 47, 36, .88) !important;
  background-color: rgba(18, 47, 36, .88) !important;
  border: 1px solid rgba(184, 146, 60, .55) !important;
  color: #f3eeda !important;
  -webkit-text-fill-color: #f3eeda !important;
  box-shadow: 0 4px 12px rgba(9, 24, 18, .35) !important;
}
html[data-bs-theme] body .badge.bookinstitute-book-card__rating span,
html[data-bs-theme] body .badge.bookinstitute-cover-rating span {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}
html[data-bs-theme] body .badge.bookinstitute-book-card__rating .bi-star-fill,
html[data-bs-theme] body .badge.bookinstitute-cover-rating .bi-star-fill {
  color: var(--bi-gold) !important;
  -webkit-text-fill-color: var(--bi-gold) !important;
}

/* ВАРИАНТ B «РАЗВОРОТ» на странице книги (02.09.2026) */
html[data-bs-theme] body .bi-book-eyebrow{
  font-family:'Golos Text',sans-serif;font-size:.68rem;letter-spacing:.22em;text-transform:uppercase;
  color:var(--bi-gold);margin-bottom:6px;
}
html[data-bs-theme] body .bi-rating-count{
  font-family:'Golos Text',sans-serif;font-size:.86rem;color:var(--bi-muted);margin-left:6px;font-weight:400;
}
html[data-bs-theme] body .bi-facts{
  display:grid;grid-template-columns:1fr 1fr;gap:0 40px;margin:22px 0 26px;padding:6px 0;
  border-top:1px solid var(--bi-line);border-bottom:1px solid var(--bi-line);
}
html[data-bs-theme] body .bi-fact{
  display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:10px 0;
  border-bottom:1px dotted var(--bi-line);font-family:'Golos Text',sans-serif;font-size:.84rem;margin:0;
}
html[data-bs-theme] body .bi-facts .bi-fact:nth-last-child(-n+2){border-bottom:0}
html[data-bs-theme] body .bi-fact dt{color:var(--bi-muted);font-weight:400;white-space:nowrap}
html[data-bs-theme] body .bi-fact dd{margin:0;color:var(--bi-ink);text-align:right}
html[data-bs-theme] body .bi-fact dd a{color: var(--bi-green-text);border-bottom:1px solid var(--bi-gold-soft)}
html[data-bs-theme] body .bi-fact dd a:hover{color: var(--bi-title);border-bottom-color:var(--bi-gold)}
html[data-bs-theme] body .bi-fact__age{
  display:inline-block;margin-left:8px;padding:1px 7px;border:1px solid var(--bi-line);border-radius:2px;
  font-size:.72rem;color:var(--bi-muted);
}
html[data-bs-theme] body .bi-fact__empty{color:var(--bi-muted);font-style:italic}
@media(max-width:767.98px){html[data-bs-theme] body .bi-facts{grid-template-columns:1fr;gap:0}
  html[data-bs-theme] body .bi-facts .bi-fact:nth-last-child(2){border-bottom:1px dotted var(--bi-line)}}

html[data-bs-theme] body .bi-your-rating__label{
  display:block;font-family:'Golos Text',sans-serif;font-size:.66rem;letter-spacing:.2em;
  text-transform:uppercase;color:var(--bi-muted);margin-bottom:8px;
}
html[data-bs-theme] body .bi-stats-subtitle{
  font-family:'Golos Text',sans-serif;font-size:.66rem;letter-spacing:.2em;text-transform:uppercase;
  color:var(--bi-muted);margin-bottom:14px;
}
html[data-bs-theme] body .bi-stats-progress{background:var(--bi-paper-deep) !important;height:7px}
html[data-bs-theme] body .book-stats-section .progress-bar.bi-status-bar{
  background:linear-gradient(90deg,var(--bi-green),#2f6b51) !important;
}
html[data-bs-theme] body .book-stats-section .book-stats-progress{background:var(--bi-paper-deep) !important}

/* ==========================================================================
   ПРОВЕРКА ВЁРСТКИ 07.09.2026 — правки по аудиту сайта.
   Версия темы: alma69.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Страница автора уезжала вправо на телефоне.

   `.row.g-5` берёт gutter 3rem, то есть margin-left/right −24px, а у
   `.container` поля всего 12px — на каждую сторону вылезало по 12px, и
   документ на окне 390 становился 402. На узких экранах жёлоб в 48px всё
   равно избыточен, поэтому сводим его к контейнерному.
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  html[data-bs-theme] body .row.g-5,
  html[data-bs-theme] body .row.gx-5 { --bs-gutter-x: 1.5rem !important; }
}

/* Пагинация не переносилась (flex-wrap: nowrap) и на планшете вылезала
   за экран: при 768 документ становился 804. */
html[data-bs-theme] body .pagination {
  flex-wrap: wrap !important;
  justify-content: center;
  row-gap: .4rem;
}

/* --------------------------------------------------------------------------
   2. Шапка залогиненного не помещалась в свой контейнер.

   `.site-navbar .container-fluid` ограничен 1400px, а меню + поиск + «Полка»
   со словом + имя пользователя требуют ~1180px при доступных 1095. На окне
   1440 меню пользователя выходило на 1449 и появлялась боковая прокрутка.
   Слово «Полка» у иконки убираем (иконка с подсказкой остаётся), поле поиска
   и отступы пунктов ужимаем, длинное имя подрезаем многоточием.

   ⚠️ Правила ловят залогиненного через `:has(#navbarDropdown)` — у гостя
   этого блока нет, и его шапка остаётся прежней. `:has()` с id поднимает
   специфичность до (1,x,x), поэтому старое правило показа слова «Полка»
   с (0,4,3) больше не побеждает.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* в этой полосе слева включается компактная иконка поиска — но вместе с ней
     показывались ещё и дубли входа/профиля, хотя те же кнопки есть справа */
  html[data-bs-theme] body .site-navbar > .container-fluid > div.d-lg-none > a:not([aria-label="Поиск"]) {
    display: none !important;
  }
}
@media (min-width: 1200px) {
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) .bookinstitute-library-link .d-xxl-inline {
    display: none !important;
  }
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) form[role="search"] { min-width: 190px !important; }
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) .navbar-nav .nav-item .nav-link {
    padding-left: .34rem !important;
    padding-right: .34rem !important;
  }
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) #navbarDropdown > span {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (min-width: 1200px) and (max-width: 1319.98px) {
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) form[role="search"] { min-width: 150px !important; }
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) .navbar-nav .nav-item .nav-link {
    font-size: .82rem !important;
    padding-left: .26rem !important;
    padding-right: .26rem !important;
  }
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) .mx-xl-4 {
    margin-left: .6rem !important;
    margin-right: .6rem !important;
  }
}

/* --------------------------------------------------------------------------
   3. Иконки шапки плохо читались на зелёном.

   `text-white-50` на бургере, поиске и входе даёт контраст около 2.5:1
   на тёмной зелени. Поднимаем до кремового.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .site-navbar .text-white-50,
html[data-bs-theme] body .site-navbar a.text-white-50,
html[data-bs-theme] body .site-navbar .btn.text-white-50 { color: #ece3cb !important; }
html[data-bs-theme] body .site-navbar .text-white-50:hover,
html[data-bs-theme] body .site-navbar .text-white-50:focus-visible { color: #fffdf4 !important; }
html[data-bs-theme] body .site-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ece3cb' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.4' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
html[data-bs-theme] body .site-navbar .navbar-toggler:focus-visible {
  box-shadow: 0 0 0 3px rgba(184, 146, 60, .5) !important;
}
html[data-bs-theme] body .site-navbar .bookinstitute-library-link { color: #ece3cb !important; }
html[data-bs-theme] body .site-navbar .bookinstitute-library-link:hover { color: #fffdf4 !important; }

/* --------------------------------------------------------------------------
   4. На телефоне книги начинались только на третьем экране (верх сетки
   был на 1706px при окне 390). Ужимаем вступление, полки фонда и плитку
   разделов — сам состав блоков не трогаем.
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  html[data-bs-theme] body .bookinstitute-home-hero { padding-top: 18px !important; margin-bottom: 28px !important; }
  html[data-bs-theme] body .bookinstitute-home-hero__eyebrow { margin-bottom: 10px !important; }
  html[data-bs-theme] body .bookinstitute-home-hero__title { font-size: 1.68rem !important; margin-bottom: 10px !important; }
  html[data-bs-theme] body .bookinstitute-home-hero__text { font-size: .96rem !important; line-height: 1.5 !important; }
  html[data-bs-theme] body .bookinstitute-home-hero__actions {
    margin-top: 16px !important;
    flex-direction: row !important;
    gap: 8px !important;
  }
  html[data-bs-theme] body .bookinstitute-home-hero__actions > a {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding-left: .6rem !important;
    padding-right: .6rem !important;
    font-size: .86rem !important;
    text-align: center;
  }
  html[data-bs-theme] body .bookinstitute-home-hero__signals {
    margin-top: 16px !important;
    gap: 10px 16px !important;
    font-size: .78rem !important;
  }
  html[data-bs-theme] body .bi-fond-stats { margin-top: 20px !important; }
  html[data-bs-theme] body .bi-fond-stats__item { padding: 10px 8px !important; }
  html[data-bs-theme] body .bookinstitute-home-routes {
    margin-top: 22px !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px !important;
  }
  html[data-bs-theme] body .bookinstitute-home-routes__item { padding: 8px 10px !important; }
  html[data-bs-theme] body .bookinstitute-home-routes__meta { display: none !important; }
  html[data-bs-theme] body .bookinstitute-home-routes__label { font-size: .86rem !important; }
  html[data-bs-theme] body .bookinstitute-catalog-head { margin-bottom: 14px !important; }
  html[data-bs-theme] body .bookinstitute-catalog-head__title { font-size: 1.3rem !important; }
  html[data-bs-theme] body .catalog-filter-toolbar { margin-bottom: 24px !important; }
}


/* --------------------------------------------------------------------------
   5. Кабинет и «Личное дело» держали донорскую голубую палитру: подчёркивание
   вкладок и счётчики #4ea1ea, светло-голубые панели подписок, голубой
   переключатель раскладки. Свои элементы сайта приводим к зелёно-золотому.
   Фирменные цвета кнопок VK/Telegram/ОК при этом не трогаем.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .library-main-switcher-wrap,
html[data-bs-theme] body .profile-section-switcher { border-bottom-color: var(--bi-line) !important; }
html[data-bs-theme] body .library-main-switcher .nav-link { color: var(--bi-muted) !important; }
html[data-bs-theme] body .library-main-switcher .nav-link.active,
html[data-bs-theme] body .library-main-switcher .nav-link:hover {
  color: var(--bi-title) !important;
  border-bottom-color: var(--bi-gold) !important;
}
html[data-bs-theme] body .library-main-switcher__badge {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
}
html[data-bs-theme] body .profile-section-tab { color: var(--bi-muted) !important; }
html[data-bs-theme] body .profile-section-tab:hover { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .profile-section-tab--active { color: var(--bi-title) !important; }
html[data-bs-theme] body .profile-section-tab--active:after { background: var(--bi-gold) !important; }

html[data-bs-theme] body .follow-watch-mobile-switcher {
  background: var(--bi-paper-deep) !important;
  border-color: var(--bi-line) !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .follow-watch-mobile-switcher__tab {
  color: var(--bi-muted) !important;
  border-radius: 3px !important;
}
html[data-bs-theme] body .follow-watch-mobile-switcher__tab.is-active {
  background: var(--bi-card) !important;
  color: var(--bi-title) !important;
  box-shadow: inset 0 0 0 1px var(--bi-line) !important;
}

html[data-bs-theme] body .library-layout-switch {
  background: var(--bi-paper-deep) !important;
  border-color: var(--bi-line) !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .library-layout-switch__button { color: var(--bi-muted) !important; border-radius: 3px !important; }
html[data-bs-theme] body .library-layout-switch__button.is-active {
  background: var(--bi-green) !important;
  color: #f3eeda !important;
  box-shadow: none !important;
  transform: none !important;
}
html[data-bs-theme] body .library-genre-dropdown__button,
html[data-bs-theme] body .library-toolbar-select {
  border-color: var(--bi-line) !important;
  background: var(--bi-card) !important;
  color: var(--bi-ink) !important;
  box-shadow: none !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .library-genre-dropdown__button:hover,
html[data-bs-theme] body .library-genre-dropdown__button:focus,
html[data-bs-theme] body .library-genre-dropdown__button:active {
  background: var(--bi-card) !important;
  color: var(--bi-ink) !important;
  border-color: var(--bi-gold) !important;
}
html[data-bs-theme] body .library-sort-dropdown__button { border-radius: 4px !important; }

html[data-bs-theme] body .collection-book-picker {
  background: var(--bi-paper) !important;
  border-color: var(--bi-line) !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .collection-book-card {
  background: var(--bi-card) !important;
  border-color: var(--bi-line) !important;
  border-radius: 4px !important;
}
html[data-bs-theme] body .collection-book-card:hover { border-color: var(--bi-gold) !important; box-shadow: none !important; }
html[data-bs-theme] body .collection-book-card.is-selected {
  background: var(--bi-green-soft) !important;
  border-color: var(--bi-green) !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .collection-book-card__title { color: var(--bi-title) !important; }
html[data-bs-theme] body .collection-book-card__meta { color: var(--bi-muted) !important; }
html[data-bs-theme] body .collection-showcase-card__stats { color: var(--bi-muted) !important; }
html[data-bs-theme] body .collection-showcase-card__stat i { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .collection-showcase-card__stat:first-child i { color: var(--bi-gold) !important; }
html[data-bs-theme] body .collection-showcase-card__nav,
html[data-bs-theme] body .profile-collection-books-nav {
  background: var(--bi-card) !important;
  border-color: var(--bi-line) !important;
  color: var(--bi-green-text) !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .profile-collection-books-nav:hover { color: var(--bi-title) !important; border-color: var(--bi-gold) !important; }
html[data-bs-theme] body .profile-edit-form__choice-input:checked + .profile-edit-form__choice-label {
  background: var(--bi-green-soft) !important;
  border-color: var(--bi-green) !important;
  color: var(--bi-title) !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .profile-edit-form__choice-label { color: var(--bi-ink-soft) !important; border-color: var(--bi-line) !important; }
html[data-bs-theme] body .rank-guide-popover {
  background: var(--bi-card) !important;
  color: var(--bi-ink) !important;
  border-color: var(--bi-line) !important;
}
html[data-bs-theme] body .rank-guide-popover:before {
  background: var(--bi-card) !important;
  border-left-color: var(--bi-line) !important;
  border-top-color: var(--bi-line) !important;
}
html[data-bs-theme] body .reader-month-row__place {
  background: var(--bi-green-soft) !important;
  color: var(--bi-title) !important;
}
html[data-bs-theme] body .reading-chart__bar--active { background: linear-gradient(180deg, var(--bi-gold), var(--bi-green)) !important; box-shadow: none !important; }
html[data-bs-theme] body .reading-chart__bar--peak { background: linear-gradient(180deg, #d8ac4c, var(--bi-green-deep)) !important; box-shadow: none !important; }
html[data-bs-theme] body .reading-chart__value,
html[data-bs-theme] body .reading-chart__label { color: var(--bi-muted) !important; }
html[data-bs-theme] body .reading-chart__item--peak .reading-chart__value { color: var(--bi-title) !important; }
html[data-bs-theme] body .achievement-rank-card {
  background: linear-gradient(180deg, var(--bi-card), var(--bi-paper-deep)) !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .bg-primary-subtle { background-color: var(--bi-green-soft) !important; }
html[data-bs-theme] body .text-primary-emphasis { color: var(--bi-title) !important; }
html[data-bs-theme] body .border-primary-subtle { border-color: var(--bi-line) !important; }
html[data-bs-theme] body .profile-sidebar-card { border-radius: 6px !important; }

/* --------------------------------------------------------------------------
   6. Часть вкладок пряталась за краем ленты, и понять, что справа есть
   продолжение, было нельзя: у обеих лент скрыт скроллбар. Ставим классические
   тени прокрутки — они появляются, только когда лента реально длиннее экрана.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .library-main-switcher,
html[data-bs-theme] body .profile-section-switcher,
html[data-bs-theme] body .nav-pills-mobile-scroll,
html[data-bs-theme] body .bi-tabs__row {
  background-image:
    linear-gradient(90deg, var(--bi-paper) 32%, rgba(246, 241, 227, 0)),
    linear-gradient(90deg, rgba(246, 241, 227, 0), var(--bi-paper) 68%),
    radial-gradient(farthest-side at 0 50%, rgba(36, 31, 22, .3), rgba(36, 31, 22, 0)),
    radial-gradient(farthest-side at 100% 50%, rgba(36, 31, 22, .3), rgba(36, 31, 22, 0));
  background-position: left center, right center, left center, right center;
  background-size: 38px 100%, 38px 100%, 17px 100%, 17px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

/* --------------------------------------------------------------------------
   7. На телефоне «Читать онлайн» пряталось под обложкой, формуляром и
   жанрами — до кнопки было 1431px от верха страницы. Поднимаем действия
   сразу под строку автора и убираем лишнюю высоту обложки.
   -------------------------------------------------------------------------- */
@media (max-width: 767.98px) {
  html[data-bs-theme] body .book-page-main-column { display: flex; flex-direction: column; }
  html[data-bs-theme] body .book-page-main-column > * { order: 3; }
  html[data-bs-theme] body .book-page-main-column > .book-primary-meta { order: 1; }
  html[data-bs-theme] body .book-page-main-column > .book-actions-section { order: 2; margin-bottom: 1.75rem !important; }
  /* обложка задана инлайном max-width:300px → 450px по высоте (2/3);
     на телефоне это почти весь первый экран */
  html[data-bs-theme] body .card-cover { max-width: 210px !important; }
  /* у картинки есть атрибут height="450" — он побеждает aspect-ratio,
     и суженная обложка осталась бы прежней высоты */
  html[data-bs-theme] body .card-cover img { height: auto !important; }
}


/* Остатки донорского серо-синего в кабинете: подписи медалей и буква в аватаре
   (буква рисовалась цветом #1e293b по зелёному кругу). */
html[data-bs-theme] body .achievement-medal-card__text,
html[data-bs-theme] body .achievement-medal-card__label,
html[data-bs-theme] body .achievement-medal__tooltip-text { color: var(--bi-muted) !important; }
html[data-bs-theme] body .achievement-medal__tooltip { color: var(--bi-ink) !important; }
html[data-bs-theme] body .avatar.bg-primary,
html[data-bs-theme] body .site-navbar .avatar.bg-primary { color: #f3eeda !important; }


/* --------------------------------------------------------------------------
   Ночь: донорские правила, которые ЖИВУТ ТОЛЬКО В ТЁМНОЙ ТЕМЕ.
   На светлой их не видно, поэтому и не всплывали раньше: движок инвертирует
   кнопки (btn-primary становится почти белой) и красит часть текста
   сланцево-серым, который на тёмной бумаге проваливается.
   -------------------------------------------------------------------------- */
html[data-bs-theme="dark"] body .btn-primary:not(.bookinstitute-register-btn) {
  background: var(--bi-green) !important;
  border-color: var(--bi-green) !important;
  color: #f3eeda !important;
}
html[data-bs-theme="dark"] body .btn-outline-info,
html[data-bs-theme="dark"] body .btn-outline-info span {
  color: #8fd0e4 !important;
  border-color: rgba(143, 208, 228, .45) !important;
}
html[data-bs-theme="dark"] body .btn-outline-success,
html[data-bs-theme="dark"] body .btn-outline-success span {
  color: #8cc7a8 !important;
  border-color: rgba(140, 199, 168, .45) !important;
}
html[data-bs-theme="dark"] body .btn-outline-danger,
html[data-bs-theme="dark"] body .btn-outline-danger span { color: #e0907f !important; border-color: rgba(224, 144, 127, .45) !important; }
html[data-bs-theme="dark"] body .breadcrumb-link-simple,
html[data-bs-theme="dark"] body .breadcrumb a,
html[data-bs-theme="dark"] body .breadcrumb,
html[data-bs-theme="dark"] body .top100-hero__text,
html[data-bs-theme="dark"] body .collections-hero__text,
html[data-bs-theme="dark"] body .genres-index-subtitle,
html[data-bs-theme="dark"] body .author-bio-content,
html[data-bs-theme="dark"] body .series-description-content { color: var(--bi-ink-soft) !important; }

/* медальные номера первой тройки «Золотой сотни» — на тёмном нужны светлее */
html[data-bs-theme="dark"] body .tbl-row--m1 .tbl-pos__num,
html[data-bs-theme="dark"] body #top100-list > div:nth-child(1) .rank-number { color: #e3bb55 !important; }
html[data-bs-theme="dark"] body .tbl-row--m2 .tbl-pos__num,
html[data-bs-theme="dark"] body #top100-list > div:nth-child(2) .rank-number { color: #bcc4ce !important; }
html[data-bs-theme="dark"] body .tbl-row--m3 .tbl-pos__num,
html[data-bs-theme="dark"] body #top100-list > div:nth-child(3) .rank-number { color: #d19a6c !important; }

/* ⚠️ В `catalog/top100.blade.php` есть свой <style> с правилом
   `[data-bs-theme="dark"] .top100-page .top100-hero .top100-hero__text{color:#4a3a25!important}`
   — вес (0,4,0), писалось когда ночи не было. Перебиваем весом (0,5,2). */
html[data-bs-theme="dark"] body .top100-page .top100-hero .top100-hero__text {
  color: var(--bi-ink-soft) !important;
}

/* --------------------------------------------------------------------------
   Шапка, посадка блоков (08.09.2026): поле поиска на широких экранах
   раздувалось до своего инлайнового потолка в 500px и отжимало меню,
   а между логотипом, пунктами и поиском оставались лишние отступы.
   ⚠️ `min-width` у залогиненного задан правилом с `:has(#navbarDropdown)`
   (вес с id), поэтому здесь трогаем только потолок и поля.
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  html[data-bs-theme] body .site-navbar form[role="search"],
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) form[role="search"] {
    max-width: 290px !important;
    margin-left: .34rem !important;
    margin-right: .34rem !important;
  }
  html[data-bs-theme] body .site-navbar .navbar-brand,
  html[data-bs-theme] body .site-navbar:has(#navbarDropdown) .navbar-brand { margin-right: .3rem !important; }
  html[data-bs-theme] body .site-navbar .navbar-nav { margin-left: 0 !important; }
}
html[data-bs-theme="dark"] body .reader-race-hero__note,
html[data-bs-theme="dark"] body .reader-month-callout__link { color: #e0b25f !important; }
/* мобильный дубль переключателя живёт в верхней строке, а не в бургере */
.bookinstitute-theme-toggle--mobile { width: 32px !important; height: 32px !important; }
@media (min-width: 992px) { .bookinstitute-theme-toggle--mobile { display: none !important; } }

/* --------------------------------------------------------------------------
   Блок «О книге»: кнопка «Раскрыть описание» и растворение текста остались
   донорскими — голубая таблетка (#075985 по rgba(78,161,234,.1)) и голубая
   линия-разделитель, а градиент затухания уходил в БЕЛЫЙ, хотя страница
   кремовая, отчего под текстом висела светлая полоса.
   Все четыре цвета заданы переменными на `.book-description-wrap` — правим их.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .book-description-wrap {
  --book-description-bg-rgb: 246, 241, 227;
  --book-description-line: rgba(184, 146, 60, .38);
  --book-description-pill-bg: rgba(29, 74, 56, .08);
  --book-description-pill-text: var(--bi-green-text);
}
html[data-bs-theme="dark"] body .book-description-wrap {
  --book-description-bg-rgb: 19, 28, 24;
  --book-description-line: rgba(197, 162, 86, .4);
  --book-description-pill-bg: rgba(140, 199, 168, .12);
  --book-description-pill-text: var(--bi-green-text);
}
html[data-bs-theme] body .book-description-toggle {
  border: 1px solid var(--bi-line) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  font-family: 'Golos Text', sans-serif !important;
}
html[data-bs-theme] body .book-description-toggle:hover,
html[data-bs-theme] body .book-description-toggle:focus {
  color: var(--bi-green-deep) !important;
  background: var(--bi-green-soft) !important;
  border-color: var(--bi-gold) !important;
  box-shadow: none !important;
}
html[data-bs-theme="dark"] body .book-description-toggle:hover,
html[data-bs-theme="dark"] body .book-description-toggle:focus {
  color: var(--bi-title) !important;
  background: var(--bi-green-soft) !important;
}
html[data-bs-theme] body .book-description-toggle:focus-visible {
  outline: 2px solid var(--bi-gold) !important;
  outline-offset: 2px;
}

/* Кнопки форматов рядом («Скачать TXT / FB2 / EPUB») — та же донорская гамма:
   #075985 синий, #155e75 бирюзовый, #166534 зелёный вразнобой. */
html[data-bs-theme] body .download-link.btn-outline-primary,
html[data-bs-theme] body .download-link.btn-outline-info,
html[data-bs-theme] body .download-link.btn-outline-success {
  color: var(--bi-green-text) !important;
  border-color: var(--bi-line) !important;
  border-radius: 3px !important;
}
html[data-bs-theme] body .download-link.btn-outline-primary:hover,
html[data-bs-theme] body .download-link.btn-outline-info:hover,
html[data-bs-theme] body .download-link.btn-outline-success:hover {
  color: var(--bi-green-deep) !important;
  background: var(--bi-green-soft) !important;
  border-color: var(--bi-gold) !important;
}
html[data-bs-theme="dark"] body .download-link.btn-outline-primary:hover,
html[data-bs-theme="dark"] body .download-link.btn-outline-info:hover,
html[data-bs-theme="dark"] body .download-link.btn-outline-success:hover { color: var(--bi-title) !important; }

/* --------------------------------------------------------------------------
   Карусель «Подборки книг, которые цепляют» на странице книги (10.09.2026).

   Карточки остались донорскими: голубые радиальные градиенты по
   `linear-gradient(135deg,#f8fbff,#eef6ff,#e3f0ff)`, рамка #bfdbfe, скругление
   26px и сланцевый заголовок #243149 — на кремовой бумаге чужеродно.
   Приводим к формуляру темы: кремовая карточка, тонкая линия, радиус 4px.

   ⚠️ У доноров звёздочка рейтинга красится правилом
   `__meta span:nth-child(2) i { color:#fbbf24 }` — то есть по ПОРЯДКУ, а не по
   смыслу. Рейтинги пока нулевые, блок со звездой не выводится, и золотым
   становился глазик просмотров. Красим по классу иконки, а не по позиции.
   -------------------------------------------------------------------------- */
html[data-bs-theme] body .book-page-collection-card {
  background: linear-gradient(160deg, var(--bi-card), var(--bi-paper-deep)) !important;
  border: 1px solid var(--bi-line) !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .book-page-collection-card:hover {
  border-color: var(--bi-gold) !important;
  box-shadow: 0 10px 22px rgba(29, 55, 44, .12) !important;
}
html[data-bs-theme] body .book-page-collection-card__title {
  color: var(--bi-title) !important;
  font-family: 'Old Standard TT', serif !important;
  font-weight: 700;
  letter-spacing: .01em;
}
html[data-bs-theme] body .book-page-collection-card__eyebrow {
  color: var(--bi-gold) !important;
  font-family: 'Golos Text', sans-serif !important;
}
html[data-bs-theme] body .book-page-collection-card__meta {
  color: var(--bi-muted) !important;
  font-family: 'Golos Text', sans-serif !important;
}
html[data-bs-theme] body .book-page-collection-card__meta span:first-child {
  color: var(--bi-green-text) !important;
  font-weight: 700;
}
html[data-bs-theme] body .book-page-collection-card__meta i { color: var(--bi-green-text) !important; }
html[data-bs-theme] body .book-page-collection-card__meta i.bi-star-fill { color: var(--bi-gold) !important; }
html[data-bs-theme] body .book-page-collection-card__cover {
  border-radius: 2px !important;
  border: 1px solid var(--bi-line) !important;
  box-shadow: 0 8px 16px rgba(29, 55, 44, .22) !important;
}
html[data-bs-theme] body .book-page-collections-slider { scrollbar-color: var(--bi-line) transparent; }
html[data-bs-theme] body .book-page-collections-slider::-webkit-scrollbar-thumb {
  background: var(--bi-line) !important;
  border-radius: 2px;
}
html[data-bs-theme] body .book-page-collections-slider-nav {
  background: var(--bi-card) !important;
  border: 1px solid var(--bi-line) !important;
  color: var(--bi-green-text) !important;
  border-radius: 3px !important;
  box-shadow: none !important;
}
html[data-bs-theme] body .book-page-collections-slider-nav:hover { border-color: var(--bi-gold) !important; }
