/* Layout: one reading column; epoch nav strip on top; each epoch = intro → causal chain → gave/took; glossary at the end */
:root {
  --bg: #f6f7f8; --surface: #ffffff; --fg: #1d2530; --muted: #5d6877; --rule: #d9dee5;
  --state: #2f5d8a; --lang: #b5792a; --faith: #6b4f9a; --mind: #2f7d63; --outside: #a23b3b;
  --disputed: #c2410c;
  --display: "Alegreya", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #12161c; --surface: #1a2029; --fg: #e4e8ee; --muted: #9aa5b3; --rule: #2c3542;
  --state: #6fa3d6; --lang: #e0a95a; --faith: #a98ad8; --mind: #5fbf9b; --outside: #e07070;
  --disputed: #fb8a4c; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #12161c; --surface: #1a2029; --fg: #e4e8ee; --muted: #9aa5b3; --rule: #2c3542;
  --state: #6fa3d6; --lang: #e0a95a; --faith: #a98ad8; --mind: #5fbf9b; --outside: #e07070;
  --disputed: #fb8a4c; color-scheme: dark }

body { background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.55;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 900px; margin: 0 auto; padding-block: 32px 64px; display: grid; gap: 40px; }
header { display: grid; gap: 10px; max-width: 70ch; }
h1 { font-family: var(--display); font-weight: 700; font-size: clamp(30px, 6vw, 44px); line-height: 1.08; margin: 0; text-wrap: balance; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(24px, 4.4vw, 32px); line-height: 1.15; margin: 0; text-wrap: balance; }
p { margin: 0; }
.lede { color: var(--muted); font-size: 16px; }
.note { font-size: 13px; color: var(--muted); border-left: 3px solid var(--rule); padding-left: 10px; max-width: 70ch; }
.tag { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.src { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); align-items: center; }

/* экраны: оглавление / эпоха / словарь — показывается один */
.screen[hidden] { display: none; }
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule); margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: 8px max(16px, env(safe-area-inset-left, 0px)); }
.bar-in { max-width: 900px; margin: 0 auto; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.bar a { color: var(--fg); text-decoration: none; padding: 4px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); white-space: nowrap; }
.bar a:hover, .bar a:focus-visible { border-color: var(--fg); outline: none; }
.bar .here { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.bar[hidden] { display: none; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--fg); text-decoration: none; min-width: 0; }
a.card:hover, a.card:focus-visible { border-color: var(--fg); outline: none; }
.card .num { font-family: var(--display); font-weight: 700; font-size: 26px; min-width: 1.4em; text-align: center; color: var(--lang); }
.card .ct { display: grid; gap: 2px; min-width: 0; }
.card b { font-family: var(--display); font-size: 17px; line-height: 1.2; }
.card.off { background: none; color: var(--muted); }
.card.off .num { color: var(--muted); }
.pw { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; background: color-mix(in srgb, var(--fg) 8%, transparent); color: var(--fg); text-decoration: none; white-space: nowrap; }
.pw::before { content: "↯ "; color: var(--outside); }
.pw:hover, .pw:focus-visible { background: color-mix(in srgb, var(--fg) 16%, transparent); outline: none; }
.rl { font-size: 11.5px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--state); color: var(--state); text-decoration: none; white-space: nowrap; }
.rl::before { content: "♛ "; }
.rl:hover, .rl:focus-visible { background: color-mix(in srgb, var(--state) 14%, transparent); outline: none; }
.rgroup { display: grid; gap: 8px; }
.rgroup h3 { font-family: var(--display); font-size: 21px; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.gnote { font-size: 14px; color: var(--muted); max-width: 68ch; }
.ruler { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; scroll-margin-top: 64px; }
.ruler:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--state) 45%, transparent); }
.ruler > div { display: grid; gap: 3px; min-width: 0; }
.ruler b { font-family: var(--display); font-size: 17px; }
.ruler .rt { font-size: 13px; color: var(--muted); }
.ruler p { font-size: 14px; max-width: 64ch; }
.ruler p > span { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-right: 2px; }
.ruler .origin > span { color: var(--muted); }
.ruler .plus > span { color: var(--mind); }
.ruler .minus > span { color: var(--outside); }
.ruler .refs a { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-right: 8px; }
@media (max-width: 520px) { .ruler { grid-template-columns: 1fr; gap: 2px; } }
.voices, .lit { border-left: 3px solid var(--faith); padding: 4px 0 4px 12px; display: grid; gap: 10px; }
.lit { border-left-color: var(--lang); }
.voices > b, .lit > b { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faith); }
.lit > b { color: var(--lang); }
.voice { display: grid; gap: 4px; }
.voice .who { font-weight: 600; color: var(--fg); text-decoration: none; font-size: 14px; }
.voice .who:hover { text-decoration: underline; }
.voice p { font-size: 14px; max-width: 66ch; }
.source-list { display: grid; gap: 10px; }
.source { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 16px; display: grid; gap: 4px; scroll-margin-top: 64px; }
.source:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--faith) 45%, transparent); }
.source b { font-family: var(--display); font-size: 18px; }
.source i { font-style: italic; }
.source p { font-size: 14px; max-width: 70ch; }
.lines-head { display: grid; gap: 4px; max-width: 70ch; }
.cards.lines { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.line-list { display: grid; gap: 10px; }
.line-ep { font-family: var(--display); font-size: 19px; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.line-item { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 14px 16px; display: grid; gap: 6px; min-width: 0; }
.line-item h4 { font-family: var(--display); font-size: 18px; line-height: 1.2; margin: 0; }
.line-item .text { max-width: 68ch; font-size: 14.5px; }
.line-item .open { font-size: 13px; color: var(--muted); }
.home-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--rule); padding-top: 20px; }
.pager a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); color: var(--fg); text-decoration: none; font-family: var(--display); font-size: 17px; line-height: 1.2; min-width: 0; }
.pager a span { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.pager .next { text-align: right; grid-column: 2; }
.pager a:hover, .pager a:focus-visible { border-color: var(--fg); outline: none; }

/* эпоха */
.epoch { display: grid; gap: 18px; scroll-margin-top: 16px; }
.epoch-head { display: grid; gap: 6px; }
.epoch-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.intro { max-width: 68ch; display: grid; gap: 8px; }

/* цепочка */
.chain { display: grid; gap: 0; }
.node { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 16px 18px; display: grid; gap: 8px; min-width: 0; scroll-margin-top: 64px; }
.node:target { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lang) 45%, transparent); }
.node-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.when { font-family: var(--mono); font-size: 13px; font-weight: 500; }
.places { font-size: 12.5px; color: var(--muted); }
.chip { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1.5px solid currentColor; }
.chip.st { color: var(--state); } .chip.ou { color: var(--outside); } .chip.la { color: var(--lang); }
.chip.fa { color: var(--faith); } .chip.mi { color: var(--mind); }
.node h3 { font-family: var(--display); font-size: 21px; line-height: 1.2; margin: 0; text-wrap: balance; }
.node .text { max-width: 68ch; }
.node blockquote { margin: 2px 0 0; padding: 8px 12px; border-left: 3px solid var(--rule); color: var(--muted); font-size: 14px; font-style: italic; max-width: 66ch; }
.node blockquote cite { display: block; font-style: normal; font-family: var(--mono); font-size: 11.5px; margin-top: 4px; }
.node.key { border: 2px solid var(--lang); }
.dispute { border: 2px dashed var(--disputed); border-radius: 6px; padding: 10px 12px; font-size: 13.5px; display: grid; gap: 4px; }
.dispute b { color: var(--disputed); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
figure { margin: 4px 0 0; display: grid; gap: 4px; }
figure img { display: block; max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--rule); background: #fff; }
figcaption { font-size: 12.5px; color: var(--muted); }
figcaption i { font-style: normal; font-family: var(--mono); font-size: 11px; }
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }

.link { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 6px 0 6px 18px; }
.link .arrow { width: 2px; height: 100%; min-height: 40px; background: var(--muted); justify-self: center; position: relative; }
.link .arrow::after { content: ""; position: absolute; bottom: -2px; left: -5px; border: 6px solid transparent; border-top: 8px solid var(--muted); border-bottom: 0; }
.link .ltext { font-size: 13.5px; color: var(--muted); max-width: 62ch; display: grid; gap: 4px; }
.link .ltext b { color: var(--fg); font-weight: 600; }
.next-epoch { font-size: 13.5px; padding: 8px 0 0 18px; }
.next-epoch a { color: var(--fg); }
.next-epoch .off { color: var(--muted); }

.fork { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fork > div { display: flex; flex-direction: column; min-width: 0; }
.fork > div > .link:last-child { margin-top: auto; }
.branch-label { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 0 8px 4px; }
@media (max-width: 680px) { .fork { grid-template-columns: 1fr; } }

/* итог */
.summary { display: grid; gap: 10px; }
.gt { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 680px) { .gt { grid-template-columns: 1fr; } }
.gt > div { background: var(--surface); border-radius: 6px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.gt .gave { border: 2px solid var(--mind); }
.gt .took { border: 2px solid var(--outside); }
.gt h3 { font-family: var(--display); font-size: 19px; margin: 0; }
.gt ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.gt .refs a { font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-right: 6px; }

/* словарь и всплывашки */
.term, .eval { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: help; text-align: inherit; }
.term.place { text-decoration-style: dashed; text-decoration-color: var(--state); }
.term { text-decoration: underline dotted; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.eval { text-decoration: underline dashed var(--disputed); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.term:hover, .term:focus-visible, .eval:hover, .eval:focus-visible { outline: none; background: color-mix(in srgb, var(--lang) 18%, transparent); border-radius: 2px; }
.pop { position: absolute; z-index: 20; max-width: min(360px, calc(100vw - 32px)); background: var(--surface); color: var(--fg); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); font-size: 14px; line-height: 1.5; display: grid; gap: 4px; font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.pop b { font-family: var(--display); font-size: 17px; }
.pop.ev b { color: var(--disputed); font-family: var(--body); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.glossary { display: grid; gap: 14px; }
.glossary dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 24px; margin: 0; }
.glossary dl > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.glossary dt { font-family: var(--display); font-weight: 700; font-size: 17px; }
.glossary dd { margin: 0; font-size: 14px; }
.gsearch { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; }
.gsearch input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--fg); background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 12px; }
.gsearch input:focus { outline: 2px solid var(--lang); outline-offset: 1px; }
.glossary [hidden] { display: none; }
/* слои: простая фраза → подробнее → голоса */
.node figure img { max-height: 300px; width: auto; object-fit: contain; }
.home { display: grid; gap: 28px; }
.simple { font-size: 17px; line-height: 1.5; max-width: 62ch; }
details.more, details.chat { border-top: 1px solid var(--rule); padding-top: 8px; display: grid; gap: 8px; }
details > summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--state); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; } details[open] > summary::before { content: "▾ "; }
details.chat > summary { color: var(--disputed); }
details[open] > summary { margin-bottom: 6px; }
.more > * + * { margin-top: 8px; }
.msgs { display: grid; gap: 12px; }
.msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.ava { flex: none; box-sizing: border-box; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; background: var(--muted); }
.ava.sc-belnat { background: #b23a48; } .ava.sc-byacad { background: #2f7d63; } .ava.sc-lit { background: #c08a12; }
.ava.sc-pl { background: #8a3fa0; } .ava.sc-ru { background: #2f5d8a; } .ava.sc-sov { background: #6b6f76; } .ava.sc-novel { background: #a0602f; }
.bubble { background: color-mix(in srgb, var(--fg) 6%, var(--surface)); border-radius: 4px 14px 14px 14px; padding: 8px 12px; display: grid; gap: 4px; min-width: 0; }
.bubble .who { font-weight: 600; color: var(--fg); text-decoration: none; font-size: 14px; }
.bubble .school { font-size: 12px; color: var(--muted); }
.bubble p { font-size: 14.5px; }
.bubble blockquote { margin: 2px 0 0; padding: 4px 10px; border-left: 2px solid var(--rule); color: var(--muted); font-size: 13px; font-style: italic; }
.bubble blockquote cite { display: block; font-style: normal; font-family: var(--mono); font-size: 11px; margin-top: 2px; }

/* дорожки */
.lanes-head { display: grid; gap: 4px; max-width: 70ch; }
.lanes { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.lanes-in { min-width: 720px; padding: 12px 14px 4px; display: grid; gap: 10px; }
.lane { display: grid; gap: 3px; }
.lane-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.track { position: relative; height: 30px; }
.seg { position: absolute; top: 0; bottom: 0; width: var(--w); min-width: 6px; border: 0; border-right: 2px solid var(--surface); padding: 0 6px; font: 600 12px/30px var(--body); color: #fff; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-radius: 3px; }
.seg:hover, .seg:focus-visible, .seg.on { outline: 2px solid var(--fg); outline-offset: -2px; z-index: 2; }
.seg:hover, .seg:focus-visible, .seg.on { width: max-content; min-width: var(--w); overflow: visible; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.seg.own { background: #2f7d63; } .seg.bel { background: #1f9d6a; } .seg.vkl { background: #3a8a9a; }
.seg.pl { background: #b23a48; } .seg.ru { background: #2f5d8a; } .seg.su { background: #5a3f8a; } .seg.de { background: #4b5058; }
.seg.slav { background: #b5792a; } .seg.pagan { background: #7a5a3a; } .seg.orth { background: #4a6fb0; } .seg.uni { background: #8a4fa0; }
.seg.r0 { background: #2f7d63; } .seg.r1 { background: #3a6ea5; } .seg.r2 { background: #8a5a9e; } .seg.r3 { background: #b06a2c; }
.seg.gap { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--fg) 14%, var(--surface)) 0 5px, color-mix(in srgb, var(--fg) 6%, var(--surface)) 5px 10px); }
.ticks .edge-l { transform: none; font-weight: 600; color: var(--fg); }
.ticks .edge-r { transform: none; font-weight: 600; color: var(--fg); }
.ticks .hl { position: absolute; top: 0; height: 100%; background: color-mix(in srgb, var(--state) 22%, transparent); border-left: 2px solid var(--state); border-right: 2px solid var(--state); transform: none; }
.ticks .hl.pt { border-right: 0; }
.ticks span.hl-y { z-index: 1; color: var(--state); font-weight: 700; }
.ticks span.hl-y.l { transform: none; padding-left: 7px; } .ticks span.hl-y.r { transform: translateX(-100%); padding-right: 4px; }
.ticks.hot > span:not(.hl-y):not(.hl) { opacity: 0; }
.seg.kyiv { background: #c0703a; } .seg.steppe { background: #8a6a2a; }
.seg.ev { background: color-mix(in srgb, var(--fg) 10%, var(--surface)); color: var(--fg); border-left: 3px solid var(--fg); border-right: 0; border-radius: 0 3px 3px 0; font-weight: 500; }
.seg.ev.flip { border-left: 0; border-right: 3px solid var(--fg); border-radius: 3px 0 0 3px; text-align: right; }
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ba > div { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 12px 16px; display: grid; gap: 6px; align-content: start; }
.ba .before { border-left: 4px solid var(--muted); } .ba .after { border-left: 4px solid var(--mind); }
.ba p { font-size: 15px; }
@media (max-width: 680px) { .ba { grid-template-columns: 1fr; } }
.epoch .lanes-in { min-width: 640px; }
.lanes-block { min-width: 0; display: grid; gap: 10px; }
.epoch > *, .home > * { min-width: 0; }
.seg.none { background: color-mix(in srgb, var(--fg) 22%, var(--surface)); color: var(--fg); }
.ticks { position: relative; height: 18px; border-top: 1px solid var(--rule); }
.ticks span { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 11px; color: var(--muted); top: 2px; }
.seg-info { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--state); border-radius: 6px; padding: 10px 14px; display: grid; gap: 4px; max-width: 70ch; }
.seg-info b { font-family: var(--display); font-size: 18px; }
.seg-info[hidden] { display: none; }
/* многостраничный сайт: шапка, подвал, хлебные крошки, страницы событий/правителей/терминов */
.site-bar .bar-in { gap: 12px 18px; flex-wrap: wrap; }
.site-bar .logo { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; }
.site-bar .bar-links { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--muted); }
.event, .ruler-page, .term-page, .source-page, .notfound { display: grid; gap: 14px; }
.event h1, .ruler-page h1, .term-page h1, .source-page h1, .notfound h1 { font-size: clamp(26px, 5vw, 38px); }
.chain-of { font-size: 14px; color: var(--muted); border-left: 3px solid var(--state); padding-left: 10px; }
.node h3 a, .rgroup .ruler b a, .source b a, .glossary dt a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.rel { display: grid; gap: 6px; }
.rel h2 { font-size: 20px; }
.rel ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.ruler-body { display: grid; gap: 8px; max-width: 70ch; }
.site-foot { border-top: 1px solid var(--rule); margin-top: 24px; padding: 20px 0 40px; }
.foot-in { max-width: 900px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 18px; font-size: 14px; }
.foot-in .src { flex-basis: 100%; }
.site-bar .logo { border: 0; background: none; padding: 4px 0; }
.q-wrap { position: relative; flex: 1 1 220px; min-width: 0; max-width: 360px; }
.q-wrap input { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; color: var(--fg); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: 5px 14px; }
.q-wrap input:focus { outline: 2px solid var(--lang); outline-offset: 1px; }
.q-results { position: absolute; top: calc(100% + 6px); left: 0; width: min(520px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .12); z-index: 20; display: grid; }
.q-results[hidden] { display: none; }
.q-hit { display: grid; gap: 2px; padding: 9px 14px; color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--rule); }
.site-bar .q-hit { border-radius: 0; border-width: 0 0 1px; white-space: normal; background: none; }
.q-hit:hover, .q-hit:focus-visible { background: color-mix(in srgb, var(--state) 10%, var(--surface)); outline: none; }
.q-kind { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); }
.q-snip { font-size: 13px; color: var(--muted); }
.q-none { padding: 10px 14px; color: var(--muted); }
.question, .overview, .questions { display: grid; gap: 16px; }
.question h1, .overview h1, .questions h1 { font-size: clamp(26px, 5vw, 38px); }
.answer { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--mind); border-radius: 6px; padding: 14px 18px; display: grid; gap: 6px; font-size: 17px; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 12px; }
.steps .refs { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; }
.ov-ep { display: grid; gap: 6px; }
.ov-ep h2 { font-size: 22px; }
.ov-ep h2 a { color: inherit; }
.cheat { display: grid; gap: 14px; }
.cheat h1 { font-size: clamp(26px, 5vw, 38px); }
.cheat h2 { font-size: 21px; margin-top: 8px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface); }
.table-wrap table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 14px; }
.table-wrap th, .table-wrap td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.table-wrap th { font-family: var(--mono); font-size: 12px; text-transform: uppercase; color: var(--muted); }
.table-wrap td:first-child { white-space: nowrap; font-family: var(--mono); font-size: 13px; }
/* телефон: шапка не прилипает и короче, таблицы — карточками */
@media (max-width: 600px) {
  .site-bar { position: static; }
  .site-bar .bar-in { gap: 8px 10px; }
  .site-bar .logo { font-size: 15px; flex: 1 1 100%; }
  .site-bar .bar-links { margin-left: 0; gap: 6px; order: 3; }
  .site-bar .bar-links a { padding: 4px 9px; font-size: 13px; }
  .q-wrap { max-width: none; flex-basis: 100%; }
  .table-wrap { border: 0; background: none; overflow: visible; }
  .table-wrap table { min-width: 0; }
  .table-wrap thead { display: none; }
  .table-wrap tr { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 10px 12px; margin-bottom: 10px; }
  .table-wrap td { display: grid; grid-template-columns: 9em 1fr; gap: 8px; padding: 0; border: 0; white-space: normal; }
  .table-wrap td::before { content: attr(data-label); font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); }
  .table-wrap td:first-child { white-space: normal; }
}
