/* ── LK CRM Импульс — design tokens (v0.1 design pass) ──────────────────── */

:root {
  --ink: #0B0B0A;
  --ink-2: #2A2A26;
  --ink-3: #525049;
  --muted: #8F8C82;
  --muted-2: #B7B4AB;
  --line: #E6E2D8;
  --line-2: #EFECE4;
  --paper: #F2EFE8;
  --paper-2: #ECE8DE;
  --card: #FFFFFF;

  --impulse: #D4F250;
  --impulse-ink: #1B2A05;
  --champion: #FF5B2E;
  --champion-ink: #FFFFFF;

  --success: #1F8A5B;
  --success-bg: #E4F4EC;
  --warn: #C77A14;
  --warn-bg: #F8EAD3;
  --danger: #D14A2F;
  --danger-bg: #FBE5DE;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* legacy aliases для совместимости со старой разметкой */
  --accent: var(--ink);
  --accent-dark: var(--ink-2);
  --accent-soft: var(--paper-2);
  --bg: var(--paper);
  --surface: var(--card);
  --surface-elev: var(--card);
  --text: var(--ink);
  --border: var(--line);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 30px -12px rgba(0,0,0,.25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px; line-height: 1.45;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#root { min-height: 100vh; }

/* ── Layout containers ──────────────────────────────────────────────────── */

.container {
  max-width: 480px; margin: 0 auto;
  padding-top: calc(16px + env(safe-area-inset-top));
  padding-right: 20px; padding-left: 20px;
  padding-bottom: calc(110px + env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh; background: var(--paper);
}
.container-no-nav {
  max-width: 480px; margin: 0 auto;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-right: 20px; padding-left: 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  min-height: 100vh; min-height: 100dvh; background: var(--paper);
}

@media (min-width: 768px) {
  .container, .container-no-nav { box-shadow: 0 0 32px rgba(0,0,0,0.06); }
}

/* ── Typography ─────────────────────────────────────────────────────────── */

.h1 {
  font-size: 28px; font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.05; margin: 4px 0 18px;
}
.h2 {
  font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.15; margin: 18px 0 10px;
}
.h3 {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  margin: 22px 0 10px;
}
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.mono { font-family: var(--font-mono); }

.page-title {
  font-size: 28px; font-weight: 600; letter-spacing: -0.025em;
  line-height: 1; margin: 4px 0 18px;
}
.page-title small {
  display: block; font-size: 13px; color: var(--muted);
  font-weight: 400; letter-spacing: 0; margin-top: 6px;
}

.section-h {
  font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
  margin: 22px 0 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.section-h .link {
  font-size: 12px; font-weight: 500; color: var(--ink-2);
  text-transform: none; letter-spacing: 0; cursor: pointer;
}
.section-h .link:hover { color: var(--ink); }

/* ── Header (greet + actions) ───────────────────────────────────────────── */

.hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0 16px;
}
.hd-hi {
  font-size: 12px; color: var(--muted);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.hd-name {
  font-size: 24px; font-weight: 600; letter-spacing: -0.02em;
  line-height: 1.1; margin-top: 2px;
}
.hd-actions { display: flex; gap: 8px; }
.hd-btn {
  position: relative;
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); cursor: pointer;
  transition: background .15s, transform .1s;
  font-family: inherit; font-size: 12px; font-weight: 600;
}
.hd-btn:hover { background: var(--paper-2); }
.hd-btn:active { transform: scale(.96); }
.hd-btn.ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.hd-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--champion); border-radius: 50%;
  border: 2px solid var(--card);
}

/* ── Cards ──────────────────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 10px;
  box-shadow: none;
}
.card-flat {
  background: var(--card);
  border-radius: var(--r-md);
  padding: 14px 16px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--ink);
  background: var(--ink); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em; cursor: pointer;
  transition: transform .08s, background .15s, color .15s, border-color .15s;
  user-select: none; white-space: nowrap;
  text-decoration: none;   /* для <a class="btn"> */
}
button:hover, .btn:hover { background: #1F1F1B; }
button:active, .btn:active { transform: scale(.985); }
button:disabled, .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block, .btn.full { width: 100%; }
.btn.lg { height: 54px; font-size: 16px; padding: 0 28px; }
.btn.sm { height: 36px; font-size: 13px; padding: 0 16px; }

/* .btn-secondary как самостоятельный класс на <a>/<div>: подключаем базовые
   стили кнопки. (Изначально базовые стили были только для button + .btn.) */
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 48px; padding: 0 22px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: transparent; color: var(--ink);
  font-family: inherit; font-size: 15px; font-weight: 500;
  letter-spacing: -0.005em; cursor: pointer;
  transition: transform .08s, background .15s, color .15s, border-color .15s;
  user-select: none; white-space: nowrap;
  text-decoration: none;
}
.btn-secondary:hover, .btn.ghost:hover { background: var(--paper); }
/* Кнопка-«перенос» — для длинных подписей, которые не лезут в одну строку
   (например, «Открыть оферту в новой вкладке» на узком мобайле). */
.btn.btn-wrap, .btn-secondary.btn-wrap {
  white-space: normal; height: auto; min-height: 48px;
  padding-top: 12px; padding-bottom: 12px; line-height: 1.3;
  text-align: center;
}
.btn.ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}

.btn-ghost {
  background: transparent; color: var(--ink-2); border: 0;
  padding: 8px 12px; height: auto; font-weight: 500; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--muted-2);
}
.btn-ghost:hover { color: var(--ink); background: transparent; }

.btn-danger {
  background: transparent; color: var(--danger); border-color: var(--line);
}
.btn-danger:hover { background: var(--danger-bg); }

.btn.lime {
  background: var(--impulse); border-color: var(--impulse); color: var(--impulse-ink);
}
.btn.lime:hover { background: #C6E739; }

.btn.ghost-light {
  background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.18);
}
.btn.ghost-light:hover { background: rgba(255,255,255,.18); }

.link-btn {
  background: none; border: none;
  color: var(--ink-2); font-size: 13px; font-weight: 500;
  cursor: pointer; padding: 4px 0; height: auto;
  text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--muted-2);
  letter-spacing: 0;
}
.link-btn:hover { color: var(--ink); background: transparent; }

/* ── Form fields ────────────────────────────────────────────────────────── */

input, select, textarea {
  width: 100%; height: 52px; padding: 0 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  font-family: inherit; font-size: 15px;
  color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
textarea { height: auto; padding: 14px 16px; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input[type="checkbox"] { width: auto; height: auto; }

label.field { display: block; margin-bottom: 12px; }
label.field > span {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px; letter-spacing: 0.01em;
}

.fld { display: block; margin: 0 0 12px; }
.fld-lbl {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--muted); margin-bottom: 6px; letter-spacing: 0.01em;
}

/* ── Layout helpers ─────────────────────────────────────────────────────── */

.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row-spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.flex-1 { flex: 1; }
.center { display: flex; align-items: center; justify-content: center; }

/* ── Bottom nav ─────────────────────────────────────────────────────────── */

.bottom-nav, .bn {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 456px;
  height: 64px;
  background: var(--ink); color: #fff;
  border-radius: 26px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px; gap: 4px;
  z-index: 50;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,.28);
}
.bn-item {
  position: relative;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  border-radius: 20px;
  color: rgba(255,255,255,.55);
  font-size: 10px; font-weight: 500; letter-spacing: 0.02em;
  cursor: pointer;
  transition: color .15s, background .15s;
  user-select: none;
  background: transparent; border: 0; padding: 0; height: auto;
}
.bn-item:hover {
  color: rgba(255,255,255,.85); background: transparent;
}
.bn-item.active {
  background: var(--impulse); color: var(--impulse-ink);
}
.bn-item .bn-icon { display: none; }
.bn-item svg { width: 22px; height: 22px; stroke-width: 1.7; }
.bn-item .dot {
  position: absolute;
  top: 8px; right: calc(50% - 14px);
  width: 7px; height: 7px;
  background: var(--champion); border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ink);
}

/* ── Beneficiary picker ─────────────────────────────────────────────────── */

.beneficiary-picker, .bp {
  display: flex; gap: 6px; overflow-x: auto;
  margin: 0 -20px 16px;
  padding: 0 20px 4px;
  scroll-snap-type: x mandatory;
}
.beneficiary-picker::-webkit-scrollbar,
.bp::-webkit-scrollbar { display: none; }

.beneficiary-chip, .bp-chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer; transition: all .15s;
  scroll-snap-align: start; white-space: nowrap;
  height: auto;
}
.beneficiary-chip:hover, .bp-chip:hover { background: var(--paper-2); }
.beneficiary-chip.active, .bp-chip.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.beneficiary-chip.active .bp-av,
.bp-chip.active .bp-av {
  background: var(--impulse); color: var(--impulse-ink);
}
.bp-chip.bp-add, .beneficiary-chip.bp-add {
  padding: 8px 14px; color: var(--muted); font-weight: 500;
}
.bp-av {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--paper-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: var(--ink-2);
  letter-spacing: 0; flex: 0 0 auto;
}

/* ── Subscription cards ─────────────────────────────────────────────────── */

.sub {
  position: relative;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 20px; overflow: hidden;
  margin-bottom: 10px;
}
.sub.hero {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.sub.attn {
  background: var(--champion); color: #fff; border-color: var(--champion);
}
.sub-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sub-tag::before {
  content: ""; width: 8px; height: 8px;
  border-radius: 50%; background: var(--impulse);
}
.sub-tag.champion::before { background: var(--champion); }
.sub.hero .sub-tag { color: var(--impulse); }
.sub.attn .sub-tag::before { background: #fff; }

.sub-title {
  font-size: 18px; font-weight: 600; letter-spacing: -0.015em;
  margin-top: 8px; line-height: 1.2;
}

.sub-big {
  font-family: var(--font-mono);
  display: flex; align-items: baseline; gap: 4px;
  margin-top: 14px;
}
.sub-big .n {
  font-size: 72px; font-weight: 500;
  letter-spacing: -0.05em; line-height: 0.85;
}
.sub-big .of {
  font-size: 18px; color: var(--muted-2); letter-spacing: -0.02em;
}
.sub.hero .sub-big .of { color: rgba(255,255,255,.55); }
.sub.attn .sub-big .of { color: rgba(255,255,255,.65); }

.sub-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px; font-size: 13px; color: var(--muted);
}
.sub.hero .sub-meta { color: rgba(255,255,255,.65); }
.sub.attn .sub-meta { color: rgba(255,255,255,.78); }

.sub-prog {
  position: relative; margin-top: 14px;
  height: 4px; background: var(--line-2);
  border-radius: 2px; overflow: hidden;
}
.sub-prog b {
  position: absolute; inset: 0 auto 0 0;
  background: var(--ink); border-radius: 2px;
}
.sub.hero .sub-prog { background: rgba(255,255,255,.16); }
.sub.hero .sub-prog b { background: var(--impulse); }
.sub.attn .sub-prog { background: rgba(255,255,255,.25); }
.sub.attn .sub-prog b { background: #fff; }

.sub-cta { margin-top: 16px; display: flex; gap: 8px; }

/* legacy subscription-card */
.subscription-card {
  background: var(--ink); color: #fff;
  border-radius: var(--r-xl); padding: 20px;
  margin-bottom: 10px; border: 1px solid var(--ink);
}
.subscription-card.champion {
  background: var(--champion); border-color: var(--champion); color: #fff;
}
.sc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.sc-title { font-weight: 600; font-size: 18px; letter-spacing: -0.015em; }
.sc-branch { font-size: 11px; opacity: 0.7; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.sc-progress {
  background: rgba(255,255,255,.16); height: 4px;
  border-radius: 2px; margin: 14px 0 8px; overflow: hidden;
}
.sc-progress-fill {
  background: var(--impulse); height: 100%; border-radius: 2px;
  transition: width 0.3s;
}
.subscription-card.champion .sc-progress { background: rgba(255,255,255,.25); }
.subscription-card.champion .sc-progress-fill { background: #fff; }
.sc-stats {
  display: flex; justify-content: space-between;
  font-size: 13px; opacity: 0.7; margin-top: 4px;
}

/* ── Lesson row ─────────────────────────────────────────────────────────── */

.lesson, .lesson-row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: grid; grid-template-columns: 8px 60px 1fr;
  align-items: center; gap: 14px;
  margin-bottom: 8px;
}
.lesson-time {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 500;
  letter-spacing: -0.03em; color: var(--ink); line-height: 1;
}
.lesson-time small {
  display: block;
  font-size: 11px; color: var(--muted);
  font-weight: 400; margin-top: 4px;
  letter-spacing: 0;
}
.lesson-body, .lesson-info { min-width: 0; }
.lesson-title, .lesson-disc {
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.01em; line-height: 1.2;
}
.lesson-meta {
  font-size: 12px; color: var(--muted);
  margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.flag {
  flex: 0 0 auto; width: 4px; height: 36px;
  border-radius: 4px; background: var(--impulse);
  justify-self: center;
}
.flag.champion { background: var(--champion); }

/* dark lesson variant — выделенная запись */
.lesson.ink {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.lesson.ink .lesson-time { color: #fff; }
.lesson.ink .lesson-time small { color: rgba(255,255,255,.6); }
.lesson.ink .lesson-title { color: var(--impulse); }
.lesson.ink .lesson-meta { color: rgba(255,255,255,.7); }

/* ── Filial badge ───────────────────────────────────────────────────────── */

.fbadge, .branch-badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--impulse); color: var(--impulse-ink);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.fbadge.champion, .branch-badge.champion {
  background: var(--champion); color: #fff;
}
.branch-badge.impulse {
  background: var(--impulse); color: var(--impulse-ink);
}

/* ── Date strip ─────────────────────────────────────────────────────────── */

.dstrip {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 0 0 18px;
}
.dstrip-c { flex: 1; text-align: center; }
.dstrip-c .d {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
}
.dstrip-c .day {
  display: block; font-size: 12px; color: var(--muted);
  margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase;
}
.dstrip-btn {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); cursor: pointer;
  transition: background .15s;
  font-size: 16px;
}
.dstrip-btn:hover { background: var(--paper-2); }

/* ── Tabs ───────────────────────────────────────────────────────────────── */

.tabs, .catalog-tabs {
  display: inline-flex;
  background: var(--paper-2); border-radius: var(--r-pill);
  padding: 4px; margin: 0 0 16px;
  border: 0;
}
.tabs-i, .catalog-tab {
  padding: 8px 16px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--muted);
  cursor: pointer; transition: all .15s;
  background: transparent; border: 0; height: auto;
}
.tabs-i.active, .catalog-tab.active {
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.tabs.full, .catalog-tabs.full {
  display: flex; width: 100%;
}
.tabs.full .tabs-i, .catalog-tabs.full .catalog-tab,
.catalog-tabs .catalog-tab { flex: 1; text-align: center; }

/* legacy tab-bar (underline) */
.tab-bar {
  display: flex; gap: 8px; margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.tab-bar > button {
  background: transparent; color: var(--muted);
  border: 0; border-bottom: 2px solid transparent;
  padding: 10px 16px; font-weight: 500; font-size: 14px;
  border-radius: 0; height: auto;
}
.tab-bar > button:hover { background: transparent; color: var(--ink-2); }
.tab-bar > button.active {
  color: var(--ink); border-bottom-color: var(--ink);
}

/* ── Catalog item (new design) ──────────────────────────────────────────── */

.catalog-item {
  background: var(--card); border-radius: var(--r-lg);
  border: 1px solid var(--line);
  padding: 20px;
  margin-bottom: 10px;
  cursor: pointer;
  display: block; align-items: initial; gap: 0;
}
.catalog-item-info { flex: 1; }
.catalog-item-name {
  font-size: 19px; font-weight: 600;
  letter-spacing: -0.018em; line-height: 1.2; margin-bottom: 8px;
}
.catalog-item-meta { font-size: 12px; color: var(--muted); margin-top: 8px; }
.catalog-item-price {
  font-family: var(--font-mono);
  font-size: 28px; font-weight: 500;
  letter-spacing: -0.03em; color: var(--ink);
}
.catalog-item-color { display: none; }

/* ── Status pills ───────────────────────────────────────────────────────── */

.status-pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  margin-top: 6px;
}
.status-pill.ok { background: var(--success-bg); color: var(--success); }
.status-pill.warn { background: var(--warn-bg); color: var(--warn); }
.status-pill.bad { background: var(--danger-bg); color: var(--danger); }
.status-pill.ink { background: var(--ink); color: #fff; }

/* ── Profile rows ───────────────────────────────────────────────────────── */

.prow {
  display: grid; grid-template-columns: 38px 1fr auto;
  align-items: center; gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.prow:last-child { border-bottom: 0; }
.prow-i {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-size: 16px;
}
.prow-t {
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
}
.prow-s {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.prow-a { color: var(--muted); font-size: 18px; }

/* ── Toggle switch ──────────────────────────────────────────────────────── */

.tgl {
  width: 44px; height: 26px;
  background: var(--line); border-radius: 999px;
  position: relative; transition: background .15s;
  flex: 0 0 auto; cursor: pointer;
}
.tgl::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  transition: transform .18s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.tgl.on { background: var(--ink); }
.tgl.on::after { transform: translateX(18px); }

/* ── Document row ───────────────────────────────────────────────────────── */

.doc {
  display: grid; grid-template-columns: 1fr auto;
  gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin-bottom: 8px;
}
.doc-t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.doc-s {
  font-size: 11px; color: var(--muted);
  margin-top: 4px; font-family: var(--font-mono);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.doc-s.warn { color: var(--warn); }
.doc-s.ok { color: var(--success); }

/* ── Notification row ───────────────────────────────────────────────────── */

.nrow {
  display: grid; grid-template-columns: 36px 1fr auto;
  gap: 12px; align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.nrow-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); font-size: 16px;
}
.nrow.lime .nrow-icon { background: var(--impulse); color: var(--impulse-ink); }
.nrow.warm .nrow-icon { background: var(--warn-bg); color: var(--warn); }
.nrow.cool .nrow-icon { background: var(--success-bg); color: var(--success); }
.nrow.fire .nrow-icon { background: var(--champion); color: #fff; }
.nrow-t {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.3; position: relative;
}
.nrow.unread .nrow-t::before {
  content: "";
  position: absolute; left: -10px; top: 6px;
  width: 6px; height: 6px;
  background: var(--champion); border-radius: 50%;
}
.nrow-d {
  font-size: 13px; color: var(--ink-3);
  line-height: 1.4; margin-top: 3px;
}
.nrow-time {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* ── Kid row ────────────────────────────────────────────────────────────── */

.kid {
  display: grid; grid-template-columns: 56px 1fr auto;
  align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 8px;
}
.kid-av {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--impulse); color: var(--impulse-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; letter-spacing: -0.02em;
}
.kid-av.champ { background: var(--champion); color: #fff; }
.kid-av.gray { background: var(--paper-2); color: var(--ink); }

/* ── History list ───────────────────────────────────────────────────────── */

.hist-month {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted);
  margin: 16px 0 10px;
}

/* ── Modal/sheet ────────────────────────────────────────────────────────── */

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11,11,10,.45);
  z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 18px 22px calc(22px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 -20px 60px -20px rgba(0,0,0,.3);
}
.modal-handle {
  width: 38px; height: 4px;
  background: var(--line); border-radius: 2px;
  margin: 0 auto 14px;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */

.toast {
  position: fixed; bottom: calc(100px + env(safe-area-inset-bottom));
  left: 16px; right: 16px; max-width: 448px; margin: 0 auto;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 500;
  z-index: 200;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.4);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--ink); color: #fff; }

/* ── Spinner ────────────────────────────────────────────────────────────── */

.spinner {
  border: 3px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  width: 24px; height: 24px;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Brand / auth header ────────────────────────────────────────────────── */

.brand-header {
  text-align: left; padding: 24px 0 36px;
}
.brand-mark {
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-mark .brand-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--impulse);
  box-shadow:
    0 0 0 5px rgba(212,242,80,.25),
    0 0 0 10px rgba(212,242,80,.12);
}
.brand-mark .brand-name {
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--impulse); color: var(--impulse-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; margin-bottom: 12px;
}
.brand-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.brand-subtitle { color: var(--muted); font-size: 14px; }

/* ── SMS code input ─────────────────────────────────────────────────────── */

.code-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 32px; letter-spacing: 16px; font-weight: 500;
  font-feature-settings: "tnum";
  padding-left: 16px;
}

/* ── QR ─────────────────────────────────────────────────────────────────── */

.qr-img {
  display: block; margin: 16px auto;
  width: 200px; height: 200px;
  border-radius: 12px; background: #fff; padding: 8px;
  border: 1px solid var(--line);
}

/* ── Big check (payment success) ────────────────────────────────────────── */

.center-stack {
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  padding: 40px 24px 0;
}
.big-check {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--impulse); color: var(--impulse-ink);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  font-size: 56px; font-weight: 600;
  position: relative;
}
.big-check::before, .big-check::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  inset: -10px;
  border: 1px solid rgba(212,242,80,.45);
}
.big-check::after { inset: -20px; border-color: rgba(212,242,80,.22); }

/* ── Placeholder image ──────────────────────────────────────────────────── */

.placeholder-img {
  background:
    repeating-linear-gradient(135deg, #E6E2D8 0 1px, transparent 1px 8px),
    var(--paper-2);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
}


/* ── Sign (ПЭП-подписание акцепта и приложений) ───────────────────────────
   Стиль офертный: тёмная олива + лайм. Согласуется с public/sign-tenant.html
   (ручная отправка из CRM) и шаблонами оферты на impulsekb.ru/offers.html. */

.sign-header {
  background: #14150d; color: #fff;
  padding: 16px 20px; border-radius: var(--r-md);
  display: flex; gap: 14px; align-items: center;
  margin-bottom: 14px;
}
.sign-header .accent {
  width: 4px; align-self: stretch; border-radius: 2px;
  background: linear-gradient(180deg, var(--impulse), #C6E739);
}
.sign-header .nm { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; color: #fff; }
.sign-header .sign-sub { color: #cbd5e1; font-size: 12px; margin-top: 2px; }

.sign-links {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px; background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  margin-bottom: 16px;
}
.sign-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--r-xs);
  font-size: 13px; font-weight: 500; text-decoration: none;
  background: var(--card); color: var(--impulse-ink);
  border: 1px solid var(--impulse-ink);
}
.sign-links a.max {
  background: var(--champion); color: #fff; border-color: var(--champion);
}

.sign-doc-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; cursor: pointer;
  transition: border-color .15s, transform .08s;
}
.sign-doc-card:hover { border-color: var(--impulse-ink); }
.sign-doc-card:active { transform: scale(.995); }
.sign-doc-card .title { font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.sign-doc-card .meta  { font-size: 13px; color: var(--muted); }
.sign-doc-card .go    { color: var(--impulse-ink); font-size: 14px; font-weight: 600; }

.consent {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: #fcfcfc; cursor: pointer;
  transition: background .15s, border-color .15s;
  margin-top: 8px;
}
.consent:has(input:checked) {
  border-color: var(--impulse-ink);
  background: #F0F8C2;
}
.consent input { margin-top: 3px; width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; }
.consent .txt { font-size: 13.5px; color: var(--ink); line-height: 1.5; }

.consents-group {
  margin-top: 12px; padding: 12px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.consents-group-title {
  font-size: 13px; font-weight: 600; margin-bottom: 4px;
  color: var(--impulse-ink);
}

.doc-info {
  background: #F0F8C2; border: 1px solid #d9ec88;
  border-radius: var(--r-md); padding: 14px 16px; margin-top: 10px;
}
.doc-info .ti { font-weight: 700; color: var(--impulse-ink); font-size: 15px; }
.doc-info .me { color: var(--ink-2); font-size: 13px; margin-top: 4px; }

.open-pdf-card {
  background: linear-gradient(135deg, #14150d, var(--impulse-ink));
  border-radius: var(--r-md); padding: 22px 20px; margin-top: 14px; color: #fff;
}
.open-pdf-card .ti { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.open-pdf-card .me { color: #d1d5db; font-size: 13px; line-height: 1.5; margin-bottom: 14px; }

.hash-pill {
  display: inline-block; padding: 8px 14px; border-radius: var(--r-xs);
  border: 1px solid var(--impulse-ink); color: var(--impulse-ink);
  font-family: var(--font-mono); font-size: 13px; margin: 0 auto;
}

.done-icon {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; margin: 0 auto 14px;
}

.audience-toggle {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.audience-toggle button {
  flex: 1; height: 44px; padding: 0 16px;
  border-radius: var(--r-pill);
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 500;
}
.audience-toggle button.active {
  background: var(--impulse); color: var(--impulse-ink); border-color: var(--impulse);
}

.step-bar { display: flex; gap: 6px; margin-bottom: 14px; }
.step-bar .step {
  flex: 1; height: 6px; border-radius: 3px; background: var(--line);
}
.step-bar .step.on   { background: var(--impulse-ink); }
.step-bar .step.done { background: var(--impulse); }

.otp-input {
  letter-spacing: 14px !important; font-size: 22px !important;
  text-align: center; font-weight: 700;
  font-family: var(--font-mono) !important;
}

/* ── Sign · Intro/legal sections (правовое промо как в ручной схеме) ───── */

.intro-lede {
  color: var(--ink-2); font-size: 14px; line-height: 1.6;
  margin: 0 0 14px;
}
.intro-section { margin-top: 18px; }
.intro-section h3 {
  margin: 0 0 6px; font-size: 13px; font-weight: 700;
  color: var(--impulse-ink);
}
.intro-section p { margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.6; }
.intro-list {
  margin: 4px 0 0; padding-left: 20px;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.7;
}
.intro-list li { margin-bottom: 4px; }
.legal-ref {
  color: var(--ink); font-weight: 600;
  background: var(--paper-2); padding: 1px 6px;
  border-radius: 4px; font-size: 12.5px;
  white-space: nowrap;
}

.chip-step {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--r-xs);
  background: var(--paper-2); color: var(--impulse-ink);
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Segmented control (переключатель «Телефон / Email» и подобные) ───── */

.seg {
  display: flex; gap: 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 4px;
  margin-bottom: 14px;
}
.seg button {
  flex: 1;
  height: 38px; padding: 0 14px;
  border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2);
  border: 0;
  font-size: 13px; font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.seg button:hover { background: rgba(0,0,0,.03); color: var(--ink); }
.seg button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.seg button:disabled { opacity: 0.5; cursor: not-allowed; }
