/* Sokol Room — её дизайн по примеру scripts/ref-design.webp: готика, тонкое золото, рамки со
   срезанными углами, Cormorant Garamond. Палитра A (её выбор): слоновая кость / почти чёрный.
   Грузится после app.css и поверх него. */

:root {
  --sr-bg: #f3eee5;
  --sr-card: #ece5d8;
  --sr-text: #231c15;
  --sr-gold: #a8834e;
  --sr-line: #c9b08a;
  --sr-muted: #7d6b57;
  --sr-cover: #d8cbb6;
  --sr-serif: 'Cormorant Garamond', 'PT Serif', Georgia, serif;
  /* старые переменные читалки — в новую палитру (остальные страницы подхватят цвета) */
  --bg: var(--sr-bg);
  --text: var(--sr-text);
  --muted: var(--sr-muted);
  --line: rgba(168, 131, 78, .28);
  --accent: #8f6a37;
  --read-bg: #f5f0e8;
  /* боковые арки (тонкие линии) */
  --sr-arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='240' viewBox='0 0 24 240' fill='none' stroke='%23c9b08a' stroke-width='.8'%3E%3Cpath d='M12 0v240M5 0v240' stroke-opacity='.45'/%3E%3Cpath d='M5 70Q5 40 12 28Q19 40 19 70V120H5Z' stroke-opacity='.55'/%3E%3Cpath d='M8 118V78Q8 60 12 50Q16 60 16 78V118' stroke-opacity='.4'/%3E%3Cpath d='M12 170l2 6 6 2-6 2-2 6-2-6-6-2 6-2Z' fill='%23c9b08a' fill-opacity='.5' stroke='none'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] {
  --sr-bg: #0e0c0a;
  --sr-card: #17130f;
  --sr-text: #ece2d1;
  --sr-gold: #c9a467;
  --sr-line: #5e4b31;
  --sr-muted: #a8977f;
  --sr-cover: #2a231c;
  --line: rgba(201, 164, 103, .2);
  --accent: #d9b77c;
  --read-bg: #12100d;
  --sr-arch: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='240' viewBox='0 0 24 240' fill='none' stroke='%237a6240' stroke-width='.8'%3E%3Cpath d='M12 0v240M5 0v240' stroke-opacity='.5'/%3E%3Cpath d='M5 70Q5 40 12 28Q19 40 19 70V120H5Z' stroke-opacity='.6'/%3E%3Cpath d='M8 118V78Q8 60 12 50Q16 60 16 78V118' stroke-opacity='.45'/%3E%3Cpath d='M12 170l2 6 6 2-6 2-2 6-2-6-6-2 6-2Z' fill='%23c9a467' fill-opacity='.45' stroke='none'/%3E%3C/svg%3E");
}

/* кристаллы первой читалки (картинки рамок) — выключаем везде */
:root, :root[data-theme="dark"] {
  --cp-img: none; --cr-img: none; --cd-img: none; --co-img: none; --cs-img: none;
  --c-drop: none; --c-text: var(--sr-text); --c-text-shadow: none;
}

html, body { background: var(--sr-bg); color: var(--sr-text); }
/* поля страницы шире — по краям арки */
/* её решение: читалка чуть уже (≈5% с каждой стороны), чтобы рисунки по бокам помещались */
/* старые украшения заголовков (✦ перед текстом, блики) */
.section-title::before, .section-title::after, .hero-label::before, .hero-label::after { content: none !important; display: none !important; }
/* фон без огоньков первой читалки; по краям — тонкие готические арки, как в примере */
body:not(.plain) {
  background-image: var(--sr-arch), var(--sr-arch);
  background-position: left 2px top, right 2px top;
  background-repeat: repeat-y;
  background-size: 14px auto; /* рисунки по бокам меньше (её решение) */
}
body::before, body::after { display: none !important; }

/* ---------- рамки со срезанными углами ---------- */
/* .sr-cut — золотая линия 1px по контуру восьмиугольника: внешний слой — золото, ::before — фон */
.sr-hero-frame, .main-nav, .sr-btn, .sr-channel, .sr-pill-frame, .reading-row {
  --cut: 10px;
  position: relative;
  isolation: isolate;
  background: var(--sr-line);
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.sr-hero-frame::before, .main-nav::before, .sr-btn::before, .sr-channel::before, .reading-row::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--sr-bg);
  clip-path: inherit;
}
/* вытянутые кнопки — острые бока (как «Читать дальше» в примере) */
.main-nav, .sr-btn, .sr-channel {
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 14px 100%, 0 50%);
}

/* ---------- все кнопки читалки: вместо кристаллов — тонкая золотая линия ----------
   (селектор как у кристаллов первой читалки в app.css — иначе их !important не перебить) */
:is(.btn, .channel-card, .icon-btn, .chip-btn, .fav-btn, .seg-btn, .pager-btn):not(.cover-stack *):not(.cover-top *) {
  border-image: none !important;
  border-style: solid !important;
  border-width: 1px !important;
  border-color: var(--sr-line) !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: var(--sr-text) !important;
  text-shadow: none !important;
  filter: none !important;
  font-family: var(--sr-serif);
  font-weight: 500 !important;
  font-size: 16px;
}
.btn:not(.ghost):not(.danger):not(.cover-stack *), .channel-card { border-color: var(--sr-gold) !important; }
:is(.seg-btn, .pager-btn, .chip-btn).on:not(.cover-stack *):not(.cover-top *) {
  background: var(--sr-gold) !important;
  border-color: var(--sr-gold) !important;
  color: var(--sr-bg) !important;
}
.icon-btn:not(.cover-stack *):not(.cover-top *) {
  --gh: 34px;
  border-radius: 50% !important;
  color: var(--sr-gold) !important;
}
.icon-btn.wide:not(.cover-stack *):not(.cover-top *), .icon-btn.home-btn:not(.cover-stack *):not(.cover-top *) {
  border-radius: 999px !important;
  color: var(--sr-text) !important;
  padding: 0 14px;
}

/* ---------- шапка ---------- */
.topbar { align-items: center; gap: 8px; padding-top: 4px; }
.topbar h1 { flex: 1; margin: 0; }
.topbar .title-link, .topbar .title-brand {
  font-family: var(--sr-serif);
  font-weight: 500;
  font-size: clamp(24px, 7.4vw, 34px);
  white-space: nowrap;
  letter-spacing: .01em;
  color: var(--sr-text) !important;
  background: none !important;
  -webkit-text-fill-color: var(--sr-text) !important;
  text-shadow: none !important;
  animation: none !important;
}
.topbar .title-link::before, .topbar .title-link::after { display: none; }
.topbar .icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--sr-line) !important;
  border-image: none !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  filter: none !important;
  color: var(--sr-gold) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar .icon-btn::before, .topbar .icon-btn::after { display: none; }
.topbar .icon-btn.wide {
  width: auto;
  border-radius: 999px !important;
  padding: 0 14px;
  font-family: var(--sr-serif);
  font-size: 16px;
  color: var(--sr-text);
}
.topbar .home-btn { width: auto; border-radius: 999px; padding: 0 12px; color: var(--sr-text); font-family: var(--sr-serif); font-size: 16px; }
.line-ico { width: 20px; height: 20px; display: block; }
.line-ico .fill { fill: none; }
.line-ico.lit .fill { fill: currentColor; }
.line-ico .solid { fill: currentColor; stroke: none; }
/* крестик «закрыть / убрать» (её выбор 1Б) — золотой */
.x-ico { width: 20px; height: 20px; margin: auto; color: var(--sr-gold); }
.hero-x .x-ico { width: 16px; height: 16px; color: inherit; }
.overlay .close .x-ico { width: 24px; height: 24px; color: #d9b77c; }
.overlay .close { display: flex; align-items: center; justify-content: center; }
/* крестик — без круга и рамки (её решение) */
html:root .x-btn.x-btn.x-btn, html:root .x-btn.x-btn.x-btn:not(.cover-stack *):not(.cover-top *) {
  border: 0 !important;
  border-image: none !important;
  background: transparent !important;
  box-shadow: none !important;
  clip-path: none !important;
}
html:root .x-btn::before, html:root .x-btn::after { display: none !important; }
.sr-hero .x-btn .x-ico { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.fs-ico { width: 18px; height: 18px; stroke-width: 1.4; }

/* меню: Главная ✦ Каталог ✦ Мои чтения */
.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  margin: 12px 0 14px;
  padding: 8px 18px;
  font-family: var(--sr-serif);
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.nav-link { color: var(--sr-text); text-decoration: none; padding: 2px 4px; }
.nav-link.on { color: var(--sr-gold); }
.nav-star { color: var(--sr-gold); font-size: 11px; }

/* ---------- баннер «Вы остановились здесь» ---------- */
.sr-hero { margin: 0 0 6px; }
.sr-hero-frame { --cut: 14px; display: flex; align-items: stretch; gap: 10px; padding: 18px 16px 18px 20px; min-height: 210px; }
.sr-hero-frame.many { cursor: pointer; }
.sr-hero-info { flex: 1 1 55%; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.sr-hero .hero-label {
  font-family: var(--sr-serif);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sr-muted);
  background: none;
  padding: 0;
}
.sr-hero .hero-label, .sr-hero .hero-chapter, .sr-hero .hero-notes { opacity: 1 !important; -webkit-text-fill-color: currentColor; }
.sr-hero .hero-title {
  font-family: var(--sr-serif);
  font-weight: 500;
  font-size: clamp(16px, 4.2vw, 29px); /* её правка: на 65% от прежнего */
  line-height: 1.05;
  text-transform: uppercase;
  margin: 8px 0 8px;
  color: var(--sr-text) !important;
  -webkit-text-fill-color: var(--sr-text) !important;
  background: none !important;
  opacity: 1 !important;
  overflow-wrap: anywhere;
}
.sr-hero .hero-chapter { font-size: 14px; color: var(--sr-text); }
.sr-hero .hero-notes { font-size: 12px; color: var(--sr-muted); margin-top: 4px; min-height: 0; }
.sr-hero .progress, .reading-info .progress { display: block; overflow: hidden; }
.sr-hero .progress > *, .reading-info .progress > * { display: block; height: 100%; }
.sr-hero .progress { margin: 8px 0 2px; height: 2px; background: var(--sr-line); border-radius: 0; box-shadow: none; }
.sr-hero .progress > * { background: var(--sr-gold); border-radius: 0; box-shadow: none; }
.sr-hero-cover { flex: 0 0 38%; position: relative; display: flex; align-items: center; justify-content: center; }
.sr-hero-cover .halo {
  position: absolute;
  width: 96%;
  aspect-ratio: 1;
  border: 1px solid var(--sr-gold);
  border-radius: 50%;
  opacity: .8;
}
.sr-hero-cover img, .sr-hero-cover .cover-ph {
  position: relative;
  width: 82%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  background: var(--sr-cover);
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.sr-hero .hero-x {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 26px;
  height: 26px;
  border: 0 !important;
  background: none !important;
  color: var(--sr-muted);
  font-size: 18px;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.sr-dots { display: flex; justify-content: center; gap: 8px; margin: 8px 0 0; }
.sr-dot { width: 7px; height: 7px; padding: 0; border: 1px solid var(--sr-gold); background: transparent; transform: rotate(45deg); border-radius: 0; box-shadow: none; }
.sr-dot.on { background: var(--sr-gold); }

/* кнопка «Читать дальше →» */
.sr-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 22px;
  white-space: nowrap;
  font-family: var(--sr-serif);
  font-size: 16px;
  color: var(--sr-text);
  text-decoration: none;
}
.sr-btn .line-ico { width: 16px; height: 16px; color: var(--sr-text); }

/* ---------- из второго примера (scripts/ref-design-2.webp) — только шапка (её решение):
   звезда перед названием и мелкие кнопки ---------- */
.page.home .topbar h1, .page.library .topbar h1, .page.my-reading .topbar h1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.page.home .topbar h1::before, .page.library .topbar h1::before, .page.my-reading .topbar h1::before {
  content: '';
  flex: none;
  width: 22px;
  height: 30px;
  background: var(--sr-gold);
  clip-path: polygon(50% 0, 56% 44%, 100% 50%, 56% 56%, 50% 100%, 44% 56%, 0 50%, 44% 44%);
}
/* ---------- заголовки разделов ---------- */
.sr-head { display: flex; align-items: center; gap: 8px; margin: 18px 0 10px; }
.sr-head .head-cross { width: 18px; height: 42px; color: var(--sr-gold); flex: none; }
.sr-head .section-title { font-family: var(--sr-serif); font-weight: 500; font-size: 26px; margin: 0; color: var(--sr-text); background: none; -webkit-text-fill-color: currentColor; }
.sr-line { flex: 1; height: 1px; background: var(--sr-line); position: relative; min-width: 20px; }
.sr-star { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); color: var(--sr-gold); font-size: 14px; background: var(--sr-bg); padding: 0 4px; }
.sr-head .section-all { display: inline-flex; align-items: center; gap: 4px; font-family: var(--sr-serif); font-size: 16px; color: var(--sr-text); text-decoration: none; background: none; border: 0; padding: 0; box-shadow: none; }
.sr-head .section-all .line-ico { width: 14px; height: 14px; }

/* ---------- постеры и анонсы ---------- */
.home .poster-grid.poster-row3, .home .ann-strip.ann-home {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
}
.home .poster-grid.poster-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.poster, .ann-item { background: none; border: 0; box-shadow: none; padding: 0; text-align: left; color: var(--sr-text); }
/* обложки без рамок (её решение: рамки — стиль первой читалки); только срезанные углы */
.poster-cover, .ann-item img, .hero.bare .hero-cover, .hero.bare .hero-cover:has(img),
:root[data-theme="dark"] .poster-cover, :root[data-theme="dark"] .hero.bare .hero-cover:has(img) {
  position: relative;
  background: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-image: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}
.poster-cover::before, .poster-cover::after, .hero.bare .hero-cover::before, .hero.bare .hero-cover::after { content: none !important; display: none !important; }.poster-cover img, .poster-cover .cover-ph {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4; /* обложка целиком (её решение) */
  object-fit: cover;
  object-position: top;
  background: var(--sr-cover);
  border-radius: 0;
  clip-path: polygon(6px 0, calc(100% - 6px) 0, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 0 calc(100% - 6px), 0 6px);
}
.home .ann-item img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.poster-wide .poster-cover img, .poster-wide .poster-cover .cover-ph { aspect-ratio: 3 / 1; }
.poster-status, .ann-soon { display: block; font-size: 10px; color: var(--sr-muted); margin-top: 6px; background: none; padding: 0; position: static; }
.poster-title, .ann-title { display: block; font-family: var(--sr-serif); font-size: 15px; line-height: 1.15; color: var(--sr-text); margin-top: 1px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; background: none; position: static; }
.excl-badge {
  font-family: var(--sr-serif) !important;
  background: var(--sr-bg) !important;
  color: var(--sr-gold) !important;
  border: 1px solid var(--sr-gold) !important;
  border-image: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}
.excl-badge::before, .excl-badge::after { display: none !important; }
/* плавное появление первой читалки на баннере не нужно (на миг всё бледное) */
.sr-hero.fade-in { animation: none !important; }
/* в избранном — маленькое готическое сердце в углу обложки */
.sr-poster-fav { position: absolute; top: 4px; right: 4px; z-index: 2; line-height: 0; }
.sr-poster-fav .line-ico { width: 22px; height: 22px; color: #d4af6a; stroke-width: 1.4; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }

/* ---------- страница новеллы ---------- */
.novel-hero .hero-cover img { border-radius: 0 !important; -webkit-mask-image: none !important; mask-image: none !important; }
/* блок с названием на обложке — без «стекла»: тёмная (светлая) вуаль и тонкая золотая линия */
.glass-brick, :root[data-theme="dark"] .glass-brick {
  border-radius: 0 !important;
  background: color-mix(in srgb, var(--sr-bg) 82%, transparent) !important;
  box-shadow: inset 0 0 0 1px var(--sr-line) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.glass-brick .hero-title { font-family: var(--sr-serif); font-weight: 500; font-size: 26px; color: var(--sr-text) !important; -webkit-text-fill-color: var(--sr-text) !important; }
.glass-brick .where { color: var(--sr-gold); }

/* сердце (её выбор): готическое сердце с крестом, золотая линия без кнопки позади;
   на светлой обложке — темнее (бронза); в избранном — залито золотом */
.hero-cover .heart-btn.heart-corner, .heart-btn {
  background: none !important;
  box-shadow: none !important;
  border: 0 !important;
  border-image: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  filter: none !important;
  width: 44px;
  height: 44px;
  padding: 0;
}
.heart-btn::before, .heart-btn::after { display: none !important; }
.heart-btn .gold-heart { width: 38px; height: 38px; display: block; overflow: visible; color: #d4af6a; stroke-width: 1.4;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55)); }
.light-cover .heart-btn .gold-heart { color: #7a5a2c; filter: drop-shadow(0 1px 1px rgba(255, 255, 255, .5)); }
.gold-heart .fill { transition: fill .2s; }
.heart-btn.on .gold-heart .fill { fill: currentColor; }
.heart-btn.pulse .gold-heart { animation: sr-heart .4s ease-out; }
@keyframes sr-heart { 50% { transform: scale(1.2); } }
.heart-pop { font-family: var(--sr-serif); background: var(--sr-bg) !important; color: var(--sr-text) !important; border: 1px solid var(--sr-line); box-shadow: none !important; border-radius: 0 !important; }

/* кнопки на обложке: «Продолжить» — золотом, «С начала» — золотая линия на вуали */
html:root .cover-actions .btn, html:root .cover-stack .cover-actions .btn {
  background: color-mix(in srgb, var(--sr-bg) 80%, transparent) !important;
  border: 1px solid var(--sr-gold) !important;
  border-image: none !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  color: var(--sr-text) !important;
  text-shadow: none !important;
  filter: none !important;
  font-family: var(--sr-serif);
  font-weight: 500 !important;
  font-size: 16px !important;
}
html:root .cover-actions .btn:not(.ghost), html:root .cover-stack .cover-actions .btn:not(.ghost) {
  background: var(--sr-gold) !important;
  color: var(--sr-bg) !important;
}
html:root .cover-actions .btn::before, html:root .cover-actions .btn::after { display: none !important; }
.glass-brick .byline, .glass-brick .meta { color: var(--sr-muted) !important; }

/* заголовки на остальных страницах — тем же шрифтом */
.toc h2, .toc-head h2, .admin-title, .page h1:not(.hero-title), .toc-group > summary {
  font-family: var(--sr-serif);
  font-weight: 500;
}
.toc h2, .toc-head h2 { font-size: 26px; }
.toc-item.current .t { color: var(--sr-gold); }

/* блоки страниц: вместо стекла — тонкая золотая линия */
:root, :root[data-theme="dark"] {
  --card: transparent;
  --card-solid: var(--sr-bg);
  --glass-border: var(--sr-line);
  --glass-shadow: none;
  --glass-blur: none;
  --facet-glass: transparent;
  --facet-shadow: none;
}

/* ---------- кнопки каналов ---------- */
/* её решение: в две строки — «Основной канал», под ним «Закрытый канал» */
.sr-channels { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 22px 0 8px; }
.sr-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  min-height: 54px;
  border: 0;
  border-image: none;
  box-shadow: none;
  color: var(--sr-text);
  text-align: left;
  cursor: pointer;
}
.sr-channel .ch-ico { width: 20px; height: 20px; color: var(--sr-gold); flex: none; }
.sr-channel .ch-arrow { width: 14px; height: 14px; color: var(--sr-text); flex: none; margin-left: auto; }
.ch-text { display: flex; flex-direction: column; min-width: 0; }
.ch-title { font-family: var(--sr-serif); font-size: 17px; line-height: 1.1; }
.ch-sub { font-size: 10px; color: var(--sr-muted); line-height: 1.25; margin-top: 2px; }

/* ---------- низ ---------- */
.sr-footer { text-align: center; margin: 20px 0 8px; }
.sr-footer-name { font-family: var(--sr-serif); font-size: 26px; color: var(--sr-gold); }
.sr-footer-tag { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--sr-muted); margin-top: 4px; }

/* ---------- «Мои чтения» ---------- */
.reading-list { display: flex; flex-direction: column; gap: 10px; }
.reading-row { --cut: 10px; display: flex; gap: 12px; padding: 10px 14px; color: var(--sr-text); text-decoration: none; align-items: center; }
.reading-cover { width: 58px; flex: none; }
.reading-cover img, .reading-cover .cover-ph { display: block; width: 58px; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; background: var(--sr-cover); }
.reading-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.reading-title { font-family: var(--sr-serif); font-size: 19px; line-height: 1.1; }
.reading-chapter { font-size: 12px; color: var(--sr-muted); margin: 3px 0 6px; }
.reading-info .progress { height: 2px; background: var(--sr-line); border-radius: 0; box-shadow: none; }
.reading-info .progress > * { background: var(--sr-gold); border-radius: 0; }
.reading-new { font-size: 11px; color: var(--sr-gold); margin-top: 4px; }

/* ---------- страница главы ---------- */
.chapter-where { font-family: var(--sr-serif); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; text-align: center; margin-top: 6px; }
.chapter-novel { color: var(--sr-muted) !important; text-decoration: none !important; }
.chapter-place { color: var(--sr-muted); }
.page.reading .chapter-title {
  font-family: var(--sr-serif);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.15;
  text-align: center;
  margin: 8px 0 4px;
  color: var(--sr-text);
}
/* под названием — линия со звездой, как у разделов */
.page.reading .chapter-title::after {
  content: '✦';
  display: block;
  margin: 10px auto 18px;
  width: 70%;
  font-size: 13px;
  line-height: 1;
  color: var(--sr-gold);
  background: linear-gradient(var(--sr-line), var(--sr-line)) left center / calc(50% - 14px) 1px no-repeat,
    linear-gradient(var(--sr-line), var(--sr-line)) right center / calc(50% - 14px) 1px no-repeat;
}
/* сноски: маленькая золотая метка вместо розовых кружков */
.chapter-text sup[data-note], :root[data-theme="dark"] .chapter-text sup[data-note], .chapter-text sup[data-note][data-kind="a"] {
  color: var(--sr-gold);
  background: none;
  box-shadow: none;
  border-bottom: 1px solid var(--sr-gold);
  border-radius: 0;
  padding: 0 .15em;
  font-family: var(--sr-serif);
  font-style: normal;
  font-weight: 600;
}
.chapter-text sup[data-note][data-kind="a"] { color: var(--sr-muted); border-bottom-color: var(--sr-muted); }
/* ползунок прокрутки: тонкая золотая линия и ромбик */
/* полосы ползунка нет (её решение) — только сам ползунок */
.crys-track::before, :root[data-theme="dark"] .crys-track::before { display: none !important; }
/* ползунок едет прямо вниз: сам блок не поворачиваем (иначе сдвиг идёт наискосок),
   ромбик рисуем внутри повёрнутым */
.crys-thumb, :root[data-theme="dark"] .crys-thumb {
  background: none;
  filter: none;
  width: 12px;
  height: 12px;
  left: 1px;
  border: 0;
  rotate: none;
}
.crys-thumb::before {
  content: '';
  position: absolute;
  inset: 1px;
  border: 1px solid var(--sr-gold);
  background: var(--sr-bg);
  transform: rotate(45deg);
}
/* Назад / Оглавление / Далее */
.chapter-nav .btn { font-size: 16px !important; }
.chapter-nav a:not([href]), .chapter-nav .disabled { opacity: .4; }

/* окошко «по подписке» / «продолжение для подписчиков» — рамка со срезанными углами */
.locked {
  --cut: 14px;
  position: relative;
  isolation: isolate;
  background: var(--sr-line) !important;
  border-radius: 0 !important;
  padding: 26px 20px !important;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.locked::before { content: ''; position: absolute; inset: 1px; z-index: -1; background: var(--sr-bg); clip-path: inherit; }
.locked .promo-title { font-family: var(--sr-serif); font-weight: 500; font-size: 22px; line-height: 1.2; }
.locked-icon { color: var(--sr-gold); display: flex; justify-content: center; }
.locked-icon .line-ico { width: 30px; height: 30px; }
.open-at { color: var(--sr-gold) !important; }

/* ---------- нижние окна: настройки «Aa», сноска, оплата ---------- */
.sheet, .note-sheet, .note-sheet.translator, .note-sheet.author, .pay-sheet,
:root[data-theme="dark"] .note-sheet, :root[data-theme="dark"] .pay-sheet {
  background: var(--sr-bg) !important;
  color: var(--sr-text);
  border-radius: 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--sr-gold) !important;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, .25) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.sheet-head h2, .pay-sheet h2, .pay-sheet .pay-title { font-family: var(--sr-serif); font-weight: 500; font-size: 22px; }
.sheet-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--sr-muted); }
.theme-swatch, .font-tile {
  border: 1px solid var(--sr-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.theme-swatch.light { background: #f3eee5 !important; color: #231c15 !important; }
.theme-swatch.dark { background: #0e0c0a !important; color: #ece2d1 !important; }
.theme-swatch.on, .font-tile.on { border-color: var(--sr-gold) !important; box-shadow: inset 0 0 0 1px var(--sr-gold) !important; }
.theme-swatch .aa { font-family: var(--sr-serif); }
.font-tile { background: transparent !important; color: var(--sr-text) !important; }
/* ползунки: тонкая золотая линия и ромбик */
.slider input[type="range"]::-webkit-slider-runnable-track { background: var(--sr-line) !important; height: 1px !important; border-radius: 0 !important; box-shadow: none !important; }
.slider input[type="range"]::-moz-range-track { background: var(--sr-line) !important; height: 1px !important; border-radius: 0 !important; box-shadow: none !important; }
.slider input[type="range"]::-webkit-slider-thumb, :root[data-theme="dark"] .slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px !important;
  height: 14px !important;
  margin-top: -7px !important;
  background: var(--sr-bg) !important;
  border: 1px solid var(--sr-gold) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: rotate(45deg);
}
.slider input[type="range"]::-moz-range-thumb, :root[data-theme="dark"] .slider input[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  background: var(--sr-bg) !important;
  border: 1px solid var(--sr-gold) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: none !important;
  transform: rotate(45deg);
}
.slider .val, .slider output { font-family: var(--sr-serif); }
.note-head, .note-sheet.author .note-head { font-family: var(--sr-serif); font-style: normal; font-size: 15px; color: var(--sr-gold) !important; letter-spacing: .06em; }
.note-sheet.author .note-head { color: var(--sr-muted) !important; }
.pay-back { background: rgba(0, 0, 0, .45) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.link-btn { color: var(--sr-gold) !important; font-family: var(--sr-serif); font-size: 16px; }

/* ---------- админка ---------- */
.page.admin .admin-title, .page.admin h1, .page.admin h2.admin-sub {
  font-family: var(--sr-serif) !important;
  font-weight: 500 !important;
  color: var(--sr-text);
}
.page.admin .admin-title { font-size: 28px; line-height: 1.15; }
.page.admin h2.admin-sub { font-size: 22px; }
.admin-row .t, .ch-title { font-family: var(--sr-serif); font-size: 19px; font-weight: 500; }
/* цветные эмодзи в кнопках админки — приглушаем до бронзы, чтобы не выбивались из золота */
.page.admin :is(.btn, .icon-btn, .chip-btn, .link-btn):not(.cover-stack *):not(.cover-top *) {
  filter: grayscale(1) sepia(.7) saturate(1.3) !important;
}
/* поля ввода */
.page.admin :is(input[type="text"], input[type="search"], input[type="number"], input:not([type]), textarea, select),
.lib-search, .lib-sort {
  background: transparent !important;
  color: var(--sr-text) !important;
  border: 1px solid var(--sr-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
.page.admin :is(input, textarea, select):focus, .lib-search:focus { outline: none; border-color: var(--sr-gold) !important; }
.page.admin input[type="checkbox"], .page.admin input[type="radio"] { accent-color: var(--sr-gold); }
.hint-box { background: transparent !important; border: 1px solid var(--sr-line) !important; border-radius: 0 !important; box-shadow: none !important; }
.toast { background: var(--sr-bg) !important; color: var(--sr-text) !important; border: 1px solid var(--sr-gold) !important; border-radius: 0 !important; box-shadow: 0 8px 24px rgba(0, 0, 0, .25) !important; font-family: var(--sr-serif); font-size: 16px; }

/* ---------- узорные рамки кнопок (её примеры): двойная тонкая линия, острые завитые концы;
   у круглых значков — двойное кольцо с ромбиками. Картинки — public/frames.css
   (scripts/make-frames.mjs); border-image: концы не растягиваются ---------- */
:is(.btn, .channel-card, .chip-btn, .fav-btn, .seg-btn, .pager-btn, .icon-btn.wide, .icon-btn.home-btn):not(.cover-stack *):not(.cover-top *),
html:root .cover-actions .btn, html:root .cover-stack .cover-actions .btn,
.sr-btn, .main-nav {
  border-style: solid !important;
  border-width: 0 !important;
  border-radius: 0 !important;
  border-image-source: var(--fr-pill) !important;
  border-image-slice: 20 24 fill !important;
  border-image-width: 50% 22px !important;
  border-image-repeat: stretch !important;
  background: transparent !important;
  box-shadow: none !important;
}
:is(.seg-btn, .pager-btn, .chip-btn).on:not(.cover-stack *):not(.cover-top *),
html:root .cover-actions .btn:not(.ghost), html:root .cover-stack .cover-actions .btn:not(.ghost) {
  border-image-source: var(--fr-pill-on) !important;
  background: transparent !important;
  color: var(--sr-bg) !important;
}
/* логотип — её файл (узорные буквы, звёзды): scripts/make-logo.mjs → img/sr-logo-*.png; на светлой
   теме буквы чёрные (её решение). Текст остаётся для чтения с экрана. Тот же логотип — внизу. */
:root { --sr-logo: url(img/sr-logo-light.png?v=7); }
:root[data-theme="dark"] { --sr-logo: url(img/sr-logo-dark.png?v=7); }
.topbar .title-brand, .sr-footer-name {
  display: block;
  width: 148px;
  height: 36px;
  font-size: 0 !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  background: var(--sr-logo) left center / contain no-repeat !important;
}
.sr-footer-name { width: 165px; height: 40px; margin: 0 auto 8px; background-position: center !important; }
/* кнопки на обложке — без подложки, текст читается за счёт тени */
html:root .cover-actions .btn.ghost { color: #f3eee5 !important; text-shadow: 0 1px 3px rgba(0, 0, 0, .8) !important; }
.light-cover html:root .cover-actions .btn.ghost, .light-cover .cover-actions .btn.ghost { color: #231c15 !important; text-shadow: 0 1px 2px rgba(255, 255, 255, .7) !important; }
/* круглые значки */
.icon-btn:not(.wide):not(.home-btn):not(.cover-stack *):not(.cover-top *) {
  border-style: solid !important;
  border-width: 0 !important;
  border-radius: 0 !important;
  border-image-source: var(--fr-circle) !important;
  border-image-slice: 24 fill !important;
  border-image-width: 50% !important;
  border-image-repeat: stretch !important;
  background: transparent !important;
}
/* «Читать дальше» и меню — та же вытянутая рамка вместо срезанного шестиугольника */
.sr-btn, .main-nav { clip-path: none !important; padding-left: 26px; padding-right: 26px; }
.sr-btn::before, .main-nav::before { display: none !important; }
/* кнопки каналов — большая рамка с ромбиками по бокам */
.sr-channel {
  clip-path: none !important;
  background: transparent !important;
  border-style: solid !important;
  border-width: 0 !important;
  border-image-source: var(--fr-box) !important;
  border-image-slice: 22 24 fill !important;
  border-image-width: 18px 20px !important;
  border-image-repeat: stretch !important;
  padding: 14px 22px !important;
  justify-content: center;
}
.sr-channel::before { display: none !important; }
.sr-channel .ch-text { align-items: center; }

/* ---------- баннер (её решение, образец scripts/ref-banner.png): слева текст, справа обложка
   фоном — по центру, плавно выцветает к тексту; без рамки. Так же — верх страницы работы ---------- */
.sr-hero-frame {
  clip-path: none !important;
  background: none !important;
  position: relative;
  display: block !important;
  overflow: hidden;
  min-height: 210px;
  padding: 22px 0 22px 2px !important;
}
.sr-hero-frame::before { display: none !important; }
.sr-hero-info { position: relative; z-index: 1; max-width: 54%; }
.sr-hero-cover {
  position: absolute !important;
  top: 0; right: 0; bottom: 0;
  width: 60%;
  display: block !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  cursor: pointer;
  /* выцветание к тексту слева и чуть-чуть сверху/снизу, как в образце */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .15) 15%, rgba(0, 0, 0, .7) 38%, #000 58%),
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, .15) 15%, rgba(0, 0, 0, .7) 38%, #000 58%),
    linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}
.sr-hero-cover img, .sr-hero-cover .cover-ph {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover;
  object-position: center;
  clip-path: none !important;
}
.sr-hero-cover .halo { display: none !important; }
.sr-hero .hero-x { z-index: 2; background: color-mix(in srgb, var(--sr-bg) 75%, transparent) !important; border-radius: 50% !important; }
/* верх страницы работы */
.novel-banner .sr-hero-frame { min-height: 270px; }
.novel-banner .hero-title { font-size: clamp(17px, 4.1vw, 25px); margin-top: 0; } /* её правки: −40%, потом +20% */
.novel-banner .byline, .novel-banner .meta { font-size: 13px; color: var(--sr-muted); margin: 2px 0; }
.novel-banner .where { color: var(--sr-gold); }
.novel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.novel-actions .btn { --gh: 40px; height: 40px; min-height: 40px; padding: 0 22px !important; font-size: 15px; margin: 0; }
.novel-actions .btn-note { font-size: 11px; margin-left: 4px; }
.novel-banner .heart-btn { position: static; width: 40px; height: 40px; }
.novel-banner .heart-btn .gold-heart, .light-cover .novel-banner .heart-btn .gold-heart { color: var(--sr-gold); filter: none; }
/* теги (её решение): золотым текстом с «#», на 20% мельче описания, без плашек */
.novel-side .tags { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.novel-side .tags .tag {
  font-size: 0.8em;
  color: var(--sr-gold) !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}
.novel-side .description .tags .tag { font-size: 0.8em; }

/* «эксклюзив» (её выбор): надпись вдоль левого края обложки на тёмной полосе */
.excl-side {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 12, 10, .72);
  color: #d9b77c;
  font-family: var(--font-sans, sans-serif);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  z-index: 2;
  pointer-events: none;
}

/* баннер на главной (её выбор «б»): обложка — фон ВСЕГО баннера, затемнена слева, текст поверх
   светлым (в обеих темах) */
/* вокруг — рамка со срезанными углами, как раньше (её решение): золотая линия 1px = фон рамки,
   обложка внутри обрезана тем же многоугольником на 1px меньше */
.sr-hero:not(.novel-banner) .sr-hero-frame {
  --cut: 14px;
  padding: 22px 18px !important;
  min-height: 220px;
  background: var(--sr-line) !important;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)) !important;
}
.sr-hero:not(.novel-banner) .sr-hero-cover {
  top: 1px; right: 1px; bottom: 1px; left: 1px;
  width: auto;
  -webkit-mask-image: none;
  mask-image: none;
  clip-path: polygon(13.5px 0, calc(100% - 13.5px) 0, 100% 13.5px, 100% calc(100% - 13.5px),
    calc(100% - 13.5px) 100%, 13.5px 100%, 0 calc(100% - 13.5px), 0 13.5px);
}
.sr-hero:not(.novel-banner) .sr-hero-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(14, 12, 10, .9) 0%, rgba(14, 12, 10, .72) 45%, rgba(14, 12, 10, .25) 100%);
}
.sr-hero:not(.novel-banner) .sr-hero-info { max-width: 72%; }
.sr-hero:not(.novel-banner) :is(.hero-label, .hero-title, .hero-chapter, .hero-notes) {
  color: #f3eee5 !important;
  -webkit-text-fill-color: #f3eee5 !important;
}
.sr-hero:not(.novel-banner) .hero-label, .sr-hero:not(.novel-banner) .hero-notes { color: #d8c7ad !important; -webkit-text-fill-color: #d8c7ad !important; }
.sr-hero:not(.novel-banner) .progress { background: rgba(243, 238, 229, .3); }
.sr-hero:not(.novel-banner) .progress > * { background: #c9a467; }
.sr-hero:not(.novel-banner) .sr-btn { color: #f3eee5; }
.sr-hero:not(.novel-banner) .sr-btn .line-ico { color: #f3eee5; }
.sr-hero:not(.novel-banner) .sr-btn { border-image-source: var(--fr-pill-dark-bg, var(--fr-pill)) !important; }
.sr-hero:not(.novel-banner) .hero-x { color: #f3eee5 !important; background: rgba(14, 12, 10, .5) !important; }

/* сердце (её правка): без красного свечения; надпись «В избранном» — прямо над кнопкой */
.heart-btn, .heart-btn.on, .heart-btn.pulse { box-shadow: none !important; filter: none !important; }
.heart-btn svg, .heart-btn.on svg { filter: none !important; }
.novel-banner .heart-btn { position: relative !important; overflow: visible; }
.heart-btn .heart-pop {
  right: auto !important;
  left: 50% !important;
  bottom: 100% !important;
  margin-bottom: 6px;
  translate: -50% 0;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
  font-weight: 500;
}

/* телефон: шапка в одну строку — название, «Админка», три значка (как во втором примере) */
@media (max-width: 440px) {
 .topbar { gap: 5px; }
  .page.home .topbar h1::before, .page.library .topbar h1::before, .page.my-reading .topbar h1::before { width: 15px; height: 22px; }
  .topbar .title-link, .topbar .title-brand { font-size: 23px; }
  .topbar h1 { flex: 1 1 auto; min-width: 0; }
  .topbar .title-brand { width: 115px; height: 28px; }
  .topbar .icon-btn:not(.cover-stack *):not(.cover-top *) { --gh: 30px; width: 30px; min-width: 30px; height: 30px; min-height: 30px; }
  .topbar .icon-btn.wide:not(.cover-stack *):not(.cover-top *) { width: auto; padding: 0 14px; font-size: 13px; border-image-width: 50% 14px !important; }
  .topbar .line-ico { width: 17px; height: 17px; }
}

/* узкий телефон */
@media (max-width: 380px) {
  .topbar .title-link, .topbar .title-brand { font-size: 28px; }
  .topbar .icon-btn { width: 30px; height: 30px; min-width: 30px; }
  .main-nav { font-size: 12px; letter-spacing: .1em; padding: 8px 12px; }
  .home .poster-grid.poster-row3, .home .ann-strip.ann-home { gap: 7px; }
  .sr-channels { grid-template-columns: 1fr; }
}
