/* Палитра и кнопки — как в интерфейсе Битрикс24 (взято из b24-focus); компоновка — карточки, плитки, таблицы в рамке */
:root {
  --ground: #eef2f4;
  --surface: #fff;
  --ink: #333;
  --ink-2: #525c69;
  --muted: #6f7882;
  --line: #e4e8eb;
  --line-strong: #cfd5da;
  --chip-bg: #f5f7f8;
  --accent: #2fc6f6;
  --accent-dark: #11a9d9;
  --link: #2067b0;
  --cta: #bbed21;
  --cta-hover: #d2f95f;
  --danger: #ff5752;
  --ok-bg: #f1fbd0; --ok-ink: #4f7d00; --ok-mark: #7bb300;
  --err-bg: #ffe8e8; --err-ink: #d0312b; --err-mark: #ff5752;
  --info-bg: #e5f9ff; --info-ink: #0b8eb6;
  --warn-bg: #fff4d6; --warn-ink: #8a5a00; --warn-mark: #f5b400;
  --shadow: 0 1px 2px rgba(20, 24, 30, .06), 0 4px 14px rgba(20, 24, 30, .05);
  --radius: 12px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.45 "Golos Text", "Open Sans", "Helvetica Neue", Arial, sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--link); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.error { color: var(--err-ink); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.pad { padding: 24px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 0; }

/* ---------- каркас ---------- */
.app { max-width: 1240px; margin: 0 auto; padding: 16px clamp(12px, 3vw, 28px) 40px; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--surface); border-radius: 10px; padding: 3px; box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: transparent; color: var(--ink-2); padding: 7px 14px; border-radius: 8px; white-space: nowrap; font-size: 14px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.job-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 8px; border-radius: 999px; background: var(--info-bg); color: var(--info-ink); font-size: 13px; }
.job-chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip-link { border: 0; background: transparent; padding: 4px 8px; border-radius: 999px; }
.chip-link:hover { text-decoration: underline; }
.chip-link + .chip-link { font-weight: 600; }

.page-head { display: flex; flex-direction: column; gap: 6px; }
.eyebrow { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.15; font-weight: 600; text-wrap: balance; }
h2 { margin: 0; font-size: 18px; font-weight: 600; }
.thesis { margin: 0; max-width: 78ch; color: var(--ink-2); }
.back { align-self: flex-start; border: 0; background: none; padding: 0; color: var(--link); font-size: 14px; }
.back:hover { text-decoration: underline; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.section { display: flex; flex-direction: column; gap: 14px; }

/* ---------- кнопки и поля (ui-btn Битрикс24) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
  white-space: nowrap;
}
.btn:hover { border-color: #a8adb4; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-cta { background: var(--cta); border-color: var(--cta); color: var(--ink-2); }
.btn-cta:hover:not(:disabled) { background: var(--cta-hover); border-color: var(--cta-hover); }
.btn-danger { color: var(--err-ink); border-color: #f3b7b5; }
.btn-l { height: 46px; border-radius: 23px; font-size: 13px; padding: 0 28px; }
.btn-s { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 11px; }
.x { border: 0; background: var(--surface); color: var(--ink-2); border-radius: 50%; width: 28px; height: 28px; font-size: 16px; line-height: 1; flex: none; }
.x:hover { background: var(--ink-2); color: #fff; }

/* поддержка */
.tour-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(23, 32, 43, .55); display: flex; justify-content: center; align-items: flex-start; padding: 24px 16px; overflow-y: auto; }
.tour { width: min(880px, 100%); background: var(--surface); border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); overflow: hidden; outline: none; }
.tour-shot { position: relative; background: #eef2f4; border-bottom: 1px solid var(--line); }
.tour-mark { position: absolute; border: 3px solid #ff7a00; border-radius: 10px; box-shadow: 0 0 0 4px rgba(255, 122, 0, .25); pointer-events: none; }
.tour-shot img { display: block; width: 100%; height: auto; aspect-ratio: 1100 / 476; }
.tour-body { padding: 18px 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.tour-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tour-head h2 { margin: 2px 0 0; }
.tour-text { margin: 0; line-height: 1.5; }
.tour-example { background: var(--info-bg); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.tour-example b { color: var(--info-ink); }
.tour-close { border: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; padding: 6px 8px; border-radius: 8px; }
.tour-close:hover { background: var(--chip-bg); color: var(--ink); }
.tour-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.tour-dots { display: flex; gap: 6px; align-items: center; }
.tour-dots button { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: var(--line-strong); }
.tour-dots button.on { width: 22px; background: var(--accent); }
@media (max-width: 600px) { .tour-overlay { padding: 8px; } .tour-body { padding: 14px 16px 16px; } }
/* ярлычок у правого края: окно приложения растянуто по содержимому, поэтому он стоит у верха, рядом с меню */
.tour-tab { position: fixed; right: 0; top: 96px; z-index: 5; writing-mode: vertical-rl; transform: rotate(180deg); border: 0; border-radius: 0 8px 8px 0;
  background: var(--accent); color: #fff; padding: 12px 5px; font-size: 13px; box-shadow: var(--shadow); }
.tour-tab:hover { background: var(--accent-dark); }
.tour-tab.hint { z-index: 60; box-shadow: 0 0 0 4px rgba(255, 122, 0, .55); animation: tour-pulse 1.4s ease-in-out infinite; }
@keyframes tour-pulse { 50% { box-shadow: 0 0 0 9px rgba(255, 122, 0, .2); } }
@media (prefers-reduced-motion: reduce) { .tour-tab.hint { animation: none; } }
@media (max-width: 700px) { .tour-tab { display: none; } }
.support { display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--accent); }
.support .card-head { margin-bottom: 0; }
.support-ctx { color: var(--ink-2); }
textarea.input { resize: vertical; }

.input {
  width: 100%; min-height: 38px; padding: 7px 10px; font: inherit; font-size: 14px; color: inherit;
  border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
.input:focus { outline: none; border-color: var(--accent); }
.input-s { min-height: 32px; padding: 5px 8px; }
select.input { width: auto; max-width: 100%; }
.num-input { width: 96px; }
.search { max-width: 320px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 13px; color: var(--ink-2); }
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check-line input { accent-color: var(--accent); margin-top: 3px; flex: none; }

/* метки */
.pill { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 6px; white-space: nowrap; background: var(--chip-bg); color: var(--ink-2); }
.pill.info { background: var(--info-bg); color: var(--info-ink); }
.pill.ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill.err { background: var(--err-bg); color: var(--err-ink); }
.pill.warn { background: var(--warn-bg); color: var(--warn-ink); }

.dashed { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 16px 18px; color: var(--ink-2); background: var(--surface); }
.dashed b { color: var(--ink); font-weight: 600; }
.note { border-radius: 10px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.note.ok { background: var(--ok-bg); color: var(--ok-ink); }
.note.err { background: var(--err-bg); color: var(--err-ink); }
.note.info { background: var(--info-bg); color: var(--info-ink); }

/* ---------- обзор ---------- */
.hero { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; }
.score-card { display: flex; flex-direction: column; gap: 12px; }
.score-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.score { font-size: 64px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.score-of { font-size: 18px; color: var(--muted); }
.delta { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--ok-ink); }
.delta.down { color: var(--err-ink); }
.ai { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 10px; margin: 0; }

.progress { height: 10px; background: var(--chip-bg); border-radius: 5px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 5px; transition: width .4s; }

.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; flex-direction: column; gap: 8px; text-align: left; border: 1px solid transparent; }
.check.click { cursor: pointer; }
.check.click:hover { border-color: var(--accent); }
.check-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.check-name { font-weight: 600; font-size: 16px; }
.check-count { font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; }
.check-base { font-size: 13px; color: var(--muted); }
.check-go { margin-top: auto; padding-top: 4px; font-size: 13px; font-weight: 500; color: var(--link); }

/* полоска балла: отметка статуса + число рядом, цвет никогда не единственный признак */
.meter { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter-track { flex: 1; height: 6px; background: var(--chip-bg); border-radius: 3px; overflow: hidden; }
.meter-track i { display: block; height: 100%; border-radius: 3px; }
.s-ok { background: var(--ok-mark); }
.s-warn { background: var(--warn-mark); }
.s-err { background: var(--err-mark); }

/* график истории */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: 180px; overflow: hidden; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .series { fill: none; stroke: var(--link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--link); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hover-line { stroke: var(--line-strong); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); }
.tip b { font-size: 14px; }

.rules > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rules > summary::-webkit-details-marker { display: none; }
.rules > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.rules[open] > summary::before { transform: rotate(90deg); }
.rules-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.rules-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--ink-2); }
.rules-list b { color: var(--ink); }

/* ---------- мастер исправления ---------- */
.toolbar { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: center; }
.toolbar .right { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 4px 11px; font-size: 13px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip .n { opacity: .75; margin-left: 4px; font-variant-numeric: tabular-nums; }

.tablewrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; border: 1px solid var(--line-strong); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 13px; font-weight: 600; background: var(--chip-bg); padding: 10px 12px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
td.cb, th.cb { width: 36px; padding-right: 0; }
td.cb input, th.cb input { accent-color: var(--accent); width: 16px; height: 16px; margin: 2px 0 0; }
td.title a { font-weight: 500; text-decoration: none; }
td.title a:hover { text-decoration: underline; }
th.num, td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.nowrap { white-space: nowrap; }
tr.done td { background: var(--ok-bg); }
tr.failed td { background: var(--err-bg); }
.wide { min-width: 720px; }
.recs { display: flex; flex-direction: column; gap: 3px; }
.recs a { text-decoration: none; font-weight: 500; }
.recs a:hover { text-decoration: underline; }
.recs .first::after { content: " · основная"; color: var(--muted); font-weight: 400; font-size: 12px; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group + .group { margin-top: 10px; }
.group-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.group-link { margin-left: auto; font-size: 14px; }
.group table { table-layout: fixed; min-width: 560px; }
.group th:nth-child(1) { width: 42%; }
.group th:nth-child(2) { width: 16%; }
.group-link a { text-decoration: none; font-weight: 500; }
.match-line { display: flex; gap: 12px 16px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 12px 16px; }
.match-title { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.match-parts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; margin-bottom: 4px; }
.settings .card.focus { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--accent); background: #f7fdff; }
.actions .step { background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; padding: 4px 12px; border-radius: 14px; }
.actions-hint { border-color: var(--accent); color: var(--ink-2); font-size: 14px; }
.action-tabs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.action-body { display: flex; flex-direction: column; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 14px; }
.tp-chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 14px; padding: 4px 10px; font-size: 13px; }
.tp-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- настройки, справка, отчёты ---------- */
.settings { display: flex; flex-direction: column; gap: 14px; max-width: 820px; }
.settings .card { display: flex; flex-direction: column; gap: 10px; }
.settings .card-head { margin-bottom: 0; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.req-group > summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
.req-group[open] > summary { margin-bottom: 8px; }
.req-body { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.field-name { display: flex; flex-direction: column; min-width: 0; }
.card-sub { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.head-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.save-status { font-size: 13px; color: var(--muted); }
.deal-dupes { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--chip-bg); border-radius: 10px; }
.save-status.ok { color: var(--ok-ink); }
.save-status.err { color: var(--err-ink); }
.field-badge { font-size: 11px; padding: 1px 7px; }
/* таблица полей в настройках: границы строк, закреплённая шапка, своя прокрутка у длинных списков */
.fields-table { border: 1px solid var(--line-strong); border-radius: 10px; max-height: 420px; overflow-y: auto; overflow-x: hidden; background: #fff; }
.fields-table table { font-size: 14px; table-layout: fixed; }
.fields-table th:nth-child(2) { width: 48%; }
.fields-table th:nth-child(3) { width: 24%; }
.fields-table th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; }
.fields-table td { padding: 7px 10px; vertical-align: middle; overflow-wrap: anywhere; }
.fields-table td.badge-cell { overflow-wrap: normal; }
@media (max-width: 640px) {
  .fields-table th, .fields-table td { padding-left: 6px; padding-right: 6px; }
  .fields-table table { font-size: 13px; }
  /* на телефоне код поля прячем — место нужнее названию и метке */
  .fields-table th:nth-child(3), .fields-table td.code { display: none; }
  .fields-table th:nth-child(2) { width: auto; }
}
.fields-table tbody tr { cursor: pointer; }
.fields-table tbody tr:hover td { background: #f7fbfd; }
.fields-table tbody tr.on td { background: var(--info-bg); }
.fields-table td.code { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.fields-table td.badge-cell .pill { white-space: normal; }
.fields-table th.cb, .fields-table td.cb { width: 36px; padding-right: 0; }
.fields-table td.cb input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; vertical-align: middle; }
.card-sub b { color: var(--ink); }
.field-code { font-size: 11px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.notes ul { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; color: var(--ink-2); }
.notes b { color: var(--ink); }

/* ---------- адаптив ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .checks, .notes { grid-template-columns: minmax(0, 1fr); }
  .toolbar .right { margin-left: 0; }
  .score { font-size: 52px; }
  .card { padding: 16px; }
}

/* ---------- печать: отчёт для клиента или руководителя ---------- */
@media print {
  body { background: #fff; }
  .topbar, .no-print, .btn { display: none !important; }
  .card, .tablewrap { box-shadow: none; border: 1px solid var(--line-strong); break-inside: avoid; }
  .app { padding: 0; }
}

/* ---------- Паспорт портала ---------- */
.names { display: inline; margin-left: 8px; font-size: 13px; color: var(--ink-2); }
.names > summary { display: inline; cursor: pointer; color: var(--link); }
.explain { background: var(--chip-bg); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.explain-title { font-weight: 600; margin: 4px 0 2px; display: flex; gap: 8px; align-items: center; }
.explain ul { margin: 0 0 6px; padding-left: 20px; color: var(--ink-2); }
.pass-section tr.req td, .pass-section tbody tr.req:nth-child(even) td { background: var(--warn-bg); }
.pass-section tr.req td:first-child { box-shadow: inset 4px 0 0 var(--warn-mark); }
.req-mark { color: var(--warn-ink); }
.req-system { margin: 0; font-size: 13px; color: var(--ink-2); background: var(--warn-bg); border-radius: 8px; padding: 8px 12px; }
.entity > summary .pill { vertical-align: 1px; }
.intro { margin: -4px 0 4px; color: var(--ink-2); font-size: 14px; line-height: 1.5; max-width: 900px; }
.attention { border-left: 4px solid var(--warn-mark); }
.attention h2 { margin-bottom: 4px; }
.attention ul { margin: 0; padding: 0; list-style: none; }
.attention li { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; }
.attention li:first-child { border-top: 0; }
/* таблицы паспорта — с сеткой, как в Excel: каждая строка и столбец видны */
.pass-section table, .diff-table table { border-collapse: collapse; }
.pass-section th, .pass-section td, .diff-table th, .diff-table td { border: 1px solid var(--line-strong); padding: 8px 10px; }
.pass-section tbody tr:nth-child(even) td:not(.funnel-cell), .diff-table tbody tr:nth-child(even) td { background: #fafbfc; }
.pass-section tbody tr:hover td:not(.funnel-cell) { background: var(--info-bg); }
.stages-table { table-layout: fixed; }
.stages-table th:nth-child(1) { width: 26%; } .stages-table th:nth-child(2) { width: 56px; }
.stages-table th:nth-child(4) { width: 15%; } .stages-table th:nth-child(5) { width: 15%; }
.stages-table td.funnel-cell { background: var(--chip-bg); vertical-align: top; overflow-wrap: anywhere; }
.stages-table tr.first td { border-top: 2px solid var(--line-strong); }
.stage-mark { display: inline-block; width: 4px; height: 14px; border-radius: 2px; margin-right: 8px; vertical-align: -2px; background: var(--accent); }
.empty-hero { max-width: 640px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.doc-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles .check-count { font-size: 28px; }
.section-nav { position: sticky; top: 0; z-index: 2; background: var(--ground); padding: 8px 0; }
.pass-section { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 56px; }
.pass-section h3 { margin: 8px 0 0; font-size: 16px; }
.entity { display: flex; flex-direction: column; gap: 10px; }
.entity > summary { cursor: pointer; font-size: 15px; padding: 4px 0; }
.funnel { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.funnel-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.stages { display: flex; flex-wrap: wrap; gap: 6px; }
.stage { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 4px 8px 4px 4px; font-size: 13px; background: #fff; }
.stage i { width: 6px; align-self: stretch; border-radius: 3px; background: var(--accent); min-height: 18px; }
.stage.s-S { border-color: var(--ok-mark); background: var(--ok-bg); }
.stage.s-F { border-color: var(--err-mark); background: var(--err-bg); }
.stage-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.dicts > summary { cursor: pointer; font-size: 14px; color: var(--link); margin-bottom: 8px; }
.rate { display: flex; align-items: center; gap: 8px; min-width: 110px; font-variant-numeric: tabular-nums; font-size: 13px; }
.rate .meter-track { flex: 1; min-width: 50px; }
.note-box { display: flex; flex-direction: column; gap: 6px; border-top: 1px dashed var(--line-strong); padding-top: 10px; }
.note-head { display: flex; gap: 10px; align-items: baseline; font-size: 13px; color: var(--ink-2); }
.note-input { font-size: 14px; }
.note-print { display: none; margin: 0; white-space: pre-wrap; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 16px; font-size: 14px; }
.compare-pick { display: flex; gap: 12px 16px; align-items: flex-end; flex-wrap: wrap; }
.compare-pick .field { min-width: 260px; }
.changes { margin: 0; padding-left: 16px; font-size: 13px; }
.changes s { color: var(--muted); }
.plain { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.row.nowrap { flex-wrap: nowrap; }
@media (max-width: 900px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print {
  .section-nav, .note-input, .note-box:not(.has-note) { display: none !important; }
  .note-print { display: block; }
  .note-box.has-note::before { content: "Заметка"; font-weight: 600; font-size: 13px; }
  .pass-section { break-inside: auto; }
  .tiles .check { break-inside: avoid; }
}
