/* Threads Radar — тёмный интерфейс без внешних зависимостей */
:root {
  --bg: #07090e;
  --bg-soft: #0a0d14;
  --surface: #0e121b;
  --surface-2: #121826;
  --surface-3: #171e2e;
  --border: rgba(255, 255, 255, .075);
  --border-strong: rgba(255, 255, 255, .13);
  --text: #eef2fa;
  --muted: #8b94a9;
  --muted-2: #626c82;
  --lime: #c8ff4d;
  --lime-dim: rgba(200, 255, 77, .12);
  --cyan: #38e1ff;
  --violet: #9a7cff;
  --pink: #ff7ab8;
  --amber: #ffc46b;
  --red: #ff6b6b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .5);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body.locked { overflow: hidden; }
[hidden] { display: none !important; }
::selection { background: rgba(200, 255, 77, .25); color: #fff; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.glow { position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; opacity: .5; }
.glow-a { width: 620px; height: 620px; top: -260px; left: -140px; background: radial-gradient(circle, rgba(124, 92, 255, .32), transparent 70%); }
.glow-b { width: 520px; height: 520px; top: 120px; right: -220px; background: radial-gradient(circle, rgba(56, 225, 255, .14), transparent 70%); }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: 600 14px/1 var(--font);
  cursor: pointer; white-space: nowrap; transition: .18s ease; text-decoration: none;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { border-color: rgba(255, 255, 255, .25); background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--lime); border-color: var(--lime); color: #0a0d12; box-shadow: 0 8px 28px rgba(200, 255, 77, .16); }
.btn.primary:hover { background: #d6ff75; border-color: #d6ff75; box-shadow: 0 10px 34px rgba(200, 255, 77, .24); }
.btn.ghost { background: rgba(255, 255, 255, .03); }
.btn.icon-only { width: 42px; padding: 0; }
.btn.tiny { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.tiny svg { width: 14px; height: 14px; }
.btn.wide { width: 100%; height: 48px; }
.btn.danger { background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .35); color: #ff9d9d; }
.btn.danger:hover { background: rgba(255, 107, 107, .18); border-color: rgba(255, 107, 107, .6); }
.btn.danger-ghost { background: transparent; border-color: rgba(255, 107, 107, .25); color: #ff9d9d; }
.btn.danger-ghost:hover { background: rgba(255, 107, 107, .1); border-color: rgba(255, 107, 107, .5); }

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 72px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(7, 9, 14, .78); backdrop-filter: blur(22px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--text); }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(145deg, rgba(200, 255, 77, .16), rgba(56, 225, 255, .06));
  border: 1px solid rgba(200, 255, 77, .3); color: var(--lime);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { font-size: 17px; letter-spacing: -.02em; white-space: nowrap; }
.brand-text b { font-weight: 800; }
.brand-beta { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--lime); background: var(--lime-dim); padding: 3px 6px; border-radius: 5px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.demo-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px;
  border: 1px solid rgba(255, 196, 107, .25); background: rgba(255, 196, 107, .07);
  color: var(--amber); border-radius: 999px; font-size: 12px; font-weight: 600;
}
.demo-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
@media (max-width: 640px) { .demo-badge { display: none; } .topbar { padding: 0 16px; } }

/* ---------- контейнер ---------- */
.wrap { position: relative; z-index: 1; width: min(1240px, 100%); margin: 0 auto; padding: 0 28px 60px; }
@media (max-width: 720px) { .wrap { padding: 0 16px 40px; } }

/* ---------- hero ---------- */
.hero { display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 52px 0 38px; }
.hero-copy { max-width: 720px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(200, 255, 77, .6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(200, 255, 77, 0); } 100% { box-shadow: 0 0 0 0 rgba(200, 255, 77, 0); } }
.hero h1 { margin: 0 0 16px; font-size: clamp(32px, 4.3vw, 50px); line-height: 1.04; letter-spacing: -.035em; font-weight: 800; }
.grad { background: linear-gradient(100deg, var(--lime), #8fffc4 45%, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; max-width: 620px; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.hero-side { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; }
.precision-ring { position: relative; width: 132px; height: 132px; }
.precision-ring svg { width: 132px; height: 132px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .07); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--lime); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7; transition: stroke-dashoffset .8s ease, stroke .3s; filter: drop-shadow(0 0 6px rgba(200, 255, 77, .5)); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.ring-label b { font-size: 28px; letter-spacing: -.04em; line-height: 1; }
.ring-label span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; margin-top: 5px; }
.hero-side-note { text-align: center; color: var(--muted); font-size: 12px; line-height: 1.55; }
.hero-side-note b { color: var(--text); }
.hero-side-note span { color: var(--muted-2); }
@media (max-width: 880px) { .hero { padding-top: 34px; gap: 22px; } .hero-side { display: none; } }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { position: relative; overflow: hidden; padding: 18px 18px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(160deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012)); }
.kpi::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(120% 80% at 100% 0%, rgba(255, 255, 255, .045), transparent 55%); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; }
.kpi-ico svg { width: 15px; height: 15px; }
.kpi-ico.lime { color: var(--lime); background: var(--lime-dim); }
.kpi-ico.cyan { color: var(--cyan); background: rgba(56, 225, 255, .09); }
.kpi-ico.violet { color: var(--violet); background: rgba(154, 124, 255, .1); }
.kpi-ico.pink { color: var(--pink); background: rgba(255, 122, 184, .09); }
.kpi-value { margin-top: 10px; font-size: 31px; font-weight: 750; letter-spacing: -.045em; line-height: 1.05; }
.kpi-value small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.kpi-sub { margin-top: 3px; font-size: 11.5px; color: var(--muted-2); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 26px; margin-top: 10px; }
.spark i { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; background: rgba(200, 255, 77, .34); transition: height .4s; }
.spark i.hot { background: var(--lime); }
@media (max-width: 980px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .kpi-value { font-size: 26px; } }

/* ---------- полоса скана ---------- */
.scan-strip { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 14px; padding: 14px 18px; border: 1px solid rgba(200, 255, 77, .18); border-radius: 13px; background: linear-gradient(90deg, rgba(200, 255, 77, .06), rgba(200, 255, 77, .015)); }
.scan-strip-main { flex: 1; min-width: 0; }
.scan-state { display: flex; align-items: center; gap: 9px; font-size: 13px; margin-bottom: 8px; }
.scan-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(200, 255, 77, .5); animation: pulse 1.6s infinite; flex: none; }
.scan-dot.done { background: var(--cyan); animation: none; box-shadow: none; }
.scan-dot.error { background: var(--red); animation: none; box-shadow: none; }
.scan-state .muted { font-size: 12px; }
.scan-bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.scan-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--lime), #8fffc4); transition: width .5s ease; }
.scan-bar.tall { height: 9px; }
.scan-nums { display: flex; align-items: center; gap: 22px; flex: none; }
.scan-nums div { display: flex; flex-direction: column; line-height: 1.15; }
.scan-nums b { font-size: 16px; letter-spacing: -.02em; }
.scan-nums span { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 800px) { .scan-strip { flex-direction: column; align-items: stretch; gap: 12px; } .scan-nums { justify-content: space-between; gap: 8px; } }

/* ---------- тулбар ---------- */
.toolbar { margin: 26px 0 0; }
.toolbar-row { display: flex; align-items: center; gap: 12px; }
.toolbar-row.second { margin-top: 12px; justify-content: space-between; gap: 18px; }
.searchbox { position: relative; flex: 1; max-width: 460px; }
.searchbox svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.searchbox input { width: 100%; height: 42px; padding: 0 56px 0 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 400 13.5px var(--font); outline: none; transition: .18s; }
.searchbox input:focus { border-color: rgba(200, 255, 77, .38); box-shadow: 0 0 0 3px rgba(200, 255, 77, .07); background: var(--surface-2); }
.searchbox input::placeholder { color: var(--muted-2); }
.searchbox kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font: 500 10px var(--font); color: var(--muted-2); border: 1px solid var(--border); border-radius: 5px; padding: 2px 5px; background: var(--surface-2); }
.toolbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.select-wrap { display: flex; flex-direction: column; gap: 3px; }
.select-wrap > span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding-left: 2px; }
.select-wrap select { height: 34px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 12px var(--font); padding: 0 26px 0 9px; cursor: pointer; outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b94a9' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.select-wrap select:hover { border-color: var(--border-strong); }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 500 12.5px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: .15s; }
.chip:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, .025); }
.chip.active { color: var(--text); border-color: rgba(255, 255, 255, .18); background: var(--surface-2); }
.chip .cnt { font-size: 10.5px; color: var(--muted-2); background: rgba(255, 255, 255, .05); border-radius: 5px; padding: 1px 5px; }
.chip.active .cnt { color: var(--text); background: rgba(255, 255, 255, .09); }
.chip .cdot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip .cat-ico { width: 13px; height: 13px; color: var(--c, var(--muted)); }
.status-tabs { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow-x: auto; }
.status-tabs button { border: 0; background: transparent; color: var(--muted); font: 500 12px var(--font); height: 28px; padding: 0 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.status-tabs button:hover { color: var(--text); }
.status-tabs button.active { color: var(--text); background: var(--surface-3); }
@media (max-width: 900px) {
  .toolbar-row { flex-wrap: wrap; }
  .searchbox { max-width: none; width: 100%; flex-basis: 100%; }
  .toolbar-actions { margin-left: 0; }
  .toolbar-row.second { flex-direction: column; align-items: stretch; }
  .status-tabs { align-self: flex-start; }
}
@media (max-width: 520px) { .select-wrap > span { display: none; } .select-wrap select { height: 38px; } .toolbar-actions { width: 100%; } .select-wrap { flex: 1; } .select-wrap select { width: 100%; } }

/* ---------- заголовок результатов ---------- */
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 14px; font-size: 13px; color: var(--muted); }
.results-head b { color: var(--text); font-size: 15px; }
.results-head .muted { color: var(--muted-2); }
.view-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted-2); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 8px rgba(200, 255, 77, .6); }

/* ---------- карточки лидов ---------- */
.leads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .leads { grid-template-columns: 1fr; } }
.lead {
  position: relative; display: flex; flex-direction: column; padding: 18px 18px 14px 21px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  transition: border-color .2s, transform .2s, background .2s; overflow: hidden;
}
.lead::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; border-radius: 0 2px 2px 0; background: var(--c, var(--lime)); opacity: .8; }
.lead:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .14); background: var(--surface-2); }
.lead.rejected { opacity: .55; }
.lead-head { display: flex; align-items: flex-start; gap: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; color: #0a0d12; letter-spacing: -.02em; }
.who { min-width: 0; flex: 1; }
.who b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { display: block; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.score { flex: none; display: inline-flex; align-items: baseline; gap: 1px; height: 28px; padding: 0 9px; border-radius: 8px; font-weight: 750; font-size: 14px; letter-spacing: -.02em; }
.score span { font-size: 9px; font-weight: 600; opacity: .65; }
.score.high { color: var(--lime); background: var(--lime-dim); }
.score.mid { color: var(--amber); background: rgba(255, 196, 107, .1); }
.score.low { color: #ff9d7a; background: rgba(255, 157, 122, .1); }
.lead-badges { display: flex; align-items: center; gap: 7px; margin: 13px 0 10px; flex-wrap: wrap; }
.cat-badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--c, var(--muted)); background: color-mix(in srgb, var(--c) 10%, transparent); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); }
.cat-badge .cat-ico { width: 13px; height: 13px; }
.cat-ico { flex: none; }
.src-badge { font-size: 10.5px; color: var(--muted-2); display: inline-flex; align-items: center; gap: 4px; }
.src-badge::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.lead-text { margin: 0; font-size: 13.8px; line-height: 1.55; color: #dfe5f1; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.lead-text.open { -webkit-line-clamp: unset; display: block; }
.lead-text mark { background: rgba(200, 255, 77, .17); color: #eaffb8; border-radius: 3px; padding: 0 1px; }
.lead-reasons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.reason { font-size: 10.5px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 2px 6px; background: rgba(255, 255, 255, .02); }
.reason.boost { color: #d8e8b5; border-color: rgba(200, 255, 77, .18); background: rgba(200, 255, 77, .05); }
.lead-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.lead-meta { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--muted-2); min-width: 0; }
.lead-meta span { display: inline-flex; align-items: center; gap: 4px; }
.lead-meta svg { width: 13px; height: 13px; }
.lead-link { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lead-link:hover { color: var(--lime); }
.lead-link svg { width: 12px; height: 12px; }
.lead-actions { display: flex; gap: 6px; flex: none; }
.act { height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border); background: transparent; color: var(--muted); font: 600 11px var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; transition: .15s; }
.act svg { width: 12px; height: 12px; }
.act:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255, 255, 255, .04); }
.act.work:hover { color: var(--lime); border-color: rgba(200, 255, 77, .35); background: var(--lime-dim); }
.act.skip:hover { color: #ff9d9d; border-color: rgba(255, 107, 107, .35); background: rgba(255, 107, 107, .07); }
.act.done { color: var(--lime); border-color: rgba(200, 255, 77, .35); background: var(--lime-dim); }
@media (max-width: 520px) {
  .lead { padding: 15px 14px 12px 18px; }
  .lead-foot { flex-direction: column; align-items: stretch; }
  .lead-actions { justify-content: flex-end; }
}

/* ---------- пустое состояние / скелетоны ---------- */
.empty { text-align: center; padding: 70px 20px 50px; border: 1px dashed var(--border); border-radius: var(--radius); margin-top: 4px; }
.empty-radar { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; color: var(--lime); background: var(--lime-dim); border: 1px solid rgba(200, 255, 77, .2); }
.empty-radar svg { width: 34px; height: 34px; animation: spin 8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.02em; }
.empty p { margin: 0 auto 20px; color: var(--muted); font-size: 13.5px; max-width: 420px; }
.skeleton { height: 230px; border-radius: var(--radius); border: 1px solid var(--border); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.load-more-wrap { text-align: center; margin-top: 18px; }

/* ---------- подвал ---------- */
.foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 46px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 11.5px; }
.foot-links { display: flex; gap: 16px; }
.foot-links a, .foot-links button { color: var(--muted); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; padding: 0; }
.foot-links a:hover, .foot-links button:hover { color: var(--lime); }
@media (max-width: 620px) { .foot { flex-direction: column; align-items: flex-start; } }

/* ---------- оверлеи / модалки ---------- */
.overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 6, 10, .72); backdrop-filter: blur(7px); animation: fade .18s ease; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(560px, 100%); max-height: calc(100vh - 48px); overflow-y: auto; padding: 30px; border-radius: 22px; border: 1px solid var(--border-strong); background: linear-gradient(165deg, #121724, #0b0f17 70%); box-shadow: var(--shadow); animation: pop .22s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } }
.modal-close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.modal-close:hover { background: rgba(255, 255, 255, .05); color: var(--text); border-color: var(--border); }
.modal-close svg { width: 17px; height: 17px; }
.modal-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--lime); margin-bottom: 10px; }
.modal h2 { margin: 0 0 8px; font-size: 25px; letter-spacing: -.03em; }
.modal-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.modal-note { margin-top: 14px; text-align: center; font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.modal-note.error { color: #ff9d9d; text-align: left; padding: 10px; border-radius: 8px; background: rgba(255, 107, 107, .08); }

.source-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.source-card { position: relative; text-align: left; padding: 15px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-family: var(--font); transition: .16s; }
.source-card:hover { border-color: var(--border-strong); }
.source-card.active { border-color: rgba(200, 255, 77, .45); background: linear-gradient(150deg, rgba(200, 255, 77, .07), rgba(200, 255, 77, .015)); box-shadow: inset 0 0 0 1px rgba(200, 255, 77, .08); }
.source-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); color: var(--lime); margin-bottom: 10px; }
.source-ico svg { width: 17px; height: 17px; }
.source-card b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.source-card > span:not(.source-ico) { display: block; font-size: 11px; color: var(--muted); line-height: 1.45; }
.tick { position: absolute; top: 11px; right: 11px; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border-strong); display: grid; place-items: center; color: transparent; }
.tick svg { width: 11px; height: 11px; }
.source-card.active .tick { background: var(--lime); border-color: var(--lime); color: #0a0d12; }
@media (max-width: 520px) { .source-grid { grid-template-columns: 1fr; } .modal { padding: 24px 18px; } }

.field { margin-bottom: 18px; }
.field > label { display: block; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.field > label .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.field input[type=text], .field input:not([type]), .field input[type=number], .field textarea, .field select {
  width: 100%; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: 400 13px var(--font); padding: 10px 12px; outline: none; transition: .15s;
}
.field textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.field input:focus, .field textarea:focus { border-color: rgba(200, 255, 77, .4); box-shadow: 0 0 0 3px rgba(200, 255, 77, .06); }
.field.two { display: grid; grid-template-columns: 80px 1fr; gap: 10px; }
.field.two input[type=color] { height: 41px; padding: 4px; cursor: pointer; }
.range-row { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.range-row input { width: 62px !important; text-align: center; padding: 8px !important; }
.range-row > span { color: var(--muted-2); font-size: 12px; }
.range-presets { display: flex; gap: 5px; margin-left: auto; }
.range-presets button { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 6px; height: 28px; padding: 0 8px; font: 600 10.5px var(--font); cursor: pointer; }
.range-presets button:hover { color: var(--lime); border-color: rgba(200, 255, 77, .35); }
.hint { margin: 7px 0 0; font-size: 11px; color: var(--muted-2); line-height: 1.5; }

/* прогресс скана */
.big-progress { margin: 18px 0 20px; padding: 16px; border-radius: 13px; border: 1px solid var(--border); background: var(--surface); }
.big-progress-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.big-progress-head b { font-size: 27px; letter-spacing: -.04em; }
.big-progress-head span { font-size: 11.5px; color: var(--muted); }
.prog-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.prog-stats div { padding: 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); }
.prog-stats b { display: block; font-size: 18px; letter-spacing: -.03em; }
.prog-stats span { display: block; font-size: 9.5px; color: var(--muted-2); margin-top: 2px; line-height: 1.3; }
@media (max-width: 520px) { .prog-stats { grid-template-columns: 1fr 1fr; } }
.prog-actions { display: flex; gap: 9px; }
.prog-actions .btn { flex: 1; }

/* ---------- drawer настроек ---------- */
.overlay:has(.drawer) { justify-content: flex-end; padding: 0; }
.drawer { position: relative; width: min(520px, 100%); height: 100%; overflow: hidden; display: flex; flex-direction: column; background: #0b0f17; border-left: 1px solid var(--border-strong); box-shadow: -30px 0 80px rgba(0, 0, 0, .5); animation: slide .24s cubic-bezier(.2, .9, .3, 1); }
@keyframes slide { from { transform: translateX(40px); opacity: .5; } }
@media (max-width: 560px) { .drawer { width: 100%; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 26px 26px 14px; border-bottom: 1px solid var(--border); flex: none; }
.drawer-head h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.drawer-head .modal-close { position: static; }
.drawer-body { padding: 22px 26px 28px; overflow-y: auto; flex: 1; }
.set-block { padding: 18px 0; border-bottom: 1px solid var(--border); }
.set-block:first-child { padding-top: 0; }
.set-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; font-size: 13.5px; }
.set-title > b { font-weight: 650; }
.set-title > span { color: var(--lime); font-weight: 700; font-size: 14px; }
.slider { width: 100%; accent-color: var(--lime); height: 4px; cursor: pointer; }
.switch { position: relative; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, .12); transition: .18s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: .18s; }
.switch input:disabled + i { opacity: .35; cursor: not-allowed; }
.switch input:checked + i { background: var(--lime); }
.switch input:checked + i::after { transform: translateX(18px); background: #0a0d12; }
.inline-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.inline-field select:disabled { opacity: .4; cursor: not-allowed; }
.inline-field select { height: 32px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 500 12px var(--font); padding: 0 8px; outline: none; }
.cat-list { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.cat-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.cat-item .em { font-size: 17px; width: 24px; height: 20px; display: grid; place-items: center; flex: none; }
.cat-item .cat-ico { width: 17px; height: 17px; }
.cat-item .ci-main { flex: 1; min-width: 0; }
.cat-item b { display: block; font-size: 12.5px; }
.cat-item span { display: block; font-size: 10.5px; color: var(--muted-2); }
.cat-item .ci-edit { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 5px; border-radius: 6px; display: grid; place-items: center; }
.cat-item .ci-edit:hover { color: var(--lime); background: rgba(255, 255, 255, .05); }
.cat-item .ci-edit svg { width: 15px; height: 15px; }
.cat-item.off { opacity: .5; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.data-row div { display: flex; flex-direction: column; }
.data-row b { font-size: 17px; }
.data-row span { font-size: 10.5px; color: var(--muted-2); }
.drawer-footer { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 26px; background: rgba(11, 15, 23, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--border); }
.drawer-footer .btn { min-width: 140px; }
.drawer-footer .muted { font-size: 11px; }
.cat-editor { position: absolute; inset: 0; display: flex; flex-direction: column; background: #0b0f17; z-index: 2; animation: slide .2s ease; }
.cat-editor[hidden] { display: none; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 4px 0 18px; cursor: pointer; }
.checkline input { accent-color: var(--lime); width: 16px; height: 16px; }
.cat-editor .btn.wide + .btn.wide { margin-top: 9px; }

/* ---------- тосты ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
.toast { min-width: 220px; max-width: 360px; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--border-strong); background: #141a27; box-shadow: 0 14px 40px rgba(0, 0, 0, .45); font-size: 12.5px; display: flex; align-items: center; gap: 9px; animation: toastIn .22s ease; }
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: none; }
.toast.error::before { background: var(--red); }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- мобильная шапка и мелочи ---------- */
@media (max-width: 640px) {
  .topbar { height: 64px; padding: 0 14px; }
  .brand { gap: 8px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .brand-text { font-size: 15px; }
  .brand-beta { display: none; }
  .top-actions { gap: 6px; }
  #scanBtn { width: 42px; padding: 0; }
  #scanBtn span { display: none; }
}
@media (max-width: 520px) {
  .hero { padding: 28px 0 26px; }
  .hero h1 { font-size: 30px; line-height: 1.07; }
  .hero p { font-size: 14px; line-height: 1.6; }
  .eyebrow { font-size: 10.5px; letter-spacing: .03em; }
  .kpi { padding: 14px 13px 12px; }
  .kpi-head { font-size: 11.5px; gap: 6px; }
  .kpi-ico { width: 24px; height: 24px; border-radius: 7px; }
  .kpi-ico svg { width: 13px; height: 13px; }
  .kpi-value { font-size: 26px; margin-top: 8px; }
  .kpi-sub { font-size: 10.5px; }
  .scan-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
  .scan-nums .btn { grid-column: 1 / -1; width: 100%; }
  .results-head { font-size: 12px; }
  .view-note { display: none; }
}
@media (max-width: 380px) {
  .hero h1 { font-size: 27px; }
  .brand-text { font-size: 14px; }
}

/* скроллбары */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Telegram Mini App ---------- */
body.tg .topbar { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
body.tg .wrap { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
body.tg .energy, body.tg .glow { opacity: .35; }

.auth-gate {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  padding: 24px; background:
    radial-gradient(90% 60% at 50% 0%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(70% 50% at 80% 100%, rgba(56, 225, 255, .08), transparent 60%),
    #07090e;
}
.auth-card {
  width: min(380px, 100%); padding: 30px 26px 24px; border-radius: 22px;
  border: 1px solid var(--border-strong); background: linear-gradient(165deg, #111725, #0a0e16 75%);
  box-shadow: var(--shadow); text-align: center;
}
.auth-mark {
  width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 16px; display: grid; place-items: center;
  color: var(--lime); background: linear-gradient(145deg, rgba(200, 255, 77, .16), rgba(56, 225, 255, .05));
  border: 1px solid rgba(200, 255, 77, .3);
}
.auth-mark svg { width: 30px; height: 30px; }
.auth-card h1 { margin: 0 0 10px; font-size: 27px; letter-spacing: -.035em; }
.auth-card h1 b { font-weight: 800; }
.auth-card p { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.auth-card input {
  width: 100%; height: 46px; margin-bottom: 9px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 14px var(--font); text-align: center; letter-spacing: .06em; outline: none;
}
.auth-card input:focus { border-color: rgba(200, 255, 77, .5); box-shadow: 0 0 0 3px rgba(200, 255, 77, .08); }
.auth-card .btn { margin-top: 8px; }
.auth-error { color: #ff9d9d; font-size: 12px; margin-top: 10px; min-height: 16px; }
@media (max-width: 420px) { .auth-gate { padding: 16px; } .auth-card { padding: 26px 20px 20px; } }

/* ---------- доступ партнёров ---------- */
.role-badge {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--lime); background: var(--lime-dim); border: 1px solid rgba(200, 255, 77, .22);
  border-radius: 5px; padding: 2px 6px;
}
.access-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.access-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface);
}
.access-item .ai-main { flex: 1; min-width: 0; }
.access-item b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.access-item span { display: block; font-size: 10.5px; color: var(--muted-2); }
.access-item .ai-role { font-size: 9.5px; color: var(--lime); flex: none; }
.access-item .ai-remove {
  border: 0; background: transparent; color: var(--muted-2); cursor: pointer; padding: 4px;
  border-radius: 5px; display: grid; place-items: center;
}
.access-item .ai-remove:hover { color: #ff9d9d; background: rgba(255, 107, 107, .08); }
.access-item .ai-remove svg { width: 14px; height: 14px; }
.invite-box { margin-top: 10px; padding: 10px; border: 1px dashed rgba(200, 255, 77, .3); border-radius: 9px; background: rgba(200, 255, 77, .04); }
.invite-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.invite-code code { font: 700 17px/1 var(--font); letter-spacing: .14em; color: var(--lime); }
.access-actions { display: flex; gap: 7px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- конкурентная разведка ---------- */
.insights-modal { width: min(820px, 100%); }
.insights-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.insights-actions .muted { font-size: 11.5px; }
.insights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.insight-kpi { padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.insight-kpi b { display: block; font-size: 20px; letter-spacing: -.03em; }
.insight-kpi span { display: block; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.insight-section { margin-top: 18px; }
.insight-section h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: -.01em; }
.insight-section p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.repeat-item { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); margin-bottom: 6px; }
.repeat-item .ri-main { flex: 1; min-width: 0; }
.repeat-item b { font-size: 12px; }
.repeat-item span { display: block; color: var(--muted-2); font-size: 10.5px; margin-top: 2px; }
.repeat-item .ri-count { flex: none; color: var(--lime); font-weight: 700; font-size: 12px; }
.repeat-item .ri-example { color: var(--muted); font-size: 11px; margin-top: 4px; display: block; }
.contact-chip { display: inline-flex; gap: 5px; align-items: center; padding: 4px 8px; margin: 0 5px 5px 0; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.02); }
.finding { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12px; line-height: 1.55; color: var(--muted); }
.finding:last-child { border-bottom: 0; }
.finding b { color: var(--text); }
.finding a { color: var(--lime); text-decoration: none; }
.finding a:hover { text-decoration: underline; }
.insight-empty { padding: 24px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
@media (max-width: 640px) { .insights-grid { grid-template-columns: 1fr 1fr; } .hide-sm { display: none; } }
