:root {
  --bg: #F5F6F8; --card: #FFFFFF; --line: #E3E6EB; --line2: #F0F2F5; --field: #D5D9E0;
  --text: #15181D; --muted: #5B6270; --muted2: #3A404B;
  --accent: #3354D1; --accent-d: #2541A8; --accent-bg: #EAEFFE; --accent-line: #C9D4FB;
  --good: #1E7B4F; --good-bg: #E7F5EE; --good-t: #17633F;
  --warn-bg: #FFF1E0; --warn-t: #8A3B00; --bad: #B42318; --lead: #C2550A;
  --head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); } a:hover { color: var(--accent-d); }
button { font: inherit; cursor: pointer; }
h1, h2 { font-family: var(--head); margin: 0; }
h1 { font-size: 28px; font-weight: 700; } h2 { font-size: 18px; }
.boot { padding: 48px; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 12px; } .s13 { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

/* вход */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.logo { font-family: var(--head); font-weight: 700; font-size: 22px; line-height: 0; }
.logo svg { height: 26px; width: auto; display: block; }
nav.side .logo svg { height: 24px; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
input.in, select.in { font: inherit; font-size: 15px; padding: 10px 12px; min-height: 44px; border: 1px solid var(--field); border-radius: 8px; background: #fff; color: var(--text); }
input.in:focus, select.in:focus { outline: 2px solid var(--accent-line); border-color: var(--accent); }
.btn { font-weight: 600; min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; }
.btn:hover { background: var(--accent-d); } .btn:disabled { opacity: .6; cursor: default; }
.btn2 { font-weight: 500; min-height: 40px; padding: 0 14px; border: 1px solid var(--field); border-radius: 8px; background: #fff; color: var(--text); }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* каркас */
.shell { display: flex; min-height: 100vh; }
nav.side { flex: 0 0 232px; background: var(--card); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; }
nav.side .logo { padding: 0 12px 20px; font-size: 20px; }
nav.side a, nav.side span.soon { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
nav.side a.on { background: var(--accent-bg); color: var(--accent-d); font-weight: 600; }
nav.side a:hover:not(.on) { background: var(--line2); }
nav.side span.soon { color: var(--muted); }
nav.side span.soon em { font-style: normal; font-size: 11px; background: var(--line2); padding: 2px 6px; border-radius: 6px; }
nav.side .grow { flex: 1 1 24px; }
nav.side .who { padding: 10px 12px; color: var(--muted); font-size: 13px; }
nav.side button.out { text-align: left; border: 0; background: none; padding: 10px 12px; color: var(--muted); border-radius: 8px; }
nav.side button.out:hover { background: var(--line2); }
main.page { flex: 1 1 auto; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1240px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.head .t { display: flex; flex-direction: column; gap: 4px; }

.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 4px; align-items: center; }
.seg button { border: 0; border-radius: 7px; padding: 8px 14px; min-height: 36px; font-size: 13px; background: transparent; color: var(--text); }
.seg button.on { background: var(--accent); color: #fff; font-weight: 600; }
.seg input[type=date] { font: inherit; font-size: 13px; border: 1px solid var(--field); border-radius: 7px; padding: 6px 8px; min-height: 36px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .l { color: var(--muted); font-size: 13px; }
.kpi .v { font-family: var(--head); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .n { color: var(--muted); font-size: 12px; }
.kpi.hl { background: var(--accent-bg); border-color: var(--accent-line); }
.kpi.hl .l, .kpi.hl .n { color: var(--accent-d); } .kpi.hl .l { font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.card .ch { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }

.frow { display: grid; grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) 80px 72px; align-items: center; gap: 12px; }
.frow .nm { font-weight: 500; }
.frow .track { background: var(--line2); border-radius: 6px; height: 28px; overflow: hidden; }
.frow .bar { height: 100%; border-radius: 6px; background: var(--accent); }
.frow .bar.pay { background: var(--good); }
.frow .c { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.frow .p { text-align: right; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--accent-line); }
.legend i.ln { width: 14px; height: 3px; border-radius: 2px; background: var(--lead); }
svg.chart { width: 100%; height: 220px; display: block; }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }

.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; min-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.t th { color: var(--muted); font-size: 12px; font-weight: 500; text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.t td { text-align: right; padding: 12px 6px; border-bottom: 1px solid var(--line2); }
table.t th:first-child, table.t td:first-child { text-align: left; }
table.t td:first-child { font-weight: 500; }
table.t tr.total td { font-weight: 700; border-bottom: 0; }
.pos { color: var(--good); font-weight: 600; } .neg { color: var(--bad); font-weight: 600; }

.srcs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.src { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.src .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.src .nm { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.badge { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; background: var(--accent-bg); color: var(--accent-d); }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: var(--good-bg); color: var(--good-t); }
.pill.warn { background: var(--warn-bg); color: var(--warn-t); }
.pill.off { background: var(--line2); color: var(--muted2); }
.pill.bad { background: #fdecec; color: #c92a2a; }
.empty { color: var(--muted); padding: 24px 0; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  nav.side { flex: none; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 4px; }
  nav.side .logo { width: 100%; padding: 0 12px 8px; }
  nav.side .grow, nav.side .who { display: none; }
  main.page { padding: 20px 16px 40px; }
  .frow { grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 56px 56px; gap: 8px; }
  .card { padding: 16px; }
}

/* кампании */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label.f { color: var(--muted); font-size: 12px; font-weight: 400; }
.filters label.grow { flex: 1 1 240px; }
.filters select.in { min-width: 180px; }
.card.flush { padding: 8px 16px 12px; }
table.tree-t td.nm { max-width: 420px; }
table.tree-t button.tree { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 0; min-height: 36px; color: var(--text); font: inherit; text-align: left; }
table.tree-t .chev { display: inline-block; width: 14px; color: var(--muted); font-size: 16px; transition: transform .15s; }
table.tree-t .chev.open { transform: rotate(90deg); }
table.tree-t .leaf { display: inline-block; padding-left: 22px; min-height: 36px; line-height: 36px; }
table.tree-t tr.lvl0 td { background: #FAFBFC; }
table.tree-t tr.lvl0 td.nm { font-weight: 600; }
table.tree-t tr.lvl1 td.nm { font-weight: 500; }
table.tree-t tr.lvl3 td.nm, table.tree-t tr.lvl4 td.nm { font-weight: 400; color: var(--muted2); }
table.tree-t td { padding-top: 6px; padding-bottom: 6px; }
table.t tfoot tr.total td { font-weight: 700; border-top: 1px solid var(--line); border-bottom: 0; padding-top: 12px; }

/* настройка воронки */
.note { background: var(--accent-bg); border: 1px solid var(--accent-line); border-radius: 12px; padding: 14px 18px; font-size: 13px; color: var(--muted2); }
ol.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
li.stage { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
li.stage .num-badge { flex: 0 0 32px; height: 32px; border-radius: 8px; background: var(--line2); color: var(--muted2); font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 6px; }
li.stage .body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
li.stage .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
li.stage .row input.in { flex: 1 1 220px; max-width: 360px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--accent-bg); color: var(--accent-d); }
.stbox[hidden] { display: none; }
.stbox { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line2); padding-top: 10px; }
fieldset.pipe { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
fieldset.pipe legend { font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
label.cbx { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 6px; border-radius: 6px; cursor: pointer; }
label.cbx:hover { background: var(--line2); }
label.cbx input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
label.cbx .small { margin-left: auto; }
.ok { color: var(--good); font-weight: 500; }

/* подрядчики */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
div.f { display: flex; flex-direction: column; gap: 6px; }
.lbl { font-size: 13px; font-weight: 500; }
label.chipbox { border: 1px solid var(--field); border-radius: 999px; padding: 0 12px; font-size: 13px; }
label.cbx.sub { padding-left: 28px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn2.danger { color: var(--bad); }
h3 { font-family: var(--head); font-size: 15px; margin: 0; }
form.gen { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
code.url { display: block; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--line2); border-radius: 8px; padding: 8px 10px; word-break: break-all; color: var(--muted2); }
input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
details summary { cursor: pointer; color: var(--accent); padding: 4px 0; }
details[open] summary { margin-bottom: 8px; }
.links { display: flex; flex-direction: column; gap: 10px; }
.link { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.link .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.made { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: var(--good-bg); border-radius: 10px; padding: 12px; }
.made code.url { background: #fff; width: 100%; }

/* подключения */
.src.soon { background: transparent; }
a.linkbtn { display: inline-flex; align-items: center; text-decoration: none; }
.note.ok-note { background: var(--good-bg); border-color: #BFE3CF; color: var(--good-t); }
label.cbx[hidden] { display: none; }

/* тариф */
.card.plan { max-width: 640px; }
.price { font-family: var(--head); font-size: 32px; font-weight: 700; }
ul.feat { margin: 0; padding-left: 18px; color: var(--muted2); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
table.t.pays { min-width: 520px; }

/* доступы */
label.f[hidden] { display: none; }
.pwrow .row input.in { flex: 1 1 220px; max-width: 320px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
button.lnk { border: 0; background: none; color: var(--accent); padding: 4px 6px; font-size: 12px; min-height: 32px; }
table.t.access { min-width: 1040px; }
table.t.access td { text-align: left; vertical-align: top; }
table.t.access th { text-align: left; }
table.t.access tr.hl td { background: var(--good-bg); }
table.t.access td.pw { white-space: nowrap; }
table.t.access .btn2 { white-space: nowrap; }

.camps[hidden] { display: none; }
fieldset.pipe button.lnk { align-self: flex-start; padding-left: 6px; }
label.cbx.sub .small { margin-left: 4px; }
table.t.conns { min-width: 820px; }
table.t.conns td { text-align: left; vertical-align: middle; }
table.t.conns th { text-align: left; }
table.t.conns .nm { display: flex; align-items: center; gap: 10px; }
table.t.conns .acts { display: flex; gap: 8px; justify-content: flex-end; white-space: nowrap; }
table.t.conns th { white-space: nowrap; }
.btn.sm, .btn2.sm { padding: 6px 10px; font-size: 13px; }
table.t.conns .badge { width: 28px; height: 28px; font-size: 11px; }
table.t.conns .st { display: flex; align-items: center; gap: 6px; }
.tip { position: relative; display: inline-flex; }
.tip-btn { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--card, #fff); color: var(--muted); font: italic 600 12px/1 Georgia, serif; cursor: pointer; padding: 0; }
.tip-btn:hover, .tip-btn:focus-visible { color: var(--accent-d); border-color: var(--accent-d); }
.tip-box { display: none; position: fixed; z-index: 50; width: max-content; max-width: 320px;
  background: #1f2430; color: #fff; font-size: 12px; line-height: 1.45; padding: 8px 10px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); white-space: normal; text-align: left; overflow-wrap: anywhere; }
.tip:hover .tip-box, .tip:focus-within .tip-box, .tip.open .tip-box { display: block; }
.stage-name { font-size: 16px; font-weight: 600; padding: 6px 0; }
button.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--accent-d); font: inherit; font-size: 13px; cursor: pointer; }
button.linkbtn:hover { text-decoration: underline; }

.crm-head { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 18px; align-items: center; margin-bottom: 16px; }
.crm-head .nm { display: flex; gap: 10px; align-items: center; }
.crm-head .strong { font-weight: 600; }
ol.map { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
ol.map > li { display: grid; grid-template-columns: minmax(220px, 300px) 28px 1fr; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line2); align-items: start; }
ol.map > li:last-child { border-bottom: 0; }
ol.map > li.map-h { color: var(--muted); font-size: 12px; font-weight: 500; padding-top: 10px; padding-bottom: 10px; }
ol.map > li.cfg { background: color-mix(in srgb, var(--accent-bg) 35%, transparent); }
.map-stage { display: flex; gap: 12px; align-items: flex-start; }
.map-stage .num-badge { flex: 0 0 28px; height: 28px; border-radius: 8px; background: var(--line2); color: var(--muted2); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.map-stage .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.map-stage input.in { max-width: 220px; }
.map-stage .stage-name { padding: 3px 0; font-size: 15px; }
.map-arrow { color: var(--muted); font-size: 18px; text-align: center; padding-top: 2px; }
.map-src { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.map-src .row { display: flex; gap: 8px; flex-wrap: wrap; }
.src-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; }
.src-crm { background: #e6efff; color: #1d4ed8; }
.src-ads { background: #f1f3f5; color: #475467; }
.src-mk { background: #fff4e5; color: #9a5b00; }
.src-pay { background: #e8f6ee; color: #1a7a43; }
@media (max-width: 760px) {
  .crm-head { grid-template-columns: 1fr; }
  ol.map > li { grid-template-columns: 1fr; gap: 8px; }
  ol.map > li.map-h, .map-arrow { display: none; }
}
button.linkbtn.pen { color: var(--muted); font-size: 14px; opacity: .55; padding: 2px 4px; }
li.map-row:hover button.linkbtn.pen, button.linkbtn.pen:focus-visible { opacity: 1; color: var(--accent-d); }
fieldset.roles { border: 0; padding: 0; margin: 4px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
fieldset.roles legend { font-size: 13px; font-weight: 500; margin-bottom: 8px; padding: 0; }
.role-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: var(--card); }
.role-card:has(input:checked) { border-color: var(--accent-d); box-shadow: 0 0 0 1px var(--accent-d) inset; background: color-mix(in srgb, var(--accent-bg) 45%, var(--card)); }
.role-card input { margin-top: 3px; accent-color: var(--accent-d); }
.role-card .rt { font-weight: 600; }
.role-card > div { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 860px) { fieldset.roles { grid-template-columns: 1fr; } }
.role-edit { display: flex; flex-direction: column; gap: 6px; min-width: 200px; }

.login-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; }
.login-links a, .login a { color: var(--accent-d); }
.auth-h { font-size: 20px; margin: 4px 0 0; }
.login.signup { max-width: 420px; }
.login .cbx { display: flex; gap: 8px; align-items: flex-start; }
.login .cbx input { margin-top: 3px; accent-color: var(--accent-d); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.modal-bg { position: fixed; inset: 0; background: rgba(15, 20, 30, .45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.modal { background: var(--card); border-radius: 14px; padding: 24px; max-width: 460px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin: 0; font-size: 20px; }
.price-big { font-size: 30px; font-weight: 700; }
ul.ticks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
ul.ticks li::before { content: '✓'; color: var(--accent-d); font-weight: 700; margin-right: 8px; }
section.onb { margin-bottom: 16px; }
ol.onb-steps { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
ol.onb-steps li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
ol.onb-steps li:first-child { border-top: 0; }
ol.onb-steps .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--line2); color: var(--muted2); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
ol.onb-steps li.done .dot { background: #e8f6ee; color: #1a7a43; }
ol.onb-steps li.cur .dot { background: var(--accent-d); color: #fff; }
ol.onb-steps li.done .tt { color: var(--muted); text-decoration: line-through; }
ol.onb-steps .tt { font-weight: 600; }
.login label.cbx { padding: 0; background: none; border: 0; margin: 0; font-weight: 400; }
.login label.cbx:hover, .login label.cbx:has(input:checked) { background: none; }
.login label.cbx input { width: 16px; height: 16px; flex: 0 0 16px; }

.paybar { position: sticky; top: 0; z-index: 60; display: flex; gap: 6px 8px; align-items: baseline; justify-content: center; flex-wrap: wrap;
  background: #FFF4E6; color: #8A3B0A; border-bottom: 1px solid #F6D3A8; padding: 13px 20px; font-size: 14px; line-height: 1.45; font-weight: 400; }
/* ссылка — тем же цветом и начертанием, что и текст полосы, только подчёркнута */
.paybar a { color: inherit; font-weight: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; white-space: nowrap; }
.paybar a:hover { color: inherit; text-decoration-thickness: 2px; }
.paybar.bad { background: #FDEEEE; color: #8F1D1D; border-bottom-color: #F4C2C2; }
.paybar.soft { background: var(--accent-bg); color: var(--accent-d); border-bottom-color: var(--accent-line); }
.paybar.support { background: #FDEEEE; color: #8F1D1D; border-bottom-color: #F4C2C2; font-weight: 600; }
@media (max-width: 640px) { .paybar { padding: 10px 16px; text-align: center; } }

/* Проверка данных */
.checks { display: flex; flex-direction: column; gap: 16px; }
.head .acts { display: flex; align-items: center; gap: 12px; }
ul.chk { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ul.chk li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line2); }
ul.chk li:first-child { border-top: 0; padding-top: 0; }
ul.chk .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
ul.chk .det { overflow-wrap: anywhere; }
ul.chk .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; margin-top: 1px; }
.chk-ok .ic { background: var(--good-bg); color: var(--good-t); }
.chk-info .ic { background: var(--accent-bg); color: var(--accent-d); }
.chk-warn .ic { background: var(--warn-bg); color: var(--warn-t); }
.chk-error .ic { background: #FDE8E7; color: var(--bad); }
.note.bad-note { background: #FDE8E7; border-color: #F5C2BE; color: var(--bad); }
ul.chk a.btn2 { text-decoration: none; white-space: nowrap; }

/* Когорты */
.coh-ctrl { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.coh-sel { display: flex; gap: 8px; flex-wrap: wrap; }
.coh-body, .vis-body { display: flex; flex-direction: column; gap: 16px; }
.coh-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.coh-kpis .kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.coh-kpis .kv { font-family: var(--head); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.coh-cap { padding: 8px 2px 4px; }
table.t.coh { min-width: 0; }
table.t.coh th[scope=row] { text-align: left; font-weight: 500; color: var(--text); font-size: 14px; white-space: nowrap; padding: 10px 8px; border-bottom: 1px solid var(--line2); }
table.t.coh th, table.t.coh td { white-space: nowrap; }
table.t.coh td.mk { min-width: 78px; padding: 10px 8px; }
table.t.coh td.na { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--line2) 6px 7px); }
table.t.coh td.now { font-style: italic; color: var(--muted2); }
table.t.coh th[scope=row] { position: sticky; left: 0; background: var(--card); z-index: 1; }
table.t.coh tfoot th[scope=row] { border-bottom: 0; border-top: 1px solid var(--line); }
table.t.coh tfoot th, table.t.coh tfoot td { font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }

/* Описание API (static/api.html) */
body.doc { display: block; }
.doc-main { max-width: 860px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 12px; line-height: 1.55; }
.doc-main h2 { margin-top: 16px; }
.doc-main ul { margin: 0; padding-left: 20px; }
.doc-main code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--line2); padding: 1px 4px; border-radius: 4px; }
.doc-code { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 0; }

/* Расход вручную */
.mc-intro { margin: -4px 0 12px; }
.mc-form { margin-top: 12px; display: grid; gap: 12px; }
.mc-form[hidden] { display: none; }
.mc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mc-ok { margin-bottom: 12px; }

/* Цели и план */
.goals-row { margin: -8px 0 16px; }
.goals { margin-bottom: 16px; display: grid; gap: 12px; }
.goals-t th[scope=row] { text-align: left; font-weight: 600; white-space: nowrap; }
.goals-t .in { min-width: 90px; max-width: 140px; padding: 6px 8px; }

/* Уведомления */
.al-link { margin-top: 12px; display: grid; gap: 10px; }
.al-rules { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 8px; }
.al-sent { padding: 10px 0; border-bottom: 1px solid var(--line); }
.al-sent:last-child { border-bottom: 0; }
.al-text { white-space: pre-wrap; font-size: 14px; }

/* Отметки событий */
.ev-flags { position: relative; height: 22px; }
.ev-flag { position: absolute; top: 0; transform: translateX(-50%); min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #7A5AF8; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: default; }
.legend i.ev { background: none; border-left: 2px dashed #7A5AF8; width: 0; height: 12px; border-radius: 0; }
.ev-box { margin-top: 14px; display: grid; gap: 10px; }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.ev-list li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ev-n { background: #7A5AF8; color: #fff; border-radius: 10px; min-width: 20px; height: 20px; font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; }
.ev-d { color: var(--muted); min-width: 80px; }
.ev-form { display: grid; grid-template-columns: 160px 1fr 200px 1fr; gap: 10px; align-items: end; }
.ev-form[hidden] { display: none; }
.ev-form .row, .ev-form .err { grid-column: 1 / -1; }
@media (max-width: 800px) { .ev-form { grid-template-columns: 1fr; } }
