@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/onest-400-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/onest-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/onest-500-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/onest-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/onest-600-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/onest-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/unbounded-600-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/unbounded-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/unbounded-800-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/unbounded-800-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #FCFAF4;
  --paper-2: #F2EEE3;
  --paper-3: #F7F4EC;
  --ink: #17150F;
  --ink-2: #6B665C;
  --ink-3: #A39C8D;
  --line: #E4DFD2;
  --line-2: #D6D0C0;
  --accent: #CBF14C;
  --accent-deep: #4E6A10;
  --success: #3D6B14;
  --danger: #A33B2A;
  --danger-bg: #FBF0EC;
  --danger-line: #E0B4A8;
  --display: 'Unbounded', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-pill: 999px;
  --r-card: 24px;
  --r-control: 12px;
  --shadow: 0 1px 2px rgba(23, 21, 15, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  letter-spacing: -0.02em;
  line-height: 1.14;
  margin: 0;
  font-weight: 600;
}

p { margin: 0; text-wrap: pretty; }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  z-index: 100;
}
.skip-link:focus { left: 12px; }

.boot-screen {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink-2);
}
.boot-screen strong { font-family: var(--display); font-size: 22px; color: var(--ink); }

.mono { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.text-right { text-align: right; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.full { width: 100%; }
.inline { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

/* ---------- Каркас приложения ---------- */

.app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.brand__mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--accent);
  border: 2px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 13px;
}
.brand__text { display: flex; flex-direction: column; min-width: 0; }
.brand__text strong {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand__text small { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.role-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper-2);
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.role-switch button {
  border: 1.5px solid transparent;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  min-height: 44px;
}
.role-switch button[aria-pressed="true"] {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.app-layout { display: block; }

.sidebar { display: none; }

.main {
  padding: 20px 16px 96px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-list { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 15px;
  color: var(--ink-2);
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  min-height: 44px;
}
.nav-link:hover { background: var(--paper-2); color: var(--ink); }
.nav-link[aria-current="page"] { background: var(--ink); color: var(--paper); font-weight: 500; }
.nav-link__icon { width: 20px; text-align: center; flex-shrink: 0; }
.nav-link__count {
  margin-left: auto;
  background: var(--accent);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--r-pill);
}
.nav-link[aria-current="page"] .nav-link__count { background: var(--accent); color: var(--ink); }
.sidebar__section {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 16px 14px 6px;
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 30;
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  min-height: 56px;
  font-size: 11px;
  color: var(--ink-2);
}
.mobile-nav a span:first-child { font-size: 17px; line-height: 1; }
.mobile-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- Заголовки страниц ---------- */

.page-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.page-header h1 { font-size: 26px; }
.page-header p { color: var(--ink-2); font-size: 15px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Кнопки ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 13px 22px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.button:hover { border-color: var(--ink); }
.button:active { transform: scale(0.985); }
.button--primary {
  background: var(--accent);
  border: 2px solid var(--ink);
  font-weight: 600;
}
.button--primary:hover { background: #D6F76A; }
.button--secondary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.button--secondary:hover { background: #2A261C; }
.button--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.button--ghost:hover { background: var(--paper-2); color: var(--ink); }
.button--danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }
.button--small { min-height: 40px; padding: 9px 16px; font-size: 14px; }
.button--block { width: 100%; }
.button[disabled] { opacity: 0.5; cursor: not-allowed; }

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line);
  background: var(--paper);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.icon-button:hover { border-color: var(--ink); }

/* ---------- Карточки и блоки ---------- */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card__header {
  padding: 20px 22px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card__header h2, .card__header h3 { font-size: 19px; }
.card__body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack--tight { gap: 8px; }
.spaced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.two-column, .three-column, .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.metric {
  background: var(--paper-2);
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.metric__label { font-size: 13px; color: var(--ink-2); }
.metric__value { font-family: var(--display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric__note { font-size: 12px; color: var(--ink-2); }

.earnings {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-card);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.earnings h2, .earnings h3 { color: var(--paper); }
.earnings .metric { background: rgba(252, 250, 244, 0.08); }
.earnings .metric__label, .earnings .metric__note { color: var(--ink-3); }
.earnings .metric__value { color: var(--paper); }
.earnings .spaced { color: var(--paper); }
.earnings .muted { color: var(--ink-3); }

.notice {
  background: var(--paper-2);
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notice strong { color: var(--ink); font-weight: 600; }
.notice--warning { background: #FBF4E2; }
.notice--danger { background: var(--danger-bg); color: var(--danger); }
.notice--danger strong { color: var(--danger); }

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.empty-state__icon { font-size: 28px; opacity: 0.5; }

/* ---------- Статусы ---------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.status--success { background: #EAF3DE; color: var(--success); }
.status--warning { background: #FBF4E2; color: #7A5A0B; }
.status--info { background: #E9EFF7; color: #2C4A73; }
.status--neutral { background: var(--paper-2); color: var(--ink-2); }
.status--danger { background: var(--danger-bg); color: var(--danger); }

/* ---------- Таблицы ---------- */

.table-shell {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  min-width: 0;
}
/* На узком контейнере таблица прокручивается внутри себя, а не обрезается. */
@media (min-width: 800px) {
  .table-shell { overflow-x: auto; overflow-y: hidden; }
  .table-shell table { min-width: 560px; }
}
.table-shell table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-shell thead { display: none; }
.table-shell tbody tr {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.table-shell tbody tr:last-child { border-bottom: none; }
.table-shell td {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  border: none;
  min-width: 0;
}
.table-shell td::before {
  content: attr(data-label);
  font-size: 12px;
  color: var(--ink-2);
  flex-shrink: 0;
}
.table-shell td:first-child { font-weight: 600; }

.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person__text { display: flex; flex-direction: column; min-width: 0; }
.person__text strong { font-size: 14px; font-weight: 600; }
.person__text span { font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.avatar {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-pill);
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}

/* ---------- Формы ---------- */

.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label, .field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--r-control);
  border: 1.5px solid var(--line);
  background: var(--paper);
  width: 100%;
}
.field textarea { min-height: 104px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--line-2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); outline: none; }
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.checkbox input { width: 20px; height: 20px; margin-top: 2px; flex-shrink: 0; accent-color: var(--ink); }

/* ---------- Диалог и тост ---------- */

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(23, 21, 15, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
  padding: 0;
}
.dialog {
  background: var(--paper);
  border-radius: 26px 26px 0 0;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: sheet-in 0.22s ease;
}
@keyframes sheet-in { from { transform: translateY(18px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
.dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 20px 14px;
  position: sticky;
  top: 0;
  background: var(--paper);
}
.dialog__header h2 { font-size: 20px; }
.dialog__header p { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.dialog__body { padding: 0 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.dialog__footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  position: sticky;
  bottom: 0;
  background: var(--paper);
  flex-wrap: wrap;
}
.dialog__footer .button { flex-grow: 1; }

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 80;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--ink);
  color: var(--paper);
  padding: 13px 22px;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  animation: sheet-in 0.2s ease;
}

/* ---------- Офферы ---------- */

.offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.offer-card {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-width: 0;
}
.offer-card__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px 0;
  flex-wrap: wrap;
}
.offer-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}
.offer-card__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex-grow: 1; }
.offer-card__title h3 { font-size: 18px; }
.offer-card__title span { font-size: 13px; color: var(--ink-2); }
.offer-card__body { padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.offer-card__body p { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.offer-card__rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  background: var(--accent);
  color: var(--ink);
  padding: 7px 13px;
  border-radius: var(--r-pill);
  align-self: flex-start;
}
.offer-card__footer {
  padding: 0 20px 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.offer-card__footer .button { flex-grow: 1; }
.offer-card--locked { background: var(--paper-3); }
.offer-card--locked .offer-mark { background: #EDE8DB; }

.rate-rail {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper-2);
  border-radius: 18px;
  padding: 16px 18px;
}
.rate-rail__step { display: flex; flex-direction: column; gap: 2px; }
.rate-rail__step strong { font-family: var(--display); font-size: 22px; font-weight: 800; }
.rate-rail__step span { font-size: 12px; color: var(--ink-2); }
.rate-rail__plus { font-size: 18px; color: var(--ink-3); }

.tabs {
  display: flex;
  gap: 4px;
  background: var(--paper-2);
  padding: 4px;
  border-radius: var(--r-pill);
}
.tabs button {
  flex-grow: 1;
  min-height: 46px;
  border: 1.5px solid transparent;
  background: transparent;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
}
.tabs button[aria-selected="true"] {
  background: var(--paper);
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 600;
}

.tool-value {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper-2);
  border-radius: var(--r-control);
  padding: 12px 14px;
  flex-wrap: wrap;
}
.tool-value code {
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
  flex-grow: 1;
  min-width: 0;
}

/* ---------- Воронка, графики, шкала ---------- */

.funnel { display: flex; flex-direction: column; gap: 12px; }
.funnel__row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 56px; align-items: center; gap: 10px; }
.funnel__label { font-size: 13px; color: var(--ink-2); }
.funnel__track { height: 10px; border-radius: var(--r-pill); background: var(--paper-2); overflow: hidden; }
.funnel__fill { height: 100%; border-radius: var(--r-pill); background: var(--ink); }
.funnel__row:first-child .funnel__fill { background: var(--accent); }
.funnel__value { font-size: 14px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bar-chart__item { flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; min-width: 0; }
.bar-chart__bar { background: var(--accent); border: 1px solid var(--ink); border-radius: 6px 6px 0 0; min-height: 4px; }
.bar-chart__item span { font-size: 10px; color: var(--ink-2); text-align: center; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline__item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline__item::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline__item:last-child::after { display: none; }
.timeline__dot {
  width: 12px;
  height: 12px;
  border-radius: var(--r-pill);
  background: var(--paper);
  border: 2px solid var(--line-2);
  flex-shrink: 0;
  margin-top: 4px;
  z-index: 1;
}
.timeline__item--done .timeline__dot { background: var(--accent); border-color: var(--ink); }
.timeline__item--danger .timeline__dot { background: var(--danger); border-color: var(--danger); }
.timeline__content { display: flex; flex-direction: column; gap: 2px; }
.timeline__content strong { font-size: 14px; font-weight: 600; }
.timeline__content span { font-size: 13px; color: var(--ink-2); }

.progress-list { display: flex; flex-direction: column; gap: 10px; }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row__number { font-variant-numeric: tabular-nums; font-weight: 600; }

.step-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.step__number {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 600;
  background: var(--accent);
  color: var(--ink);
  padding: 7px 14px;
  border-radius: var(--r-pill);
  align-self: flex-start;
}
.step h3 { font-size: 18px; }
.step p { font-size: 15px; color: var(--ink-2); line-height: 1.5; }

.quick-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  cursor: pointer;
  text-align: left;
  min-height: 56px;
  font-size: 15px;
  font-weight: 500;
}
.quick-action:hover { border-color: var(--ink); background: var(--paper-2); }

/* ---------- Лендинг ---------- */

.landing { display: flex; flex-direction: column; min-height: 100vh; background: var(--paper); }
.landing__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.landing__main { display: flex; flex-direction: column; }
.landing-section { padding: 44px 20px; }
.landing-section:nth-child(even) { background: var(--paper-3); }
.landing-section__inner { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.landing-section h2 { font-size: 27px; }

.landing-hero { padding: 40px 20px 48px; }
.landing-hero__lead { display: flex; flex-direction: column; gap: 20px; max-width: 1160px; margin: 0 auto; }
.landing-hero h1 { font-size: 34px; font-weight: 800; line-height: 1.06; }
.landing-hero p { font-size: 17px; color: var(--ink-2); }
.landing-hero__actions { display: flex; flex-direction: column; gap: 10px; }
.landing-hero__actions .button { width: 100%; }
.landing-hero__proof {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r-card);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.landing-hero__proof .eyebrow { color: var(--accent); }
.landing-hero__proof .spaced { color: var(--paper); }
.landing-hero__proof .muted { color: var(--ink-3); }
.landing-hero__proof .metric { background: rgba(252, 250, 244, 0.08); }
.landing-hero__proof .metric__label, .landing-hero__proof .metric__note { color: var(--ink-3); }
.landing-hero__proof .metric__value { color: var(--accent); }
.landing-hero__proof .stack--tight { gap: 10px; }

.faq { display: flex; flex-direction: column; }
.faq > div {
  padding: 20px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq > div:last-child { border-bottom: 1px solid var(--line); }
.faq h3 { font-size: 17px; }
.faq p { font-size: 15px; color: var(--ink-2); line-height: 1.6; }

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--paper-3);
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 25px; }

/* ---------- Планшет ---------- */

@media (min-width: 640px) {
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--wide { grid-column: 1 / -1; }
  .landing-hero h1 { font-size: 46px; }
  .landing-hero__actions { flex-direction: row; }
  .landing-hero__actions .button { width: auto; }
  .dialog-backdrop { align-items: center; padding: 24px; }
  .dialog { max-width: 620px; border-radius: var(--r-card); }
  .dialog__footer .button { flex-grow: 0; }
}

/* ---------- Десктоп ---------- */

@media (min-width: 800px) {
  .app-topbar { padding: 16px 32px; }
  .app-layout {
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    align-items: start;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 14px;
    border-right: 1px solid var(--line);
    position: sticky;
    top: 69px;
    height: calc(100vh - 69px);
    overflow-y: auto;
  }
  .main { padding: 30px 36px 48px; gap: 26px; }
  .mobile-nav { display: none; }
  .toast-root { bottom: 28px; }
  .page-header { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 20px; }
  .page-header h1 { font-size: 30px; }
  .three-column { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .span-5 { grid-column: span 1; }
  .span-7 { grid-column: span 1; }
  .span-12 { grid-column: 1 / -1; }
  .landing-section { padding: 64px 32px; }
  .landing-section h2 { font-size: 34px; }
  .landing-hero { padding: 64px 32px 72px; }
  .landing-hero__lead {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 44px;
    align-items: center;
  }
  .landing-hero h1 { font-size: 54px; }
  .landing__header { padding: 18px 32px; }
  .faq > div { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 32px; }

  .table-shell thead { display: table-header-group; }
  .table-shell thead th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    padding: 12px 18px;
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
  }
  .table-shell tbody tr { display: table-row; padding: 0; }
  .table-shell td {
    display: table-cell;
    padding: 14px 18px;
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
  }
  .table-shell tbody tr:last-child td { border-bottom: none; }
  .table-shell td::before { display: none; }
}

@media (min-width: 1120px) {
  .dashboard-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .span-5 { grid-column: span 5; }
  .span-7 { grid-column: span 7; }
  .main { padding: 34px 44px 56px; }
}

/* ---------- Узкие экраны ---------- */

/* На узких экранах шапка переносит переключатель роли на вторую строку:
   иначе название программы и кнопки не помещаются рядом. */
@media (max-width: 560px) {
  .app-topbar { flex-wrap: wrap; padding: 12px 16px; }
  .brand { flex: 1 1 100%; }
  .role-switch { width: 100%; }
  .role-switch button { flex: 1 1 0; }
  .landing__header { gap: 10px; }
  .landing__header .inline { width: 100%; }
  .landing__header .inline .button { flex: 1 1 0; }
}

@media (max-width: 380px) {
  .app-topbar { padding: 12px 14px; }
  .brand__text small { display: none; }
  .role-switch button { padding: 10px 12px; font-size: 13px; }
  .main { padding: 16px 12px 92px; }
  .landing-hero h1 { font-size: 30px; }
  .metric__value { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .app-topbar, .sidebar, .mobile-nav, .toast-root, .dialog-backdrop { display: none !important; }
}
