:root {
  --bg: #f6f7f9; --panel: #ffffff; --line: #e6e8ec; --line2: #f0f1f4;
  --text: #15171a; --muted: #6b7280; --faint: #9aa1ab;
  --accent: #e5484d; --accent-weak: #fdecec;
  --blue: #2563eb; --blue-weak: #e8f0fe;
  --green: #15803d; --green-weak: #e7f6ec;
  --amber: #b45309; --amber-weak: #fdf3e2;
  --violet: #6d28d9; --violet-weak: #f1ebfd;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, Segoe UI, sans-serif; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40px; color: var(--muted); }

/* layout */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px; padding: 0 20px; height: 56px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
.logo::after { content: ''; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 2px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.nav a:hover { background: var(--line2); text-decoration: none; }
.nav a.on { background: var(--text); color: #fff; }
.spacer { flex: 1; }
.who { color: var(--muted); font-size: 13px; }
main { padding: 20px; max-width: 1500px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 4px; } .sub { color: var(--muted); margin: 0 0 16px; }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--line2); }
.btn.primary { background: var(--text); border-color: var(--text); color: #fff; } .btn.primary:hover { opacity: .9; }
.btn.red { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.input, select.input, textarea.input { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); outline: none; }
.input:focus { border-color: #b8c0cc; box-shadow: 0 0 0 3px #eef1f5; }
textarea.input { resize: vertical; min-height: 70px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 14px; margin-bottom: 14px; align-items: end; }
.filters .wide { grid-column: span 2; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.count { color: var(--muted); }

/* table */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: default; user-select: none; background: #fafbfc; }
.t th.s { cursor: pointer; } .t th.s:hover { color: var(--text); }
.t td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; white-space: nowrap; }
.t tr.row { cursor: pointer; } .t tr.row:hover td { background: #fafbfc; }
.t tr.sel td { background: #f3f6fb !important; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.chan { display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 340px; }
.chan img, .ava { width: 32px; height: 32px; border-radius: 50%; background: var(--line); flex: none; object-fit: cover; }
.chan .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.chan .hd { color: var(--faint); font-size: 12px; }
.ico { display: inline-flex; gap: 4px; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line2); color: var(--muted); }
.tag.tg { background: var(--blue-weak); color: var(--blue); }
.tag.em { background: var(--green-weak); color: var(--green); }
.tag.ai { background: var(--violet-weak); color: var(--violet); }
.score { display: inline-grid; place-items: center; min-width: 36px; padding: 3px 6px; border-radius: 7px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc-hi { background: var(--green-weak); color: var(--green); } .sc-mid { background: var(--amber-weak); color: var(--amber); } .sc-lo { background: var(--line2); color: var(--muted); }
.st { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.st-new { background: var(--line2); color: var(--muted); }
.st-to_contact { background: var(--amber-weak); color: var(--amber); }
.st-contacted { background: var(--blue-weak); color: var(--blue); }
.st-replied { background: var(--violet-weak); color: var(--violet); }
.st-in_work { background: var(--green-weak); color: var(--green); }
.st-rejected, .st-not_fit { background: #f4f4f5; color: var(--faint); text-decoration: line-through; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 12px; }
.empty { padding: 50px 20px; text-align: center; color: var(--muted); }

/* drawer */
.overlay { position: fixed; inset: 0; background: rgba(15,17,20,.25); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--panel); z-index: 50; box-shadow: -8px 0 30px rgba(0,0,0,.12); display: flex; flex-direction: column; }
.dh { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dh img { width: 48px; height: 48px; border-radius: 50%; }
.dh .t1 { font-size: 17px; font-weight: 700; } .dh .t2 { color: var(--muted); font-size: 13px; }
.db { overflow-y: auto; padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: 8px; padding: 9px 10px; } .stat b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; } .stat span { font-size: 11.5px; color: var(--muted); }
.links { display: flex; flex-direction: column; gap: 6px; }
.lk { display: flex; align-items: center; gap: 8px; } .lk a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vids { display: flex; flex-direction: column; } .vid { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line2); font-size: 13px; }
.vid a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .vid .v { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.draft { background: var(--bg); border-radius: 8px; padding: 12px; white-space: pre-wrap; font-size: 13.5px; }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.log { font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; } .log div { color: var(--muted); } .log b { color: var(--text); font-weight: 500; }
.desc { white-space: pre-wrap; font-size: 13px; color: var(--muted); max-height: 160px; overflow: auto; background: var(--bg); padding: 10px; border-radius: 8px; }

/* niches */
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 14px; }
.niche { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.niche .nh { display: flex; align-items: center; gap: 10px; } .niche .nh h2 { font-size: 16px; margin: 0; flex: 1; }
.kws { display: flex; flex-wrap: wrap; gap: 5px; }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 12px; font-size: 13px; } .kv span { color: var(--muted); }
.form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; } .form .full { grid-column: 1 / -1; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.err { color: var(--accent); font-size: 13px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .top { gap: 10px; padding: 0 12px; } .who { display: none; }
  main { padding: 12px; } .stats { grid-template-columns: repeat(2, 1fr); }
  .form, .kv { grid-template-columns: 1fr 1fr; } .grid2 { grid-template-columns: 1fr; }
  .filters .wide { grid-column: span 1; }
}

/* send markers */
.tag.sent.tg { background: var(--blue); color: #fff; }
.tag.sent.em { background: var(--green); color: #fff; }
.sent-box { background: var(--green-weak); color: var(--green); border-radius: 8px; padding: 10px 12px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.sent-box b { font-weight: 600; }

/* analytics */
.pad { padding: 16px; } .pad-x { padding: 16px 16px 0; }
.ct { font-size: 13px; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpi { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; }
.kpi:hover:not(:disabled) { border-color: #c9ced6; }
.kpi:disabled { cursor: default; }
.kpi b { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.kpi span { font-size: 13px; color: var(--text); font-weight: 500; }
.kpi em { font-style: normal; font-size: 12px; color: var(--muted); }
.fn { display: grid; grid-template-columns: 120px 1fr 90px; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; }
.fn:hover .fb i { background: #1c5cab; }
.fl { font-size: 13px; } .fv { font-size: 13px; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; } .fv small { color: var(--muted); font-weight: 400; }
.fb { height: 14px; background: var(--line2); border-radius: 4px; overflow: hidden; }
.fb i { display: block; height: 100%; background: #2a78d6; border-radius: 0 4px 4px 0; }
.legend { display: flex; gap: 14px; font-size: 12px; margin-bottom: 10px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.em, .stack i.em { background: var(--green); } .sw.tg, .stack i.tg { background: var(--blue); }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--line); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.bar:hover { background: var(--line2); border-radius: 4px 4px 0 0; }
.stack { width: 100%; display: flex; flex-direction: column; gap: 2px; min-height: 0; }
.stack i { display: block; min-height: 2px; } .stack i:first-child { border-radius: 4px 4px 0 0; }
.axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } .fn { grid-template-columns: 90px 1fr 70px; } }

/* profile */
.profile { width: 100%; max-width: 420px; padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.modal { position: fixed; z-index: 60; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px)); }
.modal .profile { box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.who-btn { font-weight: 500; }
.fn-on .fl { font-weight: 700; } .fn-on .fb i { background: var(--accent); }

/* работа */
.wtop{display:flex;align-items:center;gap:16px;flex-wrap:wrap;padding:14px 16px;margin-bottom:14px}
.wbar{flex:1;min-width:120px;height:8px;border-radius:4px;background:rgba(127,127,127,.18);overflow:hidden}
.wbar i{display:block;height:100%;background:#30a46c}
.wsec{padding:12px 0 4px;margin-bottom:14px}
.wsec .ct{padding:0 16px;margin:0}
.wsec .wh{font-size:12px;padding:2px 16px 8px}
.wrow{display:flex;align-items:center;gap:12px;padding:8px 16px;border-top:1px solid rgba(127,127,127,.15);cursor:pointer}
.wrow:hover{background:rgba(127,127,127,.07)}
.wrow img,.wrow .ava{width:34px;height:34px;border-radius:50%;flex:none}
.wmain{flex:1;min-width:0}
.wmain .nm{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.wmain .hd{font-size:12px;opacity:.65}
.wv{font-size:13px;font-weight:600;white-space:nowrap}
.wact{display:flex;gap:6px}
@media (max-width:700px){.wv,.wrow .ico{display:none}}

/* этапы */
.steps{display:flex;gap:4px;flex-wrap:wrap}
.step{border:1px solid var(--line2,#ddd);background:transparent;border-radius:999px;padding:5px 11px;font:inherit;font-size:12.5px;cursor:pointer;color:inherit;opacity:.75}
.step.done{background:var(--green-weak);color:var(--green);border-color:transparent;opacity:1}
.step.on{background:var(--accent);color:#fff;border-color:transparent;opacity:1;font-weight:600}
.next{margin-top:10px;padding:10px 12px;border-radius:10px;background:rgba(127,127,127,.08)}
.next.late{background:rgba(229,72,77,.10)}
.nx-h{font-weight:600;font-size:13px;margin-bottom:6px}.nx-h span{font-weight:400;opacity:.7}
.next.late .nx-h span{color:#e5484d;opacity:1}
.wrow.red{box-shadow:inset 3px 0 0 #e5484d}
.funnel-strip{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.funnel-strip a{flex:1;min-width:110px;text-decoration:none;color:inherit;padding:10px 12px;border-radius:10px;background:rgba(127,127,127,.08)}
.funnel-strip b{display:block;font-size:20px}.funnel-strip span{font-size:12px;opacity:.7}
.st-cabinet,.st-offers{background:var(--green-weak);color:var(--green)}
.st-launched{background:var(--green);color:#fff}
.st-no_reply{background:#f4f4f5;color:var(--faint)}
.help .card{margin-bottom:14px}.help ol,.help ul{margin:6px 0 0;padding-left:20px;line-height:1.6}
.modal.imgm{width:min(760px,calc(100vw - 32px))}

.srctabs{display:flex;gap:6px;margin:0 0 12px;flex-wrap:wrap}
.srct{border:1px solid var(--line2,#ddd);background:transparent;border-radius:999px;padding:6px 14px;font:inherit;font-size:13px;cursor:pointer;color:inherit}
.srct.on{background:var(--accent);color:#fff;border-color:transparent;font-weight:600}
.srct:disabled{opacity:.4;cursor:default}
.tag.src-vk{background:#e6eefb;color:#2a5bb8}
.tag.src-youtube{background:#fdecec;color:#c9302c}
.btn.disabled{opacity:.5;pointer-events:none}

.owner{margin:0 0 10px;padding:8px 12px;border-radius:10px;background:var(--green-weak);color:var(--green);font-size:13px;font-weight:600}
.owner.other{background:#fdecec;color:#c9302c}
.tag.ok { background: var(--green-weak); color: var(--green); }
.tag.warn { background: var(--amber-weak); color: var(--amber); }
.tag.bad { background: rgba(229,72,77,.12); color: #e5484d; }
.tag.src-site{background:#eaf6ee;color:#2f8a4f}
.tag.src-app{background:#efeafb;color:#6a4bc4}

/* мастер нового поиска */
.wz-steps { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.wz-step { padding: 5px 12px; border-radius: 999px; background: var(--line2); color: var(--muted); font-size: 13px; font-weight: 600; }
.wz-step.on { background: #e5484d; color: #fff; }
.wz-step.done { background: #e6f6ec; color: #1a7f45; }
.wz-kws { display: flex; flex-wrap: wrap; gap: 6px; }
.wz-kw { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line2); border-radius: 999px; font-size: 13px; cursor: pointer; user-select: none; }
.wz-kw input { margin: 0; }
.wz-kw.on { border-color: #e5484d; background: #fff1f1; }

/* ===================== редизайн 21.10: спокойный минимализм ===================== */
:root {
  --bg: #fafafa; --panel: #ffffff; --line: #ececee; --line2: #f3f3f5;
  --text: #111113; --muted: #6e6e76; --faint: #a0a0a8;
  --accent: #e5484d; --accent-weak: #fff0f0;
  --radius: 12px; --shadow: 0 1px 2px rgba(17,17,19,.04);
  --side: 232px;
}
html, body { font: 14px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif; letter-spacing: -0.005em; }
h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.sub { font-size: 14px; }
.card { border-color: var(--line); box-shadow: var(--shadow); }
.btn { border-radius: 9px; border-color: var(--line); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line2); color: var(--text); }
.btn.primary { background: var(--text); }
.input { border-radius: 9px; }
.input.big { padding: 10px 14px; font-size: 15px; }

/* оболочка с боковым меню */
.shell { display: flex; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; width: var(--side); flex: none; display: flex; flex-direction: column; gap: 6px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--panel); }
.side .brand { padding: 4px 10px 16px; font-size: 16px; letter-spacing: -0.01em; }
.side .nav { display: flex; flex-direction: column; gap: 2px; }
.nv { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.nv i { width: 18px; text-align: center; font-style: normal; font-size: 15px; opacity: .8; }
.nv:hover { background: var(--line2); color: var(--text); text-decoration: none; }
.nv.on { background: var(--text); color: #fff; } .nv.on i { opacity: 1; }
.nav2 .nv { font-size: 13px; padding: 6px 10px; }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; text-align: left; }
.me:hover { background: var(--line2); }
.me-ava { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-weak); color: var(--accent); font-weight: 700; flex: none; }
.me-t { min-width: 0; display: flex; flex-direction: column; } .me-t b { font-size: 13px; } .me-t em { font-style: normal; font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell main { flex: 1; min-width: 0; padding: 32px 40px 60px; max-width: 1180px; margin: 0 auto; }

/* заголовок страницы */
.phead { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; } .phead > div { flex: 1; } .phead .sub { margin: 0; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; } .searchbar .big { flex: 1; }

/* чипсы-фильтры */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 13px; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); border-color: #d9d9de; }
.chip.on { background: var(--text); border-color: var(--text); color: #fff; }
.chip.sm { padding: 4px 10px; font-size: 12.5px; }
.chip-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.filters { margin-bottom: 14px; }

/* список вместо таблицы */
.list { overflow: hidden; }
.lhead { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px 10px; }
.lrow { display: grid; grid-template-columns: 36px minmax(0, 1fr) 170px 150px 140px; align-items: center; gap: 14px; padding: 11px 18px; border-top: 1px solid var(--line2); cursor: pointer; }
.lrow:first-child { border-top: 0; }
.lrow:hover { background: #fafafb; } .lrow.sel { background: #f5f6f8; }
.lrow.static { grid-template-columns: minmax(0, 1fr) auto auto auto; cursor: default; }
.lrow img, .lrow .ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--line2); display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.lmain { min-width: 0; } .lmain .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lmain .hd { font-size: 12.5px; color: var(--faint); display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
.lmain .hd .dot { opacity: .6; }
.lv { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lv b { font-weight: 600; }
.lc { flex-wrap: wrap; }
.lrow .st { justify-self: end; }
.pager { border-top: 1px solid var(--line2); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }

/* карточка площадки: вкладки */
.drawer { width: min(680px, 100vw); border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(17,17,19,.08); }
.dh { padding: 20px 24px; } .db { padding: 18px 24px 48px; gap: 20px; }
.dtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 -24px; padding: 0 24px; position: sticky; top: -18px; background: var(--panel); z-index: 2; }
.dtab { border: 0; background: none; padding: 10px 12px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dtab:hover { color: var(--text); } .dtab.on { color: var(--text); border-bottom-color: var(--text); }
.sec h3 { font-size: 11.5px; letter-spacing: .06em; }

/* онбординг */
.onb { padding: 16px 18px; margin-bottom: 16px; background: linear-gradient(180deg, #fff, #fff8f8); border-color: #f6dede; }
.onb-h { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.onb-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.onb-s { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.onb-s:hover { text-decoration: none; border-color: #d9d9de; }
.onb-s b { display: block; font-size: 13.5px; } .onb-s em { font-style: normal; font-size: 12.5px; color: var(--muted); }
.onb-n { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; }
.onb-s.ok { opacity: .55; } .onb-s.ok .onb-n { background: var(--green); }

/* переключатель */
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.switch input { display: none; }
.switch span { width: 30px; height: 18px; border-radius: 999px; background: #dcdce0; position: relative; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--green); } .switch input:checked + span::after { left: 14px; }

.more-box { margin-top: 16px; } .more-box summary { cursor: pointer; color: var(--muted); font-weight: 500; padding: 6px 0; }
.kpi { border-radius: var(--radius); } .kpi b { letter-spacing: -0.02em; }
.wsec, .wtop { border-radius: var(--radius); }
.funnel-strip a { background: var(--panel); border: 1px solid var(--line); }
.tag.src-telegram { background: var(--blue-weak); color: var(--blue); }

@media (max-width: 900px) {
  .lrow { grid-template-columns: 36px minmax(0, 1fr) auto; } .lrow .lv, .lrow .st { display: none; }
  .onb-steps { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { position: fixed; bottom: 0; top: auto; left: 0; right: 0; height: auto; width: 100%; flex-direction: row; padding: 6px; border-right: 0; border-top: 1px solid var(--line); z-index: 30; }
  .side .brand, .side .spacer, .side .me, .side > .btn, .nav2 { display: none; }
  .side .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nv { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 8px; }
  .shell main { padding: 18px 14px 90px; }
  .searchbar { flex-wrap: wrap; }
}
.icn { width: 18px; height: 18px; flex: none; opacity: .85; }
.nv.on .icn { opacity: 1; }
.sm-sel { width: auto; padding: 4px 8px; font-size: 12.5px; }
.wz .form { grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) {
  .side .nav2 { display: none; }
  .searchbar .big { flex-basis: 100%; }
  .phead .btn { display: none; }
}
select.input.sm-sel { width: auto; }
@media (max-width: 760px) {
  .shell main { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .wrow .wact { display: none; }
  .funnel-strip a { min-width: 30%; }
  .drawer .dtabs { overflow-x: auto; }
}

/* ===================== бренд и варианты ===================== */
:root { --accent: #c5f82a; --accent-ink: #0e0f12; --accent-weak: #f3fdd4; --mk-bg: #0e0f12; --mk-fg: #ffffff; }
.mark { width: 28px; height: 28px; flex: none; }
.mk-bg { fill: var(--mk-bg); } .mk-ring { fill: none; stroke: var(--mk-fg); stroke-width: 1.8; opacity: .9; }
.mk-sweep { fill: var(--accent); opacity: .55; } .mk-dot { fill: var(--accent); }
.side .brand span, .login .brand { font-weight: 800; letter-spacing: -0.03em; font-size: 19px; }
/* акцент со своей контрастной надписью */
.step.on, .wz-step.on, .onb-n, .btn.red { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.wz-kw.on { border-color: var(--accent-ink); background: var(--accent-weak); }
.me-ava { background: var(--accent-weak); color: var(--accent-ink); }
.nv.on { background: var(--accent-ink); color: #fff; } .nv.on .icn { color: var(--accent); }
.fn-on .fb i { background: var(--accent-ink); }
.onb { background: linear-gradient(180deg, #fff, var(--accent-weak)); border-color: var(--line); }
.wbar i { background: var(--accent-ink); }
.why { background: var(--accent-weak); border-radius: 12px; padding: 14px 16px; }
.why p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; } .why p:last-child { margin: 0; }
.hide { display: none !important; }

/* v2 · трафо · тёмная */
[data-v="2"] { --bg: #0b0c0f; --panel: #131418; --line: #23252b; --line2: #1b1d22; --text: #ededef; --muted: #8b8e97; --faint: #5f626b;
  --accent: #c5f82a; --accent-ink: #c5f82a; --accent-weak: rgba(197,248,42,.08); --mk-bg: #c5f82a; --mk-fg: #0b0c0f;
  --blue-weak: rgba(59,130,246,.15); --green-weak: rgba(34,197,94,.14); --amber-weak: rgba(245,158,11,.14); --violet-weak: rgba(139,92,246,.16); }
[data-v="2"] .nv.on { background: rgba(197,248,42,.1); color: var(--accent); } [data-v="2"] .nv.on .icn { color: var(--accent); }
[data-v="2"] .step.on, [data-v="2"] .wz-step.on, [data-v="2"] .onb-n, [data-v="2"] .btn.red, [data-v="2"] .btn.primary, [data-v="2"] .chip.on { background: var(--accent); color: #0b0c0f; border-color: transparent; }
[data-v="2"] .t th, [data-v="2"] .lrow:hover, [data-v="2"] .lrow.sel { background: #17181d; }
[data-v="2"] .onb { background: linear-gradient(180deg, #131418, #171a10); }
[data-v="2"] .drawer, [data-v="2"] .dtabs { background: var(--panel); }
[data-v="2"] .input, [data-v="2"] .btn, [data-v="2"] .chip, [data-v="2"] .me, [data-v="2"] .onb-s, [data-v="2"] .funnel-strip a { background: #17181d; border-color: var(--line); color: var(--text); }
[data-v="2"] .st-new { background: #1d1f25; } [data-v="2"] .wbar { background: #23252b; } [data-v="2"] .wbar i { background: var(--accent); }
[data-v="2"] .fb { background: #1d1f25; } [data-v="2"] .why { border: 1px solid rgba(197,248,42,.18); }

/* v3 · орбита · индиго, раздельный экран как в почте */
[data-v="3"] { --bg: #f7f7fb; --accent: #5046e5; --accent-ink: #5046e5; --accent-weak: #eeedfd; --mk-bg: #5046e5; --mk-fg: #fff; }
[data-v="3"] .step.on, [data-v="3"] .wz-step.on, [data-v="3"] .onb-n, [data-v="3"] .btn.red, [data-v="3"] .nv.on { background: var(--accent); color: #fff; }
[data-v="3"] .nv.on .icn { color: #fff; } [data-v="3"] .chip.on { background: var(--accent); border-color: var(--accent); }
[data-v="3"] .mk-sweep, [data-v="3"] .mk-dot { fill: #fff; }
[data-v="3"] .shell main { max-width: none; padding-right: 0; }
[data-v="3"] .overlay { display: none; }
[data-v="3"] .drawer { top: 0; width: 46vw; max-width: 640px; box-shadow: none; border-left: 1px solid var(--line); }
[data-v="3"] .shell main:has(.drawer) { padding-right: calc(min(46vw, 640px) + 24px); }
[data-v="3"] .lrow { grid-template-columns: 36px minmax(0,1fr) 90px; } [data-v="3"] .lrow .lv, [data-v="3"] .lrow .lc { display: none; }
[data-v="3"] .lrow.sel { background: var(--accent-weak); box-shadow: inset 3px 0 0 var(--accent); }

/* v4 · нишка · тёплая, канбан */
[data-v="4"] { --bg: #fbf8f4; --line: #efe8df; --line2: #f6f0e8; --accent: #ff6b4a; --accent-ink: #ff6b4a; --accent-weak: #fff0eb; --mk-bg: #ff6b4a; --mk-fg: #fff; --radius: 16px; }
[data-v="4"] .step.on, [data-v="4"] .wz-step.on, [data-v="4"] .onb-n, [data-v="4"] .btn.red, [data-v="4"] .nv.on { background: var(--accent); color: #fff; }
[data-v="4"] .nv.on .icn { color: #fff; } [data-v="4"] .mk-sweep, [data-v="4"] .mk-dot { fill: #fff; } [data-v="4"] .chip.on { background: #2b1d16; }
[data-v="4"] h1 { font-family: Montserrat, Inter, sans-serif; font-weight: 800; }
[data-v="4"] .shell main { max-width: none; }
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--line2); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.kh { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; padding: 4px 6px; } .kh span { color: var(--muted); font-weight: 600; }
.kcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.kcard:hover { border-color: var(--accent); }
.kcard .nm { font-weight: 600; font-size: 13.5px; } .kcard .hd { font-size: 12px; color: var(--faint); }
.kf { display: flex; justify-content: space-between; align-items: center; gap: 6px; } .kv { font-size: 12px; font-weight: 600; }
.kempty { color: var(--faint); font-size: 12px; text-align: center; padding: 20px 0; }

/* v5 · сигнал · изумруд, верхнее меню, плитки */
[data-v="5"] { --accent: #10b981; --accent-ink: #047857; --accent-weak: #e7f8f1; --mk-bg: #047857; --mk-fg: #fff; }
[data-v="5"] .step.on, [data-v="5"] .wz-step.on, [data-v="5"] .onb-n, [data-v="5"] .btn.red { background: var(--accent); color: #fff; }
[data-v="5"] .mk-sweep, [data-v="5"] .mk-dot { fill: #a7f3d0; }
[data-v="5"] .shell { flex-direction: column; }
[data-v="5"] .side { position: sticky; top: 0; height: 60px; width: 100%; flex-direction: row; align-items: center; padding: 0 24px; border-right: 0; border-bottom: 1px solid var(--line); z-index: 30; }
[data-v="5"] .side .brand { padding: 0 18px 0 0; } [data-v="5"] .side .nav { flex-direction: row; gap: 4px; } [data-v="5"] .nav2 { margin-right: 8px; }
[data-v="5"] .side .me { margin: 0; padding: 4px 10px; } [data-v="5"] .me-t em { display: none; } [data-v="5"] .side > .btn { width: auto !important; }
[data-v="5"] .nv.on { background: var(--accent-weak); color: var(--accent-ink); } [data-v="5"] .nv.on .icn { color: var(--accent-ink); }
.gridc { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; cursor: pointer; transition: .15s; }
.gcard:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.05); }
.gtop { display: flex; justify-content: space-between; align-items: flex-start; }
.gtop img, .gtop .ava { width: 44px; height: 44px; border-radius: 12px; background: var(--line2); display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.gcard .nm { font-weight: 700; font-size: 15px; line-height: 1.3; } .gcard .hd { font-size: 12px; color: var(--faint); }
.gnum { display: flex; gap: 18px; } .gnum b { display: block; font-size: 18px; letter-spacing: -0.02em; } .gnum span { font-size: 11.5px; color: var(--muted); }
.gwhy { font-size: 12.5px; color: var(--muted); background: var(--accent-weak); border-radius: 10px; padding: 8px 10px; } .gwhy b { color: var(--text); display: block; }

/* v6 · фокус-режим */
.focus { max-width: 760px; } .fprog { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-weight: 600; } .fprog .wbar { flex: 1; }
.fcard { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.fhead { display: flex; align-items: center; gap: 14px; } .fhead img, .fhead .ava { width: 56px; height: 56px; border-radius: 16px; background: var(--line2); display: grid; place-items: center; font-size: 22px; font-weight: 700; }
.fhead .t1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.fstat { text-align: right; } .fstat b { display: block; font-size: 20px; letter-spacing: -0.02em; } .fstat span { font-size: 12px; color: var(--muted); }
.btn.big { padding: 11px 20px; font-size: 15px; }
.tag { white-space: nowrap; }
[data-v="3"] .searchbar { flex-wrap: wrap; } [data-v="3"] .searchbar .big { flex-basis: 100%; }
.seg { display: inline-flex; background: var(--line2); border-radius: 10px; padding: 3px; gap: 2px; flex: none; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.kcard:hover { border-color: var(--accent-ink); }
.shell main:has(.kanban) { max-width: none; }
.phead > .seg { flex: none; align-self: flex-start; }
.kanban { grid-template-columns: repeat(5, minmax(190px, 1fr)); }
.asbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: -12px 0 18px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: 13.5px; }
.howto { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 13.5px; } .howto li { margin-bottom: 6px; }
.btn.take { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.take:hover { filter: brightness(.96); }
.btn.nofit { color: var(--muted); }
.btn.nofit:hover { color: #c9302c; border-color: #f2c4c4; background: #fff5f5; }
.hint { font-size: 12.5px; color: var(--muted); background: var(--line2); border-radius: 10px; padding: 8px 12px; }

/* Доска в Базе (25.10) */
.kanban.board { grid-template-columns: repeat(8, minmax(210px, 1fr)); align-items: start; }
.kanban.board .kcol { max-height: calc(100vh - 230px); overflow-y: auto; }
.kanban.board .kcol.over { outline: 2px dashed var(--accent); outline-offset: -2px; }
.kanban.board .kcol.lost { opacity: .75; }
.kanban.board .kcard[draggable="true"] { cursor: grab; }
.kanban.board .kf { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; }
.kanban.board .kd { color: var(--faint); white-space: nowrap; } .kanban.board .kd.red { color: #c0392b; font-weight: 600; }
.shell main:has(.kanban.board) { max-width: none; }

/* CRM-воронка (05.11): этапы, застой, поля карточки */
.st-no_reply { background: var(--blue-weak); color: var(--blue); }
.stale { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #fdecec; color: #c9302c; font-size: 11.5px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.crm { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(127,127,127,.06); font-size: 13px; }
.crm-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 6px; }
.crm-f { flex: 1; min-width: 150px; font-size: 12.5px; }
.crm-cd { flex: 1; min-width: 180px; padding-bottom: 8px; }
.lst { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }

/* 06.11: таблицы аналитики подстраиваются под ширину — длинные названия переносятся, «По нишам» на всю ширину */
.t.wrap td:first-child { white-space: normal; min-width: 160px; }
.grid2 > .span-all { grid-column: 1 / -1; }
