/* ============================================================
   Компонентный слой «Дорогая академия»: командный центр поиска,
   витрина номера (3D-обложка), музейные формуляры, паспорт рукописи,
   BBox-просмотрщик с золотой подсветкой, модалки, тосты.
   ============================================================ */

/* ================= HERO: ИНЖЕНЕРНЫЙ ПОИСК (тёмный, монолит с шапкой) ================= */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 460px at 88% -120px, rgba(197, 160, 89, .16), transparent 62%),
    radial-gradient(700px 420px at -8% 30%, rgba(2, 132, 199, .16), transparent 60%),
    linear-gradient(180deg, #0b1528 0%, var(--ink-deep) 70%);
  color: #f2ecdd;
  padding: 46px 0 50px;
}
/* тонкое золотое кольцо-орнамент справа */
.hero::after {
  content: ""; position: absolute; right: -160px; top: -160px; width: 460px; height: 460px;
  border-radius: 50%; border: 1px solid rgba(197, 160, 89, .18); pointer-events: none;
  box-shadow: 0 0 0 60px rgba(197, 160, 89, .04), 0 0 0 130px rgba(197, 160, 89, .025);
}
.hero h1 { color: #faf5e8; max-width: 1120px; }
.hero h1 em { font-style: normal; color: var(--gold-2); }
.hero .lead { color: #b9c3d8; max-width: 760px; font-size: 1.05rem; margin-bottom: 26px; }
.hero-title {
  margin-bottom: 22px;
  font-size: clamp(1.5rem, 2.4vw, 2.3rem);
  letter-spacing: -.008em;
}
/* На широких экранах заголовок — строго одна строка */
@media (min-width: 900px) { .hero-title { white-space: nowrap; } }

/* === Поисковая карточка-воркспейс (Perplexity/Claude) === */
.search-card {
  background: rgba(12, 20, 40, .66);
  border: 1px solid rgba(197, 160, 89, .38);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(14px);
  transition: border-color .2s, box-shadow .25s;
}
.search-card:focus-within {
  border-color: rgba(212, 175, 55, .85);
  box-shadow:
    0 18px 50px rgba(0, 0, 0, .45),
    0 0 0 4px rgba(212, 175, 55, .12),
    0 0 48px rgba(212, 175, 55, .22),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}
.search-input {
  display: block; width: 100%;
  min-height: 118px; max-height: 340px;
  padding: 20px 22px 12px;
  background: transparent; border: 0; outline: none; resize: none;
  color: #f5f0e2;
  font: 400 1.05rem/1.6 var(--font-ui);
}
.search-input::placeholder { color: #7e879e; }
/* Нижняя панель действий внутри карточки */
.search-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(197, 160, 89, .16);
}
.sa-hint { color: #8b94ab; font-size: .78rem; letter-spacing: .03em; }
.src-toggles { display: flex; gap: 8px; flex-wrap: wrap; }
.src-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #cfd6e6; font-size: .84rem; font-weight: 600;
  transition: border-color .15s, color .15s, background .15s;
  user-select: none;
}
.src-pill input { position: absolute; opacity: 0; pointer-events: none; }
.src-pill .box {
  width: 16px; height: 16px; border-radius: 5px; flex: 0 0 auto;
  border: 1.5px solid rgba(212, 175, 55, .55);
  background: transparent; position: relative;
  transition: background .15s, border-color .15s;
}
.src-pill .box::after {
  content: ""; position: absolute; left: 4.5px; top: 1.5px;
  width: 5px; height: 9px; border: solid #221a08; border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg) scale(0); transition: transform .12s;
}
.src-pill:hover { border-color: rgba(212, 175, 55, .55); color: #f2e8cf; }
.src-pill input:checked ~ .box,
.src-pill:has(input:checked) .box { background: var(--gold-foil); border-color: var(--gold-2); }
.src-pill input:checked ~ .box::after,
.src-pill:has(input:checked) .box::after { transform: rotate(45deg) scale(1); }
.src-pill:has(input:checked) { color: #f2e8cf; border-color: rgba(212, 175, 55, .5); background: rgba(197, 160, 89, .12); }
.act-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Кнопка голосового ввода (стеклянная пилюля) */
.btn-mic {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .07); color: #e9dfc4;
  border: 1px solid rgba(197, 160, 89, .35);
  font-weight: 650; font-size: .87rem;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.btn-mic:hover { border-color: var(--gold-2); box-shadow: 0 0 18px rgba(212, 175, 55, .25); }
.btn-mic .wave { display: none; gap: 2.5px; align-items: center; height: 16px; }
.btn-mic .wave i {
  width: 3px; border-radius: 2px; background: currentColor; height: 30%;
  animation: wave .9s ease-in-out infinite;
}
.btn-mic .wave i:nth-child(1) { animation-delay: 0s; }
.btn-mic .wave i:nth-child(2) { animation-delay: .12s; }
.btn-mic .wave i:nth-child(3) { animation-delay: .24s; }
.btn-mic .wave i:nth-child(4) { animation-delay: .36s; }
.btn-mic .wave i:nth-child(5) { animation-delay: .48s; }
@keyframes wave { 0%, 100% { height: 22%; } 50% { height: 100%; } }
.btn-mic.listening { color: #ff9c93; border-color: #ff9c93; }
.btn-mic.listening .mic-ico { display: none; }
.btn-mic.listening .wave { display: inline-flex; }
.search-card .btn-accent { padding: 11px 22px; }
.search-card .btn-ghost { color: #e9dfc4; border-color: rgba(197, 160, 89, .4); background: transparent; }
.search-card .btn-ghost:hover { background: rgba(255, 255, 255, .07); border-color: var(--gold-2); }

/* Пилюли быстрых тем — один ряд под карточкой */
.quick-prompts { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.quick-prompts .chip {
  cursor: pointer; background: rgba(255, 255, 255, .05); color: #d9dee9;
  border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(6px);
  transition: border-color .15s, color .15s, transform .06s;
}
.quick-prompts .chip:hover { border-color: rgba(212, 175, 55, .7); color: #f7e9c8; transform: translateY(-1px); }

/* ================= ВЫДАЧА: КАРТОЧКИ ПУБЛИКАЦИЙ ================= */
.results { border-top: 1px solid var(--line-soft); padding: 16px 20px 6px; }
.results-head { font: 800 .78rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); margin-bottom: 12px; }
.result-card {
  border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px;
  background: var(--surface); margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.result-card:hover { border-color: rgba(197, 160, 89, .6); box-shadow: 0 8px 24px rgba(154, 123, 58, .12); }
.r-title { font-family: var(--font-display); font-size: 1.02rem; margin: 0; line-height: 1.3; }
.r-meta { color: var(--ink-3); font-size: .8rem; margin-top: 4px; }
.r-takeaway { font-size: .9rem; color: var(--ink-2); margin: 9px 0 11px; line-height: 1.5; }
.r-take-tag { font-weight: 800; font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--cyan); margin-right: 6px; }
.r-actions { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }

/* ================= B2B ПЛАШКА: ПЕРЕХОД В OWUI ================= */
.upsell-zone { padding: 4px 20px 20px; }
.upsell {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  border: 1px solid rgba(197, 160, 89, .5); border-radius: 14px;
  background: linear-gradient(120deg, rgba(197, 160, 89, .12), rgba(10, 17, 32, .04) 55%, rgba(2, 132, 199, .08));
  padding: 16px 18px;
}
.upsell-ico {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px;
  background: var(--gold-foil); color: #241b08;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.upsell-title { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; margin-bottom: 2px; }
.upsell .btn-accent { flex: 0 0 auto; }

/* ================= ПАНЕЛЬ ОТВЕТА ================= */
.answer-panel {
  max-width: 880px; margin-top: 26px;
  background: rgba(255, 255, 255, .97);
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
  overflow: hidden; color: var(--ink);
}
.answer-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  font-size: .84rem; color: var(--ink-2);
}
.answer-body { padding: 20px 22px; font-size: 1.0rem; }
.answer-body.reading { font-family: var(--font-read); font-size: 1.06rem; line-height: 1.68; }
.answer-body p:last-child { margin-bottom: 0; }
.caret { display: inline-block; width: 8px; height: 1.05em; vertical-align: text-bottom; background: var(--gold-deep); margin-left: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.sup-cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 4px; margin: 0 2px;
  border-radius: 5px; background: var(--gold-soft); color: var(--gold-deep);
  font: 700 .72rem/1 var(--font-ui); cursor: pointer; vertical-align: 2px; user-select: none;
  border: 1px solid rgba(197, 160, 89, .5);
}
.sup-cite:hover { background: var(--gold); color: #fff; border-color: var(--gold-deep); }

/* Ссылка-цитата [[N]](url) из живых ответов моста: кнопка N↗ во вьювер */
.cite-link {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 1px 5px; margin: 0 2px; border-radius: 5px;
  background: var(--gold-soft); color: var(--gold-deep);
  border: 1px solid rgba(197, 160, 89, .5);
  font: 700 .72rem/1.3 var(--font-ui); text-decoration: none; vertical-align: 1px;
}
.cite-link:hover { background: var(--gold); color: #fff; border-color: var(--gold-deep); text-decoration: none; }
.md-link { color: var(--cyan); text-decoration: underline; text-underline-offset: 2px; }
.md-link:hover { color: var(--cyan-2); }

/* ================= ЦИТАТЫ ================= */
.citations { border-top: 1px solid var(--line-soft); padding: 16px 20px 20px; }
.citations h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gold-deep); margin-bottom: 12px; font-family: var(--font-ui); }
.cite-list { display: grid; gap: 9px; }
.cite {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, box-shadow .15s, transform .06s;
}
.cite:hover { border-color: var(--gold); box-shadow: 0 8px 26px rgba(197, 160, 89, .22); transform: translateY(-1px); }
.cite-n {
  flex: 0 0 auto; width: 27px; height: 27px; border-radius: 8px;
  background: var(--gold-foil); color: #241b08;
  font: 800 .82rem/27px var(--font-ui); text-align: center;
}
.cite-doc { font-weight: 700; font-size: .9rem; }
.cite-meta { color: var(--ink-3); font-size: .78rem; display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 3px; }
.cite-preview { color: var(--ink-2); font-size: .84rem; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cite-open { color: var(--cyan); font-size: .8rem; font-weight: 700; margin-top: 6px; display: inline-flex; gap: 5px; align-items: center; }

/* ================= ВИТРИНА СВЕЖЕГО НОМЕРА ================= */
/* === Тизер свежего номера на главной (витрина — на отдельной странице) === */
.issue-teaser { background: var(--surface); border-bottom: 1px solid var(--line); }
.issue-teaser .wrap { padding-top: 14px; padding-bottom: 14px; }
.issue-teaser-link {
  display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit;
  border: 1px solid rgba(197, 160, 89, .42); border-radius: 14px; padding: 12px 16px;
  background: linear-gradient(90deg, #fffdf7, #f8f2e2);
  transition: box-shadow .2s, border-color .2s;
}
.issue-teaser-link:hover { border-color: var(--gold); box-shadow: 0 8px 26px rgba(154, 123, 58, .18); text-decoration: none; }
.it-cover {
  flex: 0 0 44px; width: 44px; height: 60px; border-radius: 3px;
  background: linear-gradient(160deg, #16244a, #0a1120);
  border: 1px solid var(--gold); color: #f0d9a8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: .82rem; line-height: 1.15;
  box-shadow: 2px 3px 8px rgba(10, 17, 32, .35);
}
.it-cover em { font-style: normal; font-size: .54rem; letter-spacing: .14em; color: #c5a059; }
.it-kicker { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: var(--gold-deep); }
.it-title { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.it-note { display: block; color: var(--ink-3); font-size: .8rem; }
@media (max-width: 640px) { .it-note { display: none; } .issue-teaser-link { gap: 12px; } }

.issue-showcase {
  display: grid; grid-template-columns: 300px 1fr; gap: 34px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); padding: 30px; align-items: start;
  position: relative;
}
.issue-showcase::before {
  content: ""; position: absolute; inset: 10px; border-radius: 12px;
  border: 1px solid rgba(197, 160, 89, .28); pointer-events: none;
}

/* === Полиграфическая 3D-обложка === */
.book3d { perspective: 1200px; max-width: 280px; margin: 6px auto 10px; }
.book3d .book-inner {
  position: relative; border-radius: 6px 12px 12px 6px;
  transform: rotateY(-9deg) rotateX(2deg);
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1);
  box-shadow:
    -18px 18px 30px rgba(10, 17, 32, .18),
    -6px 8px 14px rgba(10, 17, 32, .22);
}
.book3d:hover .book-inner { transform: rotateY(-3deg) rotateX(1deg); }
/* корешок */
.book3d .book-inner::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px;
  background: linear-gradient(90deg, #071529 0%, #0d2b4d 45%, rgba(255, 255, 255, .12) 50%, #0d2b4d 55%, #071529 100%);
  border-radius: 6px 0 0 6px; z-index: 2;
}
/* форзац */
.book3d .book-inner::after {
  content: ""; position: absolute; right: -7px; top: 3px; bottom: -3px; width: 8px;
  background: linear-gradient(90deg, rgba(240, 232, 210, .9), rgba(240, 232, 210, 0));
  border-radius: 0 3px 3px 0; z-index: 0;
}
.cover-face {
  position: relative; border-radius: 4px 10px 10px 4px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 30% 0%, #123a63 0%, #0a2a4c 46%, #071d38 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 40px rgba(0, 0, 0, .35);
}
/* фактура бумаги обложки */
.cover-face::before {
  content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cover-face .emboss { padding: 22px 18px 16px 30px; position: relative; z-index: 1; }

/* Оглавление: аккордеоны с микротипографикой */
.toc-rubric { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; margin-bottom: 10px; background: var(--surface); }
.toc-rubric > button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 0; padding: 11px 16px; cursor: pointer;
  font-weight: 700; font-size: .93rem; text-align: left; color: var(--ink);
}
.toc-rubric > button:hover { background: var(--gold-soft); }
.toc-rubric .chev { transition: transform .18s; color: var(--gold-deep); }
.toc-rubric.open .chev { transform: rotate(180deg); }
.toc-items { display: none; padding: 4px 0; }
.toc-rubric.open .toc-items { display: block; }
.toc-item {
  display: flex; gap: 12px; align-items: baseline; padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft); font-size: .92rem; cursor: pointer;
  transition: background .12s;
}
.toc-item:last-child { border-bottom: 0; }
.toc-item:hover { background: var(--gold-soft); }
.toc-item .t-title { font-weight: 640; line-height: 1.35; }
.toc-item .t-authors { color: var(--ink-2); font-size: .82rem; margin-top: 2px; }
.toc-item .t-affil { color: var(--ink-3); font-size: .76rem; margin-top: 1px; }
.toc-item .t-meta { display: flex; gap: 8px; align-items: center; margin-top: 5px; flex-wrap: wrap; }
.toc-item .pages { color: var(--ink-3); font-size: .78rem; white-space: nowrap; font-family: var(--font-mono); }
.toc-item .readtime { color: var(--ink-3); font-size: .74rem; white-space: nowrap; }

/* ================= КАРТОЧКА СТАТЬИ ================= */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 30px; align-items: start; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); padding: 26px;
}
.meta-strip { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.doi-link { font-family: var(--font-mono); font-size: .84rem; }

.author-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.affil-list { font-size: .85rem; color: var(--ink-2); margin: 8px 0 0; }
.affil-list sup { color: var(--gold-deep); font-weight: 700; }

/* AI Executive Summary — золотистые тезисы */
.ai-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--r); }
.ai-thesis {
  border: 1px solid rgba(197, 160, 89, .4); border-radius: 12px; padding: 15px;
  background: linear-gradient(175deg, #fffdf6 0%, var(--gold-soft) 130%);
  position: relative;
}
.ai-thesis::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  background: var(--gold-foil); border-radius: 0 3px 3px 0;
}
.ai-thesis .tag {
  font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .09em;
  color: var(--gold-deep); display: flex; gap: 6px; align-items: center; margin-bottom: 7px;
}
.ai-thesis p { font-size: .9rem; margin: 0; }

/* Табы */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin: 20px 0 0; overflow-x: auto; }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 11px 16px;
  font-weight: 640; color: var(--ink-3); font-size: .93rem; white-space: nowrap;
  border-bottom: 3px solid transparent; margin-bottom: -2px; font-family: var(--font-ui);
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.tab-panel { padding: 18px 2px 0; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Литература */
.ref-list { counter-reset: ref; margin: 0; padding: 0; list-style: none; }
.ref {
  counter-increment: ref; position: relative;
  padding: 11px 12px 11px 48px; border-bottom: 1px solid var(--line-soft);
  font-size: .9rem; line-height: 1.5;
}
.ref::before {
  content: counter(ref); position: absolute; left: 11px; top: 12px;
  width: 25px; height: 25px; border-radius: 8px; background: var(--gold-soft);
  font: 700 .78rem/25px var(--font-ui); text-align: center; color: var(--gold-deep);
  border: 1px solid rgba(197, 160, 89, .4);
}
.ref .ref-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 7px; }

/* Формулы и таблицы */
.figure-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--surface); margin-bottom: 12px; }
.figure-card .fig-tag { font-size: .72rem; font-weight: 800; letter-spacing: .08em; color: var(--gold-deep); text-transform: uppercase; margin-bottom: 7px; }
.formula { font-family: var(--font-mono); font-size: 1.0rem; background: var(--surface-2); border-radius: 9px; padding: 13px 15px; overflow-x: auto; text-align: center; border: 1px solid var(--line-soft); }
.mini-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.mini-table th, .mini-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.mini-table th { background: var(--gold-soft); font-weight: 700; }

/* Покупка */
.buy-panel { position: sticky; top: 88px; }
.price-line { display: flex; align-items: baseline; gap: 12px; margin: 8px 0 16px; }
.price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; font-family: var(--font-display); }
.ent-banner {
  display: flex; gap: 11px; align-items: flex-start;
  border: 1px solid #bcdccb; background: var(--ok-soft); color: #14532d;
  padding: 13px 15px; border-radius: 11px; font-size: .88rem; margin-bottom: 12px;
}

/* ================= ИСТОРИЯ И ЛИЦА: музейные формуляры ================= */
.era-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.person-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--r); }
.museum-card {
  position: relative; padding: 22px 20px 18px; text-align: center;
  background: linear-gradient(178deg, #fffdf7 0%, #f8f2e2 100%);
  border: 1px solid rgba(197, 160, 89, .45); border-radius: 6px;
  box-shadow: var(--shadow);
}
.museum-card::before {
  content: ""; position: absolute; inset: 6px; border-radius: 3px;
  border: 1px solid rgba(197, 160, 89, .35); pointer-events: none;
}
.museum-card:hover { box-shadow: 0 10px 34px rgba(154, 123, 58, .25); }
.medallion { width: 116px; height: 116px; margin: 0 auto 12px; filter: drop-shadow(0 4px 10px rgba(60, 45, 15, .28)); }

/* Портрет «на монетке»: реальная фотография в круглом чекане — сепия, золотой рант, гильоширная кайма */
.medallion-photo { position: relative; border-radius: 50%; background: #e7d3a8; }
.medallion-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 22%; border-radius: 50%;
  filter: sepia(.52) contrast(1.07) brightness(1.02) saturate(.72);
}
.medallion-photo .coin-rim { position: absolute; inset: 0; pointer-events: none; }
.medallion-photo::after { /* блик чекана + виньетка по краю кружка */
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background:
    radial-gradient(120% 90% at 30% 10%, rgba(255, 248, 225, .32), transparent 42%),
    radial-gradient(150% 120% at 50% 112%, rgba(56, 39, 12, .42), transparent 58%);
}
.medallion-credit { display: block; margin: -4px auto 10px; width: 116px; font-size: .6rem; color: var(--ink-3); letter-spacing: .02em; }
.museum-era {
  display: inline-block; font-size: .68rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase;
  color: var(--gold-deep); border-top: 1px solid rgba(197, 160, 89, .55); border-bottom: 1px solid rgba(197, 160, 89, .55);
  padding: 3px 10px; margin-bottom: 10px;
}
.person-name { font-family: var(--font-display); font-weight: 700; font-size: 1.06rem; margin: 2px 0 2px; line-height: 1.25; }
.person-years { color: var(--ink-2); font-size: .82rem; font-family: var(--font-mono); letter-spacing: .04em; }
.person-deg { color: var(--gold-deep); font-size: .78rem; font-weight: 650; margin-top: 2px; }
.museum-rule { width: 56px; height: 2px; margin: 12px auto; background: var(--gold-foil); }
.person-bio { font-size: .86rem; color: var(--ink-2); margin: 0; text-align: left; line-height: 1.55; }
.person-pubs { margin: 12px 0 0; padding: 0; list-style: none; font-size: .8rem; text-align: left; }
.person-pubs li { padding: 5px 0; border-top: 1px dashed var(--line); }
.person-pubs a { font-weight: 650; }
.person-source { margin-top: 10px; font-size: .7rem; color: var(--ink-3); letter-spacing: .03em; }

/* ================= КОЛЛЕКЦИОННЫЕ ИЗДАНИЯ ================= */
.rarities-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--r); }
.rarity-card { text-align: left; padding: 0; overflow: hidden; cursor: default; position: relative; }
.rarity-cover {
  position: relative; aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(130% 100% at 30% 0%, #8a5424 0%, #5c3210 60%, #462508 100%);
}
.rarity-cover::after {
  content: ""; position: absolute; inset: 7px; border: 1px solid rgba(246, 238, 219, .35); border-radius: 2px;
}
.rarity-cover .year { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: .04em; color: #f0d9a8; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.rarity-body { padding: 13px 15px 15px; }
.veterans-strip { display: flex; gap: 6px; flex-wrap: wrap; }
.vol-chip {
  width: 44px; height: 44px; border-radius: 10px; border: 1px solid rgba(197, 160, 89, .5);
  background: linear-gradient(178deg, #fffdf7, #f6efdd);
  font: 700 .8rem/44px var(--font-ui); text-align: center; color: var(--gold-deep);
  cursor: pointer; transition: box-shadow .15s, transform .06s;
}
.vol-chip:hover { box-shadow: 0 6px 18px rgba(154, 123, 58, .3); transform: translateY(-1px); }

/* Конструктор подарочного тома */
.gift-config { display: grid; grid-template-columns: 270px 1fr; gap: 30px; }
.book-preview {
  position: relative; border-radius: 8px 14px 14px 8px; padding: 30px 20px; text-align: center; color: #f5e9d0;
  background:
    radial-gradient(120% 100% at 30% 0%, #8a5a2a 0%, #6b3d15 55%, #54300e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 240, 200, .3), inset 0 0 30px rgba(0, 0, 0, .3), var(--shadow);
  transform: rotateY(-7deg); transition: transform .4s;
}
.book-preview:hover { transform: rotateY(-2deg); }
.book-preview::before { content: ""; position: absolute; left: 10px; top: 10px; bottom: 10px; right: 10px; border: 1px solid rgba(240, 217, 168, .45); border-radius: 4px; }
.book-preview .bk-year { font-size: 2.3rem; font-weight: 800; color: #ffd98a; font-family: var(--font-display); text-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.book-preview .bk-title { font-family: var(--font-read); font-size: .95rem; margin-top: 8px; line-height: 1.4; }
.book-preview .bk-stamp { margin-top: 16px; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #e8c07a; }

/* Реставрация было/стало */
.remaster { display: grid; grid-template-columns: 1fr 1fr; gap: var(--r); }
.remaster .pane { border-radius: 10px; border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.remaster .pane .cap { font-size: .78rem; padding: 7px 11px; background: var(--gold-soft); color: var(--gold-deep); font-weight: 700; }
.remaster .old { background: #efe7d8; filter: sepia(.5) contrast(.85); }
.scan-lines { position: relative; }
.scan-lines::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(90, 70, 30, .12) 0 2px, transparent 2px 5px); pointer-events: none; }

/* ================= АВТОРАМ И РЕЦЕНЗЕНТАМ ================= */
.prescreen-layout { display: grid; grid-template-columns: 430px 1fr; gap: 28px; align-items: start; }
.dropzone {
  border: 2px dashed rgba(197, 160, 89, .55); border-radius: 16px;
  background: linear-gradient(178deg, #fffdf7, var(--surface-2));
  padding: 38px 22px; text-align: center; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--gold-2); background: var(--gold-soft); box-shadow: 0 10px 30px rgba(197, 160, 89, .25); }
.dropzone .dz-ico { font-size: 2.1rem; margin-bottom: 8px; }
.file-pill {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px; background: var(--surface);
  font-size: .88rem;
}
.pipeline { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pipe-step { display: flex; gap: 10px; align-items: center; font-size: .88rem; color: var(--ink-3); }
.pipe-step .st-ico { width: 22px; text-align: center; color: var(--gold-deep); }
.pipe-step.active { color: var(--ink); font-weight: 650; }
.pipe-step.done { color: var(--ok); }
.pipe-step .spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto;
  border: 2px solid var(--line); border-top-color: var(--gold-deep);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Паспорт: hero-число + одноцветный линейный метр */
.novelty { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.novelty-num { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.novelty-num .unit { font-size: 1.2rem; color: var(--ink-3); font-weight: 600; }
.meter { flex: 1 1 240px; min-width: 200px; }
.meter-track { position: relative; height: 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-fill {
  position: absolute; inset: 0 auto 0 0; width: 0%;
  background: linear-gradient(90deg, #8a6a2f, var(--gold) 70%, var(--gold-2));
  border-radius: 999px; transition: width .9s cubic-bezier(.22, 1, .36, 1);
}
.meter-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-3); margin-top: 5px; }
.passport-sec { margin-top: 22px; }
.passport-sec h4 { font-family: var(--font-ui); font-size: .95rem; border-left: 3px solid var(--gold); padding-left: 10px; }
.match-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: .9rem; }
.match-bar { flex: 0 0 120px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.match-bar i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a2f, var(--gold-2)); border-radius: 999px; }

/* ================= BBox ПРОСМОТРЩИК ================= */
.viewer-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 0;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow);
  min-height: 70vh;
}
.page-pane { background: #23262b; padding: 20px; overflow: auto; position: relative; }
.page-canvas { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 6px 26px rgba(0, 0, 0, .5); transform-origin: top center; }
.page-canvas img { width: 100%; display: block; }
.block-region { position: absolute; border-radius: 2px; }
.block-region.hl {
  border: 3px solid var(--hl);
  background: rgba(246, 199, 0, .26);
  box-shadow: 0 0 0 2px var(--hl-glow), 0 0 26px var(--hl-glow);
  z-index: 5;
  animation: hl-pulse 1.7s ease-in-out infinite;
}
@keyframes hl-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--hl-glow), 0 0 18px rgba(246, 199, 0, .35); }
  50%      { box-shadow: 0 0 0 3px rgba(246, 199, 0, .75), 0 0 42px rgba(246, 199, 0, .65); }
}
.block-region.dim { outline: 1px dashed rgba(197, 160, 89, .4); }
.chunk-pane { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; max-height: 78vh; }
.chunk-card { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: .88rem; cursor: pointer; }
.chunk-card:hover { background: var(--surface-2); }
.chunk-card.active { background: #fdf6dd; box-shadow: inset 3px 0 0 var(--gold); }
.chunk-card .ch-tag { font-size: .7rem; font-weight: 800; letter-spacing: .07em; color: var(--gold-deep); text-transform: uppercase; }
.viewer-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; font-size: .85rem; color: var(--ink-2); }
.viewer-toolbar .btn-ghost { color: var(--ink); }

/* Синтетическая страница (демо-режим вьюера) */
.synt-page { position: relative; width: 100%; color: #1c1c1c; font-family: var(--font-read); }
.synt-page .s-block { position: absolute; overflow: hidden; }
.synt-page .s-head { font-weight: 700; text-align: center; text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.synt-page .s-title { font-weight: 700; text-align: center; font-size: 15px; line-height: 1.3; }
.synt-page .s-auth { text-align: center; font-size: 10.5px; }
.synt-page .s-text { font-size: 9.5px; line-height: 1.45; text-align: justify; }
.synt-page .s-formula { font-family: var(--font-mono); text-align: center; font-size: 11px; }
.synt-page .s-table { font-size: 8.5px; }

/* ================= МОДАЛКИ / ТОСТЫ ================= */
.modal-back {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(7, 12, 24, .62); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  max-width: 720px; width: 100%; max-height: 92vh; overflow: auto; position: relative;
  border: 1px solid rgba(197, 160, 89, .35);
  animation: modal-in .22s cubic-bezier(.22, 1, .36, 1);
}
.modal-wide { max-width: 1080px; }
@keyframes modal-in { from { transform: translateY(14px); opacity: 0; } }

/* Выезжающий сплит-экран просмотрщика (цитата → документ) */
.modal.modal-slide {
  max-width: min(1120px, 96vw); width: 100%; height: 94vh; max-height: 94vh;
  margin-left: auto; margin-right: 0; border-radius: 18px 0 0 18px;
  animation: slide-in-right .38s cubic-bezier(.22, 1, .36, 1);
}
@keyframes slide-in-right { from { transform: translateX(7%); opacity: 0; } }
.modal-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 20px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.modal-head h3 { margin: 0; font-size: 1.02rem; font-family: var(--font-display); }
.modal-body { padding: 20px; }
.modal-body:has(iframe) { padding: 14px; }
.modal-x { border: 0; background: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink-3); padding: 4px 9px; border-radius: 7px; }
.modal-x:hover { background: var(--surface-2); color: var(--ink); }

.sbp-qr { width: 190px; height: 190px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; box-shadow: var(--shadow); }

.toast-zone { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--ink-deep); color: #f2ecdd; padding: 12px 18px; border-radius: 11px;
  border: 1px solid rgba(197, 160, 89, .4);
  box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 380px;
  animation: toast-in .25s ease-out;
}
.toast.ok { background: linear-gradient(160deg, #123527, #0d2a1e); border-color: rgba(74, 222, 128, .4); }
.toast.err { background: linear-gradient(160deg, #431715, #2e0f0e); border-color: rgba(248, 113, 113, .4); }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

/* ================= АДАПТИВ ================= */
@media (max-width: 1020px) {
  .article-layout { grid-template-columns: 1fr; }
  .buy-panel { position: static; }
  .viewer-shell { grid-template-columns: 1fr; }
  .chunk-pane { border-left: 0; border-top: 1px solid var(--line); max-height: 45vh; }
  .prescreen-layout { grid-template-columns: 1fr; }
  .rarities-grid { grid-template-columns: repeat(2, 1fr); }
  .person-grid { grid-template-columns: repeat(2, 1fr); }
  .issue-showcase { grid-template-columns: 1fr; }
  .book3d { max-width: 240px; }
  .gift-config { grid-template-columns: 1fr; }
  .book-preview { max-width: 270px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .ai-summary { grid-template-columns: 1fr; }
  .person-grid { grid-template-columns: 1fr; }
  .rarities-grid { grid-template-columns: 1fr; }
  .remaster { grid-template-columns: 1fr; }
  .answer-panel { border-radius: 12px; }
  .hero { padding: 44px 0 40px; }
  .copilot-box .btn-accent { padding: 11px 14px; }
}
