/* ============================================================
   DemoChange — дизайн-система
   Одна таблица стилей на весь сайт. Токены → примитивы → блоки.
   Тема переключается атрибутом data-theme на <html>.
   ============================================================ */

/* ---------- токены ---------- */
:root {
  color-scheme: dark;

  --bg: #080b16;
  --bg-soft: #0d1120;
  --surface: #121729;
  --surface-2: #171d33;
  --surface-3: #1e2540;
  --line: #232b47;
  --line-soft: #1a2038;

  --text: #eef1fa;
  --text-2: #a3abc6;
  --text-3: #6f7899;

  --accent: #4d7cff;
  --accent-2: #22d3ee;
  --accent-soft: rgba(77, 124, 255, 0.14);
  --accent-line: rgba(77, 124, 255, 0.35);
  --on-accent: #ffffff;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.14);
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.14);
  --red: #f4484a;
  --red-soft: rgba(244, 72, 74, 0.14);
  --violet: #a06bff;

  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 30px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 40px 90px -30px rgba(0, 0, 0, 0.85);
  --glow: 0 0 0 1px var(--accent-line), 0 18px 50px -18px rgba(77, 124, 255, 0.55);

  --max: 1200px;
  --header-h: 68px;

  --font: 'Inter Tight', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Unbounded', var(--font);
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme='light'] {
  color-scheme: light;

  --bg: #f6f8fd;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f5fc;
  --surface-3: #e8edf9;
  --line: #dfe5f3;
  --line-soft: #eaeff9;

  --text: #0b1020;
  --text-2: #55607d;
  --text-3: #8d97b3;

  --accent: #2b5cff;
  --accent-2: #0ea5c4;
  --accent-soft: rgba(43, 92, 255, 0.09);
  --accent-line: rgba(43, 92, 255, 0.22);

  --green: #12a150;
  --green-soft: rgba(18, 161, 80, 0.1);
  --amber: #b8730a;
  --amber-soft: rgba(184, 115, 10, 0.1);
  --red: #d32f30;
  --red-soft: rgba(211, 47, 48, 0.1);

  --shadow: 0 1px 2px rgba(16, 24, 48, 0.05), 0 12px 30px -14px rgba(16, 24, 48, 0.18);
  --shadow-lg: 0 40px 80px -32px rgba(16, 24, 48, 0.28);
  --glow: 0 0 0 1px var(--accent-line), 0 18px 44px -20px rgba(43, 92, 255, 0.35);
}

/* ---------- сброс ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
* { margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Мягкое свечение на фоне — даёт глубину без картинок. */
body::before {
  content: '';
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(60% 60% at 20% 0%, rgba(77, 124, 255, 0.18), transparent 70%),
    radial-gradient(50% 50% at 85% 10%, rgba(34, 211, 238, 0.12), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
[data-theme='light'] body::before { opacity: 0.55; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; position: relative; z-index: 1; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.break { word-break: break-all; }
.stack { display: grid; gap: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- типографика ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.12; }
h1 { font-size: clamp(32px, 5.2vw, 56px); }
h2 { font-size: clamp(24px, 3.4vw, 36px); }
h3 { font-size: 20px; }
h4 { font-size: 16px; letter-spacing: -0.01em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.lead { font-size: 17px; color: var(--text-2); max-width: 62ch; }

.section { padding: 72px 0; position: relative; z-index: 1; }
.section-head { max-width: 62ch; margin-bottom: 36px; display: grid; gap: 12px; }

/* ---------- шапка ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.nav { display: flex; align-items: center; gap: 28px; height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.logo .mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--grad);
  display: grid; place-items: center;
  box-shadow: 0 8px 20px -6px rgba(77, 124, 255, 0.7);
  flex: none;
}
.logo .mark svg { width: 17px; height: 17px; stroke: #fff; }
.logo b { font-weight: 700; }
.logo .tag {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: 2px;
}

.menu { display: flex; gap: 26px; margin-left: 12px; font-size: 14.5px; font-weight: 500; color: var(--text-2); }
.menu a { transition: color 0.18s; }
.menu a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: 0.18s;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent-line); }
.icon-btn svg { width: 17px; height: 17px; }

.burger { display: none; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s, border-color 0.18s, opacity 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: var(--grad); color: var(--on-accent); box-shadow: 0 10px 26px -12px rgba(77, 124, 255, 0.9); }
.btn-primary:hover { box-shadow: 0 14px 34px -12px rgba(77, 124, 255, 1); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent-line); background: var(--surface-2); }

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

.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-lg { height: 52px; padding: 0 28px; font-size: 15.5px; border-radius: var(--r-lg); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.55; pointer-events: none; }

.btn.is-loading::after {
  content: '';
  width: 15px; height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- карточки и поверхности ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-flat { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r); padding: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 18px; }
.card h3 + .lead { margin-top: 6px; }

.divider { height: 1px; background: var(--line); margin: 20px 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- формы ---------- */
.field { display: grid; gap: 7px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12.5px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--text);
  font-size: 15px;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  background: var(--surface);
}
.input.is-error, .textarea.is-error { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.textarea { min-height: 96px; resize: vertical; }

.select {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238d97b3' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.select option { background: var(--surface); color: var(--text); }

.input-group { position: relative; }
.input-group .suffix {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.input-group .input { padding-right: 74px; }

.alert {
  display: none;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r);
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.alert.show { display: flex; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.alert-ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.alert-info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.alert-warn { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }

/* ---------- бейджи статусов ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.s-new { background: var(--accent-soft); color: var(--accent); }
.badge.s-awaiting_payment { background: var(--amber-soft); color: var(--amber); }
.badge.s-paid { background: var(--accent-soft); color: var(--accent-2); }
.badge.s-processing { background: var(--violet); color: #fff; }
.badge.s-done { background: var(--green-soft); color: var(--green); }
.badge.s-rejected { background: var(--red-soft); color: var(--red); }
.badge.s-expired { background: var(--surface-3); color: var(--text-3); }

/* ---------- монеты ---------- */
.coin { display: inline-flex; align-items: center; gap: 9px; }
.coin .ic {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex: none;
  letter-spacing: -0.02em;
}
.coin .ic.sm { width: 22px; height: 22px; font-size: 9px; }
.coin .nm { font-weight: 600; }
.coin .net { font-size: 12px; color: var(--text-3); }

/* ---------- виджет обмена ---------- */
.exchange {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.exchange::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--accent-line), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.exchange-leg { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 10px; }
.exchange-leg .cap { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.exchange-leg .cap > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exchange-leg .body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.exchange-leg .amount {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 0;
  min-height: auto;
}
.exchange-leg .amount:focus { outline: none; box-shadow: none; background: none; }
.exchange-leg .amount[readonly] { color: var(--text-2); }
.exchange-leg .select { width: auto; min-width: 168px; min-height: 44px; flex: none; background-color: var(--surface); }

.swap-line { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.swap-line .ln { flex: 1; height: 1px; background: var(--line); }
.swap {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text-2);
  transition: 0.2s;
}
.swap:hover { color: var(--accent); border-color: var(--accent-line); transform: rotate(180deg); }
.swap svg { width: 18px; height: 18px; }

.rate-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 13.5px;
}
.rate-line .val { font-family: var(--font-mono); font-weight: 700; }
.rate-line.flash { animation: flash 0.5s ease; }
@keyframes flash { 0% { background: color-mix(in srgb, var(--accent) 26%, transparent); } 100% { background: var(--accent-soft); } }

/* ---------- герой ---------- */
.hero { padding: 64px 0 40px; }
/* minmax(0,…) обязателен: иначе широкое содержимое виджета
   растягивает колонку и появляется горизонтальный скролл. */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 56px; align-items: center; }
.hero h1 { margin: 16px 0 18px; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line-soft); }
.hero-stats .v { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.hero-stats .k { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- сетки ---------- */
/* Двухколоночные раскладки страниц. Заданы классами, а не инлайном,
   чтобы медиазапросы могли схлопнуть их на мобильном. */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.split-form { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.pay-split { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 20px; align-items: start; }
.sticky-col { position: sticky; top: calc(var(--header-h) + 20px); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature { display: grid; gap: 12px; }
.feature .ic {
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  display: grid; place-items: center;
  color: var(--accent);
}
.feature .ic svg { width: 20px; height: 20px; }

/* шаги «как это работает» */
.steps { counter-reset: step; display: grid; gap: 16px; }
.step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; }
.step .n {
  counter-increment: step;
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent);
}
.step .n::before { content: counter(step); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.data { min-width: 620px; font-size: 14px; }
table.data th {
  text-align: left;
  padding: 13px 16px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background 0.15s; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ---------- статус заявки ---------- */
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 26px 1fr; gap: 14px; }
.tl-item .rail { display: grid; justify-items: center; }
.tl-item .pt {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  margin-top: 5px;
  flex: none;
}
.tl-item .bar { width: 2px; flex: 1; min-height: 22px; background: var(--line); }
.tl-item:last-child .bar { display: none; }
.tl-item .txt { padding-bottom: 18px; }
.tl-item .ttl { font-weight: 600; font-size: 14.5px; }
.tl-item .sub { font-size: 12.5px; color: var(--text-3); }
.tl-item.done .pt { background: var(--green); border-color: var(--green); }
.tl-item.done .bar { background: var(--green); }
.tl-item.current .pt { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.tl-item.current .ttl { color: var(--accent); }
.tl-item.fail .pt { background: var(--red); border-color: var(--red); }
.tl-item.fail .ttl { color: var(--red); }

.copy-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.copy-box code { flex: 1; font-family: var(--font-mono); font-size: 13.5px; word-break: break-all; line-height: 1.5; }
.copy-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); flex: none; transition: 0.18s; }
.copy-btn:hover { color: var(--accent); border-color: var(--accent-line); }
.copy-btn.ok { color: var(--green); border-color: var(--green); }
.copy-btn svg { width: 16px; height: 16px; }

.qr { background: #fff; border-radius: var(--r); padding: 12px; width: 176px; height: 176px; display: grid; place-items: center; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; }

.timer {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.timer.low { color: var(--red); }

.kv { display: grid; gap: 11px; }
.kv .r { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 14px; }
.kv .k { color: var(--text-3); flex: none; }
.kv .v { font-weight: 600; text-align: right; word-break: break-word; }
.kv .r.total { padding-top: 11px; border-top: 1px dashed var(--line); font-size: 16px; }

/* чат с оператором */
.chat { display: grid; gap: 10px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: var(--r); font-size: 14px; line-height: 1.45; }
.msg .who { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.65; margin-bottom: 3px; }
.msg.client { justify-self: end; background: var(--accent); color: #fff; border-bottom-right-radius: 5px; }
.msg.operator { justify-self: start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 5px; }

/* ---------- личный кабинет ---------- */
.dash { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.side { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 8px; }
.side .who { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 22px 16px; }
.avatar {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--grad);
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}
.avatar.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 13px; }
.side nav { display: grid; gap: 4px; }
.side nav button {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  text-align: left;
  transition: 0.16s;
}
.side nav button svg { width: 17px; height: 17px; }
.side nav button:hover { background: var(--surface-2); color: var(--text); }
.side nav button.on { background: var(--accent-soft); color: var(--accent); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 18px; }
.stat .k { font-size: 12.5px; color: var(--text-3); }
.stat .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin-top: 4px; }

.order-card { display: grid; gap: 14px; padding: 20px; }
.order-card .top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.order-card .num { font-family: var(--font-mono); font-weight: 700; }
.order-card .when { margin-left: auto; font-size: 12.5px; color: var(--text-3); }
.order-flow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.order-flow .arrow { color: var(--text-3); }
.order-flow .amt { font-family: var(--font-mono); font-weight: 700; font-size: 16px; }
.order-flow .cur { font-size: 12.5px; color: var(--text-3); }

.empty { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 44px 20px; color: var(--text-3); }
.empty .ic { width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }

/* ---------- вкладки ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; }
.tabs button { padding: 9px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); transition: 0.16s; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pane { display: none; }
.pane.on { display: block; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- аккордеон FAQ ---------- */
.faq { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq details:last-child { border-bottom: none; }
.faq summary { padding: 18px 22px; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 20px; color: var(--text-3); line-height: 1; }
.faq details[open] summary::after { content: '−'; color: var(--accent); }
.faq .answer { padding: 0 22px 20px; color: var(--text-2); font-size: 14.5px; }

/* ---------- подвал ---------- */
footer { border-top: 1px solid var(--line-soft); padding: 44px 0 32px; margin-top: 72px; position: relative; z-index: 1; }
.foot-grid { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr); gap: 32px; }
.foot-grid h4 { margin-bottom: 12px; font-family: var(--font); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-3); }
.foot-grid ul { list-style: none; display: grid; gap: 9px; font-size: 14px; color: var(--text-2); }
.foot-grid a:hover { color: var(--text); }
.foot-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--text-3); }

.demo-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--amber-soft);
  border: 1px solid color-mix(in srgb, var(--amber) 26%, transparent);
  color: var(--amber);
  font-size: 13.5px;
  line-height: 1.5;
}
.demo-note svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }

/* ---------- уведомления ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 10px; max-width: min(360px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toast-in 0.25s ease;
}
.toast.err { border-color: color-mix(in srgb, var(--red) 40%, transparent); color: var(--red); }
.toast.ok { border-color: color-mix(in srgb, var(--green) 40%, transparent); color: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- скелетоны ---------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--r-sm); color: transparent !important; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- мобильное меню ---------- */
.mobile-nav {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
  display: none;
  padding: 20px;
}
.mobile-nav.open { display: grid; align-content: start; gap: 6px; }
.mobile-nav .top { display: flex; justify-content: space-between; align-items: center; height: var(--header-h); margin-bottom: 14px; }
.mobile-nav a { padding: 15px 4px; font-size: 19px; font-weight: 600; font-family: var(--font-display); border-bottom: 1px solid var(--line-soft); }
.mobile-nav .btn { margin-top: 18px; }

/* ---------- адаптив ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .split, .split-form, .pay-split { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
  .dash { grid-template-columns: 1fr; }
  .side { position: static; }
  .side nav { grid-auto-flow: column; overflow-x: auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .menu, .hide-sm, .logo .tag { display: none; }
  .qr { width: 156px; height: 156px; }
  /* На узких экранах шапке не хватает места под логотип + кнопки. */
  .nav { gap: 12px; }
  .nav-right { gap: 8px; }
  .logo { font-size: 16px; }
  .burger { display: grid; }
  .nav-right .btn-desktop { display: none; }
  .section { padding: 52px 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 26px; }
  .exchange-leg .body { flex-wrap: wrap; }
  .exchange-leg .select { width: 100%; min-width: 0; }
  .exchange-leg .amount { font-size: 23px; }
  .card { padding: 18px; }
  .hero { padding: 40px 0 24px; }
  .hero-stats { gap: 20px; }
}

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

/* ============================================================
   Навигация, отзывы, прогресс — добавлено в версии 3
   ============================================================ */

/* ---------- полоса «назад» и хлебные крошки ---------- */
.subnav {
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  position: relative;
  z-index: 40;
}
.subnav .wrap { display: flex; align-items: center; gap: 16px; min-height: 48px; flex-wrap: wrap; }
.subnav .back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: color .16s;
}
.subnav .back:hover { color: var(--accent); }
.subnav .back svg { width: 17px; height: 17px; }
.subnav .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); margin-left: auto; }
.subnav .crumbs i { font-style: normal; opacity: .5; }
.subnav .crumbs span:last-child { color: var(--text-2); font-weight: 600; }

.menu a.on { color: var(--text); position: relative; }
.menu a.on::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; border-radius: 2px; background: var(--grad);
}

/* ---------- спиннер и полноэкранная загрузка ---------- */
.spinner {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
.spinner.lg { width: 42px; height: 42px; border-width: 3.5px; }
.spinner.sm { width: 15px; height: 15px; border-width: 2px; }

.overlay {
  position: fixed; inset: 0; z-index: 300;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(6px);
}
.overlay.show { display: grid; animation: fade .18s ease; }
.overlay-box {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
}

/* ---------- прогресс обработки платежа ---------- */
.progress-stage { display: grid; gap: 18px; justify-items: center; text-align: center; padding: 26px 16px; }
.progress-stage .ring { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.progress-stage .ring .spinner { width: 84px; height: 84px; border-width: 4px; position: absolute; }
.progress-stage .ring .ic { font-size: 30px; line-height: 1; }
.progress-stage h3 { font-size: 21px; }
.progress-stage .sub { color: var(--text-2); max-width: 44ch; }

.check-mark {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center;
  animation: pop .35s cubic-bezier(.2, .9, .3, 1.4);
}
.check-mark svg { width: 40px; height: 40px; stroke-width: 3; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.stage-list { display: grid; gap: 10px; width: 100%; max-width: 380px; text-align: left; }
.stage-row { display: flex; align-items: center; gap: 11px; font-size: 14px; color: var(--text-3); }
.stage-row .dot-ic {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2px solid var(--line); display: grid; place-items: center;
}
.stage-row.done { color: var(--text); }
.stage-row.done .dot-ic { background: var(--green); border-color: var(--green); color: #fff; }
.stage-row.done .dot-ic::after { content: '✓'; font-size: 12px; font-weight: 700; }
.stage-row.now { color: var(--accent); font-weight: 600; }
.stage-row.now .dot-ic { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }

/* ---------- отзывы ---------- */
/* Карточки одинаковой высоты: строки грида выравниваются по самой
   длинной, а короткий текст просто оставляет больше воздуха снизу. */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; grid-auto-rows: 1fr; }

/* Размер звёзд задан и здесь, и атрибутами в самом SVG: даже если стили
   не подгрузились, они останутся мелкими, а не растянутся во весь блок. */
.star, .stars svg { width: 14px; height: 14px; flex: none; fill: currentColor; display: block; }
.stars { display: inline-flex; gap: 2px; color: var(--amber); line-height: 0; }

.review { display: grid; grid-template-rows: auto 1fr; gap: 12px; padding: 18px; height: 100%; }
.review .who { display: flex; align-items: center; gap: 11px; }
.review .ava { width: 40px; height: 40px; border-radius: 13px; overflow: hidden; flex: none; display: block; }
.review .ava svg, .ava-img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.review .who-txt { display: grid; gap: 1px; min-width: 0; }
.review .nm { font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 5px; }
.review .verified { color: var(--accent); display: inline-grid; place-items: center; flex: none; }
.review .when { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.review .stars { margin-left: auto; align-self: flex-start; }
.review p { font-size: 14px; line-height: 1.5; color: var(--text-2); }

.rating-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; padding: 18px 22px; }
.rating-summary .score { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.rating-summary .of { color: var(--text-3); font-size: 13px; }

/* ---------- живая лента обменов ---------- */
.ticker { overflow: hidden; border-block: 1px solid var(--line-soft); background: color-mix(in srgb, var(--surface) 40%, transparent); }
.ticker-track { display: flex; gap: 34px; padding: 12px 0; width: max-content; animation: slide 42s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ticker-item .ok { color: var(--green); }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- недоступное направление ---------- */
.leg-unavailable { border-color: color-mix(in srgb, var(--amber) 35%, transparent) !important; }
.select option:disabled { color: var(--text-3); }

@media (max-width: 1000px) { .reviews { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) {
  .reviews { grid-template-columns: 1fr; }
  .hide-xs { display: none; }
  .subnav .crumbs { display: none; }
}

/* ---------- анимации ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.2, .7, .3, 1), transform .55s cubic-bezier(.2, .7, .3, 1);
  will-change: opacity, transform;
}
[data-reveal].revealed { opacity: 1; transform: none; }

/* Карточки чуть приподнимаются под курсором — интерфейс кажется живым. */
.card.hoverable, .review, .feature {
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), border-color .22s, box-shadow .22s;
}
.card.hoverable:hover, .review:hover, .feature:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow), 0 18px 40px -22px rgba(77, 124, 255, .5);
}

/* Цифры, которые «набегают», не должны дёргать вёрстку при смене ширины. */
[data-count] { font-variant-numeric: tabular-nums; }

.hero-stats > div { transition: transform .22s; }
.hero-stats > div:hover { transform: translateY(-2px); }

/* Пульсация точки «сервис работает». */
.chip .dot { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--green-soft); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* Плавная подсветка строки курса при обновлении. */
.rate-line .val { transition: color .2s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .chip .dot { animation: none; }
}
