:root {
  --paper: #ffffff;
  --ink: #141414;
  --ink-2: #343432;
  --muted: #8a8a86;
  --muted-2: #6f6f6a;
  --line: #e8e8e5;
  --line-2: #dfded9;
  --soft: #f5f5f3;
  --soft-2: #fafaf8;
  --blue: #3978f6;
  --telegram: #229ed9;
  --green: #2f8f5b;
  --green-soft: #eaf5ee;
  --amber: #a26413;
  --amber-soft: #fbf2e4;
  --red: #c2413a;
  --red-soft: #fcecea;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 5px 16px rgba(25, 25, 22, .035);
  --shadow-lg: 0 18px 50px rgba(25, 25, 22, .12);
  --sidebar: 248px;
  --serif: "Source Serif 4 Hero", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

@font-face { font-family: "Inter"; src: url("/fonts/inter-ru-en-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Source Serif 4 Hero"; src: url("/fonts/source-serif-4-600-italic.woff2") format("woff2"); font-style: italic; font-weight: 600; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); font-size: 14px; line-height: 1.45; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
h1, h2, h3 { margin: 0; letter-spacing: -.045em; font-weight: 560; }
p { margin: 0; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 600; letter-spacing: -.05em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- boot and spinners ---------- */
.boot { min-height: 100svh; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; display: inline-block; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.light { border-color: rgba(255,255,255,.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { position: relative; overflow: hidden; background: var(--soft); border-radius: 8px; }
.skeleton::after { position: absolute; inset: 0; content: ""; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: sheen 1.3s infinite; }
@keyframes sheen { to { transform: translateX(100%); } }

/* ---------- buttons and inputs ---------- */
.btn { min-height: 40px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.secondary { border-color: #d4d3ce; background: #fff; color: var(--ink); }
.btn.secondary:hover { border-color: #b7b6b0; background: var(--soft-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { border-color: var(--red); background: var(--red); }
.btn.telegram { border-color: var(--telegram); background: var(--telegram); }
.btn.telegram:hover { background: #168dcc; border-color: #168dcc; }
.btn.lg { min-height: 50px; padding: 14px 24px; font-size: 14px; }
.btn.sm { min-height: 32px; padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
.link { padding: 0; border: 0; background: none; color: var(--ink); font-size: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #c9c8c2; cursor: pointer; }
.link:hover { text-decoration-color: var(--ink); }
.link.muted { color: var(--muted); }

.field { display: grid; gap: 7px; }
.field > span, .label { font-size: 12px; font-weight: 550; color: var(--muted-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error-text { font-size: 12px; color: var(--red); }
.input, .textarea, .select { width: 100%; min-height: 44px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus, .textarea:focus, .select:focus { border-color: #b9b8b2; box-shadow: 0 0 0 4px rgba(20,20,20,.06); }
.input.invalid, .textarea.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(194,65,58,.08); }
.textarea { min-height: 96px; line-height: 1.55; resize: vertical; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-affix:focus-within { border-color: #b9b8b2; box-shadow: 0 0 0 4px rgba(20,20,20,.06); }
.input-affix input { flex: 1; min-width: 0; padding: 11px 13px; border: 0; outline: none; background: transparent; font-size: 14px; }
.input-affix .affix { padding: 0 13px; display: flex; align-items: center; color: var(--muted); background: var(--soft-2); border-left: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.input-affix .affix.left { border-left: 0; border-right: 1px solid var(--line); }
.counter { font-size: 11px; color: var(--muted); text-align: right; }
.counter.over { color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 32px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; font-size: 12px; font-weight: 550; cursor: pointer; }
.chip:hover { border-color: #c4c3bd; }
.chip.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--soft); }
.segmented button { min-height: 30px; padding: 5px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted-2); font-size: 12px; font-weight: 600; cursor: pointer; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: var(--soft); color: var(--muted-2); font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: #eaf1fe; color: var(--blue); }
.badge.dark { background: var(--ink); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- auth ---------- */
.auth { min-height: 100svh; padding: 24px 16px; display: grid; grid-template-rows: auto 1fr auto; }
.auth-top { width: min(100%, 1180px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; min-height: 54px; }
.wordmark { font-size: 18px; font-weight: 650; letter-spacing: -.03em; text-decoration: none; display: inline-flex; align-items: baseline; gap: 6px; }
.wordmark span { color: var(--muted); font-weight: 450; }
.auth-main { display: grid; place-items: center; padding: 32px 0; }
.auth-card { width: min(100%, 460px); text-align: center; }
.auth-card h1 { font-size: clamp(38px, 6vw, 56px); line-height: 1; letter-spacing: -.055em; }
.auth-card h1 .serif { display: block; }
.auth-card > p { margin: 18px auto 0; max-width: 380px; color: var(--muted-2); font-size: 15px; line-height: 1.5; }
.auth-actions { margin-top: 34px; display: grid; gap: 12px; justify-items: center; }
.auth-actions .btn { min-width: 260px; }
.auth-widget { min-height: 40px; display: flex; justify-content: center; }
.auth-divider { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-wait { margin-top: 24px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft-2); display: grid; gap: 10px; justify-items: center; color: var(--muted-2); font-size: 13px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 12px; }
.auth-points { margin: 38px auto 0; display: grid; gap: 10px; text-align: left; max-width: 360px; }
.auth-points div { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: var(--muted-2); font-size: 13px; }
.auth-points svg { width: 18px; height: 18px; margin-top: 1px; }

/* ---------- shell ---------- */
.shell { min-height: 100svh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); background: linear-gradient(to right, var(--soft-2) var(--sidebar), var(--paper) var(--sidebar)); }
.sidebar { position: sticky; top: 0; height: 100svh; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; background: var(--soft-2); overflow-y: auto; }
.content-col { min-width: 0; min-height: 100svh; border-left: 1px solid var(--line); background: var(--paper); }
.main:focus { outline: none; }
.sidebar .wordmark { padding: 4px 10px; font-size: 17px; }
.service-pill { margin: 0 4px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-decoration: none; min-width: 0; }
.service-pill .avatar { width: 30px; height: 30px; flex: 0 0 30px; }
.service-pill div { min-width: 0; }
.service-pill strong { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-pill small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.nav { display: grid; gap: 2px; }
.nav a { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 11px; border-radius: 9px; color: var(--muted-2); font-size: 13px; font-weight: 550; text-decoration: none; }
.nav a svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav a:hover { background: #f0f0ec; color: var(--ink); }
.nav a.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--line); }
.nav a .count { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 10px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.sidebar-foot .avatar { width: 32px; height: 32px; }
.sidebar-foot div { min-width: 0; flex: 1; }
.sidebar-foot strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot small { color: var(--muted); font-size: 11px; }
.env-badge { margin: 0 10px; align-self: flex-start; }

.mobile-bar { display: none; }
.main { min-width: 0; padding: 28px clamp(16px, 3.4vw, 48px) 80px; }
.page { width: min(100%, 1120px); margin: 0 auto; }
.page-head { margin-bottom: 26px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(28px, 3vw, 38px); line-height: 1.05; letter-spacing: -.05em; }
.page-head p { margin-top: 8px; color: var(--muted-2); font-size: 14px; max-width: 640px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--soft); display: inline-grid; place-items: center; color: var(--muted-2); font-weight: 650; font-size: 13px; overflow: hidden; flex: 0 0 auto; }
.avatar.lg { width: 72px; height: 72px; font-size: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- cards and grids ---------- */
.card { padding: clamp(18px, 2vw, 24px); border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.card.soft { background: var(--soft-2); box-shadow: none; }
.card.flat { box-shadow: none; }
.card-head { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2, .card h2 { font-size: 18px; letter-spacing: -.035em; font-weight: 580; }
.card-head p { color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 16px; }
.stack.sm { gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

.kpi { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); display: grid; gap: 6px; align-content: start; min-height: 132px; }
.kpi .label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 550; }
.kpi .label svg { width: 15px; height: 15px; }
.kpi .value { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(30px, 2.6vw, 38px); line-height: 1.05; letter-spacing: -.05em; }
.kpi .value small { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--muted); letter-spacing: 0; font-weight: 450; }
.kpi .sub { color: var(--muted-2); font-size: 12px; }
.delta { font-size: 12px; font-weight: 600; color: var(--muted); }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }

.hero-card { padding: clamp(22px, 3vw, 34px); border-radius: 20px; background: var(--ink); color: #fff; display: grid; gap: 18px; position: relative; overflow: hidden; }
.hero-card::after { position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; content: ""; border-radius: 50%; background: radial-gradient(circle, rgba(57,120,246,.45), transparent 70%); pointer-events: none; }
.hero-card .label { color: rgba(255,255,255,.65); }
.hero-card .big { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(44px, 5vw, 64px); line-height: 1; letter-spacing: -.055em; }
.hero-card .btn { background: #fff; color: var(--ink); border-color: #fff; }
.hero-card .btn:hover { background: #f1f1ee; }
.hero-card .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.hero-card p { color: rgba(255,255,255,.75); }
.hero-card .delta { color: rgba(255,255,255,.85); }
.hero-card .delta.up { color: #93e2b4; }
.hero-card .delta.down { color: #ffb4ad; }

.notice { padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; background: var(--soft); color: var(--muted-2); font-size: 13px; line-height: 1.5; }
.notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.notice.green { background: var(--green-soft); color: #25603f; }
.notice.amber { background: var(--amber-soft); color: #7a4c10; }
.notice.red { background: var(--red-soft); color: #8f2d27; }
.notice.blue { background: #eef3fe; color: #2a57b3; }
.notice strong { color: inherit; }

.empty { padding: 44px 20px; display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--muted-2); }
.empty svg { width: 34px; height: 34px; color: #c9c8c2; }
.empty h3 { font-size: 17px; color: var(--ink); letter-spacing: -.03em; }
.empty p { max-width: 380px; font-size: 13px; }
.error-state { padding: 36px 20px; display: grid; justify-items: center; gap: 12px; text-align: center; }
.error-state p { color: var(--muted-2); max-width: 420px; }

.checklist { display: grid; gap: 4px; }
.check { padding: 10px 4px; display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .tick { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #d4d3ce; display: grid; place-items: center; }
.check.done .tick { background: var(--green); border-color: var(--green); color: #fff; }
.check .tick svg { width: 13px; height: 13px; }
.check strong { font-size: 13px; font-weight: 580; display: block; }
.check small { color: var(--muted); font-size: 12px; }
.check.done strong { color: var(--muted-2); }

.progress { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .4s ease; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { padding: 11px 14px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; background: var(--soft-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.person { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.person .avatar { width: 34px; height: 34px; font-size: 12px; }
.person strong { display: block; font-weight: 580; }
.person small { color: var(--muted); font-size: 12px; }
.usage { width: 90px; display: grid; gap: 4px; }
.usage small { color: var(--muted); font-size: 11px; }
.pager { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.pager .row { gap: 6px; }
.toolbar { margin-bottom: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .search { flex: 1 1 260px; position: relative; }
.toolbar .search input { padding-left: 38px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.cards-list { display: none; }

/* ---------- tariffs ---------- */
.plan-card { padding: clamp(22px, 2.4vw, 30px); border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); display: grid; gap: 18px; align-content: start; }
.plan-card.featured { border-color: #cecdc7; box-shadow: 0 12px 34px rgba(25, 25, 22, .08); }
.plan-card.soon { background: var(--soft-2); box-shadow: none; color: var(--muted-2); }
.plan-card h2 { font-size: 20px; }
.plan-price { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(40px, 4vw, 52px); line-height: 1; letter-spacing: -.055em; }
.plan-price small { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--muted); letter-spacing: 0; font-weight: 450; }
.range { width: 100%; accent-color: var(--ink); }
.split-bar { height: 10px; border-radius: 999px; background: var(--soft); overflow: hidden; display: flex; }
.split-bar i { display: block; height: 100%; }
.split-bar i.you { background: var(--ink); }
.split-bar i.referrer { background: #9fa0a8; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted-2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.earn { padding: 14px 16px; border-radius: 12px; background: var(--soft); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.earn strong { font-family: var(--serif); font-style: italic; font-size: 26px; letter-spacing: -.04em; white-space: nowrap; }
.earn span { min-width: 0; }

/* ---------- onboarding ---------- */
.onb { min-height: 100svh; display: grid; grid-template-rows: auto 1fr; }
.onb-top { position: sticky; top: 0; z-index: 20; padding: 14px clamp(16px, 3vw, 36px); display: flex; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(10px); }
.steps { flex: 1; display: flex; justify-content: center; gap: 6px; }
.steps button { padding: 7px 12px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.steps button .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font-size: 11px; }
.steps button.active { color: var(--ink); background: var(--soft); }
.steps button.active .n { background: var(--ink); color: #fff; }
.steps button.done .n { background: var(--green); color: #fff; }
.steps button:disabled { cursor: default; opacity: .6; }
.save-state { color: var(--muted); font-size: 12px; min-width: 90px; text-align: right; }
.onb-body { width: min(100%, 1180px); margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 36px) 110px; display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.onb-body.single { grid-template-columns: minmax(0, 720px); justify-content: center; }
.onb-form { display: grid; gap: 22px; }
.onb-form > header h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.03; letter-spacing: -.055em; }
.onb-form > header p { margin-top: 12px; color: var(--muted-2); font-size: 15px; max-width: 560px; }
.onb-preview { position: sticky; top: 90px; }
.onb-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px clamp(16px, 3vw, 36px); display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(10px); }
.onb-nav .row { gap: 8px; }
.welcome { text-align: center; display: grid; gap: 22px; justify-items: center; padding-top: 4vh; }
.welcome h1 { font-size: clamp(40px, 6vw, 72px); line-height: .98; letter-spacing: -.06em; max-width: 860px; }
.welcome > p { max-width: 560px; color: var(--muted-2); font-size: 16px; }
.welcome-steps { width: min(100%, 860px); margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: left; }
.welcome-steps div { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; }
.welcome-steps b { display: block; font-family: var(--serif); font-style: italic; font-size: 28px; letter-spacing: -.05em; margin-bottom: 8px; }
.welcome-steps strong { display: block; font-size: 14px; margin-bottom: 4px; }
.welcome-steps span { color: var(--muted-2); font-size: 13px; }
.avatar-drop { display: flex; align-items: center; gap: 16px; }
.avatar-drop .avatar { width: 76px; height: 76px; border: 1px dashed #cfcec8; background: var(--soft-2); }
.avatar-drop .avatar svg { width: 22px; height: 22px; }
.text-item { border: 1px solid var(--line-2); border-radius: 14px; background: #fff; overflow: hidden; }
.text-item > button { width: 100%; padding: 14px 16px; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; }
.text-item > button strong { font-size: 14px; font-weight: 580; flex: 1; }
.text-item > button .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.text-item.open > button .chev { transform: rotate(180deg); }
.text-item .text-body { padding: 0 16px 16px; display: grid; gap: 10px; }
.text-item.focus { border-color: #b9b8b2; box-shadow: 0 0 0 4px rgba(20,20,20,.04); }
.var-row { display: flex; flex-wrap: wrap; gap: 6px; }
.var-row button { padding: 3px 8px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--soft-2); color: var(--muted-2); font-size: 11px; cursor: pointer; }
.bot-create { display: grid; gap: 14px; }
.bot-status { padding: 16px; display: flex; gap: 14px; align-items: center; border: 1px solid var(--line-2); border-radius: 14px; background: var(--soft-2); }
.bot-status.ok { border-color: #cfe5d7; background: var(--green-soft); }
.bot-status .avatar { width: 44px; height: 44px; }
.steps-list { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps-list li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-size: 13px; color: var(--muted-2); }
.steps-list li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink); font-weight: 650; font-size: 12px; }
.steps-list li strong { color: var(--ink); display: block; font-size: 14px; margin-bottom: 2px; }

.provision { min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.provision-card { width: min(100%, 520px); display: grid; gap: 26px; text-align: center; }
.provision-card h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1; letter-spacing: -.055em; }
.provision-steps { display: grid; gap: 4px; text-align: left; }
.provision-steps div { padding: 12px 14px; display: flex; align-items: center; gap: 12px; border-radius: 12px; color: var(--muted); font-size: 14px; transition: background .3s, color .3s; }
.provision-steps div.active { background: var(--soft); color: var(--ink); }
.provision-steps div.done { color: var(--ink); }
.provision-steps .ico { width: 22px; height: 22px; display: grid; place-items: center; }
.provision-steps .ico svg { width: 18px; height: 18px; color: var(--green); }
.success-mark { width: 76px; height: 76px; margin: 0 auto; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
.success-mark svg { width: 36px; height: 36px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

/* ---------- telegram preview ---------- */
.phone { border: 1px solid var(--line-2); border-radius: 26px; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden; }
.phone-head { padding: 12px 14px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: #fff; }
.phone-head .avatar { width: 38px; height: 38px; font-size: 14px; background: linear-gradient(135deg, #7eb6ff, #3978f6); color: #fff; }
.phone-head strong { display: block; font-size: 14px; font-weight: 600; }
.phone-head small { color: var(--muted); font-size: 11px; }
.phone-chat { height: 470px; padding: 14px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; background: #dfe7ee linear-gradient(160deg, #e5ecd8 0%, #cfe0e6 55%, #d9d5ea 100%); }
.bubble { max-width: 88%; padding: 8px 11px 7px; border-radius: 14px 14px 14px 4px; background: #fff; font-size: 13px; line-height: 1.42; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.me { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #e1f7cf; }
.bubble blockquote { margin: 4px 0; padding: 2px 0 2px 8px; border-left: 3px solid var(--telegram); color: #333; }
.bubble code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(0,0,0,.05); padding: 0 3px; border-radius: 3px; }
.kb { max-width: 88%; display: grid; gap: 4px; }
.kb .kb-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.kb span { padding: 8px 10px; border-radius: 10px; background: rgba(40, 70, 90, .28); color: #fff; font-size: 12px; font-weight: 600; text-align: center; backdrop-filter: blur(4px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bot-intro { margin: auto 8px; padding: 14px; border-radius: 14px; background: rgba(0,0,0,.18); color: #fff; font-size: 13px; text-align: center; white-space: pre-wrap; }
.bot-intro strong { display: block; margin-bottom: 6px; }
.phone-foot { padding: 10px 12px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12px; background: #fff; }
.phone-foot .start { flex: 1; padding: 10px; border-radius: 10px; background: var(--soft); color: var(--telegram); font-weight: 650; text-align: center; }
.preview-tabs { margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- modal and toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 16px; display: grid; place-items: center; background: rgba(20,20,20,.38); animation: fade .15s; }
.modal { width: min(100%, 460px); max-height: calc(100svh - 32px); overflow: auto; padding: 24px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-lg); display: grid; gap: 16px; animation: rise .2s cubic-bezier(.2,.9,.3,1); }
.modal h2 { font-size: 22px; }
.modal p { color: var(--muted-2); }
.modal .row.end { justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.toasts { position: fixed; z-index: 200; top: 16px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; }
.toast { min-width: 240px; max-width: 360px; padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); animation: rise .2s; }
.toast.error { background: var(--red); }
.toast svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }

.save-bar { position: sticky; bottom: 12px; z-index: 10; margin-top: 16px; padding: 12px 14px 12px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); animation: rise .2s; }
.save-bar .btn { background: #fff; color: var(--ink); border-color: #fff; }
.save-bar .btn.ghost { background: transparent; color: #fff; border-color: transparent; }

.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 13px; color: var(--muted-2); background: var(--soft-2); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.tabs { margin-bottom: 18px; display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.option-card { padding: 20px; border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; display: grid; gap: 12px; align-content: start; cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s; }
.option-card:hover { border-color: #c4c3bd; }
.option-card.active { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20,20,20,.06); }
.option-card svg { width: 22px; height: 22px; }
.option-card strong { font-size: 15px; }
.option-card span { color: var(--muted-2); font-size: 13px; }
.timeline { display: grid; gap: 0; }
.timeline .item { padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 8px; border-bottom: 1px solid var(--line); }
.timeline .item:last-child { border-bottom: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onb-body { grid-template-columns: minmax(0, 1fr); }
  .onb-preview { position: static; order: -1; }
  .onb-preview .phone-chat { height: 360px; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; background: var(--paper); }
  .content-col { border-left: 0; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: min(86vw, 300px); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); background: #fff; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open::after { position: fixed; inset: 0; z-index: 50; content: ""; background: rgba(20,20,20,.3); }
  .mobile-bar { position: sticky; top: 0; z-index: 40; min-height: 56px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
  .mobile-bar strong { flex: 1; font-size: 15px; font-weight: 620; }
  .icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
  .icon-btn svg { width: 22px; height: 22px; }
  .main { padding: 20px 16px 80px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .welcome-steps { grid-template-columns: 1fr; }
  .steps button .label-text { display: none; }
  .table-wrap.responsive { display: none; }
  .cards-list { display: grid; gap: 10px; }
  .list-card { padding: 14px; border: 1px solid var(--line-2); border-radius: 14px; background: #fff; display: grid; gap: 10px; }
  .list-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted-2); font-size: 12px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
}
@media (max-width: 560px) {
  .grid.four { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; min-height: 112px; }
  .kpi .value { font-size: 26px; }
  .page-head h1 { font-size: 28px; }
  .onb-top .wordmark { display: none; }
  .save-state { display: none; }
  .btn.lg { width: 100%; }
  .toasts { width: calc(100vw - 32px); }
  .toast { max-width: none; width: 100%; }
  .copy-field { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- form-style questions ---------- */
.lead { color: var(--ink); font-size: 14px; line-height: 1.55; }
.form { border: 1px solid var(--line-2); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.question { padding: 22px 24px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); transition: background .15s, box-shadow .15s; }
.question:last-child { border-bottom: 0; }
.question.focus { background: var(--soft-2); box-shadow: inset 3px 0 0 var(--ink); }
.question-title { font-size: 15px; font-weight: 580; letter-spacing: -.02em; }
.question .textarea { min-height: 52px; overflow: hidden; resize: none; }
.question-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.question-foot .btn { margin-left: -12px; }
.form-section-title { margin: 8px 0 -6px; font-size: 17px; font-weight: 580; letter-spacing: -.03em; }
.bot-create > .segmented { justify-self: start; }
.preset-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.preset-grid .option-card { padding: 16px; min-height: 96px; }
.preset-grid .option-card strong { font-size: 15px; }
.preset-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-2); }
@media (max-width: 900px) { .preset-grid { grid-template-columns: 1fr 1fr; } .question { padding: 18px 16px; } }

/* ---------- sidebar long names ---------- */
.service-pill { overflow: hidden; }
.service-pill div { flex: 1; }
.service-pill small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-foot div, .sidebar-foot small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- income card, after the Pro plan of the landing ---------- */
.income-card { position: relative; overflow: hidden; isolation: isolate; padding: clamp(24px, 2.6vw, 34px); display: grid; gap: 14px; align-content: start; border: 1px solid #cecdc7; border-radius: var(--radius); background: rgba(255, 255, 255, .72); box-shadow: 0 12px 34px rgba(25, 25, 22, .08); }
.income-card > * { position: relative; z-index: 2; }
.income-card .art { position: absolute; z-index: 0; inset: 0; background: url("/media/pricing-motion-crop.webp") 50% 50% / cover no-repeat; -webkit-mask-image: url("/media/mask-41.png"); mask-image: url("/media/mask-41.png"); -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; mask-mode: alpha; pointer-events: none; }
.income-card .label { color: var(--ink); font-size: 16px; font-weight: 520; letter-spacing: -.03em; }
.income-card .big { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: clamp(44px, 4.6vw, 60px); line-height: 1; letter-spacing: -.055em; }
.income-card .big small { font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--muted); letter-spacing: 0; font-weight: 450; }
.income-card p { color: var(--muted-2); font-size: 14px; max-width: 420px; }
.income-card .btn { justify-self: start; min-width: 200px; border-radius: 9px; }
.service-pill small .dot { margin-right: 5px; vertical-align: 1px; }

/* Side-by-side plans line up: descriptions of different length must not shift the price and slider below. */
.plan-card > p.muted { min-height: calc(3 * 1.45em); margin: 0; }
.earn span { line-height: 1.3; }
.text-group { display: grid; gap: 12px; }
.text-group + .text-group { margin-top: 28px; }
.text-group h2 { font-size: 19px; letter-spacing: -.03em; }
.text-group > p { margin: -4px 0 4px; max-width: 62ch; }
