@import url("/static/fonts/fonts.css");

:root {
  --ink: #16181b; --ink-2: #4d5258; --ink-3: #82868c;
  --paper: #f3f1ec; --panel: #faf9f6; --white: #fffefb;
  --rule: #d8d4ca; --rule-2: #e7e4dc;
  --signal: #c8321e; --signal-soft: #f6e2dd;
  --ok: #2f6b3a; --ok-soft: #e0ebdf;
  --amber: #8a5a00; --amber-soft: #f5ead0;
  --blue: #27477a; --blue-soft: #e4eaf4;
  --parcel: #ffd400;
  --sans: "Golos Text", "PT Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "PT Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --bar-h: 52px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15.5px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---- шапка ---- */
.bar { position: sticky; top: 0; z-index: 30; height: var(--bar-h); display: flex; align-items: stretch; background: var(--ink); color: #f1efe9; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 18px 0 16px; text-decoration: none; font-weight: 700; font-size: 15px; letter-spacing: .05em; text-transform: uppercase; border-right: 1px solid #2c2f34; white-space: nowrap; }
.brand svg { flex: none; }
.brand i { font-style: normal; font-weight: 400; opacity: .6; }
.module { display: flex; flex-direction: column; justify-content: center; padding: 0 18px; border-right: 1px solid #2c2f34; white-space: nowrap; }
.module b { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.module span { font-size: 11.5px; color: #a4a8ae; }
.nav { display: flex; align-items: stretch; padding-left: 6px; flex: 1; min-width: 0; }
.nav a { display: flex; align-items: center; padding: 0 14px; font-size: 13.5px; text-decoration: none; color: #d9d6ce; border-bottom: 2px solid transparent; border-top: 2px solid transparent; white-space: nowrap; }
.nav a:hover { color: #fff; }
.nav a.on { border-bottom-color: var(--parcel); color: #fff; font-weight: 600; }
.bar-right { display: flex; align-items: center; gap: 14px; padding: 0 16px; font-size: 12px; color: #a4a8ae; white-space: nowrap; }
.bar-right b { color: #f1efe9; font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6b6f75; margin-right: 6px; vertical-align: 1px; }
.dot.on { background: #58c26b; }
.bar-right a { color: #a4a8ae; }

.demo-note { background: #e9e5db; border-bottom: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-2); padding: 6px 18px; }
.demo-note b { color: var(--ink); font-weight: 600; }

/* ---- рабочая область ---- */
.work { display: grid; grid-template-columns: minmax(0, 1fr) 420px; min-height: calc(100vh - var(--bar-h) - 31px); }
.col { min-width: 0; }
.dialog { display: flex; flex-direction: column; min-height: calc(100vh - var(--bar-h) - 31px); }
.feed { flex: 1; padding: 26px clamp(16px, 4vw, 44px) 18px; max-width: 900px; width: 100%; margin: 0 auto; }
.side { border-left: 1px solid var(--rule); background: var(--panel); position: sticky; top: var(--bar-h); height: calc(100vh - var(--bar-h)); overflow-y: auto; }

.page { max-width: 1120px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }
.page-wide { display: grid; grid-template-columns: minmax(0, 1fr) 420px; }
.page-wide .page { margin: 0 auto; width: 100%; }
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.sub { color: var(--ink-2); margin-top: 6px; max-width: 70ch; }
.eyebrow { font: 400 11.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

/* ---- приветствие ---- */
.hello { padding: 5vh 0 8px; }
.hello h1 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; max-width: 18ch; }
.hello p { margin-top: 12px; color: var(--ink-2); max-width: 62ch; font-size: 16px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 26px; border: 1px solid var(--rule); background: var(--white); }
.facts div { padding: 14px 16px; border-right: 1px solid var(--rule-2); }
.facts div:last-child { border-right: 0; }
.facts b { display: block; font: 400 20px/1.1 var(--mono); }
.facts span { font-size: 12.5px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { border: 1px solid var(--rule); background: var(--white); padding: 8px 13px; font-size: 14px; border-radius: 2px; text-align: left; transition: border-color .12s, background .12s; }
.chip:hover { border-color: var(--ink); }
.chip.mono { font-family: var(--mono); font-size: 13px; }

/* ---- сообщения ---- */
.msg { margin-top: 22px; }
.msg-user { display: flex; justify-content: flex-end; }
.msg-user div { background: var(--ink); color: #f5f3ee; padding: 10px 14px; max-width: 80%; border-radius: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-user.pick div { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); font-size: 14px; padding: 6px 11px; }
.card { background: var(--white); border: 1px solid var(--rule); }
.card-body { padding: 20px 22px 6px; }
.card h2 { font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.card p.lead { margin-top: 10px; }
.card p.lead:first-child { margin-top: 0; }
.plain { padding: 16px 20px; }
.plain p + p { margin-top: 8px; }

.notice { margin: 0 0 10px; padding: 8px 12px; font-size: 13.5px; background: var(--blue-soft); border-left: 3px solid var(--blue); color: #1d3357; }

.verdict { margin-top: 14px; padding: 12px 14px; border-left: 4px solid var(--ink); background: var(--paper); font-weight: 500; }
.verdict.ok { border-color: var(--ok); background: var(--ok-soft); }
.verdict.cond { border-color: #c98a00; background: var(--amber-soft); }
.verdict.stop { border-color: var(--signal); background: var(--signal-soft); }
.verdict .tag { display: block; font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; opacity: .75; }

.refs { display: inline; }
.ref { display: inline-block; margin: 2px 0 2px 5px; padding: 1px 7px; border: 1px solid var(--rule); background: var(--panel); font: 400 11.5px/1.5 var(--mono); color: var(--ink-2); border-radius: 2px; white-space: nowrap; vertical-align: 1px; }
.ref:hover, .ref.on { border-color: var(--ink); color: var(--ink); background: #fff; }
.ref.on { box-shadow: inset 0 -2px 0 var(--parcel); }
.ref.fut { border-style: dashed; border-color: #9fb0cc; color: var(--blue); }

.sec { margin-top: 22px; }
.sec-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: 400 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 7px; border-bottom: 1px solid var(--rule-2); margin-bottom: 10px; }
.sec-h .refs .ref { text-transform: none; letter-spacing: 0; }

.chain { display: flex; flex-wrap: wrap; gap: 6px 0; align-items: stretch; }
.node { position: relative; padding: 8px 22px 8px 12px; background: var(--paper); border: 1px solid var(--rule-2); margin-right: 14px; min-width: 0; }
.node b { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.node span { font-size: 12px; color: var(--ink-2); }
.node::after { content: ""; position: absolute; right: -11px; top: 50%; width: 8px; height: 8px; border-top: 1.5px solid var(--ink-3); border-right: 1.5px solid var(--ink-3); transform: translateY(-50%) rotate(45deg); }
.node:last-child { margin-right: 0; background: var(--ink); color: #f5f3ee; border-color: var(--ink); }
.node:last-child span { color: #b9bcc1; }
.node:last-child::after { display: none; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { position: relative; padding: 0 0 14px 40px; counter-increment: st; }
.steps li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; font: 400 12.5px/1 var(--mono); border: 1px solid var(--ink); background: var(--white); }
.steps li::after { content: ""; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 1px; background: var(--rule); }
.steps li:last-child { padding-bottom: 2px; }
.steps li:last-child::after { display: none; }
.st-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.st-top b { font-weight: 600; }
.term { font: 400 12px/1.5 var(--mono); background: var(--ink); color: #fff; padding: 1px 7px; border-radius: 2px; white-space: nowrap; }
.term.soft { background: var(--amber-soft); color: var(--amber); }
.st-text { color: var(--ink-2); margin-top: 2px; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { position: relative; padding: 5px 0 5px 26px; }
.list li + li { border-top: 1px dashed var(--rule-2); }
.list li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 7px; height: 7px; background: var(--ink-3); }
.list.num { counter-reset: n; }
.list.num li { counter-increment: n; }
.list.num li::before { content: counter(n); background: none; width: auto; height: auto; top: 5px; left: 2px; font: 400 13px/1.6 var(--mono); color: var(--ink-3); }
.list.check li::before { background: none; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); top: 12px; }
.list.auto li::before { background: none; border: 1.5px solid var(--ink-3); border-radius: 50%; width: 8px; height: 8px; top: 12px; }
.list.stop li::before { background: var(--signal); }
.list.cond li::before { background: #c98a00; }
.list.warn li::before { background: var(--signal); }
.tagx { display: inline-block; font: 400 10.5px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; padding: 0 6px; margin-right: 6px; background: var(--amber-soft); color: var(--amber); border-radius: 2px; vertical-align: 1px; }
.tagx.red { background: var(--signal-soft); color: var(--signal); }
.tagx.grey { background: var(--rule-2); color: var(--ink-2); }

.future { border: 1px solid #b9c6dc; background: var(--blue-soft); padding: 12px 14px; }
.future .sec-h { color: var(--blue); border-color: #c9d3e5; }
.future p + p { margin-top: 8px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 400 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 6px 10px 6px 0; border-bottom: 1px solid var(--rule); }
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule-2); vertical-align: top; }
.tbl tr.hl td { background: #fff6c9; }
.tbl tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--parcel); padding-left: 10px; }
.tbl .num { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.tbl a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.scroll-x { overflow-x: auto; }
.small { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }

.pending { margin-top: 22px; padding: 12px 14px; background: repeating-linear-gradient(135deg, #f1eee6 0 8px, #ece8de 8px 16px); border: 1px dashed #b9b3a4; }
.pending .sec-h { border: 0; padding: 0; margin-bottom: 6px; color: var(--ink-2); }
.pending ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--ink-2); }
.pending li + li { margin-top: 3px; }

.parcel { border-bottom: 1px solid var(--rule); background: var(--ink); color: #f1efe9; padding: 14px 22px; }
.parcel-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.parcel-cn { font: 400 20px/1.2 var(--mono); color: var(--parcel); }
.parcel-src { font-size: 12px; color: #a4a8ae; }
.parcel dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 16px; margin: 10px 0 0; font-size: 13.5px; }
.parcel dt { color: #a4a8ae; }
.parcel dd { margin: 0; overflow-wrap: anywhere; }
.parcel-law { margin-top: 10px; padding: 7px 10px; background: #24272c; border-left: 3px solid var(--parcel); font-size: 13.5px; }
.parcel-law a { color: var(--parcel); }

.question { padding: 18px 22px 20px; }
.question h3 { font-size: 18px; font-weight: 600; line-height: 1.3; }
.question .hint { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-top: 14px; }
.opt { text-align: left; padding: 10px 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: 2px; line-height: 1.3; font-size: 14.5px; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--ink); background: #fff; }
.opt.muted { background: transparent; border-style: dashed; color: var(--ink-2); }
.opts.done .opt { pointer-events: none; opacity: .45; }
.opts.done .opt.sel { opacity: 1; border-color: var(--ink); background: #fff; box-shadow: inset 3px 0 0 var(--parcel); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; border-radius: 2px; text-decoration: none; }
.btn:hover { background: #2a2d32; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }

.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 20px; padding: 10px 22px; border-top: 1px solid var(--rule-2); font-size: 12px; color: var(--ink-3); background: var(--panel); }
.card-foot .sp { flex: 1; }
.fb { border: 0; background: none; padding: 2px 4px; color: var(--ink-2); font-size: 12px; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.fb:hover { color: var(--ink); }
.fb.sel { color: var(--ok); text-decoration: none; font-weight: 600; }

.contacts { margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.quote { border-left: 3px solid var(--parcel); background: var(--panel); padding: 10px 14px; margin-top: 12px; }
.quote h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.quote p { white-space: pre-line; font-size: 14.5px; }

/* ---- строка «что понял» ---- */
.slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px clamp(16px, 4vw, 44px); border-top: 1px solid var(--rule); background: var(--panel); font-size: 13px; }
.slots:empty { display: none; }
.slots .lbl { font: 400 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.slot { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--rule); background: #fff; padding: 2px 4px 2px 9px; border-radius: 2px; }
.slot i { font-style: normal; color: var(--ink-3); }
.slot em { font-style: normal; font: 400 10px/1 var(--mono); color: var(--blue); text-transform: uppercase; letter-spacing: .05em; }
.slot button { border: 0; background: none; color: var(--ink-3); padding: 0 4px; font-size: 15px; line-height: 1; }
.slot button:hover { color: var(--signal); }
.slots .reset { margin-left: auto; border: 0; background: none; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---- ввод ---- */
.composer { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--rule); padding: 12px clamp(16px, 4vw, 44px) 14px; }
.composer form { display: flex; gap: 8px; max-width: 812px; margin: 0 auto; }
.composer textarea { flex: 1; resize: none; min-height: 46px; max-height: 160px; padding: 11px 13px; border: 1px solid var(--ink-3); background: #fff; border-radius: 2px; line-height: 1.4; }
.composer textarea:focus { outline: 2px solid var(--ink); outline-offset: -1px; border-color: var(--ink); }
.composer .hint { max-width: 812px; margin: 6px auto 0; font-size: 12px; color: var(--ink-3); }
.typing { display: inline-flex; gap: 4px; padding: 14px 18px; }
.typing i { width: 6px; height: 6px; background: var(--ink-3); border-radius: 50%; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---- панель нормы ---- */
.src-empty { padding: 26px 22px; color: var(--ink-2); font-size: 14px; }
.src-empty h3 { font-size: 15px; color: var(--ink); margin-bottom: 8px; }
.src-empty ol { padding-left: 18px; margin: 10px 0 0; }
.src-empty li + li { margin-top: 6px; }
.src { padding: 20px 22px 30px; }
.src-close { display: none; }
.src .eyebrow { display: flex; justify-content: space-between; gap: 10px; }
.src h3 { font-size: 18px; font-weight: 700; margin-top: 8px; line-height: 1.25; }
.src .act { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.src .art { margin-top: 14px; font-size: 13.5px; font-weight: 600; }
.src-text { margin-top: 10px; background: #fff; border: 1px solid var(--rule); padding: 14px 16px; font-size: 15px; line-height: 1.55; }
.src-text p + p, .src-text .it { margin-top: 8px; }
.src-text .it { padding-left: 4px; }
.src-text .it.focus { background: #fff6c9; box-shadow: -8px 0 0 #fff6c9, 8px 0 0 #fff6c9, -11px 0 0 var(--parcel); }
.src-text.focus-all { box-shadow: inset 3px 0 0 var(--parcel); }
.src-meta { margin: 14px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; font-size: 13px; }
.src-meta dt { color: var(--ink-3); }
.src-meta dd { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; font: 400 11px/1.6 var(--mono); padding: 0 7px; border-radius: 2px; background: var(--ok-soft); color: var(--ok); }
.badge.fut { background: var(--blue-soft); color: var(--blue); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.grey { background: var(--rule-2); color: var(--ink-2); }
.src-notes { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }

/* ---- страницы ---- */
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.box { background: var(--white); border: 1px solid var(--rule); padding: 18px 20px; }
.box h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
textarea.big { width: 100%; min-height: 250px; resize: vertical; padding: 12px 14px; border: 1px solid var(--ink-3); background: #fff; border-radius: 2px; line-height: 1.5; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.draft { white-space: pre-wrap; font: 400 14.5px/1.6 Georgia, "Times New Roman", serif; background: #fff; border: 1px solid var(--rule); padding: 22px 24px; max-height: 620px; overflow-y: auto; }
.masked { white-space: pre-wrap; font-size: 14px; background: var(--panel); border: 1px solid var(--rule-2); padding: 10px 12px; max-height: 180px; overflow-y: auto; }
.masked mark { background: var(--ink); color: var(--parcel); font: 400 12px/1.5 var(--mono); padding: 1px 5px; border-radius: 2px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--rule); background: var(--white); margin-top: 22px; }
.kpi { padding: 16px 18px; border-right: 1px solid var(--rule-2); }
.kpi:last-child { border-right: 0; }
.kpi b { display: block; font: 400 30px/1.1 var(--mono); }
.kpi b small { font-size: 16px; color: var(--ink-3); }
.kpi span { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.kpi.good b { color: var(--ok); }
.pipe { display: flex; flex-wrap: wrap; gap: 6px 0; margin-top: 12px; }
.pipe .node { font-size: 13px; }
.pipe .node.llm { border-style: dashed; }
.pipe .node:last-child { background: var(--paper); color: var(--ink); border-color: var(--rule-2); }
.pipe .node:last-child span { color: var(--ink-2); }
.act-card { background: var(--white); border: 1px solid var(--rule); margin-top: 14px; }
.act-head { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; padding: 14px 18px; align-items: start; cursor: pointer; }
.act-head:hover { background: var(--panel); }
.act-short { font: 400 15px/1.3 var(--mono); }
.act-title { font-weight: 600; line-height: 1.3; }
.act-sub { font-size: 13px; color: var(--ink-2); margin-top: 3px; }
.act-badges { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.act-body { display: none; border-top: 1px solid var(--rule-2); padding: 6px 18px 14px; }
.act-card.open .act-body { display: block; }
.art-row { padding: 8px 0; border-bottom: 1px dashed var(--rule-2); font-size: 14px; }
.art-row:last-child { border: 0; }
.art-row b { font-weight: 600; }
.search { display: flex; gap: 8px; margin-top: 18px; }
.search input { flex: 1; padding: 10px 13px; border: 1px solid var(--ink-3); background: #fff; border-radius: 2px; }
.hit { padding: 10px 0; border-bottom: 1px solid var(--rule-2); }
.hit p { font-size: 14px; color: var(--ink-2); margin-top: 3px; }
.ok-mark { color: var(--ok); font-weight: 700; }
.bad-mark { color: var(--signal); font-weight: 700; }
.muted { color: var(--ink-3); }
.mt { margin-top: 22px; }

/* ---- вход ---- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--ink); }
.gate-box { width: min(420px, 100%); background: var(--paper); padding: 30px 30px 26px; }
.gate-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; letter-spacing: .05em; text-transform: uppercase; }
.gate-brand i { font-style: normal; font-weight: 400; opacity: .6; }
.gate-box h1 { font-size: 22px; margin-top: 22px; line-height: 1.25; }
.gate-box p { color: var(--ink-2); font-size: 14px; margin-top: 8px; }
.gate-box input { width: 100%; margin-top: 18px; padding: 11px 13px; border: 1px solid var(--ink-3); font: 400 17px/1.3 var(--mono); letter-spacing: .04em; background: #fff; border-radius: 2px; }
.gate-box .btn { width: 100%; justify-content: center; margin-top: 10px; padding: 11px; }
.gate-err { color: var(--signal) !important; font-weight: 500; }

/* ---- адаптив ---- */
@media (max-width: 1180px) {
  .work, .page-wide { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; inset: auto 0 0 0; top: auto; height: auto; max-height: 78vh; z-index: 50; border-left: 0; border-top: 2px solid var(--ink); box-shadow: 0 -18px 50px rgba(0, 0, 0, .28); transform: translateY(105%); transition: transform .22s ease; }
  .side.open { transform: none; }
  .src-close { display: inline-flex; }
  .src-empty { display: none; }
  .bar-right .hide-m { display: none; }
}
@media (max-width: 860px) {
  body { font-size: 15px; }
  .bar { height: auto; flex-wrap: wrap; }
  .brand, .module { height: var(--bar-h); }
  .module { border-right: 0; flex: 1; }
  .bar-right { display: none; }
  .nav { order: 3; width: 100%; height: 42px; overflow-x: auto; border-top: 1px solid #2c2f34; padding-left: 4px; }
  .side { top: auto; }
  .facts, .kpis { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(2n), .kpi:nth-child(2n) { border-right: 0; }
  .facts div, .kpi { border-bottom: 1px solid var(--rule-2); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .card-body { padding: 16px 16px 4px; }
  .question, .parcel { padding-left: 16px; padding-right: 16px; }
  .card-foot { padding: 10px 16px; }
  .act-head { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .act-badges { flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
  .msg-user div { max-width: 92%; }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .node { margin-right: 14px; }
  .dialog, .work { min-height: calc(100vh - 130px); }
  .tbl.stack thead { display: none; }
  .tbl.stack tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
  .tbl.stack td { display: block; border: 0; padding: 2px 0; }
  .tbl.stack td:first-child { font-weight: 600; }
  .tbl.stack tr.hl { background: #fff6c9; padding-left: 10px; box-shadow: inset 3px 0 0 var(--parcel); }
  .tbl.stack tr.hl td { background: none; box-shadow: none; padding-left: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .bar, .demo-note, .composer, .side, .slots, .actions, .card-foot .fb { display: none !important; }
  .work { display: block; }
  body { background: #fff; }
}
