/* ============================================================
   LeadFinder — дизайн-система (v2)
   Одна шкала типографики 12/13/15/16/18/24/32, два радиуса,
   нейтральный тёмный фон, акцент только на действиях.
   ============================================================ */

:root {
  --bg: #0a0b0e;
  --surface: #111318;
  --surface-2: #161920;
  --surface-3: #1c2029;
  --line: #232833;
  --line-2: #2c333f;

  --ink: #e9ecf2;
  --ink-2: #a4acba;
  --ink-3: #7f8896;

  --acc: #4d7dfb;
  --acc-hover: #6d95ff;
  --acc-press: #3f68d8;
  --acc-soft: rgba(77, 125, 251, .13);
  --acc-line: rgba(77, 125, 251, .38);

  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --warn: #f2b544;
  --warn-soft: rgba(242, 181, 68, .12);
  --bad: #ef6b76;

  --r: 12px;
  --r-lg: 16px;
  --pill: 999px;

  --rail: 76px;
  --panel: 328px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", ui-sans-serif, monospace;

  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 8px 24px -12px rgba(0, 0, 0, .7);
  --sh-3: 0 24px 64px -24px rgba(0, 0, 0, .85);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.015em; }
p { margin: 0; }
a { color: var(--acc-hover); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--acc-soft); }

.t-xs { font-size: 12px; }
.t-s  { font-size: 13px; }
.t-m  { font-size: 15px; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: var(--r);
  background: var(--surface-3); color: var(--ink);
  font-size: 14px; font-weight: 550; white-space: nowrap;
  cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease), transform .06s;
  text-decoration: none;
}
.btn:hover { background: var(--line); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn--primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn--primary:hover { background: var(--acc-hover); border-color: var(--acc-hover); }

.btn--ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover { background: var(--surface-3); }

.btn--quiet { background: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--surface-3); color: var(--ink); }

.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn--lg { height: 48px; font-size: 15px; border-radius: var(--r); }
.btn--block { width: 100%; }
.btn--danger { color: var(--bad); border-color: rgba(239, 107, 118, .3); background: rgba(239, 107, 118, .08); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn--on { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-hover); }

/* ---------- поля ---------- */
.field { display: grid; gap: 6px; }
.field > label { font-size: 13px; font-weight: 550; color: var(--ink-2); }

.input, .select {
  width: 100%; height: 42px; padding: 0 12px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r);
  font: inherit; font-size: 14px;
  transition: border-color .15s, background .15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus, .select:focus { outline: none; border-color: var(--acc); background: var(--surface); }
.input--icon { padding-left: 40px; }
.select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237f8896' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.check input {
  appearance: none; flex: 0 0 auto;
  width: 18px; height: 18px; margin: 1px 0 0;
  border: 1.5px solid var(--line-2); border-radius: 5px;
  background: var(--surface-2); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.check input:checked {
  background: var(--acc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--acc);
}

/* ---------- бейджи ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: var(--pill);
  font-size: 12px; font-weight: 550; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--acc { background: var(--acc-soft); color: var(--acc-hover); }
.badge--dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
}

/* ============================================================
   ГЕЙТ (вход)
   ============================================================ */
.gate {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.gate__pitch {
  position: relative; overflow: hidden;
  padding: 56px clamp(32px, 5vw, 72px);
  display: flex; flex-direction: column; justify-content: center; gap: 24px;
  border-right: 1px solid var(--line);
}
.gate__pitch::after {
  content: ""; position: absolute; inset: auto -10% -40% -10%; height: 70%;
  background: radial-gradient(60% 60% at 50% 100%, rgba(77, 125, 251, .22), transparent 70%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.brand__mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(150deg, var(--acc-hover), var(--acc-press));
  color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 18px -8px rgba(77, 125, 251, .9);
}
.gate__title {
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.12; letter-spacing: -.03em;
  max-width: 15ch;
}
.gate__sub { font-size: 16px; color: var(--ink-2); max-width: 42ch; }
.gate__stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; }
.gate__stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.gate__stat span { font-size: 13px; color: var(--ink-3); }
.gate__proof {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2);
}
.gate__proof li { display: flex; gap: 8px; align-items: flex-start; list-style: none; }
.gate__proof ul { margin: 0; padding: 0; display: grid; gap: 10px; }
.gate__proof svg { flex: 0 0 auto; color: var(--ok); margin-top: 2px; }

.gate__panel {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(77, 125, 251, .10), transparent 60%),
    var(--bg);
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 28px;
  display: grid; gap: 18px;
}
.auth-card__head { display: grid; gap: 6px; }
.auth-card__head h2 { font-size: 22px; }
.auth-card__head p { font-size: 14px; color: var(--ink-2); }
.auth-steps { display: flex; gap: 6px; margin-bottom: 2px; }
.auth-steps span {
  height: 3px; flex: 1; border-radius: var(--pill); background: var(--line-2);
}
.auth-steps span.on { background: var(--acc); }
.auth-msg { font-size: 13px; min-height: 18px; color: var(--ink-2); }
.auth-msg--err { color: var(--bad); }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-3); }
.link-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--acc-hover); font-size: inherit; font-weight: 550;
}
.link-btn:hover { text-decoration: underline; }

.tg-code-row { display: flex; gap: 8px; }
.tg-code-row .input { letter-spacing: .3em; font-family: var(--mono); text-align: center; }

/* ---------- онбординг ---------- */
.onb { display: grid; gap: 16px; }
.onb__title { font-size: 20px; }
.onb__row { display: grid; gap: 8px; }
.chip-set { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--pill);
  background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.chip:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.chip--on { background: var(--acc-soft); border-color: var(--acc-line); color: var(--acc-hover); }

/* ============================================================
   КАРКАС ПРИЛОЖЕНИЯ
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--rail) var(--panel) minmax(0, 1fr);
  height: 100dvh;
}

/* ---------- рейл ---------- */
.rail {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 8px;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.rail__mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 14px;
  border-radius: 11px; background: linear-gradient(150deg, var(--acc-hover), var(--acc-press));
  color: #fff; font-weight: 800; font-size: 16px;
}
.rail__nav { display: grid; gap: 4px; width: 100%; }
.rail__btn {
  position: relative; white-space: nowrap;
  display: grid; justify-items: center; gap: 3px;
  width: 100%; padding: 9px 4px;
  border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-3);
  font-size: 10.5px; font-weight: 550; cursor: pointer;
  transition: background .15s, color .15s;
}
.rail__btn:hover { background: var(--surface-2); color: var(--ink-2); }
.rail__btn[aria-current="page"] { background: var(--acc-soft); color: var(--acc-hover); }
.rail__btn .count {
  position: absolute; top: 4px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--pill); background: var(--acc); color: #fff;
  font-size: 10px; line-height: 16px; font-weight: 700;
}
.rail__spacer { flex: 1; }
.rail__bottom { display: grid; gap: 4px; width: 100%; }

/* ---------- панель фильтров ---------- */
.panel {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-height: 0;
}
.panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}
.panel__head h1 { font-size: 16px; }
.panel__body { flex: 1; overflow-y: auto; padding: 16px 18px 20px; display: grid; gap: 20px; }
.panel__body::-webkit-scrollbar { width: 10px; }
.panel__body::-webkit-scrollbar-thumb { background: var(--line-2); border: 3px solid var(--surface); border-radius: 99px; }

.group { display: grid; gap: 10px; }
.group__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.group__head h2 {
  font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.group__hint { font-size: 12px; color: var(--ink-3); }
.add-row { display: flex; gap: 8px; }
.add-row .input { height: 38px; font-size: 13px; }

.selected-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 6px 0 10px;
  border-radius: var(--pill); background: var(--acc-soft);
  border: 1px solid var(--acc-line); color: var(--acc-hover);
  font-size: 12px; font-weight: 550;
}
.tag button {
  display: grid; place-items: center;
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: inherit; cursor: pointer;
}
.tag button:hover { background: rgba(255, 255, 255, .1); }

.scroll-list {
  max-height: 168px; overflow-y: auto; padding: 2px;
  display: grid; gap: 2px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
}
.scroll-list button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink-2);
  font-size: 13px; text-align: left; cursor: pointer;
}
.scroll-list button:hover { background: var(--surface-3); color: var(--ink); }
.scroll-list button.on { background: var(--acc-soft); color: var(--acc-hover); }
.scroll-list .n { font-size: 11px; color: var(--ink-3); }
.scroll-empty { padding: 10px; font-size: 13px; color: var(--ink-3); }

.toggles { display: grid; gap: 8px; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; font-size: 13px;
}
.toggle:has(input:checked) { border-color: var(--acc-line); background: var(--acc-soft); }
.toggle span { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.toggle:has(input:checked) span { color: var(--ink); }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: var(--pill); background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; }
.toggle input::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease);
}
.toggle input:checked { background: var(--acc); }
.toggle input:checked::after { transform: translateX(14px); }

.panel__foot {
  position: sticky; bottom: 0;
  display: grid; gap: 8px;
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, var(--surface) 70%, rgba(17, 19, 24, .92));
}
.panel__foot .hint { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

/* ---------- main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 24px; min-height: 60px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.tabs { display: flex; gap: 4px; }
.tab {
  height: 34px; padding: 0 12px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 550; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface-3); color: var(--ink); }
.tab .n {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--pill);
  background: var(--line-2); color: var(--ink-2); font-size: 11px; line-height: 20px; font-weight: 700;
}
.tab[aria-selected="true"] .n { background: var(--acc); color: #fff; }

.topbar__spacer { flex: 1; }

.plan-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 6px 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--pill);
  background: var(--surface-2); color: var(--ink-2);
  font-size: 13px; cursor: pointer;
}
.plan-chip:hover { border-color: var(--acc-line); color: var(--ink); }
.plan-chip b { color: var(--ink); font-weight: 600; }
.plan-chip .bar {
  width: 54px; height: 4px; border-radius: var(--pill); background: var(--line-2); overflow: hidden;
}
.plan-chip .bar i { display: block; height: 100%; background: var(--acc); border-radius: inherit; }
.plan-chip .up {
  display: inline-grid; place-items: center;
  height: 24px; padding: 0 10px; margin-left: 2px;
  border-radius: var(--pill); background: var(--acc); color: #fff;
  font-size: 12px; font-weight: 650;
}

.avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--surface-3);
  font-size: 13px; font-weight: 650; color: var(--ink-2); cursor: pointer;
}
.avatar:hover { border-color: var(--acc-line); color: var(--ink); }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 40px; }
.content::-webkit-scrollbar { width: 12px; }
.content::-webkit-scrollbar-thumb { background: var(--line-2); border: 4px solid var(--bg); border-radius: 99px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-wrap svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-wrap .input { height: 42px; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.stat {
  flex: 1 1 150px;
  padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
}
.stat b { display: block; font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); }

.listbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 20px 0 12px;
}
.listbar__info { font-size: 13px; color: var(--ink-3); }
.listbar__spacer { flex: 1; }

.bulkbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--r);
  background: var(--acc-soft); border: 1px solid var(--acc-line);
}
.bulkbar b { font-size: 13px; }

/* ---------- карточка лида ---------- */
.leads { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.lead {
  position: relative;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.lead:hover { border-color: var(--line-2); background: var(--surface-2); }
.lead.is-selected { border-color: var(--acc-line); background: var(--acc-soft); }
.lead__check { padding-top: 2px; }
.lead__main { min-width: 0; display: grid; gap: 6px; cursor: pointer; }
.lead__name {
  font-size: 15px; font-weight: 620; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lead__meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.lead__meta .sep { color: var(--ink-3); }
.lead__addr {
  font-size: 12px; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lead__side { display: grid; gap: 6px; justify-items: end; }
.lead__phone {
  font-size: 13px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lead__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.lead__icons { display: flex; gap: 4px; margin-top: 2px; }
.soc-mini {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--ink-2);
  background: var(--surface-2);
}
.soc-mini:hover { color: var(--ink); border-color: var(--line-2); text-decoration: none; }
.soc-mini svg { width: 12px; height: 12px; }

.lead__flag { position: absolute; top: 0; right: 0; }

.empty {
  display: grid; place-items: center; gap: 10px;
  padding: 64px 24px; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-lg);
  color: var(--ink-2);
}
.empty svg { color: var(--ink-3); }
.empty h3 { font-size: 16px; }
.empty p { font-size: 13px; color: var(--ink-3); max-width: 46ch; }

.more { display: grid; place-items: center; gap: 8px; padding: 24px 0 8px; }
.more__hint { font-size: 12px; color: var(--ink-3); }

.skeleton {
  height: 92px; border-radius: var(--r);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: sheen 1.2s infinite linear;
}
@keyframes sheen { to { background-position: -120% 0; } }

/* ============================================================
   ДИАЛОГИ
   ============================================================ */
dialog {
  padding: 0; border: 0; background: transparent; color: inherit;
  max-width: min(560px, calc(100vw - 32px)); width: 100%;
}
dialog::backdrop { background: rgba(4, 6, 10, .72); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.modal {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-3);
  display: grid; max-height: min(86vh, 900px);
  min-width: 0; overflow: hidden;
}
.modal__body, .modal__foot, .sheet__body { min-width: 0; }
.modal__head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line);
}
.modal__head h2 { font-size: 18px; }
.modal__head p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.modal__head .icon-btn { margin-left: auto; flex: 0 0 auto; }
.modal__body { padding: 18px 20px; overflow-y: auto; display: grid; gap: 16px; }
.modal__foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  align-items: center;
}
.modal__foot .t-xs { flex: 1 1 220px; }

/* тарифы */
.plans { display: grid; gap: 10px; }
.plan {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
}
.plan--hot { border-color: var(--acc-line); background: linear-gradient(180deg, var(--acc-soft), var(--surface-2)); }
.plan h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.plan__price { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.plan__price small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.plan ul { grid-column: 1 / -1; margin: 0; padding: 0; display: grid; gap: 6px; }
.plan li { list-style: none; font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--ok); font-weight: 700; }
.plan__cta { grid-row: 1 / span 2; grid-column: 2; }

/* лид-шит */
.sheet {
  width: 460px;
  max-width: 100vw;
  margin: 0 0 0 auto;
  height: 100dvh;
  transform: translateX(100%);
  transition: transform .22s var(--ease);
  border-radius: 0;
}
dialog.sheet[open] { transform: translateX(0); }
dialog.sheet { max-width: 100vw; }
.sheet .modal { height: 100dvh; border-radius: 0; border-left: 1px solid var(--line); max-height: none; width: 100%; }
.sheet__head { padding: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.sheet__head .row { display: flex; align-items: flex-start; gap: 10px; }
.sheet__head h2 { font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.sheet__head .meta { font-size: 13px; color: var(--ink-2); }
.sheet__body { padding: 20px; overflow-y: auto; overflow-x: hidden; display: grid; gap: 20px; align-content: start; }
.kv { display: grid; gap: 10px; }
.kv .row { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }

.statuses { display: flex; flex-wrap: wrap; gap: 6px; }
.status {
  height: 30px; padding: 0 11px; border-radius: var(--pill);
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2);
  font-size: 12px; font-weight: 550; cursor: pointer;
}
.status:hover { background: var(--surface-3); }
.status--on { border-color: var(--acc-line); background: var(--acc-soft); color: var(--acc-hover); }
.status--on[data-status="client"] { border-color: rgba(61, 220, 151, .4); background: var(--ok-soft); color: var(--ok); }
.status--on[data-status="refused"] { border-color: rgba(239, 107, 118, .4); background: rgba(239, 107, 118, .1); color: var(--bad); }

.note-area {
  width: 100%; min-height: 88px; resize: vertical; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r);
  color: var(--ink); font: inherit; font-size: 13.5px;
}
.note-area:focus { outline: none; border-color: var(--acc); }

.toast-host {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: grid; gap: 8px; z-index: 200; pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: var(--sh-2); font-size: 13px; color: var(--ink);
  animation: toastIn .2s var(--ease);
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   АДАПТИВ
   ============================================================ */
.mobile-only { display: none !important; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: var(--rail) minmax(0, 1fr); }
  .panel__head h1 { order: 1; }
  .panel__head #filtersReset { order: 2; margin-left: auto; }
  .panel__head #filtersClose { order: 3; }
  .panel {
    position: fixed; z-index: 60; inset: 0 auto 0 0;
    width: min(340px, 88vw);
    transform: translateX(-102%);
    transition: transform .22s var(--ease);
    box-shadow: var(--sh-3);
  }
  body.filters-open .panel { transform: none; }
  body.filters-open::after {
    content: ""; position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5);
  }
}

@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; inset: auto 0 0 0; z-index: 40;
    flex-direction: row; justify-content: space-around;
    height: 62px; padding: 6px 4px;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .rail__mark, .rail__spacer, .rail__bottom { display: none; }
  .rail__nav { display: flex; justify-content: space-around; }
  .rail__btn { width: auto; min-width: 64px; }
  .mobile-only.icon-btn { display: inline-grid !important; }
  .mobile-only.rail__btn { display: grid !important; }
  .content { padding: 14px 14px 90px; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .gate { grid-template-columns: 1fr; }
  .gate__pitch { padding: 32px 22px 8px; border-right: 0; border-bottom: 0; gap: 16px; }
  .gate__pitch::after { display: none; }
  .gate__proof { display: none; }
  .gate__stats { gap: 20px; }
  .gate__stat b { font-size: 20px; }
  .gate__panel { padding: 20px 16px 40px; }
  .auth-card { padding: 22px; }
  .leads { grid-template-columns: 1fr; }
  .stat { flex: 1 1 100px; padding: 10px 12px; }
  .stat b { font-size: 17px; }
  .plan-chip .bar, .plan-chip .up { display: none; }
  .avatar { display: none; }
  .toast-host { bottom: 76px; }
  .topbar { min-height: 54px; }
  .tab { padding: 0 9px; font-size: 13px; }
  .search-wrap { flex: 1 1 100%; }
  .dialog-on-mobile-full { max-width: 100vw; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
