/* Датарум «Рубеж»: стиль документов oasixai.dev (Onest, один синий, тонкие линии, почти прямые углы). */
@font-face { font-family: Onest; src: url(/fonts/Onest-Light.ttf) format("truetype"); font-weight: 300; font-display: swap }
@font-face { font-family: Onest; src: url(/fonts/Onest-Regular.ttf) format("truetype"); font-weight: 400; font-display: swap }
@font-face { font-family: Onest; src: url(/fonts/Onest-Medium.ttf) format("truetype"); font-weight: 500; font-display: swap }
@font-face { font-family: Onest; src: url(/fonts/Onest-SemiBold.ttf) format("truetype"); font-weight: 600; font-display: swap }

:root {
  --ink: #17242b; --ink-2: #5c666a; --ink-3: #7c8588; --line: #dde0e4; --tint: #f0f2f5;
  --accent: #2045e8; --c1: #1535bd; --soft: #dde3fb; --paper: #fff; --err: #b42318; --r: 2px; --top: 60px;
  color-scheme: light;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px) }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: lining-nums; padding-bottom: env(safe-area-inset-bottom, 0px) }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px }
a:hover { text-decoration: underline }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
img { max-width: 100% }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -.012em; text-wrap: balance }
h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.04 }
h2 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.12 }
h3 { font-size: 18px; line-height: 1.3 }
p { text-wrap: pretty }
.accent { color: var(--accent) }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: max(16px, min(4vw, 40px)) }
.kicker { font-size: 14px; color: var(--ink-2); margin: 0 0 16px }
.lead { font-size: clamp(17px, 1.7vw, 20px); line-height: 1.5; color: var(--ink-2); max-width: 780px; margin: 20px 0 0 }

/* Шапка */
.top { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); padding-top: env(safe-area-inset-top, 0px) }
.top-in { display: flex; align-items: center; gap: 20px; height: var(--top) }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap }
.brand:hover { text-decoration: none }
.brand svg { width: 22px; height: 22px; fill: var(--accent); flex: none }
.brand i { font-style: normal; font-weight: 300; color: #a0a8a4; margin: 0 .05em 0 .1em }
.brand em { font-style: normal; font-weight: 400; color: var(--accent) }
.top-t { color: var(--ink-2); font-size: 14px; padding-left: 20px; border-left: 1px solid var(--line); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; min-width: 0 }
.top-nav { margin-left: auto; display: flex; gap: 2px; align-items: center }
.top-nav a, .top-nav button { font: inherit; font-size: 15px; color: var(--ink); background: none; border: 0; padding: 8px 12px;
  border-radius: var(--r); cursor: pointer; white-space: nowrap }
.top-nav a[aria-current] { color: var(--accent) }
.top-nav a:hover, .top-nav button:hover { background: var(--tint); text-decoration: none }
@media (max-width: 760px) { .top-t { display: none } .top-nav a, .top-nav button { padding: 8px } }
@media (max-width: 400px) { .brand span { display: none } }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px;
  border: 1px solid var(--ink); border-radius: var(--r); color: var(--ink); background: none; font: inherit; font-size: 15px;
  font-weight: 500; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s }
.btn:hover { background: var(--ink); color: #fff; text-decoration: none }
.btn.solid { background: var(--accent); border-color: var(--accent); color: #fff }
.btn.solid:hover { background: var(--c1); border-color: var(--c1) }
.btn:disabled { opacity: .55; cursor: default }
.acts { display: flex; gap: 8px; flex-wrap: wrap }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none; border: 1px solid var(--line);
  background: #fff; border-radius: var(--r); cursor: pointer; font: inherit; font-size: 20px; line-height: 1; color: var(--ink) }
.icon-btn:hover { border-color: var(--ink); text-decoration: none }

/* Первый экран */
.hero { padding: clamp(40px, 7vw, 80px) 0 clamp(32px, 5vw, 56px) }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px } }
.hcards { display: grid; gap: 12px }
.hcard { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 16px; border: 1px solid var(--line);
  padding: 20px 22px; color: var(--ink); border-radius: var(--r); transition: border-color .15s }
.hcard:hover { border-color: var(--ink); text-decoration: none }
.hcard > * { grid-column: 1 }
.hcard .lab { font-size: 14px; color: var(--ink-2) }
.hcard b { font-weight: 500; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere }
.hcard small { font-size: 14px; color: var(--ink-2) }
.hcard .go { grid-column: 2; grid-row: 1 / span 4; align-self: end; font-weight: 500; white-space: nowrap }
.hcard.primary { background: var(--accent); border-color: var(--accent); color: #fff }
.hcard.primary:hover { background: var(--c1); border-color: var(--c1) }
.hcard.primary .lab, .hcard.primary small { color: rgba(255, 255, 255, .82) }
.bar { display: block; height: 4px; background: var(--line); overflow: hidden }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease }
.hcard .bar { margin: 14px 0 10px; background: rgba(255, 255, 255, .28) }
.hcard .bar i { background: #fff }

.subnav { display: flex; gap: 4px 20px; flex-wrap: wrap; padding-block: 14px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line) }
.subnav a { color: var(--ink); font-size: 15px }
.subnav a:hover { color: var(--accent); text-decoration: none }

/* Разделы */
.sec { padding: clamp(44px, 6vw, 72px) 0; border-bottom: 1px solid var(--line) }
.sec-h { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 28px }
.sec-h p { color: var(--ink-2); margin: 10px 0 0; max-width: 700px }
.sub-h { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin: 40px 0 16px;
  padding-top: 16px; border-top: 1px solid var(--ink) }
.note { font-size: 15px; color: var(--ink-2); border-left: 2px solid var(--accent); padding: 2px 0 2px 14px; margin: 0; max-width: 760px }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; counter-reset: s }
.steps li { counter-increment: s; border-top: 1px solid var(--ink); padding-top: 14px }
.steps li::before { content: counter(s); display: block; font-size: 30px; font-weight: 500; line-height: 1; margin-bottom: 14px }
.steps p { color: var(--ink-2); margin: 8px 0 12px; font-size: 15px }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; gap: 20px } }

.docs { border-top: 1px solid var(--ink) }
.doc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center }
.doc p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; max-width: 720px }
.doc p.meta { font-size: 13px; color: var(--ink-3); margin-top: 6px }
@media (max-width: 640px) { .doc { grid-template-columns: 1fr } }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 24px; margin: 0 0 28px }
.facts div { border-top: 1px solid var(--ink); padding-top: 10px }
.facts b { display: block; font-size: clamp(26px, 3vw, 34px); font-weight: 500; line-height: 1.1 }
.facts span { font-size: 14px; color: var(--ink-2) }

/* Прототип */
.proto { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: start }
@media (max-width: 900px) { .proto { grid-template-columns: 1fr } }
.entries { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink) }
.entries a { display: grid; gap: 2px; padding: 14px 28px 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); position: relative }
.entries a::after { content: "↗"; position: absolute; right: 0; top: 14px; color: var(--ink-3) }
.entries b { font-weight: 500 }
.entries span { color: var(--ink-2); font-size: 15px }
.entries a:hover { text-decoration: none }
.entries a:hover b, .entries a:hover::after { color: var(--accent) }
.proto-shots { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 12px }
.proto-shots .shot .im { aspect-ratio: auto; height: clamp(220px, 30vw, 360px) }

/* Галереи */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 20px 16px }
.gal.big { grid-template-columns: 1fr }
.shot { display: block; color: var(--ink); cursor: zoom-in; min-width: 0 }
.shot:hover { text-decoration: none }
.shot .im { display: block; aspect-ratio: 4 / 3; background: var(--tint); border: 1px solid var(--line); overflow: hidden; border-radius: var(--r) }
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: left top; display: block; transition: transform .35s ease }
.gal.fit .shot img { object-fit: contain; object-position: center; padding: 8px }
.shot:hover img { transform: scale(1.025) }
.shot:hover .im { border-color: var(--ink-3) }
.shot .cap { display: block; font-size: 14px; margin-top: 8px; color: var(--ink) }
.shot:focus-visible { outline: 0 }
.shot:focus-visible .im { outline: 2px solid var(--accent); outline-offset: 2px }
.shot.tall .im { aspect-ratio: 16 / 7 }
.arch { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 32px; align-items: start }
.arch .shot .im { aspect-ratio: 4 / 3 }
.arch-side p { margin: 0 0 16px; color: var(--ink-2); font-size: 15px }
@media (max-width: 800px) { .arch { grid-template-columns: 1fr } .shot.tall .im { aspect-ratio: 4 / 3 } }

/* Окна */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--paper); border-radius: var(--r); box-shadow: 0 24px 64px rgba(10, 16, 22, .28) }
dialog::backdrop { background: rgba(14, 20, 26, .66) }
.lb { width: min(1240px, calc(100vw - 24px)); height: calc(100dvh - 24px); max-height: none; max-width: none }
.lb[open] { display: flex; flex-direction: column }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 18px; border-bottom: 1px solid var(--line) }
.lb-bar .cap { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.lb-body { flex: 1; overflow: auto; background: var(--tint); overscroll-behavior: contain }
.lb-body img { display: block; width: 100%; height: auto; margin: 0 auto; max-width: max-content; min-width: min(100%, 720px) }

.term-dlg { width: min(580px, calc(100vw - 24px)); padding: 28px 28px 24px; max-height: calc(100dvh - 24px); overflow: auto }
.term-dlg h3 { font-size: 26px; font-weight: 500; line-height: 1.15; padding-right: 44px }
.term-dlg dl { margin: 6px 0 0 }
.term-dlg dt { font-size: 13px; color: var(--c1); font-weight: 500; margin-top: 18px }
.term-dlg dd { margin: 4px 0 0; font-size: 16px; line-height: 1.55 }
.term-dlg .x { position: absolute; top: 16px; right: 16px }
.term-in { margin: 20px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2) }
.term-in a { display: inline-block; margin: 2px 8px 0 0; font-weight: 500 }

/* Подвал */
.foot { padding-block: 40px 56px; color: var(--ink-2); font-size: 14px; display: flex; flex-wrap: wrap; gap: 12px 32px;
  align-items: center; justify-content: space-between }

/* Вход */
.login { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: 1fr auto; padding-inline: 16px }
.login-card { align-self: center; justify-self: center; width: min(420px, 100%); padding-block: 48px }
.login-card h1 { font-size: clamp(38px, 8vw, 48px); margin: 44px 0 14px }
.login-card > p { color: var(--ink-2); margin: 0 0 32px }
.login form { display: grid; gap: 8px }
.login label { font-size: 14px; color: var(--ink-2) }
.login input, .field input { font: inherit; font-size: 17px; color: var(--ink); height: 48px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; width: 100% }
.login input:focus, .field input:focus, .q-com textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent) }
.login .btn { min-height: 50px; margin-top: 8px; font-size: 16px }
.login .err { color: var(--err); min-height: 1.5em; font-size: 15px; margin: 6px 0 0 }
.login-foot { text-align: center; color: var(--ink-3); font-size: 14px; padding: 24px 0; margin: 0 }

/* Вопросы */
.q-head { padding-block: clamp(36px, 6vw, 64px) 28px }
.q-tools { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; justify-content: space-between; margin-top: 32px }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); flex: 1 1 280px; max-width: 420px }
.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 10px 28px; margin-top: 28px;
  font-size: 14px; color: var(--ink-2) }
.legend div { display: flex; gap: 10px; align-items: baseline }
.pr { display: inline-block; font-size: 12px; line-height: 1; padding: 5px 8px; font-weight: 500; white-space: nowrap; border-radius: var(--r) }
.pr.b { background: var(--accent); color: #fff }
.pr.v { background: var(--soft); color: var(--c1) }
.pr.d { box-shadow: inset 0 0 0 1px var(--ink-3); color: var(--ink-2) }

.q-bar { position: sticky; top: calc(var(--top) + env(safe-area-inset-top, 0px)); z-index: 20; background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line) }
.q-bar-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 10px }
.prog { display: flex; align-items: center; gap: 12px; flex: 1 1 320px; min-width: 0 }
.prog b { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums }
.prog .bar { flex: 1; max-width: 220px; min-width: 60px }
.prog small { color: var(--ink-2); font-size: 14px; white-space: nowrap }
.filters { display: flex; gap: 4px; flex-wrap: wrap }
.filters button { font: inherit; font-size: 14px; height: 36px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: var(--r); cursor: pointer; color: var(--ink); white-space: nowrap }
.filters button:hover { border-color: var(--ink) }
.filters button small { color: var(--ink-3); margin-left: 2px }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.filters button[aria-pressed="true"] small { color: rgba(255, 255, 255, .7) }
@media (max-width: 640px) {
  .q-bar-in { gap: 8px 12px; padding-block: 8px }
  .prog small { display: none }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -4px; padding-inline: 4px; scrollbar-width: none; width: 100% }
}

.q-toc { display: flex; flex-wrap: wrap; gap: 6px; padding-block: 20px 0 }
.q-toc a { font-size: 14px; color: var(--ink); border: 1px solid var(--line); padding: 6px 10px; border-radius: var(--r) }
.q-toc a small { color: var(--ink-3); margin-left: 4px; font-variant-numeric: tabular-nums }
.q-toc a:hover { border-color: var(--ink); text-decoration: none }
.q-toc a.full { border-color: var(--accent) }
.q-toc a.full small { color: var(--accent) }

.topic { padding-top: clamp(40px, 6vw, 64px) }
.topic-h { display: grid; gap: 6px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--ink) }
.topic-h > span { font-size: 14px; color: var(--ink-2) }
.topic-h p { margin: 0; color: var(--ink-2) }
.q { border-bottom: 1px solid var(--line); padding: 24px 0 22px; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 20px }
.q:last-child { border-bottom: 0 }
.q-n { font-size: 22px; font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--ink-3); transition: color .2s }
.q[data-done] .q-n { color: var(--accent) }
.q-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px }
.q-text { font-size: 19px; line-height: 1.5; margin: 0; max-width: 840px }
.q-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 10px 28px; margin: 14px 0 0;
  font-size: 15px; color: var(--ink-2); max-width: 840px }
.q-info dt { font-size: 13px; color: var(--ink-3) }
.q-info dd { margin: 2px 0 0 }
.q-rec { margin: 16px 0 0; background: var(--tint); padding: 12px 16px 13px; border-left: 2px solid var(--accent); font-size: 15px; max-width: 840px }
.q-rec > span { display: block; font-size: 13px; color: var(--c1); font-weight: 500; margin-bottom: 3px }
.q-rec p { margin: 0 }
.q-ans { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px }
.q-ans button { font: inherit; font-size: 15px; min-height: 42px; padding: 0 15px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: var(--r); cursor: pointer; transition: border-color .12s, background .12s, color .12s }
.q-ans button:hover { border-color: var(--ink) }
.q-ans button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff }
.q-ans button[data-v="rec"][aria-pressed="true"] { background: var(--accent); border-color: var(--accent) }
.q-ans .q-cbtn { border-style: dashed; color: var(--ink-2) }
.q-ans .q-cbtn[aria-expanded="true"] { border-style: solid; border-color: var(--ink); color: var(--ink) }
.q-com { margin-top: 10px; max-width: 840px }
.q-com textarea { width: 100%; font: inherit; font-size: 16px; line-height: 1.5; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--r); resize: vertical; min-height: 88px; background: #fff; display: block }
.q-meta { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; min-height: 1.4em }
.q-meta.err { color: var(--err) }
.q-meta button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline }
@media (max-width: 640px) {
  .q { grid-template-columns: 1fr }
  .q-n { font-size: 17px; margin-bottom: 6px }
  .q-text { font-size: 17px }
  .q-ans button { flex: 1 1 auto }
}
button.term { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: help; line-height: inherit;
  text-align: inherit; letter-spacing: inherit; text-decoration: underline dashed var(--accent); text-decoration-thickness: 1px;
  text-underline-offset: 4px; -webkit-tap-highlight-color: transparent }
button.term:hover, button.term:focus-visible { color: var(--accent) }
.empty { padding: 48px 0; color: var(--ink-2) }
.q-note { margin: 12px 0 0; font-size: 14px; color: var(--err) }
.gloss-sec { padding-bottom: 24px }
.gloss { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 16px }
.field.ask label::after { content: " · укажите, чтобы мы знали, кто ответил"; color: var(--accent) }
