/* Кабинет API Swarme (swarme.xyz/keys/) — стиль «Кость / Чёрный», как у Swarme Terminal (brief/10_STYLE_SPEC.md,
   site/theme.css): тёплый стол «Два света» с зерном, лотки с карточками, моно-подписи ПРОПИСНЫМИ, один акцент.
   Токены — те же имена и значения, что в site/theme.css (тема сайта сюда не подключается — кабинет отдаётся отдельно). */

/* «Medeo Sans Tab» (27.11.2026): владелец убрал моноширинный везде — --st-mono теперь наш Medeo, только цифры одной
   ширины (собирает swarm_terminal/site/tools/medeo_tab.py). Объявлен здесь: style.css браузер перечитывает сразу. */
@font-face { font-family: 'Medeo Sans Tab'; src: url('/keys/fonts/medeo-1.1.0/MedeoSansVariable-sw-tab.woff2') format('woff2');
  font-weight: 100 900; font-style: normal; font-display: swap; }

/* ---------- Кость ---------- */
:root, html[data-theme="bone"] {
  color-scheme: light;
  --st-bg: #F2EEE6; --st-tray: #EAE5DB; --st-tray-line: rgba(70,55,30,.09);
  --st-card: #FBF9F5; --st-card-2: #F5F2EC; --st-card-hover: #FFFFFF;
  --st-line: rgba(40,32,20,.10); --st-line-2: rgba(40,32,20,.06); --st-line-hi: rgba(40,32,20,.18); --st-line-strong: #A59E91;
  --st-grid: rgba(70,55,30,.16); --st-hatch-2: rgba(70,55,30,.085);
  --st-fill: rgba(40,32,20,.04); --st-fill-2: rgba(40,32,20,.075); --st-hi: rgba(255,255,255,.8);
  --st-ink: #1E1C19; --st-ink-2: #55514A; --st-ink-3: #6B665D; --st-ink-4: #B5B0A6;
  --st-accent: #3D5FD9; --st-accent-soft: rgba(61,95,217,.10); --st-accent-line: rgba(61,95,217,.28); --st-focus: rgba(61,95,217,.55);
  --st-up: #107A52; --st-up-soft: rgba(16,122,82,.10); --st-up-line: rgba(16,122,82,.26);
  --st-down: #C33238; --st-down-soft: rgba(195,50,56,.09); --st-down-line: rgba(195,50,56,.26);
  --st-warn: #B05517; --st-warn-soft: rgba(176,85,23,.10); --st-warn-line: rgba(176,85,23,.28);
  --st-on-tone: #FFFFFF;
  --st-btn: #1E1C19; --st-btn-hover: #36332E; --st-btn-ink: #F7F4EE;
  --st-glass: rgba(251,249,245,.72); --st-glass-line: rgba(255,255,255,.65);
  --st-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 14px 36px -16px rgba(60,45,20,.22);
  --st-shadow-sm: 0 1px 2px rgba(60,45,20,.06);
  --st-shadow-lg: 0 0 0 1px rgba(40,32,20,.06), 0 4px 14px -6px rgba(60,45,20,.12), 0 26px 60px -22px rgba(60,45,20,.30);
  --st-sh-1: rgba(60,45,20,.08); --st-sh-2: rgba(60,45,20,.18);
  --st-scrim: rgba(40,32,20,.28);
  --st-light-a: rgba(255,255,255,.38); --st-light-a0: rgba(255,255,255,0);
  --st-light-b: rgba(255,240,215,.28); --st-light-b0: rgba(255,240,215,0);
  --st-tint-blue-bg: #EBEFFC; --st-tint-blue-line: #C4CEEE; --st-tint-blue-ink: #2E489E;
  --st-tint-violet-bg: #F2EEFB; --st-tint-violet-line: #D5CBEB; --st-tint-violet-ink: #5C3EA3;
  --st-tint-gray-bg: #EFEDE9; --st-tint-gray-line: #D7D3CC; --st-tint-gray-ink: #5E5950;
  --qr-bg: #FFFFFF;
  --grain: url("/keys/bg/grain-bone.png");
  /* шрифты — как в Swarme Terminal: текст Medeo (21.11.2026), моноширинного нет с 27.11.2026 — Medeo Sans Tab; Geist — запасной */
  --st-font: 'Medeo Sans', Geist, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --st-mono: 'Medeo Sans Tab', 'Medeo Sans', Geist, ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.22,1,.36,1);
}

/* ---------- Чёрный ---------- */
html[data-theme="black"] {
  color-scheme: dark;
  --st-bg: #000000; --st-tray: #09090A; --st-tray-line: rgba(255,255,255,.075);
  --st-card: #121214; --st-card-2: #0D0D0F; --st-card-hover: #18181B;
  --st-line: rgba(255,255,255,.09); --st-line-2: rgba(255,255,255,.07); --st-line-hi: rgba(255,255,255,.17); --st-line-strong: #6A6A71;
  --st-grid: rgba(255,255,255,.10); --st-hatch-2: rgba(255,255,255,.05);
  --st-fill: rgba(255,255,255,.045); --st-fill-2: rgba(255,255,255,.08); --st-hi: rgba(255,255,255,.055);
  --st-ink: #F4F4F5; --st-ink-2: #B9B9BF; --st-ink-3: #8E8E95; --st-ink-4: #4E4E55;
  --st-accent: #86A4FF; --st-accent-soft: rgba(134,164,255,.12); --st-accent-line: rgba(134,164,255,.30); --st-focus: rgba(134,164,255,.6);
  --st-up: #3CCB8F; --st-up-soft: rgba(60,203,143,.12); --st-up-line: rgba(60,203,143,.28);
  --st-down: #FF6A6E; --st-down-soft: rgba(255,106,110,.12); --st-down-line: rgba(255,106,110,.30);
  --st-warn: #F2A15E; --st-warn-soft: rgba(242,161,94,.12); --st-warn-line: rgba(242,161,94,.30);
  --st-on-tone: #000000;
  --st-btn: #F4F4F5; --st-btn-hover: #FFFFFF; --st-btn-ink: #09090B;
  --st-glass: rgba(18,18,20,.68); --st-glass-line: rgba(255,255,255,.10);
  --st-shadow: 0 1px 0 rgba(255,255,255,.045) inset, 0 16px 40px -18px rgba(0,0,0,.8);
  --st-shadow-sm: 0 1px 2px rgba(0,0,0,.5);
  --st-shadow-lg: 0 0 0 1px rgba(255,255,255,.06), 0 4px 14px -6px rgba(0,0,0,.6), 0 28px 64px -22px rgba(0,0,0,.85);
  --st-sh-1: rgba(0,0,0,.4); --st-sh-2: rgba(0,0,0,.6);
  --st-scrim: rgba(0,0,0,.62);
  --st-light-a: rgba(134,164,255,.065); --st-light-a0: rgba(134,164,255,0);
  --st-light-b: rgba(190,150,255,.045); --st-light-b0: rgba(190,150,255,0);
  --st-tint-blue-bg: #171B28; --st-tint-blue-line: #2B324B; --st-tint-blue-ink: #9CB1F7;
  --st-tint-violet-bg: #1E1929; --st-tint-violet-line: #352C48; --st-tint-violet-ink: #C0AAF3;
  --st-tint-gray-bg: #1B1B1E; --st-tint-gray-line: #323237; --st-tint-gray-ink: #C7C7CC;
  --qr-bg: #F4F4F5;
  --grain: url("/keys/bg/grain-black.png");
}

/* ---------- основа ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--st-bg); font-variant-numeric: tabular-nums; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--st-ink); background: var(--st-bg);
  font: 400 15px/1.5 var(--st-font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
/* стол «Два света»: два мягких пятна по диагонали + зерно; слой стоит на месте, листается только страница */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 75vmax at 8% -5%, var(--st-light-a), var(--st-light-a0)),
    radial-gradient(circle 75vmax at 95% 102%, var(--st-light-b), var(--st-light-b0)), var(--grain) 0 0 / 256px 256px; }
@media (min-resolution: 2dppx) { body::before { background-size: auto, auto, 128px 128px; } }
html[data-modal] body { overflow: hidden; }
::selection { background: var(--st-accent-line); }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--st-focus); outline-offset: 2px; }
input::placeholder { color: var(--st-ink-3); }
[hidden] { display: none !important; }
.copy-tmp { position: fixed; left: -9999px; top: 0; opacity: 0; }
.noscript { max-width: 520px; margin: 80px auto; padding: 0 24px; color: var(--st-ink-2); text-align: center; }

/* служебная подпись: моно, ПРОПИСНЫЕ, разрядка */
.meta { font: 500 11px/14px var(--st-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--st-ink-3); }

/* ---------- шапка ---------- */
.top { position: sticky; top: 0; z-index: 30; padding-top: env(safe-area-inset-top); border-bottom: 1px solid transparent;
  transition: background-color 220ms var(--ease), border-color 220ms var(--ease), backdrop-filter 220ms; }
.top.scrolled { background: var(--st-glass); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border-bottom-color: var(--st-line); }
.top-in { display: flex; align-items: center; gap: 12px; max-width: 1120px; height: 60px; margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--st-ink); font: 600 16px/1 var(--st-font); letter-spacing: -.01em; }
.brand .mark { width: 20px; height: 20px; flex: none; }
.brand-api { padding: 3px 6px; border-radius: 6px; border: 1px solid var(--st-line-hi); color: var(--st-ink-2);
  font: 500 10.5px/1 var(--st-mono); letter-spacing: .08em; }
.top-r { display: flex; align-items: center; gap: 8px; margin-left: auto; min-width: 0; }
.who { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--st-ink-2); font-size: 13.5px; margin-right: 4px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 34px; height: 34px; padding: 0;
  border: 1px solid var(--st-line); border-radius: 999px; background: var(--st-card); color: var(--st-ink-2); cursor: pointer;
  box-shadow: inset 0 1px 0 var(--st-hi), var(--st-shadow-sm); text-decoration: none; transition: color 140ms, background-color 140ms, border-color 140ms; }
.icon-btn:hover { color: var(--st-ink); background: var(--st-card-hover); border-color: var(--st-line-hi); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- значки ---------- */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.ic-fill { fill: currentColor; stroke: none; }

/* ---------- кнопки ---------- */
.btn, .btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 999px; font: 500 14px/1 var(--st-font); white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), transform 100ms var(--ease), opacity 140ms; }
.btn { border: 0; background: var(--st-btn); color: var(--st-btn-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px var(--st-sh-1), 0 6px 16px -8px var(--st-sh-2); }
.btn:hover { background: var(--st-btn-hover); }
.btn-ghost { border: 1px solid var(--st-line); background: var(--st-card); color: var(--st-ink); box-shadow: inset 0 1px 0 var(--st-hi), var(--st-shadow-sm); }
.btn-ghost:hover { background: var(--st-card-hover); border-color: var(--st-line-hi); }
.btn:active, .btn-ghost:active { transform: scale(.98); }
.btn:disabled, .btn-ghost:disabled { opacity: .45; cursor: default; transform: none; }
.btn[data-busy], .btn-ghost[data-busy] { cursor: progress; }
.btn-danger { background: var(--st-down); color: var(--st-on-tone); }
.btn-danger:hover { background: var(--st-down); filter: brightness(1.08); }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.btn-xs { height: 30px; padding: 0 11px; gap: 6px; font-size: 12.5px; }
.btn .ic, .btn-ghost .ic { width: 15px; height: 15px; }
.btn-lg .ic { width: 18px; height: 18px; }
.copy-btn[data-copied] { color: var(--st-up); border-color: var(--st-up-line); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  color: var(--st-ink-2); font: 500 13px/1 var(--st-font); cursor: pointer; white-space: nowrap; transition: color 140ms, background-color 140ms; }
.link-btn:hover { color: var(--st-ink); background: var(--st-fill); }
.link-btn.danger { color: var(--st-down); }
.link-btn.danger:hover { background: var(--st-down-soft); color: var(--st-down); }
.link-btn:disabled { opacity: .45; cursor: default; }

/* ---------- переключатель-пилюля ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--st-card-2);
  box-shadow: inset 0 1px 2px var(--st-sh-1), inset 0 0 0 1px var(--st-line); }
.seg > button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px; background: transparent; color: var(--st-ink-3); font: 500 13px/1 var(--st-font); cursor: pointer;
  white-space: nowrap; transition: color 160ms, background-color 160ms, box-shadow 160ms; }
.seg > button:hover { color: var(--st-ink-2); }
.seg > button[data-on="1"] { color: var(--st-ink); background: var(--st-card-hover);
  box-shadow: inset 0 1px 0 var(--st-hi), 0 0 0 1px var(--st-line-hi), 0 1px 2px var(--st-sh-1), 0 4px 10px -6px var(--st-sh-2); }
.seg-sm > button { height: 26px; padding: 0 9px; font: 500 11px/1 var(--st-mono); letter-spacing: .06em; }
.seg-theme > button { width: 30px; padding: 0; }
.sw { display: block; width: 13px; height: 13px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--st-line-hi); }
.sw-bone { background: #F2EEE6; }
.sw-black { background: #000; }
html[data-theme="black"] .sw-black { box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }

/* ---------- выключатель ---------- */
.switch { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; height: 36px; margin: -6px -6px -6px 0;
  padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.sw-track { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--st-line-strong);
  box-shadow: inset 0 1px 2px var(--st-sh-1); transition: background-color 160ms; }
.switch[data-on="1"] .sw-track { background: var(--st-up); }
.sw-track > i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px var(--st-sh-2); transition: transform 300ms var(--ease); }
.switch[data-on="1"] .sw-track > i { transform: translateX(14px); }
.switch:disabled { opacity: .5; cursor: progress; }

/* ---------- чипы, тона, заметки ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--st-line); background: var(--st-fill); color: var(--st-ink-2);
  font: 500 10.5px/1 var(--st-mono); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tone-up     { --t-bg: var(--st-up-soft);     --t-line: var(--st-up-line);     --t-ink: var(--st-up); }
.tone-down   { --t-bg: var(--st-down-soft);   --t-line: var(--st-down-line);   --t-ink: var(--st-down); }
.tone-warn   { --t-bg: var(--st-warn-soft);   --t-line: var(--st-warn-line);   --t-ink: var(--st-warn); }
.tone-accent { --t-bg: var(--st-accent-soft); --t-line: var(--st-accent-line); --t-ink: var(--st-accent); }
.tone-blue   { --t-bg: var(--st-tint-blue-bg);   --t-line: var(--st-tint-blue-line);   --t-ink: var(--st-tint-blue-ink); }
.tone-violet { --t-bg: var(--st-tint-violet-bg); --t-line: var(--st-tint-violet-line); --t-ink: var(--st-tint-violet-ink); }
.tone-gray   { --t-bg: var(--st-tint-gray-bg);   --t-line: var(--st-tint-gray-line);   --t-ink: var(--st-tint-gray-ink); }
.chip[class*="tone-"], .note[class*="tone-"] { background: var(--t-bg); border-color: var(--t-line); color: var(--t-ink); }
.note { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border: 1px solid; border-radius: 12px; font-size: 14px; line-height: 1.45; }
.note .ic { width: 17px; height: 17px; margin-top: 1px; }
.note > span { min-width: 0; }
.note-row { display: flex; align-items: center; gap: 12px; }
.note-row > span { flex: 1; }

/* ---------- раскладка ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 12px 24px calc(64px + env(safe-area-inset-bottom)); outline: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.boot { display: flex; justify-content: center; padding: 120px 0; }
.boot i { width: 8px; height: 8px; border-radius: 50%; background: var(--st-ink-3); opacity: 0; animation: boot 1.4s ease-in-out .35s infinite; }
@keyframes boot { 0%, 100% { opacity: .15; transform: scale(.8); } 50% { opacity: .6; transform: scale(1.2); } }

/* лоток — подложка секции, внутри карточки с зазором */
.tray { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 5px; border-radius: 18px; scroll-margin-top: 72px;
  background: var(--st-tray); border: 1px solid var(--st-tray-line); box-shadow: var(--st-shadow); }
.tray-h { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px 4px 12px; }
.tray-t { font: 600 15px/20px var(--st-font); letter-spacing: -.01em; }
.tray-h .grow { flex: 1; }
.card { min-width: 0; padding: 16px; border-radius: 14px; background: var(--st-card); border: 1px solid var(--st-line-2); box-shadow: var(--st-shadow-sm); }
.hatch { padding: 28px 20px; border: 1px dashed var(--st-grid); border-radius: 14px; color: var(--st-ink-2); text-align: center;
  background-image: repeating-linear-gradient(135deg, var(--st-hatch-2) 0 1px, transparent 1px 7px); }
.hatch p { max-width: 34em; margin: 0 auto; text-wrap: balance; }
.hatch .btn, .hatch .btn-ghost { margin-top: 14px; }

/* заголовок кабинета */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 22px 4px 4px; }
.head h1 { font: 600 32px/1.1 var(--st-font); letter-spacing: -.02em; }
.head p { margin-top: 6px; color: var(--st-ink-2); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head > div { min-width: 0; }

/* ---------- баланс ---------- */
.bal-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1fr); gap: 5px; }
.bal-main { display: flex; flex-direction: column; gap: 6px; }
.bal-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.bal-v { font: 600 40px/1.05 var(--st-font); letter-spacing: -.025em; white-space: nowrap; }
.bal-v[data-zero="1"] { color: var(--st-ink-3); }
.bal-sub { display: flex; align-items: center; gap: 6px; color: var(--st-ink-3); font-size: 13px; cursor: help; }
.bal-sub .ic { width: 14px; height: 14px; }
.stat { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.stat-v { font: 500 24px/1.1 var(--st-font); letter-spacing: -.025em; white-space: nowrap; }

/* ---------- вкладки ---------- */
.tabs { align-self: flex-start; }
.tabs > button { height: 36px; padding: 0 18px; font-size: 14px; }
.tab-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- ключи ---------- */
.keys { display: flex; flex-direction: column; gap: 5px; }
.key { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; }
.key-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.key-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 15.5px/1.3 var(--st-font); letter-spacing: -.01em; }
.key-top .grow { flex: 1; }
.key-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.key-meta .meta { white-space: nowrap; }
.key-tail { color: var(--st-ink-2); text-transform: none; letter-spacing: .04em; }
.key-bot { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.key-acts { display: flex; flex-wrap: wrap; gap: 2px; margin-right: -6px; }
.key[data-off="1"] .key-name, .key[data-off="1"] .key-meta { opacity: .55; }
.depth-seg > button { height: 28px; padding: 0 12px; font-size: 12.5px; }

/* ---------- формы ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > .meta { padding: 0 2px; }
.hint { color: var(--st-ink-3); font-size: 13px; line-height: 1.45; padding: 0 2px; }
.inp { width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--st-line-hi); background: var(--st-card-2);
  color: var(--st-ink); font: 400 16px var(--st-font); outline: none; box-shadow: inset 0 1px 2px var(--st-sh-1);
  transition: border-color 140ms, box-shadow 140ms; }
.inp:focus { border-color: var(--st-accent-line); box-shadow: 0 0 0 3px var(--st-accent-soft); }
.inp-mono { font: 400 14px var(--st-mono); }
.money { position: relative; }
.money > .inp { padding-left: 30px; font: 500 18px var(--st-font); letter-spacing: -.01em; }
.money::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--st-ink-3); font: 500 18px var(--st-font); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.form-err { color: var(--st-down); font-size: 13.5px; padding: 0 2px; }
.form-err:empty { display: none; }

/* выбор карточкой (версия, монета) */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.opt { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 12px 14px; text-align: left;
  border: 1px solid var(--st-line); border-radius: 12px; background: var(--st-card-2); color: var(--st-ink); cursor: pointer;
  transition: border-color 160ms, box-shadow 160ms, background-color 160ms; }
.opt:hover { border-color: var(--st-line-hi); background: var(--st-card-hover); }
.opt[aria-checked="true"] { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent); background: var(--st-card-hover); }
.opt:disabled { opacity: .5; cursor: default; }
.opt-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.opt-t { font: 600 15px/1.2 var(--st-font); letter-spacing: -.01em; }
.opt-d { color: var(--st-ink-2); font-size: 13px; line-height: 1.45; }
.depth-box { display: flex; flex-direction: column; gap: 8px; }
.depth-box .seg { align-self: flex-start; }
.cap-line { color: var(--st-ink-2); font-size: 13px; }

/* ---------- окно ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.scrim { position: absolute; inset: 0; background: var(--st-scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity 200ms var(--ease); }
.modal { position: relative; width: 100%; max-width: 500px; max-height: calc(100dvh - 48px); overflow: auto; padding: 6px; border-radius: 22px;
  background: var(--st-tray); border: 1px solid var(--st-tray-line); box-shadow: var(--st-shadow), var(--st-shadow-lg);
  opacity: 0; transform: translateY(10px) scale(.985); transition: opacity 220ms var(--ease), transform 260ms var(--ease); }
.modal-wrap[data-on="1"] .scrim, .modal-wrap[data-on="1"] .modal { opacity: 1; transform: none; }
.modal-card { padding: 18px 20px 18px; border-radius: 17px; background: var(--st-card); border: 1px solid var(--st-line-2); box-shadow: var(--st-shadow-sm); }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-t { font: 600 19px/1.25 var(--st-font); letter-spacing: -.02em; }
.modal-x { width: 32px; height: 32px; margin: -4px -6px -4px 0; box-shadow: none; border-color: transparent; background: transparent; }
.modal-b { display: flex; flex-direction: column; gap: 14px; }
.modal-p { color: var(--st-ink-2); line-height: 1.5; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.secret { padding: 14px; border-radius: 12px; border: 1px solid var(--st-accent-line); background: var(--st-accent-soft);
  font: 500 14px/1.5 var(--st-mono); word-break: break-all; user-select: all; -webkit-user-select: all; }

/* ---------- всплывашка ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 120; max-width: min(440px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 14px; background: var(--st-glass); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--st-glass-line); box-shadow: var(--st-shadow), var(--st-shadow-lg); color: var(--st-ink); font-size: 14px;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity 200ms var(--ease), transform 240ms var(--ease); }
.toast[data-on="1"] { opacity: 1; transform: translate(-50%, 0); }
.toast[data-tone="down"] { color: var(--st-down); }
.toast[data-tone="warn"] { color: var(--st-warn); }
.toast[data-tone="up"] { color: var(--st-up); }

/* ---------- пополнение ---------- */
.top-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.req-coin { font: 600 15px/1.2 var(--st-font); }
.pay-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pay-amount { font: 600 30px/1.1 var(--st-font); letter-spacing: -.02em; }
.pay-sub { color: var(--st-ink-2); font-size: 13.5px; margin-top: 4px; }
/* точная сумма к оплате — главное на шаге 2: отдельная плашка акцентом, сумма крупно, рядом «Скопировать сумму» */
.pay-exact { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 13px; border-radius: 12px;
  border: 1px solid var(--st-accent-line); background: var(--st-accent-soft); }
.pay-exact .pay-head { align-items: center; }
.pay-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.pay-exact .pay-amount { font-size: 34px; letter-spacing: -.025em; user-select: all; -webkit-user-select: all; }
.pay-coin { color: var(--st-ink-2); font-weight: 500; letter-spacing: -.01em; }
.pay-exact .pay-sub { margin: 0; color: var(--st-ink); }
.pay-exact .copy-btn { background: var(--st-card); }
.pay-grid { display: grid; grid-template-columns: 184px minmax(0, 1fr); gap: 18px; align-items: start; }
.qr-box { width: 184px; height: 184px; padding: 10px; border-radius: 14px; background: var(--qr-bg); box-shadow: inset 0 0 0 1px var(--st-line), 0 1px 2px var(--st-sh-1); }
.qr-box img { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.pay-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.addr { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--st-line-hi); background: var(--st-card-2);
  font: 500 15px/1.5 var(--st-mono); word-break: break-all; user-select: all; -webkit-user-select: all; }
.addr-row { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.addr-row > .addr { align-self: stretch; }
.pay-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.ok-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px 20px; text-align: center; }
.ok-ic { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--st-up-soft); color: var(--st-up); box-shadow: inset 0 0 0 1px var(--st-up-line); }
.ok-ic .ic { width: 24px; height: 24px; stroke-width: 2.2; }
.ok-t { font: 600 22px/1.2 var(--st-font); letter-spacing: -.02em; }
.ok-d { max-width: 30em; color: var(--st-ink-2); text-wrap: balance; }
.orders { display: flex; flex-direction: column; gap: 5px; }
.order { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.order-v { font: 500 15.5px/1.2 var(--st-font); letter-spacing: -.01em; }
.order-bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.order-why { color: var(--st-down); font-size: 13px; }

/* ---------- расход ---------- */
.use-sum { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.use-v { font: 600 26px/1.1 var(--st-font); letter-spacing: -.02em; }
.chart { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.chart-cap { min-height: 14px; }
.bars { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 150px; padding-top: 4px; border-bottom: 1px solid var(--st-line-hi); }
.bars::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; border-top: 1px dashed var(--st-line); pointer-events: none; }
.bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: none; cursor: pointer; }
.bar > i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--st-accent); opacity: .78; transition: opacity 120ms; }
.bar[data-zero="1"] > i { background: var(--st-ink-4); opacity: .5; }
.bar:hover > i, .bar[data-on="1"] > i { opacity: 1; }
.bars[data-pick="1"] .bar:not([data-on="1"]) > i { opacity: .42; }
.axis { display: flex; justify-content: space-between; }
.bykey { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.bk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.bk-n { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-n > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-v { font-weight: 500; white-space: nowrap; }
.bk-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--st-fill-2); overflow: hidden; }
.bk-bar > i { display: block; height: 100%; border-radius: 4px; background: var(--st-accent); }
.reqs { display: flex; flex-direction: column; }
.rq { display: grid; grid-template-columns: 112px minmax(80px, 140px) 56px 66px 78px 104px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px 4px; border-top: 1px solid var(--st-line-2); font-size: 13.5px; }
.rq:first-child { border-top: 0; }
.rq-h { padding-top: 2px; padding-bottom: 8px; }
.rq-h > span { font: 500 10.5px/14px var(--st-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--st-ink-3); }
.rq .num { text-align: right; }
.rq-q { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--st-ink-2); }
.rq-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rq-t { color: var(--st-ink-2); white-space: nowrap; }
.reqs-ph { display: none; flex-direction: column; }
.rqm { display: flex; flex-direction: column; gap: 7px; padding: 12px 2px; border-top: 1px solid var(--st-line-2); }
.rqm:first-child { padding-top: 2px; border-top: 0; }
.rqm:last-child { padding-bottom: 2px; }
.rqm-q { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.rqm-l { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.rqm-k { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--st-ink-2); font-size: 13px; }
.rqm-k > .meta { margin-right: 4px; }
.rqm-usd { flex: none; font-weight: 500; }
.rqm-c { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* ---------- как подключить ---------- */
.guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.guide > .wide { grid-column: 1 / -1; }
.gd { display: flex; flex-direction: column; gap: 12px; }
.gd h3 { font: 600 16px/1.3 var(--st-font); letter-spacing: -.01em; }
.gd p { color: var(--st-ink-2); line-height: 1.55; }
.base-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.base { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--st-line-hi); background: var(--st-card-2); font: 500 15px/1.3 var(--st-mono); word-break: break-all; }
.code { position: relative; }
.code pre { margin: 0; padding: 14px 16px; padding-right: 48px; border-radius: 12px; border: 1px solid var(--st-line); background: var(--st-card-2);
  font: 400 12.5px/1.6 var(--st-mono); color: var(--st-ink); overflow-x: auto; white-space: pre; tab-size: 2; }
.code .copy-btn { position: absolute; top: 8px; right: 8px; width: 30px; padding: 0; }
.code .copy-btn .lbl { display: none; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 10px; }
.steps > li { position: relative; padding-left: 34px; color: var(--st-ink-2); line-height: 1.55; counter-increment: st; overflow-wrap: anywhere; }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--st-fill-2); color: var(--st-ink); font: 500 11.5px/1 var(--st-mono); }
.dtable { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--st-line); border-radius: 12px; overflow: hidden; }
.dtable > span { padding: 9px 12px; border-top: 1px solid var(--st-line-2); font-size: 13.5px; }
.dtable > span:nth-child(-n+4) { border-top: 0; background: var(--st-card-2); }
.errs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin: 0; }
.ex-pair { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px 12px; align-items: start; }
.ex-resp { display: flex; flex-direction: column; gap: 8px; }
.errs > div { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.errs dt { margin: 0; }
.errs dd { margin: 0; color: var(--st-ink-2); line-height: 1.5; }
.mono-i { padding: 1px 5px; border-radius: 5px; background: var(--st-fill-2); font: 500 .86em var(--st-mono); color: var(--st-ink); overflow-wrap: anywhere; }

/* ---------- гость ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 44px 0 20px; }
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 0 4px; }
.hero h1 { font: 600 clamp(40px, 6vw, 64px)/1.02 var(--st-font); letter-spacing: -.03em; /* Medeo в крупном кегле плотнее Geist (21.11.2026) */ }
.hero .lead { max-width: 34em; color: var(--st-ink-2); font-size: 17.5px; line-height: 1.55; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.cta .ic-fill { width: 18px; height: 18px; }
.tiers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
.tier { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.tier-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tier-n { font: 600 22px/1.1 var(--st-font); letter-spacing: -.02em; }
.tier-d { color: var(--st-ink-2); line-height: 1.55; }
.tier-p { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--st-line-hi); }
.tier-price { font: 600 20px/1.2 var(--st-font); letter-spacing: -.02em; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.how .card { display: flex; flex-direction: column; gap: 6px; }
.how-n { font: 500 11px/1 var(--st-mono); color: var(--st-ink-3); letter-spacing: .08em; }
.how-t { font: 600 16px/1.3 var(--st-font); letter-spacing: -.01em; }
.how-d { color: var(--st-ink-2); font-size: 14px; }
.err-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.err-card h2 { font: 600 18px/1.3 var(--st-font); }

/* ---------- телефон ---------- */
@media (max-width: 720px) {
  .top-in { height: 56px; padding: 0 14px; gap: 8px; }
  .who { display: none; }
  .wrap { padding: 4px 12px calc(48px + env(safe-area-inset-bottom)); }
  .head { padding: 12px 4px 2px; }
  .head h1 { font-size: 26px; }
  .bal-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bal-main { grid-column: 1 / -1; }
  .bal-v { font-size: 36px; }
  .stat-v { font-size: 20px; }
  .card { padding: 14px; }
  .tabs { align-self: stretch; display: flex; }
  .tabs > button { flex: 1 1 auto; padding: 0 8px; font-size: 13.5px; }
  .key { padding: 13px 14px; }
  .key-bot { flex-direction: column; align-items: stretch; }
  .depth-seg { display: flex; }
  .depth-seg > button { flex: 1; }
  .key-acts { margin: 0 -6px; }
  .top-grid { grid-template-columns: minmax(0, 1fr); }
  .opts { grid-template-columns: minmax(0, 1fr); }
  .req-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pay-grid { grid-template-columns: minmax(0, 1fr); }
  .qr-box { margin: 0 auto; width: 200px; height: 200px; }
  .pay-acts { flex-direction: column-reverse; }
  .pay-row { flex-direction: column; align-items: stretch; }
  .pay-row > .copy-btn { height: 42px; }
  .pay-exact .pay-amount { font-size: 32px; }
  .pay-acts > button { width: 100%; height: 46px; }
  .guide { grid-template-columns: minmax(0, 1fr); }
  .errs, .ex-pair { grid-template-columns: minmax(0, 1fr); }
  .how { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 24px 0 4px; }
  .hero { gap: 14px; }
  .hero .lead { font-size: 16px; }
  .cta { width: 100%; }
  .cta > a, .cta > button { flex: 1 1 100%; }
  /* последние запросы — карточками в три строки вместо таблицы */
  .reqs { display: none; }
  .reqs-ph { display: flex; }
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal { max-width: none; max-height: 92dvh; border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: calc(6px + env(safe-area-inset-bottom));
    transform: translateY(24px); }
  .modal-f { flex-direction: column-reverse; }
  .modal-f > button { width: 100%; height: 46px; }
}
@media (max-width: 380px) {
  .seg-sm > button { padding: 0 7px; }
  .tabs > button { font-size: 13px; padding: 0 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; } }
