/* ============================================================
   ebooks dark — «Книжная полка» (внутренние страницы)
   Тёмная тема, адаптив: разворот книги на десктопе,
   одна «страница» + свайп/листание на мобильном.
   ============================================================ */

:root{
  --eb-ink-0:#0a0c12;
  --eb-ink-1:#10131c;
  --eb-ink-2:#171b28;
  --eb-ink-3:#1f2434;
  --eb-gold:#d4a24e;
  --eb-gold-2:#f0cd8a;
  --eb-gold-dim:#8a6c33;
  --eb-paper:#efe3c8;
  --eb-paper-2:#e2d0a8;
  --eb-paper-3:#d8c393;
  --eb-inktext:#3b2f1d;
  --eb-inktext-dim:#71603f;
  --eb-text-on-dark:#e8e2d2;
  --eb-text-dim:#a79f8a;
  --eb-font-display:"Playfair Display","PT Serif",Georgia,"Times New Roman",serif;
  --eb-font-body:"PT Serif",Georgia,"Times New Roman",serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}

body.eb{
  margin:0;
  min-height:100dvh;
  background:var(--eb-ink-0);
  color:var(--eb-text-on-dark);
  font-family:var(--eb-font-body);
  font-size:17px;
  line-height:1.6;
  overflow-x:hidden;
}

/* ---------- сцена ---------- */

.eb-scene{
  position:relative;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(80% 45% at 50% -6%, rgba(48,56,92,.28), transparent 62%),
    radial-gradient(60% 40% at 50% 42%, rgba(255,190,110,.10), transparent 70%),
    linear-gradient(180deg,#0b0d14,#10131c 60%,#0a0c12);
}
.eb-scene::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:radial-gradient(46% 32% at 50% 40%, rgba(255,190,110,.12), transparent 70%);
  animation:eb-candle 5.5s ease-in-out infinite;
}
.eb-scene::after{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:radial-gradient(130% 95% at 50% 45%, transparent 58%, rgba(0,0,0,.5));
}
@keyframes eb-candle{
  0%,100%{opacity:1}
  38%{opacity:.8}
  62%{opacity:.93}
}
@media (prefers-reduced-motion: reduce){.eb-scene::before{animation:none}}

.eb-topbar,.eb-bookwrap,.eb-copy{position:relative;z-index:2}

/* ---------- верхняя панель ---------- */

.eb-topbar{
  display:flex;align-items:center;gap:10px;
  padding:12px clamp(12px,3vw,32px);
  border-bottom:1px solid rgba(212,162,78,.16);
  background:linear-gradient(180deg,rgba(10,12,18,.72),rgba(10,12,18,.35));
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.eb-brand{
  display:inline-flex;align-items:center;gap:10px;
  margin-right:auto;
  text-decoration:none;
  color:var(--eb-gold-2);
  font-family:var(--eb-font-display);
  font-weight:700;
  font-size:clamp(15px,1.7vw,19px);
  letter-spacing:.03em;
  white-space:nowrap;
}
.eb-brand__mark{color:var(--eb-gold);text-shadow:0 0 14px rgba(240,205,138,.55)}
.eb-brand:hover{color:#fbe4b5}

.eb-icons{display:flex;gap:4px}
.eb-icons a{
  display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:38px;border-radius:10px;
  color:var(--eb-text-dim);
  border:1px solid transparent;
  transition:color .25s,border-color .25s,background .25s;
}
.eb-icons a:hover{color:var(--eb-gold-2);border-color:rgba(212,162,78,.35);background:rgba(212,162,78,.08)}
.eb-icons svg{width:19px;height:19px;display:block}

/* бургер — только мобильный */
.eb-burger{
  display:none;
  width:42px;height:38px;
  flex-direction:column;align-items:center;justify-content:center;gap:5px;
  background:none;border:1px solid rgba(212,162,78,.35);border-radius:10px;
  cursor:pointer;
}
.eb-burger span{display:block;width:18px;height:2px;background:var(--eb-gold-2);border-radius:2px;transition:.3s}
.eb-burger[aria-expanded="true"] span:nth-child(1){transform:translateY(7px) rotate(45deg)}
.eb-burger[aria-expanded="true"] span:nth-child(2){opacity:0}
.eb-burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-7px) rotate(-45deg)}

/* ---------- книга ---------- */

.eb-bookwrap{
  flex:1;
  display:flex;justify-content:center;
  padding:clamp(16px,3.5vh,44px) clamp(10px,3vw,36px) 24px;
}

.eb-book{
  position:relative;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  width:min(100%,1360px);
}

/* корешок-основа книги за разворотом */
.eb-book::before{
  content:"";
  position:absolute;inset:-10px 30px;
  z-index:0;
  border-radius:14px 22px 22px 14px;
  background:
    radial-gradient(120% 100% at 15% 8%, rgba(255,220,160,.10), transparent 45%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 0.13 0 0 0 0 0.08 0 0 0 0 0.05 0 0 0 0.5 0'/></filter><rect width='140' height='140' filter='url(%23l)'/></svg>"),
    linear-gradient(160deg,#43281c,#2c1a12 60%,#231410);
  box-shadow:inset 0 0 0 1px rgba(240,205,138,.14), inset 0 0 70px rgba(0,0,0,.55), 0 34px 80px rgba(0,0,0,.6);
}

.eb-spread{
  position:relative;z-index:1;
  display:grid;
  grid-template-columns:minmax(0,5fr) minmax(0,7fr);
  grid-column:2;
  perspective:1600px;
}

/* корешок-щель между страницами — привязан к правому краю левой страницы */
.eb-page--left::after{
  content:"";
  position:absolute;top:0;bottom:0;right:-18px;
  width:36px;
  background:linear-gradient(90deg,transparent,rgba(60,42,20,.30) 38%,rgba(40,26,12,.48) 50%,rgba(60,42,20,.30) 62%,transparent);
  pointer-events:none;z-index:3;
}

/* ---------- страница ---------- */

.eb-page{
  position:relative;
  min-width:0;
  padding:clamp(18px,3vw,34px) clamp(16px,2.6vw,32px);
  color:var(--eb-inktext);
  background:
    radial-gradient(140% 90% at 50% -10%, rgba(255,252,240,.6), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.22 0 0 0 0.05 0'/></filter><rect width='180' height='180' filter='url(%23p)'/></svg>"),
    linear-gradient(178deg,var(--eb-paper) 0%,var(--eb-paper-2) 82%,var(--eb-paper-3) 100%);
  box-shadow:inset 0 0 90px rgba(150,110,55,.14);
  display:flex;flex-direction:column;
}
/* потёртый край страницы */
.eb-page::before{
  content:"";position:absolute;inset:9px;pointer-events:none;
  border:1px solid rgba(140,105,55,.35);
  border-radius:3px;
}

.eb-page--left{
  border-radius:10px 3px 3px 10px;
  box-shadow:inset -24px 0 34px -24px rgba(80,55,25,.5), inset 0 0 90px rgba(150,110,55,.14);
}
.eb-page--right{
  border-radius:3px 10px 10px 3px;
  box-shadow:inset 24px 0 34px -24px rgba(80,55,25,.5), inset 0 0 90px rgba(150,110,55,.14);
}

.eb-page__head{padding-bottom:12px;border-bottom:1px solid rgba(140,105,55,.35);margin-bottom:14px}
.eb-page__eyebrow{
  display:block;
  font-size:11px;letter-spacing:.34em;text-indent:.34em;text-transform:uppercase;
  color:var(--eb-inktext-dim);
}
.eb-page__section{
  display:block;margin-top:4px;
  font-family:var(--eb-font-display);
  font-size:clamp(17px,1.8vw,22px);font-weight:700;
  color:#54401e;
}

.eb-page__title{
  margin:0 0 14px;
  padding-bottom:12px;
  font-family:var(--eb-font-display);
  font-size:clamp(22px,2.6vw,32px);font-weight:800;line-height:1.2;
  color:#453313;
  border-bottom:1px solid rgba(140,105,55,.35);
}
.eb-page__title:empty{display:none}

.eb-page__body,.eb-content{position:relative;z-index:1;flex:1;min-width:0}

/* ---------- закладки-табы ---------- */

.eb-tabs{position:relative;z-index:2;align-self:start}
.eb-tabs ul{list-style:none;margin:0;padding:14px 0;display:flex;flex-direction:column;gap:9px;align-items:stretch}
.eb-tabs li{white-space:nowrap}
.eb-tabs li a{
  display:flex;align-items:center;justify-content:center;
  min-height:42px;
  padding:10px 18px;
  text-decoration:none;
  font-family:var(--eb-font-display);
  font-size:13.5px;font-weight:700;letter-spacing:.04em;
  color:#f2e6c8;
  transition:transform .3s cubic-bezier(.2,.7,.3,1.2),box-shadow .3s;
  box-shadow:0 4px 10px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.06);
}
.eb-tabs--left{grid-column:1;grid-row:1;margin-top:30px}
.eb-tabs--right{grid-column:3;grid-row:1;margin-top:30px}
.eb-tabs--left li a{border-radius:9px 0 0 9px;margin-left:-10px}
.eb-tabs--right li a{border-radius:0 9px 9px 0;margin-right:-10px}
.eb-tabs--left li a:hover{transform:translateX(-8px)}
.eb-tabs--right li a:hover{transform:translateX(8px)}
/* активная закладка наезжает на страницу */
.eb-tabs li{position:relative}
.eb-tabs li.selected{z-index:3}
.eb-tabs li.selected a{color:#ffe9b8;box-shadow:0 6px 16px rgba(0,0,0,.55), inset 0 0 0 1px rgba(240,205,138,.5), 0 0 18px rgba(212,162,78,.25)}
.eb-tabs--left li.selected a{transform:translateX(14px)}
.eb-tabs--right li.selected a{transform:translateX(-14px)}

/* палитра закладок */
.eb-tabs li:nth-child(9n+1) a{background:linear-gradient(180deg,#7a3b34,#5d2e2c)}
.eb-tabs li:nth-child(9n+2) a{background:linear-gradient(180deg,#3b656a,#2c4a4e)}
.eb-tabs li:nth-child(9n+3) a{background:linear-gradient(180deg,#6e6840,#54502c)}
.eb-tabs li:nth-child(9n+4) a{background:linear-gradient(180deg,#50396e,#3c2c54)}
.eb-tabs li:nth-child(9n+5) a{background:linear-gradient(180deg,#3a4f78,#2c3c5e)}
.eb-tabs li:nth-child(9n+6) a{background:linear-gradient(180deg,#7a5c3a,#5e462c)}
.eb-tabs li:nth-child(9n+7) a{background:linear-gradient(180deg,#5c4038,#43302c)}
.eb-tabs li:nth-child(9n+8) a{background:linear-gradient(180deg,#3b6b55,#2c5040)}
.eb-tabs li:nth-child(9n+9) a{background:linear-gradient(180deg,#74603a,#584428)}

/* ---------- листание ---------- */

.eb-flip{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-top:18px;padding-top:12px;
  border-top:1px solid rgba(140,105,55,.3);
}
.eb-flip__btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;
  font-family:var(--eb-font-display);font-size:14px;font-weight:700;
  color:#54401e;text-decoration:none;
  border:1px solid rgba(140,105,55,.4);border-radius:8px;
  background:linear-gradient(180deg,rgba(255,250,235,.5),rgba(230,214,180,.4));
  transition:.25s;
}
.eb-flip__btn:hover{color:#2f2208;border-color:rgba(140,105,55,.7);box-shadow:0 4px 12px rgba(80,55,25,.25)}
.eb-flip__btn svg{width:16px;height:16px;flex:0 0 auto}
.eb-flip__btn span{max-width:20ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.eb-flip__toc{
  font-size:13px;letter-spacing:.18em;text-transform:uppercase;
  color:var(--eb-inktext-dim);text-decoration:none;
  border-bottom:1px dotted var(--eb-inktext-dim);
}
.eb-flip__toc:hover{color:#54401e;border-color:#54401e}

/* ---------- контент страницы ---------- */

.eb-content,.eb-page__body{
  font-size:16px;line-height:1.65;
  color:var(--eb-inktext);
}
.eb-content h2,.eb-content h3,.eb-content h4,
.eb-page__body h2,.eb-page__body h3,.eb-page__body h4{
  font-family:var(--eb-font-display);
  color:#453313;line-height:1.25;
}
.eb-content a,.eb-page__body a{color:#8a5a1e;text-decoration-color:rgba(138,90,30,.4);transition:.2s}
.eb-content a:hover,.eb-page__body a:hover{color:#5d3c0e;text-decoration-color:currentColor}
.eb-content img,.eb-page__body img{max-width:100%;height:auto;border-radius:4px}
.eb-content table{max-width:100%;border-collapse:collapse}
.eb-content p{margin:0 0 1em}

/* ---------- карточки персон (catalog.section) ---------- */

.eb-cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:16px}
.eb-card{
  position:relative;
  display:flex;flex-direction:column;
  padding:10px 10px 12px;
  background:linear-gradient(180deg,#f6ecd4,#e9d9b4);
  border:1px solid rgba(140,105,55,.4);
  border-radius:6px;
  box-shadow:0 3px 8px rgba(80,55,25,.22), inset 0 0 0 4px rgba(255,252,240,.5);
  text-align:center;
  transition:transform .3s,box-shadow .3s;
}
.eb-card:hover{transform:translateY(-4px);box-shadow:0 10px 22px rgba(80,55,25,.35), inset 0 0 0 4px rgba(255,252,240,.6)}
.eb-card__photo{
  display:flex;align-items:center;justify-content:center;
  min-height:130px;padding:8px;
  border-radius:4px;
  border:1px solid rgba(140,105,55,.5);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='5'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.42 0 0 0 0 0.28 0 0 0 0.06 0'/></filter><rect width='160' height='160' filter='url(%23m)'/></svg>"),
    linear-gradient(180deg,#eee0bd,#dcc99c);
}
/* фото не апскейлим — только в натуральном размере */
.eb-card__photo img{
  display:block;max-width:100%;height:auto;
  border:1px solid rgba(90,64,32,.45);
  border-radius:2px;
  filter:sepia(.14) contrast(1.02);
}
.eb-card__name{
  display:block;margin-top:9px;
  font-family:var(--eb-font-display);font-size:15px;font-weight:700;line-height:1.3;
  color:#453313;text-decoration:none;
}
.eb-card__name:hover{color:#8a5a1e}
.eb-card__fio{margin-top:4px;font-size:12.5px;line-height:1.4;color:var(--eb-inktext-dim)}
.eb-card__link{position:absolute;inset:0}

/* ---------- статья (news.detail) ---------- */

.eb-article{max-width:66ch}
.eb-article h1,.eb-article h2,.eb-article h3{font-family:var(--eb-font-display);color:#453313}
.eb-article .detail_picture{
  float:left;margin:4px 18px 10px 0;
  max-width:100%;height:auto;
  padding:6px;
  background:#f6ecd4;
  border:1px solid rgba(140,105,55,.45);
  box-shadow:0 6px 16px rgba(80,55,25,.3);
  transform:rotate(-.6deg);
  filter:sepia(.1);
}
.eb-article::after{content:"";display:block;clear:both}

/* ---------- пагинация (книжная) ---------- */

.eb-pager{
  margin:22px 0 6px;
  padding-top:14px;
  border-top:1px solid rgba(140,105,55,.3);
}
.eb-pager__info{
  display:flex;justify-content:space-between;align-items:baseline;gap:10px;
  margin-bottom:10px;
  font-size:13px;color:var(--eb-inktext-dim);
}
.eb-pager__info b{
  font-family:var(--eb-font-display);font-size:13.5px;
  letter-spacing:.06em;color:#54401e;white-space:nowrap;
}
.eb-pager__row{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:7px;
}
.eb-pager__btn,.eb-pager__num{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:40px;height:40px;padding:0 8px;
  font-family:var(--eb-font-display);font-size:15px;font-weight:700;
  color:#54401e;text-decoration:none;
  border:1px solid rgba(140,105,55,.45);border-radius:9px;
  background:linear-gradient(180deg,rgba(255,250,235,.55),rgba(230,214,180,.45));
  transition:.2s;
}
.eb-pager__btn:hover,.eb-pager__num:hover{
  color:#2f2208;border-color:rgba(140,105,55,.75);
  box-shadow:0 4px 12px rgba(80,55,25,.3);transform:translateY(-1px);
}
.eb-pager__btn svg{width:19px;height:19px}
.eb-pager__btn--off{opacity:.3;pointer-events:none}
.eb-pager__btn--all{padding:0 16px;font-size:13.5px;letter-spacing:.08em;text-transform:uppercase}
.eb-pager__num--cur{
  color:#f0e2c2;background:linear-gradient(180deg,#5d4622,#453313);
  border-color:#453313;cursor:default;
  box-shadow:inset 0 0 0 1px rgba(240,205,138,.35), 0 3px 10px rgba(80,55,25,.35);
}
.eb-pager__dots{align-self:flex-end;padding:0 2px 8px;color:var(--eb-inktext-dim);font-size:15px}

/* ---------- формы ---------- */

.eb-content input[type="text"],.eb-content input[type="password"],.eb-content input[type="email"],
.eb-content textarea,.eb-content select,
.eb-page__body input[type="text"],.eb-page__body textarea,.eb-page__body select{
  width:100%;max-width:420px;
  padding:9px 12px;
  font:inherit;color:var(--eb-inktext);
  background:rgba(255,252,242,.75);
  border:1px solid rgba(140,105,55,.5);border-radius:8px;
}
.eb-content input:focus,.eb-content textarea:focus,.eb-page__body input:focus,.eb-page__body textarea:focus{
  outline:2px solid rgba(212,162,78,.55);outline-offset:1px;border-color:var(--eb-gold-dim);
}
.eb-content input[type="submit"],.eb-content button[type="submit"],
.eb-page__body input[type="submit"]{
  padding:10px 22px;
  font-family:var(--eb-font-display);font-weight:700;font-size:15px;
  color:#1c1410;cursor:pointer;
  background:linear-gradient(180deg,#f0d194,#d4a24e 60%,#b98a3e);
  border:none;border-radius:9px;
  box-shadow:0 4px 14px rgba(140,105,55,.4);
}
.eb-content table,.eb-page__body table{border-spacing:0}

/* ---------- выдвижное меню (мобильное) ---------- */

.eb-drawer{
  position:fixed;top:0;right:0;bottom:0;z-index:60;
  width:min(84vw,340px);
  transform:translateX(105%);
  transition:transform .4s cubic-bezier(.2,.8,.3,1);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(212,162,78,.10), transparent 50%),
    linear-gradient(160deg,#171b28,#10131c);
  border-left:1px solid rgba(212,162,78,.3);
  box-shadow:-20px 0 60px rgba(0,0,0,.6);
  visibility:hidden;
}
.eb-drawer.open{transform:none;visibility:visible}
.eb-drawer__scroller{height:100%;overflow-y:auto;padding:26px 22px 40px}
.eb-drawer__label{
  margin:18px 0 8px;
  font-size:11px;letter-spacing:.3em;text-transform:uppercase;
  color:var(--eb-gold);
}
.eb-drawer__label:first-child{margin-top:6px}
.eb-drawer ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.eb-drawer li a{
  display:block;padding:11px 14px;
  color:var(--eb-text-on-dark);text-decoration:none;
  font-family:var(--eb-font-display);font-size:16px;
  border:1px solid rgba(212,162,78,.14);border-radius:10px;
  background:rgba(255,255,255,.02);
}
.eb-drawer li a:hover{border-color:rgba(212,162,78,.45);color:var(--eb-gold-2)}
.eb-drawer li.selected a{border-color:var(--eb-gold);color:var(--eb-gold-2);background:rgba(212,162,78,.1)}
body.eb-drawer-lock{overflow:hidden}

/* плавающая мобильная панель — только <920px */
.eb-mobilenav,.eb-totop{display:none}

/* ---------- подвал ---------- */

.eb-copy{padding:12px 16px 18px;text-align:center;font-size:13px;color:var(--eb-text-dim)}
.eb-copy a{color:var(--eb-gold);text-decoration:none}
.eb-copy a:hover{color:var(--eb-gold-2);text-decoration:underline}

/* ---------- анимация появления/перелистывания ---------- */

.eb-page{animation:eb-page-in .55s cubic-bezier(.2,.7,.3,1) both}
.eb-page--right{animation-delay:.08s}
@keyframes eb-page-in{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}

/* прилёт страницы после листания: лист «докручивается» от корешка */
body.eb-enter-fwd .eb-page--right{
  transform-origin:left center;
  animation:eb-in-fwd .5s cubic-bezier(.2,.75,.3,1) both;
}
@keyframes eb-in-fwd{
  from{transform:rotateY(-26deg);opacity:.35}
  to{transform:none;opacity:1}
}
body.eb-enter-back .eb-page--left{
  transform-origin:right center;
  animation:eb-in-back .5s cubic-bezier(.2,.75,.3,1) both;
}
@keyframes eb-in-back{
  from{transform:rotateY(26deg);opacity:.35}
  to{transform:none;opacity:1}
}

/* уход страницы: лист взлетает с среза и ложится через корешок */
body.eb-flip-fwd .eb-page--right{
  transform-origin:left center;
  animation:eb-out-fwd .34s cubic-bezier(.45,.05,.7,.4) both;
}
@keyframes eb-out-fwd{
  from{transform:rotateY(0deg);opacity:1}
  60%{opacity:.9}
  to{transform:rotateY(-76deg);opacity:.12}
}
body.eb-flip-back .eb-page--left{
  transform-origin:right center;
  animation:eb-out-back .34s cubic-bezier(.45,.05,.7,.4) both;
}
@keyframes eb-out-back{
  from{transform:rotateY(0deg);opacity:1}
  60%{opacity:.9}
  to{transform:rotateY(76deg);opacity:.12}
}
/* соседняя страница слегка темнеет под летящим листом */
body.eb-flip-fwd .eb-page--left,
body.eb-flip-back .eb-page--right{animation:eb-dim .34s both}
@keyframes eb-dim{to{filter:brightness(.88)}}

@media (prefers-reduced-motion: reduce){
  .eb-page,
  body.eb-enter-fwd .eb-page--right,
  body.eb-enter-back .eb-page--left,
  body.eb-flip-fwd .eb-page--right,
  body.eb-flip-back .eb-page--left,
  body.eb-flip-fwd .eb-page--left,
  body.eb-flip-back .eb-page--right{animation:none}
}

/* ---------- адаптив ---------- */

@media (max-width:1100px){
  .eb-tabs li a{padding:9px 13px;font-size:12px}
}

@media (max-width:920px){
  .eb-book{grid-template-columns:minmax(0,1fr);row-gap:14px}
  .eb-book::before{inset:-6px -4px;border-radius:12px}

  /* табы глав — горизонтальная лента над книгой */
  .eb-tabs--left{grid-column:1;grid-row:1;margin-top:0;overflow-x:auto;scrollbar-width:none}
  .eb-tabs--left::-webkit-scrollbar{display:none}
  .eb-tabs--left ul{flex-direction:row;gap:6px;padding:2px}
  .eb-tabs--left li{flex:0 0 auto}
  .eb-tabs--left li a{
    height:auto;padding:9px 15px;border-radius:999px;
    font-size:12.5px;white-space:nowrap;
  }
  .eb-tabs--left li a:hover,.eb-tabs--left li.selected a{transform:translateY(-2px)}
  .eb-tabs--right{display:none}

  .eb-spread{grid-column:1;grid-row:2;grid-template-columns:minmax(0,1fr)}
  .eb-page{border-radius:10px}
  .eb-page--left{margin-top:14px}

  .eb-burger{display:inline-flex}
  .eb-brand__text{max-width:44vw;overflow:hidden;text-overflow:ellipsis}

  /* на мобильном листание — плавающая панель, внутристраничные кнопки прячем */
  .eb-flip{display:none}

  /* место под плавающую панель листания */
  body.eb-inner{padding-bottom:76px}

  .eb-mobilenav{
    position:fixed;left:50%;bottom:12px;z-index:55;
    transform:translateX(-50%);
    display:flex;align-items:center;gap:8px;
    width:min(96vw,480px);
    padding:8px 10px;
    border-radius:16px;
    background:linear-gradient(180deg,#f4ead0,#e6d6ae);
    border:1px solid rgba(140,105,55,.55);
    box-shadow:0 10px 30px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,252,240,.6);
  }
  .eb-mobilenav__btn{
    flex:1;min-width:0;
    display:inline-flex;align-items:center;justify-content:center;gap:6px;
    padding:10px 10px;
    font-family:var(--eb-font-display);font-size:13.5px;font-weight:700;
    color:#453313;text-decoration:none;
    border:1px solid rgba(140,105,55,.45);border-radius:10px;
    background:linear-gradient(180deg,rgba(255,250,235,.7),rgba(230,214,180,.5));
  }
  .eb-mobilenav__btn span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .eb-mobilenav__btn svg{width:17px;height:17px;flex:0 0 auto}
  .eb-mobilenav__btn--off{visibility:hidden}
  .eb-mobilenav__toc{
    flex:0 0 auto;
    display:inline-flex;align-items:center;justify-content:center;
    width:42px;height:42px;border-radius:50%;
    color:#1c1410;
    background:linear-gradient(180deg,#f0d194,#d4a24e 60%,#b98a3e);
    box-shadow:0 4px 12px rgba(140,105,55,.5), inset 0 1px 0 rgba(255,255,255,.5);
  }
  .eb-mobilenav__toc svg{width:20px;height:20px}

  .eb-totop{
    position:fixed;right:14px;bottom:86px;z-index:55;
    display:inline-flex;align-items:center;justify-content:center;
    width:46px;height:46px;border:none;border-radius:50%;
    color:#1c1410;cursor:pointer;
    background:linear-gradient(180deg,#f0d194,#d4a24e 60%,#b98a3e);
    box-shadow:0 8px 22px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.5);
    opacity:0;visibility:hidden;transform:translateY(10px);
    transition:opacity .3s,transform .3s,visibility .3s;
  }
  .eb-totop svg{width:20px;height:20px}
  .eb-totop.visible{opacity:1;visibility:visible;transform:none}
}

@media (max-width:560px){
  .eb-topbar{padding:10px 12px}
  .eb-brand__text{font-size:14px}
  .eb-page{padding:18px 14px}
  .eb-cards{grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:12px}
  .eb-article .detail_picture{float:none;display:block;margin:0 auto 14px;max-width:100%}
}
