/* Сопоставитель: ясное рабочее пространство, данные и действия на первом плане. */
:root {
  --paper: oklch(0.975 0.004 265); --sheet: oklch(0.995 0.002 265);
  --rule: oklch(0.9 0.01 265); --rule-2: oklch(0.76 0.02 265);
  --ink: oklch(0.26 0.025 265); --ink-2: oklch(0.43 0.025 265); --ink-3: oklch(0.51 0.025 265);
  --stamp: oklch(0.49 0.17 275); --stamp-deep: oklch(0.42 0.17 275); --stamp-wash: oklch(0.95 0.025 275);
  --ok: oklch(0.43 0.1 155); --ok-wash: oklch(0.95 0.025 155);
  --hold: oklch(0.46 0.1 75); --hold-wash: oklch(0.96 0.04 85);
  --miss: oklch(0.48 0.16 25); --miss-wash: oklch(0.96 0.025 25);
  --on-stamp: oklch(0.995 0.002 265); --on-miss: oklch(0.995 0.002 265);
  --display: "Segoe UI", system-ui, -apple-system, sans-serif;
  --text: "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--text); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--stamp); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(26px, 3.4vw, 36px); }
h2 { font-size: 21px; }
h3, .h3 { font-size: 17px; }
p { margin: 0; }
.num, .fig { font-family: var(--display); font-variant-numeric: tabular-nums; }
.quiet { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* каркас: колонка слева отделена двойной линией, как в книге учёта */
.frame { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  border-right: 3px double var(--rule-2); padding: 22px 20px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 26px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { flex: none; }
.brand b { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.mk-bar { fill: var(--ink); }
.mk-tie { stroke: var(--stamp); }
.rail h4, .rail-h { margin: 0 0 6px; font: 600 13px var(--text); color: var(--ink-3); }
.rail-nav a, .rail-nav span.off {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0;
  color: var(--ink-2); text-decoration: none; border-bottom: 1px solid var(--rule);
}
.rail-nav a:hover { color: var(--ink); }
.rail-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.rail-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--stamp); padding-left: 10px; margin-left: -10px; }
.rail .rmob { display: none; }
.rail-nav span.off { color: var(--ink-3); }
.rail-nav .n { font-family: var(--display); font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 400; }
.rail-nav .n.hold { color: var(--hold); }
.rail-nav .step { display: grid; grid-template-columns: 18px 1fr auto; }
.rail-nav .step i { font-style: normal; font-family: var(--display); color: var(--ink-3); }
.rail-prof { font-size: 14px; }
.rail-prof b { display: block; font-weight: 600; }
.rail-foot { margin-top: auto; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 7px; align-items: baseline; }
.lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; transform: translateY(-1px); }
.lamp.off { background: var(--miss); }

main { padding: 34px 44px 90px; max-width: 1180px; width: 100%; outline: none; }
.head { margin-bottom: 26px; max-width: 72ch; }
.head p { margin-top: 8px; color: var(--ink-2); }
.mstrip { display: none; }

/* листы */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: 3px; }
.sheet + .sheet, .sheet + .block, .block + .sheet, .block + .block { margin-top: 22px; }
.pad { padding: 22px 24px; }
.sheet-top { padding: 18px 24px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 24px; flex-wrap: wrap; }
.sheet-top p { color: var(--ink-3); font-size: 13.5px; margin-top: 4px; max-width: 70ch; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--rule-2); border-radius: 3px; background: var(--sheet); color: var(--ink); cursor: pointer;
  font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.main { background: var(--stamp); border-color: var(--stamp); color: var(--on-stamp); }
.btn.main:hover { background: var(--stamp-deep); border-color: var(--stamp-deep); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 13.5px; }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.lnk { background: none; border: 0; padding: 0; color: var(--stamp); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; font-size: 14px; }
.lnk.miss { color: var(--miss); }
.bar { display: flex; gap: 12px 16px; align-items: center; margin-top: 22px; flex-wrap: wrap; }
.bar .end { margin-left: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* шаги мастера: номера, потому что это настоящая последовательность */
.wsteps { display: flex; gap: 0; margin: 0 0 26px; padding: 0; list-style: none; border-bottom: 1px solid var(--rule-2); flex-wrap: wrap; }
.wsteps li { display: flex; align-items: baseline; gap: 8px; padding: 0 22px 10px 0; color: var(--ink-3); position: relative; }
.wsteps li .fig { font-size: 20px; }
.wsteps li.cur { color: var(--ink); font-weight: 600; }
.wsteps li.cur::after { content: ""; position: absolute; left: 0; right: 22px; bottom: -1px; height: 3px; background: var(--stamp); }
.wsteps li.done { color: var(--ok); }
.wsteps button { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; display: flex; align-items: baseline; gap: 8px; text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 5px; }
.wsteps button:hover { color: var(--ink); }

/* поля загрузки */
.fieldset-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; display: block; }
.drop {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 84px; cursor: pointer;
  border: 1px solid var(--rule-2); border-radius: 3px; background: var(--sheet);
}
.drop:hover, .drop.over { background: var(--stamp-wash); border-color: var(--stamp); }
.drop.has { border-left: 4px solid var(--ok); }
.drop.err { border-left: 4px solid var(--miss); }
.drop-body { flex: 1; min-width: 0; }
.drop-name { font-family: var(--display); font-size: 17px; overflow-wrap: anywhere; }
.drop-sub { font-size: 13px; color: var(--ink-3); }
.drop.err .drop-sub { color: var(--miss); }
.drop-act { color: var(--stamp); font-weight: 600; font-size: 14px; white-space: nowrap; }
.samples { margin-top: 14px; font-size: 14px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; }

/* таблица ролей: как строки бланка */
.form-table { width: 100%; border-collapse: collapse; }
.form-table th { text-align: left; font: 600 13px var(--text); color: var(--ink-3); padding: 0 12px 8px 0; border-bottom: 1px solid var(--rule-2); }
.form-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.form-table .role b { display: block; font-weight: 600; }
.form-table .role span { display: block; font-size: 13px; color: var(--ink-3); }
.form-table select { width: 100%; }
select, input[type=text], input[type=search], input[type=url], input[type=password], textarea {
  border: 0; border-bottom: 1px solid var(--rule-2); border-radius: 0; background: transparent; padding: 7px 2px; min-height: 38px;
}
select:hover, input:hover, textarea:hover { border-bottom-color: var(--ink-2); }
select:focus, input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):focus, textarea:focus { outline: none; border-bottom: 2px solid var(--stamp); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible, input[type=range]:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; }
.drop:focus-within { outline: 2px solid var(--stamp); outline-offset: 2px; }
select option { background: var(--sheet); color: var(--ink); }
textarea { width: 100%; min-height: 90px; resize: vertical; border: 1px solid var(--rule-2); padding: 8px 10px; }
.na { color: var(--ink-3); font-size: 13px; }
.hint { font-size: 13px; font-weight: 600; white-space: nowrap; }
.hint.ok { color: var(--ok); } .hint.hold { color: var(--hold); } .hint.miss { color: var(--miss); } .hint.prof { color: var(--stamp); }
.filefacts { font-size: 13.5px; color: var(--ink-2); }
.filefacts b { color: var(--ink); }
.filefacts p + p { margin-top: 4px; }

/* заметки */
.memo { padding: 10px 14px; border-left: 3px solid var(--rule-2); background: transparent; color: var(--ink-2); font-size: 14px; }
.memo b { color: var(--ink); }
.memo.ok { border-color: var(--ok); } .memo.hold { border-color: var(--hold); } .memo.miss { border-color: var(--miss); }
.memo.note { border-color: var(--stamp); }

/* счётная строка — она же фильтр */
.tally { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: baseline; padding: 14px 24px; border-bottom: 1px solid var(--rule); }
.tally button { all: unset; cursor: pointer; display: inline-flex; gap: 7px; align-items: baseline; color: var(--ink-2); padding: 2px 0; border-bottom: 2px solid transparent; }
.tally button .fig { font-size: 24px; color: var(--ink); }
.tally button[aria-pressed="true"] { border-bottom-color: var(--stamp); color: var(--ink); }
.tally button:focus-visible { outline: 2px solid var(--stamp); outline-offset: 3px; }
.tally .ok .fig { color: var(--ok); } .tally .hold .fig { color: var(--hold); } .tally .miss .fig { color: var(--miss); } .tally .stamp .fig { color: var(--stamp); }

/* сверочная ведомость */
.ledger { list-style: none; margin: 0; padding: 0; }
.lrow {
  display: grid; grid-template-columns: 54px minmax(0, 1fr) 132px minmax(0, 1fr) 150px; gap: 0 16px; align-items: center;
  padding: 13px 24px; border-bottom: 1px solid var(--rule); cursor: pointer; color: inherit; text-decoration: none;
}
.ledger > li:last-child .lrow { border-bottom: 0; }
.lrow-empty { padding: 16px 24px; }
.lrow:hover { background: var(--paper); }
.lrow:focus-visible { outline: 2px solid var(--stamp); outline-offset: -2px; }
.lrow.lhead { cursor: default; padding-top: 10px; padding-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--ink-3); border-bottom-color: var(--rule-2); }
.lrow.lhead:hover { background: none; }
.lrow:last-child { border-bottom: 0; }
.lno { font-family: var(--display); color: var(--ink-3); font-size: 14px; overflow-wrap: anywhere; min-width: 0; }
.lname { overflow-wrap: anywhere; }
.lmeta { font-size: 13px; color: var(--ink-3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.lmeta .fig { color: var(--ink-2); }
.lwarn { font-size: 12.5px; color: var(--hold); margin-top: 3px; }
.lempty { color: var(--ink-3); font-style: italic; }
.scaled { text-decoration: none; font-size: 11.5px; color: var(--stamp); border: 1px solid currentColor; border-radius: 2px; padding: 0 4px; margin-left: 4px; cursor: help; white-space: nowrap; }

/* стежок между позицией и товаром */
.tie { position: relative; height: 34px; display: flex; align-items: flex-start; justify-content: center; }
.tie .fig { font-size: 15px; line-height: 1; color: var(--ink-2); background: var(--sheet); padding: 0 6px; position: relative; z-index: 1; }
.lrow:hover .tie .fig { background: var(--paper); }
.tie::before { content: ""; position: absolute; left: 0; right: 0; top: 24px; border-top: 2px solid var(--stamp); }
.tie.manual::before { border-top: 4px double var(--ok); top: 23px; }
.tie.auto::before { border-top-color: var(--ok); }
.tie.hold::before { border-top: 2px dashed var(--hold); }
.tie.ai::before { border-top: 2px dotted var(--stamp); }
.tie.miss::before { border-top: 2px solid var(--miss); right: 62%; }
.tie.miss::after { content: "×"; position: absolute; left: 38%; top: 13px; color: var(--miss); font-weight: 700; margin-left: 4px; }
.lstat { font-size: 14px; font-weight: 600; }
.lstat small { display: block; font-weight: 400; color: var(--ink-3); font-size: 12.5px; }
.st-ok { color: var(--ok); } .st-hold { color: var(--hold); } .st-miss { color: var(--miss); }
.more { padding: 14px 24px; text-align: center; }

/* разбор */
.review { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; align-items: start; }
.slip { background: var(--sheet); border: 1px solid var(--rule); border-top: 4px solid var(--ink); padding: 20px 22px; }
.slip .lno { font-size: 13px; }
.slip-name { font-family: var(--display); font-size: 22px; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
dl.lines { display: grid; grid-template-columns: auto 1fr; margin: 16px 0 0; font-size: 14px; }
dl.lines dt, dl.lines dd { padding: 6px 0; border-bottom: 1px dotted var(--rule-2); margin: 0; }
dl.lines dt { color: var(--ink-3); padding-right: 16px; }
dl.lines dd { text-align: right; overflow-wrap: anywhere; }
.check-block { border-left: 3px solid var(--stamp); padding: 4px 0 4px 16px; }
.check-block h3, .h3 { font-size: 17px; }
.check-block .sub { font-size: 13px; color: var(--ink-3); margin-top: 10px; }
.checks { list-style: none; padding: 0; margin: 8px 0 0; font-size: 14px; display: grid; gap: 4px; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 6px; }
.checks li::before { font-weight: 700; font-family: var(--display); }
.checks .ok::before { content: "✓"; color: var(--ok); }
.checks .warn::before { content: "!"; color: var(--hold); }
.checks .fail::before { content: "×"; color: var(--miss); }
.checks .info::before { content: "?"; color: var(--ink-3); }
.checks .fail { color: var(--miss); }
.cands { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.cand { border-bottom: 1px solid var(--rule); }
.cand label { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 4px 14px 0; cursor: pointer; }
.cand input[type=radio] { margin: 3px 0 0; width: 17px; height: 17px; accent-color: var(--stamp); }
.cand.sel { background: var(--stamp-wash); box-shadow: inset 3px 0 0 var(--stamp); }
.cand.sel label { padding-left: 10px; grid-template-columns: 22px minmax(0, 1fr) auto; }
.cand-name { font-weight: 600; overflow-wrap: anywhere; }
.cand-conf { font-family: var(--display); font-size: 20px; text-align: right; line-height: 1.1; }
.cand-body { grid-column: 2 / 4; }
.cand-tags { display: inline-flex; gap: 10px; margin-left: 4px; }
.cand-tags span { font-size: 12.5px; font-weight: 600; }
.cand-tags .rec { color: var(--stamp); } .cand-tags .art { color: var(--ok); }
.search { display: flex; gap: 10px; align-items: flex-end; }
.search input { flex: 1; min-width: 0; }
.decide {
  position: sticky; bottom: 0; background: var(--sheet); border-top: 3px double var(--rule-2); padding: 12px 0 14px;
  display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-top: 8px;
}
.decide .chosen { flex: 1 1 240px; font-size: 14px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.journal { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13.5px; }
.journal li { padding: 7px 0; border-top: 1px dotted var(--rule-2); }
.journal .fig { color: var(--ink-3); margin-right: 6px; }

/* выписка: точечные отточия, как в бланке */
.leaders { list-style: none; margin: 0; padding: 0; max-width: 460px; }
.leaders li { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; }
.leaders li::after { content: ""; order: 2; flex: 1; border-bottom: 1px dotted var(--ink-3); transform: translateY(-4px); }
.leaders li span:first-child { order: 1; }
.leaders li .fig { order: 3; font-size: 18px; }
.fmt { display: flex; gap: 10px 28px; flex-wrap: wrap; }
.radio { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.radio input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--stamp); }
.radio small { display: block; color: var(--ink-3); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 13px; padding: 9px 12px; border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tbl .r { text-align: right; white-space: nowrap; font-family: var(--display); font-variant-numeric: tabular-nums; }
.tbl th.r { font-family: var(--text); }

/* правила */
.range { width: 100%; accent-color: var(--stamp); }
.tick { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.tick input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--stamp); flex: none; }
.tick small { display: block; color: var(--ink-3); }
details summary { cursor: pointer; color: var(--stamp); font-weight: 600; }
.big-in { width: 100%; font-family: var(--display); font-size: 22px; padding: 6px 2px; }
.thr { font-family: var(--display); font-size: 30px; line-height: 1; }

.progress { height: 3px; background: var(--rule); margin-top: 14px; }
.progress i { display: block; height: 100%; background: var(--stamp); width: 0; transition: width .2s; }

/* штамп «Сверено» — единственный громкий элемент */
.stamp-wrap { text-align: center; padding: 46px 24px 36px; }
.stamp {
  display: inline-block; color: var(--stamp); border: 3px solid currentColor; outline: 1px solid currentColor; outline-offset: 3px;
  padding: 10px 24px 8px; transform: rotate(-5deg); font-family: var(--display); text-align: center; border-radius: 4px;
  animation: stamp .32s cubic-bezier(.2, .9, .3, 1.3) both; opacity: .92;
}
.stamp b { display: block; font-size: 38px; letter-spacing: .14em; font-weight: 700; line-height: 1.05; }
.stamp span { display: block; font-size: 14px; letter-spacing: .06em; margin-top: 2px; }
@keyframes stamp { from { transform: rotate(-5deg) scale(1.6); opacity: 0; } to { transform: rotate(-5deg) scale(1); opacity: .92; } }
.stamp-wrap h2 { margin-top: 26px; }
.stamp-wrap p { color: var(--ink-2); max-width: 58ch; margin: 8px auto 20px; }

.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%); background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 3px; font-size: 14px; z-index: 50; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast.bad { background: var(--miss); color: var(--on-miss, #fff); }
.lstat small { overflow-wrap: anywhere; }

@media (max-width: 1080px) {
  main { padding: 28px 28px 80px; }
  .lrow { grid-template-columns: 44px minmax(0, 1fr) 110px minmax(0, 1fr); }
  .lrow .lstat { grid-column: 2 / -1; margin-top: 6px; }
  .lrow.lhead > :last-child { display: none; }
  .review { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .frame { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 3px double var(--rule-2); padding: 12px 16px; flex-direction: row; align-items: center; gap: 12px; }
  .rail .brand b { font-size: 18px; }
  .rail .rsec, .rail-foot { display: none; }
  .rail .rmob { display: flex; gap: 16px; margin-left: auto; font-size: 14px; }
  .rail .rmob a { color: var(--ink-2); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
  .rail .rmob a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--stamp); font-weight: 600; }
  main { padding: 20px 16px 70px; }
  .mstrip { display: flex; gap: 0; list-style: none; margin: 0 0 18px; padding: 0; border-bottom: 1px solid var(--rule-2); }
  .mstrip a { flex: 1; text-align: center; padding: 8px 4px; color: var(--ink-3); text-decoration: none; font-size: 14px; border-bottom: 3px solid transparent; margin-bottom: -1px; }
  .mstrip a[aria-current="step"] { color: var(--ink); border-bottom-color: var(--stamp); font-weight: 600; }
  .mstrip .fig { margin-left: 4px; }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .pad { padding: 16px; }
  .sheet-top { padding: 14px 16px; }
  .tally { padding: 12px 16px; gap: 4px 16px; }
  .lrow { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; gap: 0; }
  .lrow .lno { font-size: 12.5px; }
  .lrow .lstat { grid-column: auto; margin-top: 4px; }
  .lrow.lhead { display: none; }
  .tie { height: 30px; justify-content: flex-start; align-items: center; margin: 4px 0; }
  .tie .fig { padding-left: 0; padding-right: 10px; }
  .tie::before { left: 0; top: 50%; }
  .tie.manual::before { top: calc(50% - 2px); }
  .tie.miss::before { right: auto; width: 40px; }
  .tie.miss::after { left: 44px; top: 4px; margin: 0; }
  .form-table thead { display: none; }
  .form-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .form-table td { border: 0; padding: 0; }
  .form-table td.role { grid-column: 1 / -1; }
  .form-table td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-3); }
  .form-table td.conf { grid-column: 1 / -1; }
  .wsteps li { padding-right: 14px; font-size: 14px; }
  .wsteps li .fig { font-size: 17px; }
  .bar .end, .bar .end .btn { width: 100%; }
  .decide .btn { flex: 1 1 40%; padding: 0 8px; }
  .decide .chosen { flex-basis: 100%; font-size: 13px; }
  .search { flex-wrap: wrap; }
  .search input { flex-basis: 100%; }
  dl.lines { grid-template-columns: minmax(0, 1fr); }
  dl.lines dt { border-bottom: 0; padding-bottom: 0; }
  dl.lines dd { text-align: left; }
  .cand label { grid-template-columns: 22px minmax(0, 1fr); }
  .cand-conf { grid-column: 2; text-align: left; font-size: 17px; }
  .tbl-wrap { margin: 0 -16px; }
  .stamp b { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

@media (max-width: 720px) {
  .toast { top: 12px; bottom: auto; }
  .lnk { min-height: 44px; display: inline-flex; align-items: center; }
  .samples { gap: 0 16px; }
}

/* помощник ИИ */
.aibar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 24px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.aibar .progress { flex-basis: 100%; margin-top: 4px; }
@media (max-width: 720px) { .aibar { padding: 12px 16px; } }
input[data-llm]:not([type=radio]):not([type=range]) { width: 100%; }

/* 1С */
.onec-line { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.onec-cps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; max-width: 560px; }
.onec-steps { margin: 12px 0 0; padding-left: 20px; max-width: 76ch; color: var(--ink-2); font-size: 14px; }
.onec-steps li + li { margin-top: 6px; }
.onec-pre { font: 12.5px/1.45 ui-monospace, Consolas, monospace; background: var(--stamp-wash); padding: 10px 12px; overflow: auto; max-height: 320px; white-space: pre; }
select[data-onec], select[data-onec-sel] { max-width: 100%; }
/* Account shell and refreshed product surfaces */
h1 { font-size: 30px; font-weight: 650; letter-spacing: -.03em; }
h2 { font-size: 21px; letter-spacing: -.015em; }
h3 { font-size: 17px; }
.frame { grid-template-columns: 224px minmax(0, 1fr); }
.rail { border-right: 1px solid var(--rule); background: var(--sheet); padding: 26px 18px 20px; gap: 28px; }
.brand { gap: 9px; }
.brand b { font-size: 18px; letter-spacing: -.025em; }
.brand svg { width: 26px; height: 26px; }
main { padding: 40px 42px 80px; max-width: 1320px; }
.workspace-label { display: grid; gap: 6px; padding: 0 10px; overflow-wrap: anywhere; }
.workspace-label strong { font-size: 14px; font-weight: 600; }
.eyebrow { display: block; font-size: 11px; font-weight: 650; letter-spacing: .065em; text-transform: uppercase; color: var(--ink-3); }
.portal-nav { display: grid; gap: 5px; }
.portal-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 6px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; }
.portal-nav a:hover { background: var(--paper); color: var(--ink); }
.portal-nav a[aria-current="page"] { color: var(--stamp); background: var(--stamp-wash); font-weight: 600; }
.nav-group { margin: 22px 12px 6px; }
.nav-badge { font-variant-numeric: tabular-nums; font-size: 11px; padding: 1px 6px; background: var(--hold-wash); color: var(--hold); border-radius: 4px; }
.account-foot { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 30px minmax(0,1fr); gap: 10px; }
.avatar { display: grid; place-items: center; background: var(--stamp-wash); color: var(--stamp); width: 30px; height: 30px; border-radius: 50%; font-weight: 650; }
.account-foot strong, .account-foot div span { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-foot div span { color: var(--ink-3); font-size: 11px; }
.account-foot button { grid-column: 2; justify-self: start; font-size: 12px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 32px; }
.page-heading h1 { margin-top: 8px; }
.page-heading p { color: var(--ink-3); margin-top: 10px; font-size: 14px; max-width: 72ch; }
.btn { border-radius: 6px; font-size: 13px; font-weight: 600; transition: background-color 120ms, border-color 120ms; min-height: 40px; }
.btn.main { box-shadow: 0 1px 2px oklch(0.25 0.03 265 / .1); }
.sheet { border-radius: 8px; box-shadow: 0 1px 2px oklch(0.25 0.01 265 / .025); }
.head { margin-bottom: 28px; }
.head p { font-size: 14px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { border: 1px solid var(--rule-2); border-radius: 6px; background: var(--sheet); min-height: 42px; padding: 9px 11px; box-shadow: none; max-width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--stamp); }
label > input:not([type="checkbox"]):not([type="radio"]), label > select { display: block; width: 100%; margin-top: 6px; }
.memo { border: 1px solid var(--rule); border-radius: 6px; box-shadow: none; padding: 14px 16px; }
.memo.miss { background: var(--miss-wash); border-color: oklch(0.85 0.07 25); }
.memo.hold { background: var(--hold-wash); border-color: oklch(0.85 0.06 75); }
.drop { border-radius: 8px; background: var(--sheet); min-height: 132px; border: 1px dashed var(--rule-2); }
.drop:hover { border-color: var(--stamp); background: var(--stamp-wash); }
.drop-act { border-radius: 5px; }
.rail-note { color: var(--ink-3); font-size: 13px; line-height: 1.8; }
.auth-screen .frame { grid-template-columns: 1fr; }
.auth-screen .rail { position: absolute; width: auto; height: auto; border: 0; background: transparent; padding: 28px 5vw; }
.auth-screen .rail-note { display: none; }
.auth-screen main { max-width: 1280px; margin: 0 auto; padding: 120px 5vw 65px; }
.auth-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 8vw; align-items: center; min-height: 65vh; }
.auth-intro h1 { font-size: 48px; line-height: 1.13; letter-spacing: -.045em; margin: 20px 0; max-width: 18ch; }
.auth-intro p { max-width: 39ch; color: var(--ink-2); font-size: 17px; line-height: 1.7; }
.auth-intro ol { list-style: decimal-leading-zero; margin: 36px 0 0; padding-left: 28px; color: var(--ink-3); font-size: 13px; }
.auth-intro li { padding: 9px 0 9px 6px; }
.auth-form { padding: 36px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; max-width: 440px; }
.auth-form h2 { font-size: 26px; margin: 12px 0 22px; }
.auth-form form { margin-top: 24px; }
.auth-form label { font-size: 13px; font-weight: 550; }
.auth-form .btn { width: 100%; }
.auth-help { padding-top: 24px; margin-top: 24px; border-top: 1px solid var(--rule); }
.auth-form .memo { margin-bottom: 20px; }
.form-error { color: var(--miss); font-size: 13px; }
.form-error:empty { display: none; }
.identity-strip { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 24px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.identity-strip strong, .identity-strip div > span:last-child { display: block; margin-top: 5px; }
.identity-strip div > span:last-child { font-size: 13px; color: var(--ink-3); }
.state-chip { display: inline-flex; align-items: center; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); border-radius: 5px; padding: 3px 8px; font-size: 11px; white-space: nowrap; }
.state-chip.ok { background: var(--ok-wash); color: var(--ok); border-color: oklch(.85 .04 155); }
.state-chip.miss { background: var(--miss-wash); color: var(--miss); border-color: oklch(.85 .04 25); }
.block { padding-top: 30px; margin-top: 10px; }
.block > h2 { margin-bottom: 18px; }
.invite-section { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(260px, 1.2fr); gap: 36px; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
.invite-section h2 { margin-bottom: 10px; }
.invite-section p { font-size: 13px; max-width: 40ch; }
.invite-form { display: grid; gap: 16px; }
.invite-form label { font-size: 13px; font-weight: 550; }
.invite-form > .btn { justify-self: start; }
.permission-fields { border: 0; margin: 0; padding: 0; }
.permission-fields legend { font-size: 12px; color: var(--ink-3); margin-bottom: 8px; }
.permission-fields label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; margin: 7px 0; }
.invite-result { border: 1px solid oklch(.83 .07 155); border-radius: 8px; padding: 20px; margin-top: 24px; background: var(--ok-wash); }
.invite-result p { font-size: 13px; margin: 8px 0 12px; color: var(--ink-2); }
.invite-result input { flex: 1; min-width: 160px; font-size: 12px; }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 8px; background: var(--sheet); }
.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th { text-align: left; font-weight: 550; color: var(--ink-3); background: var(--paper); font-size: 11px; padding: 13px 16px; white-space: nowrap; }
.history-table td { padding: 17px 16px; border-top: 1px solid var(--rule); vertical-align: middle; }
.history-table strong { font-weight: 550; }
.history-table small { display: block; color: var(--ink-3); margin-top: 5px; font-size: 11px; max-width: 42ch; }
.history-table details { margin-top: 10px; }
.history-table summary { color: var(--stamp); cursor: pointer; font-size: 12px; }
.history-table details form { padding: 12px 0; min-width: 220px; }
.nowrap { white-space: nowrap; }
.history-toolbar { display: flex; justify-content: space-between; margin: 30px 0 14px; color: var(--ink-3); font-size: 12px; }
.history-toolbar button { font-size: 12px; }
.invitation-list > div { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.invitation-list strong { font-size: 13px; font-weight: 550; }
.invitation-list small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.empty-state { padding: 64px 24px; text-align: center; border: 1px dashed var(--rule-2); border-radius: 10px; background: var(--sheet); }
.empty-symbol { font-size: 40px; line-height: 1; color: var(--stamp); }
.empty-state h2 { margin: 20px 0 12px; }
.empty-state p { color: var(--ink-3); font-size: 14px; max-width: 48ch; margin: 0 auto 24px; }
.empty-state .btn { margin: 4px; }
.loading-rows { padding: 36px; background: var(--sheet); border-radius: 8px; color: var(--ink-3); }
:focus-visible { outline: 3px solid oklch(.6 .13 275); outline-offset: 3px; }
@media (max-width: 1050px) { main { padding: 30px 26px 60px; } .invite-section { grid-template-columns: 1fr; gap: 22px; } .auth-intro h1 { font-size: 38px; } .auth-layout { gap: 5vw; } .auth-form { padding: 28px; } }
@media (max-width: 820px) { .frame { grid-template-columns: 1fr; } .rail { position: static; height: auto; padding: 18px 20px; border: 0; border-bottom: 1px solid var(--rule); gap: 18px; } .workspace-label { display: none; } .portal-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; } .portal-nav a { white-space: nowrap; padding: 8px 10px; } .nav-group { display: none; } .account-foot { display: flex; margin: 0; padding: 0; border: 0; align-items: center; } .account-foot .lnk { margin-left: auto; } main { padding: 28px 20px 60px; } .page-heading { align-items: flex-start; flex-wrap: wrap; } .auth-screen .rail { position: static; } .auth-screen main { padding: 20px 20px 60px; } .auth-layout { grid-template-columns: 1fr; gap: 28px; min-height: 0; } .auth-intro h1 { font-size: 32px; margin: 12px 0; } .auth-intro h1 br { display: none; } .auth-intro p, .auth-intro ol, .auth-intro .eyebrow { display: none; } .auth-form { max-width: none; padding: 26px 22px; } h1 { font-size: 26px; } .identity-strip { gap: 12px; } .history-table td { padding: 14px 12px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 820px) {
  .frame, main { min-width: 0; }
  .rail { flex-direction: column; align-items: stretch; width: 100%; min-width: 0; }
  .portal-nav { width: 100%; min-width: 0; }
  .portal-nav a { flex: 0 0 auto; }
  .account-foot { min-width: 0; }
}
/* Anonymous showcase uses the same controls, with its scope always visible. */
.demo-notice { display:flex; flex-wrap:wrap; gap:6px 18px; padding:14px 18px; margin-bottom:24px; border:1px solid oklch(.83 .025 275); background:oklch(.95 .02 275); border-radius:8px; }
.demo-notice strong { white-space:nowrap; }
.demo-notice span { flex:1 1 420px; font-size:13px; line-height:1.5; }
.demo-file { display:grid; gap:8px; padding:20px; border:1px solid oklch(.87 .008 265); border-radius:8px; min-width:0; }
.demo-file strong { overflow-wrap:anywhere; }
.usage-toolbar, .usage-section-title { display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap; margin:24px 0 18px; }
.usage-totals { display:flex; flex-wrap:wrap; margin:0; padding:24px 0; border-block:1px solid var(--rule); gap:26px; }
.usage-totals > div { flex:1 1 190px; }
.usage-totals dt, .usage-totals small { color:var(--ink-3); font-size:12px; }
.usage-totals dd { margin:12px 0 8px; font-size:28px; font-weight:550; font-variant-numeric:tabular-nums; }
.usage-chart { display:flex; gap:10px; align-items:end; overflow-x:auto; padding:20px 4px; }
.usage-day { display:flex; flex:1 0 34px; flex-direction:column; align-items:center; justify-content:end; gap:9px; min-height:160px; font-size:12px; }
.usage-day i { width:100%; max-width:52px; background:var(--stamp); border-radius:3px 3px 0 0; }
.usage-day small { white-space:nowrap; color:var(--ink-3); font-size:10px; }
.usage-details summary { cursor:pointer; padding:15px 0; color:var(--stamp); }
.usage-caption, .usage-empty { margin:18px 0; }
