/* Титул KZ — раскрытая зачётная книжка: бордовый ледерин со слепым тиснением, графлёные страницы,
   подписи и штамп синими чернилами, ведомость с миниатюрами листов, карта вузов. */
:root {
  --cover: #5b1e25; --cover-2: #47161c; --cover-hi: #74303a; --emboss: #a95b66;
  --paper: #fbf8f0; --paper-2: #ece4d1; --paper-3: #f4eedf; --rule: #c9d3e4; --margin: #c25b45;
  --ink: #1d2433; --ink-2: #4f586b; --ghost: #9da5b6;
  --stamp: #2f43a6; --stamp-2: #26379a; --night: #1d2a68;
  --serif: 'Alegreya', 'PT Serif', Georgia, serif;
  --sans: 'PT Sans', 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 12px; }
body { margin: 0; background: var(--paper-2); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: var(--stamp); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
.wrap { max-width: 1560px; margin: 0 auto; padding: 0 clamp(16px, 2.5vw, 40px); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: #fff; padding: 8px 12px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
h2 { font-size: clamp(24px, 2.4vw, 32px); margin-bottom: 16px; }
h3 { font-size: 20px; }
[hidden] { display: none !important; }

/* Обложка-шапка: ледерин, слепое тиснение */
.cover { background: var(--cover) radial-gradient(rgba(0,0,0,.12) 1px, transparent 1.2px) 0 0 / 5px 5px; color: #f1e6dc; box-shadow: inset 0 -6px 10px -8px rgba(0,0,0,.6); }
.cover-in { display: flex; align-items: center; gap: 24px 36px; flex-wrap: wrap; min-height: 76px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-link { display: flex; align-items: center; gap: 12px; color: var(--emboss); text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 3px; font: 700 27px/1 var(--serif); color: var(--emboss); box-shadow: inset 1px 1px 0 rgba(0,0,0,.45), inset -1px -1px 0 rgba(255,255,255,.14), 1px 1px 0 rgba(255,255,255,.1); text-shadow: 1px 1px 0 rgba(255,255,255,.16), -1px -1px 0 rgba(0,0,0,.55); }
.brand-name { font: 700 26px/1 var(--serif); letter-spacing: .03em; text-shadow: 1px 1px 0 rgba(255,255,255,.16), -1px -1px 0 rgba(0,0,0,.55); }
.brand-sub { font-size: 13px; color: #d7b9b1; }
.nav { display: flex; gap: 6px 22px; flex-wrap: wrap; margin-left: auto; }
.nav a { color: #f1e6dc; font-size: 16px; padding: 4px 0; border-bottom: 2px solid transparent; }
.nav a:hover { text-decoration: none; border-color: #f1e6dc; }
.lang { display: flex; gap: 4px; }
.lang a { padding: 5px 12px 6px; color: #f1e6dc; font-size: 15px; border-radius: 3px 3px 0 0; background: var(--cover-hi); }
.lang a[aria-current] { background: var(--paper); color: var(--cover); font-weight: 700; }
.lang a:hover { text-decoration: none; }

/* Заголовок страницы — без «заголовок слева, подпись справа» */
.lead-row { padding: 30px 0 22px; max-width: 1180px; }
.lead-row h1 { font-size: clamp(30px, 3.6vw, 50px); }
.lead { margin: 10px 0 0; color: var(--ink-2); font-size: 18px; max-width: 900px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 0; margin: 18px 0 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.crumbs li + li::before { content: '/'; margin: 0 8px; color: var(--ghost); }

/* Генератор: раскрытая книжка — левая страница с графами, корешок, правая страница с листом */
.gen { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .86fr); margin-bottom: 64px; padding: 10px; border-radius: 8px; background: var(--cover) radial-gradient(rgba(0,0,0,.12) 1px, transparent 1.2px) 0 0 / 5px 5px; box-shadow: 0 26px 40px -30px rgba(40,10,14,.8); }
.book { background: var(--paper); border-radius: 4px 0 0 4px; position: relative; box-shadow: inset -26px 0 26px -24px rgba(60,30,20,.45), -3px 0 0 #e7dec8, -6px 0 0 #d9cdb0; }
.book-tabs { display: flex; flex-wrap: wrap; gap: 12px 26px; padding: 16px 20px 14px; border-bottom: 2px solid var(--ink); }
.seg { border: 0; margin: 0; padding: 0; display: flex; align-items: center; flex-wrap: wrap; }
.seg legend { float: left; margin-right: 12px; font: 600 15px var(--serif); color: var(--ink-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 12px; border: 1px solid #cdbf9c; margin-left: -1px; font-size: 15px; background: #fff; }
.seg input:checked + span { background: var(--cover); border-color: var(--cover); color: #fff; font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--stamp); outline-offset: 2px; }
.rows { position: relative; }
.rows::before { content: ''; position: absolute; top: 0; bottom: 0; left: 196px; border-left: 2px solid var(--margin); opacity: .55; pointer-events: none; }
.row { display: grid; grid-template-columns: 196px minmax(0, 1fr); border-bottom: 1px solid var(--rule); min-height: 50px; }
.row-l { padding: 13px 14px 8px 20px; font: 600 15px/1.3 var(--serif); color: var(--ink-2); }
.row-c { padding: 6px 14px 6px 16px; display: flex; align-items: center; }
.row-c input, .row-c select, .row-c textarea { width: 100%; border: 0; border-bottom: 1px dashed transparent; background: transparent; font: 17px/1.4 var(--sans); color: var(--ink); padding: 7px 2px; border-radius: 0; resize: vertical; }
.row-c input:focus, .row-c select:focus, .row-c textarea:focus { outline: none; border-bottom-color: var(--stamp); background: rgba(47,67,166,.04); }
.row-c ::placeholder { color: var(--ghost); }
.row-c select { cursor: pointer; }
.pair-in { display: flex; gap: 14px; width: 100%; align-items: center; }
.pair-in input:first-child { flex: 0 0 auto; width: 5.5em; }
.pair-in select { flex: 1; }
.pair-in input[name=group], .pair-in input[name=city] { flex: 1; width: auto; }
.row-c .num { display: flex; align-items: center; gap: 4px; color: var(--ink-2); white-space: nowrap; }
.row-c .num input { width: 3.2em; }
.pick { width: 100%; position: relative; }
.pick-q { margin-bottom: 2px; }
.pick-list { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; max-height: 320px; overflow: auto; margin: 0; padding: 4px 0; list-style: none; background: #fff; border: 1px solid var(--rule); box-shadow: 0 12px 24px -12px rgba(0,0,0,.3); }
.pick-list li { padding: 7px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.pick-list li small { color: var(--ink-2); }
.pick-list li[aria-selected=true], .pick-list li:hover { background: #eef1fa; }
.checks .row-c { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 10px; padding-bottom: 10px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 16px; cursor: pointer; }
.checks input { width: auto; accent-color: var(--stamp); }
.book-foot { position: sticky; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; padding: 14px 20px; background: var(--paper); border-top: 1px solid var(--ink); box-shadow: 0 -10px 18px -14px rgba(60,30,20,.35); border-radius: 0 0 0 4px; }
.stamp { display: inline-flex; align-items: center; gap: 10px; font: 700 18px/1 var(--sans); color: #fff; background: var(--stamp); border: 0; border-radius: 4px; padding: 15px 26px 15px 20px; cursor: pointer; box-shadow: 0 3px 0 #1f2f80, 0 8px 18px -8px rgba(47,67,166,.7); transition: background .15s, transform .1s, box-shadow .1s; }
.stamp svg { width: 22px; height: 22px; flex: none; }
.stamp:hover { background: var(--stamp-2); }
.stamp:active { transform: translateY(2px); box-shadow: 0 1px 0 #1f2f80; }
.stamp:focus-visible { outline: 3px solid var(--margin); outline-offset: 3px; }
.book-note { margin: 0; font-size: 14px; color: var(--ink-2); max-width: 420px; }

/* Правая страница: лист, скрепка или переплёт, штамп */
.sheet-col { overflow-x: clip; background: var(--paper-3); border-radius: 0 4px 4px 0; padding: 26px clamp(18px, 2.4vw, 40px) 26px; box-shadow: inset 26px 0 26px -24px rgba(60,30,20,.45), 3px 0 0 #e7dec8, 6px 0 0 #d9cdb0; }
.sheet-stick { position: sticky; top: 18px; }
.sheet { container-type: inline-size; position: relative; }
.pv { display: grid; gap: 18px; }
.a4 { position: relative; aspect-ratio: 210 / 297; background: #fff; color: #000; box-shadow: 0 1px 2px rgba(0,0,0,.15), 0 16px 30px -20px rgba(40,20,10,.55); display: flex; flex-direction: column; font: 2.353cqw/1.15 'Times New Roman', Times, serif; }
.a4 p { margin: 0; overflow-wrap: anywhere; }
.a4 .ghost { color: #a7aebd; }
.a4 .pair { display: grid; grid-template-columns: 45% 55%; }
.a4-tag { position: absolute; top: 8px; right: 10px; font: 600 12px var(--sans); color: var(--ink-2); background: var(--paper-2); padding: 2px 8px; }
/* Скрепка в углу — реферат, СРС и другие простые работы */
.pv-simple .a4:first-child::before { content: ''; position: absolute; top: -9px; left: 22px; width: 46px; height: 13px; border: 2px solid #8b93a3; border-radius: 7px; transform: rotate(-38deg); background: linear-gradient(transparent 4px, rgba(255,255,255,.6) 4px 6px, transparent 6px); box-shadow: 1px 1px 0 rgba(0,0,0,.12); }
/* Переплёт — выпускные работы */
.pv-grad .a4 { border-left: 16px solid var(--cover-2); }
.pv-grad .a4::after { content: ''; position: absolute; top: 4%; bottom: 4%; left: -10px; width: 4px; background: repeating-linear-gradient(to bottom, rgba(255,255,255,.55) 0 7px, transparent 7px 15px); }
.pv-anim .a4:first-child { animation: slidein .45s ease-out; }
@keyframes slidein { from { transform: translateY(-26px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
.seal { position: absolute; right: -6px; bottom: 9%; width: 118px; height: 118px; pointer-events: none; opacity: 0; transform: rotate(-14deg) scale(1.5); transition: opacity .25s, transform .3s cubic-bezier(.2,1.6,.4,1); mix-blend-mode: multiply; }
.gen.ready .seal { opacity: .88; transform: rotate(-14deg) scale(1); }
.seal circle { fill: none; stroke: var(--stamp); }
.seal text { fill: var(--stamp); font-family: var(--sans); font-weight: 700; }
.sheet-note { font-size: 14px; color: var(--ink-2); margin: 12px 0 0; }

/* Ведомость: лист в скоросшивателе */
.ledger { margin-bottom: 72px; }
.ledger-paper { position: relative; max-width: 1180px; background: #fff; padding: 22px 26px 18px 64px; box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 30px -24px rgba(40,20,10,.6); }
.ledger-paper::before { content: ''; position: absolute; left: 22px; top: 0; bottom: 0; width: 14px; background: radial-gradient(circle, var(--paper-2) 5.5px, rgba(0,0,0,.2) 6px, transparent 6.6px) 0 40px / 14px 120px repeat-y; }
.ledger-scroll { overflow-x: auto; max-width: 1180px; }
.ledger table { width: 100%; border-collapse: collapse; font-size: 16px; }
.ledger th { font: 600 13px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--ink-2); padding: 8px 12px; border-bottom: 2px solid var(--ink); }
.ledger td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ledger td + td, .ledger th + th { border-left: 1px solid var(--rule); }
.ledger td:first-child { font: 600 15px var(--serif); color: var(--ink-2); width: 3em; }
.ledger td:nth-child(2) { white-space: nowrap; }
.ledger tr[aria-current] td { background: #fff7dc; }
.bridge { max-width: 860px; margin: 14px 0 0; color: var(--ink-2); }

/* Карта вузов — полоса синих чернил на всю ширину */
.atlas { background: var(--night); color: #e8ebf7; margin: 0 0 64px; padding: 46px 0 50px; }
.atlas h2 { color: #fff; }
.atlas-in { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px 40px; align-items: start; }
.atlas-map svg { width: 100%; height: auto; display: block; }
.atlas-map .land { fill: rgba(255,255,255,.06); stroke: rgba(232,235,247,.55); stroke-width: 1.4; }
.atlas-map .grid { stroke: rgba(232,235,247,.08); stroke-width: 1; }
.atlas-map a { cursor: pointer; }
.atlas-map circle { fill: #f6efe0; stroke: var(--night); stroke-width: 2; transition: fill .15s; }
.atlas-map a:hover circle, .atlas-map a[aria-current] circle { fill: #ffb199; }
.atlas-map text { fill: #e8ebf7; font: 600 19px var(--sans); paint-order: stroke; stroke: var(--night); stroke-width: 4px; }
.atlas-map a[aria-current] text { fill: #fff; }
.atlas-panel { background: rgba(255,255,255,.05); border: 1px solid rgba(232,235,247,.2); padding: 18px 20px; min-height: 280px; }
.atlas-panel h3 { color: #fff; font-size: 24px; margin-bottom: 4px; }
.atlas-count { margin: 0 0 12px; color: #b9c0e3; font-size: 15px; }
.atlas-panel ul { list-style: none; margin: 0; padding: 0; columns: 2 200px; column-gap: 24px; }
.atlas-panel li { padding: 3px 0; break-inside: avoid; }
.atlas-panel a { color: #fff; }
.atlas-all { display: inline-block; margin-top: 14px; color: #ffcfbf !important; }

/* Вопросы — первый с образцом на всю ширину, дальше два столбца */
.qa { margin-bottom: 56px; }
.qa ol { list-style: none; counter-reset: q; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 24px 44px; max-width: 1180px; }
.qa li { counter-increment: q; position: relative; padding-left: 46px; }
.qa li::before { content: counter(q) '.'; position: absolute; left: 0; top: -2px; font: 700 28px/1 var(--serif); color: var(--margin); }
.qa li.qa-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 40px; align-items: start; }
.qa li.qa-wide .qa-q { grid-column: 1 / -1; }
.qa-q { font: 700 19px/1.25 var(--serif); margin: 0 0 6px; color: var(--ink); }
.qa p { margin: 0; color: var(--ink-2); max-width: 860px; }
.qa p.qa-q { color: var(--ink); }
.strip { background: #fff; padding: 16px 18px 14px; font: 15px/1.5 'Times New Roman', Times, serif; color: #000; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,.12); text-transform: uppercase; }
.strip ins { display: block; text-decoration: none; color: var(--stamp); font-family: var(--sans); text-transform: none; font-size: 14px; margin-bottom: 2px; }
.strip del { text-decoration-color: var(--margin); text-decoration-thickness: 2px; color: #555; }
.strip .now { display: block; margin-top: 8px; }
.strip small { display: block; margin-top: 6px; font: 13px var(--sans); text-transform: none; color: var(--ink-2); }

/* Текстовые страницы */
.prose { max-width: 860px; margin-bottom: 44px; }
.prose p, .prose li { margin: 0 0 12px; }
.prose h3 { margin: 22px 0 8px; font-size: 20px; }
.prose ol { padding-left: 22px; margin: 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0; border: 1px solid #d9cfb5; background: var(--paper); margin-bottom: 40px; max-width: 1180px; }
.facts div { padding: 14px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dt { font: 600 14px var(--serif); color: var(--ink-2); }
.facts dd { margin: 2px 0 0; font-size: 17px; }
.inline-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; }
.cities { margin-bottom: 54px; }
.find { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 14px; max-width: 760px; }
.find label { font: 600 15px var(--serif); color: var(--ink-2); width: 100%; }
.find input { flex: 1; min-width: 200px; font: 17px var(--sans); padding: 10px 12px; border: 1px solid #cdbf9c; background: var(--paper); }
.find button { font: 700 16px var(--sans); color: #fff; background: var(--stamp); border: 0; border-radius: 4px; padding: 11px 18px; cursor: pointer; }
.find button:hover { background: var(--stamp-2); }

/* Подвал — выходные данные на последней странице, не зеркало шапки */
.imprint { background: var(--paper); color: var(--ink-2); border-top: 1px solid #d9cfb5; font-size: 14px; }
.imprint-in { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px 40px; padding-top: 26px; padding-bottom: 26px; }
.imprint-brand { font: 700 18px var(--serif); color: var(--cover); margin: 0 0 4px; }
.imprint p { margin: 0; }
.imprint nav { display: flex; flex-direction: column; gap: 4px; }
.imprint-op { grid-column: 1 / -1; border-top: 1px dashed #cdbf9c; padding-top: 12px !important; font-size: 13px; }

@media (max-width: 1100px) {
  .gen { grid-template-columns: 1fr; padding: 8px; }
  .book { border-radius: 4px 4px 0 0; box-shadow: none; }
  .sheet-col { border-radius: 0 0 4px 4px; box-shadow: inset 0 22px 22px -22px rgba(60,30,20,.45); }
  .sheet-stick { position: relative; top: auto; max-width: 560px; margin: 0 auto; }
  .atlas-in { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .lead-row { padding-top: 22px; }
  .rows::before { display: none; }
  .row { grid-template-columns: 1fr; min-height: 0; }
  .row-l { padding: 10px 16px 0; font-size: 14px; }
  .row-c { padding: 2px 16px 8px; }
  .book-tabs { padding: 14px 16px; }
  .cover-in { gap: 10px 18px; }
  .brand-sub { display: none; }
  .nav { order: 3; width: 100%; margin-left: 0; gap: 4px 18px; }
  .lang { margin-left: auto; }
  .imprint-in { grid-template-columns: 1fr; }
  .ledger-paper { padding: 16px 12px 12px 40px; }
  .ledger-paper::before { left: 12px; }
  .ledger td:nth-child(2) { white-space: normal; }
  .book-foot .book-note { display: none; }
  .book-foot { padding-top: 10px; padding-bottom: 10px; }
  .seal { width: 92px; height: 92px; right: -4px; }
  .qa li.qa-wide { grid-template-columns: 1fr; }
  .atlas { padding: 32px 0 36px; }
  .atlas-map text { font-size: 24px; }
}
.row-c, .pair-in > *, .pair-in input, .pair-in select { min-width: 0; }
@media (max-width: 760px) { .pair-in { gap: 8px; } .pair-in input:first-child { width: 4.2em; } .row-c .num input { width: 2.6em; } }

/* Значки вузов: фавиконка сайта или аббревиатура */
.vuz-ico { flex: none; display: inline-block; width: 24px; height: 24px; padding: 2px; margin-right: 8px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; object-fit: contain; vertical-align: middle; }
.vuz-ico-txt { display: inline-flex; align-items: center; justify-content: center; padding: 0; font: 700 9px/1 var(--sans); color: var(--cover); background: var(--paper-3); letter-spacing: .02em; }
.vuz-ico-lg { width: 56px; height: 56px; padding: 5px; margin-right: 14px; border-radius: 6px; }
.vuz-ico-lg.vuz-ico-txt { padding: 0; font-size: 15px; }
.lead-vuz { display: flex; align-items: center; }
.vuz-link { display: inline-flex; align-items: center; }
.pick-name { display: inline-flex; align-items: center; }
.pick-list .vuz-ico { width: 20px; height: 20px; padding: 1px; }
.atlas-panel .vuz-ico { width: 22px; height: 22px; border-color: rgba(255,255,255,.25); }
.atlas-panel .vuz-ico-txt { background: rgba(255,255,255,.12); color: #fff; }
.inline-list .vuz-ico { width: 20px; height: 20px; padding: 1px; margin-right: 6px; }
