/* ==========================================================================
   META COIN — общий стиль.
   Токены → база → раскладка → компоненты. Страничные стили живут рядом
   (css/home.css …), а здесь только то, что нужно двум страницам и больше.
   Язык: тёмный тёплый фон, золото, толстые рамки, жёсткие сдвиг-тени у
   главных кнопок. Плоские поверхности: градиентов нет, кроме внутри картинок монет.
   ========================================================================== */

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

  --bg: #0B0A09;
  --surface: #15120F;
  --surface-2: #1D1915;
  --border: #2B251F;
  --border-strong: #3D352B;

  --gold: #FFC400;
  --gold-hi: #FFE04A;
  --gold-pale: #FFF4A8;
  --gold-deep: #EE9A00;
  --gold-dark: #8F5A00;

  --text: #FFFFFF;
  --text-2: #F6E7C8;
  --text-3: #B3A284;
  --text-4: #8A7C62;
  --ink: #0B0A09;

  --up: #5BE08A;
  --down: #FF7A66;
  --up-bg: rgba(91, 224, 138, .14);
  --down-bg: rgba(255, 122, 102, .14);
  --info: #7CC4FF;

  --font-display: 'Fredoka', ui-rounded, 'Arial Rounded MT Bold', 'Hiragino Maru Gothic ProN', system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;

  --gutter: 16px;
  --container: 1200px;
  /* высота верхней панели и строки подвала; core.js перезаписывает их измеренными */
  --header-h: 100px;
  --foot-h: 0px;

  --hard: 5px 5px 0 var(--gold-deep);
  --hard-sm: 3px 3px 0 var(--gold-deep);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

@media (min-width: 641px) { :root { --gutter: 24px; --header-h: 64px; --foot-h: 34px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

/* ───────────── база ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
html.modal-open { overflow: hidden; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1 0 auto; }
[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-hi); }
button { font: inherit; color: inherit; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink); }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--text);
}
p { margin: 0; }

:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; left: 12px; top: -64px; z-index: 200; background: var(--gold); color: var(--ink); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; transition: top .15s; }
.skip-link:focus { top: 12px; color: var(--ink); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.gold { color: var(--gold); }
.muted { color: var(--text-3); }
.mono, .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.up { color: var(--up); }
.down { color: var(--down); }
.nowrap { white-space: nowrap; }
.icon { flex: none; }

/* ───────────── раскладка ───────────── */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 96px); }
.section--tight { padding-block: clamp(32px, 4vw, 56px); }
.section-head { display: grid; gap: 10px; margin-bottom: clamp(24px, 4vw, 40px); max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; justify-items: center; }
.section-title { font-size: clamp(32px, 5vw, 56px); }
.section-sub { font-size: clamp(16px, 2vw, 19px); color: var(--text-3); max-width: 60ch; }
.eyebrow { font-family: var(--font-body); font-weight: 800; font-size: 13px; line-height: 1; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.lead { font-size: clamp(17px, 2.2vw, 20px); line-height: 1.5; color: var(--text-2); }

.stack { display: grid; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap, 16px); }

/* ───────────── app-оболочка ─────────────
   Правило (2026-10-09): документ НЕ скроллится. Шапка с вкладками + один экран на
   вкладку (100dvh). Длинное скроллится внутри .scroll. Блокировку включает класс
   html.has-shell (его ставит core.js; в index.html он прописан статически). */
html.has-shell, html.has-shell body { height: 100%; overflow: hidden; }
html.has-shell body { display: block; min-height: 0; }

.app { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.screen { flex: none; min-height: 0; min-width: 0; position: relative; overflow: hidden; }
/* экран переполнен (страница ещё не оформлена по правилу) — прокрутка ВНУТРИ экрана, не документа */
.screen.is-overflowing { overflow-y: auto; overscroll-behavior: contain; }

.scroll { overflow: auto; overscroll-behavior: contain; min-height: 0; -webkit-overflow-scrolling: touch; }
.scroll, .screen.is-overflowing { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.scroll::-webkit-scrollbar, .screen.is-overflowing::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb, .screen.is-overflowing::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* заготовки для экранов */
.screen-pad { padding: 16px var(--gutter); }
.fill { height: 100%; min-height: 0; }
.panel { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); overflow: hidden; }
.panel-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 2px solid var(--border); }
.panel > .scroll { flex: 1 1 auto; }
/* пустое/ошибочное состояние внутри панели: компактно, по центру оставшейся высоты */
.panel > .state { flex: 1 1 auto; align-content: center; min-height: 0; border: 0; border-radius: 0; padding: 20px 18px; }

/* ───────────── экран с под-вкладками (js/panes.js): token, flywheel ─────────────
   Одна панель за раз; панель сама решает, что у неё скроллится (.scroll внутри .panel). */
.pg { height: 100%; min-height: 0; width: 100%; max-width: 1680px; margin-inline: auto; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 12px; padding: 12px var(--gutter) 14px; }
.pg-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-width: 0; }
.pg-seg { flex: none; }
.pg-seg button { min-height: 38px; padding: 4px 16px; font-size: 16px; white-space: nowrap; }
.pg-bar .notice { flex: 1 1 260px; min-width: 0; margin: 0; padding: 6px 12px; border-radius: 12px; font-size: 13px; line-height: 1.35; align-items: center; }
.pg-bar .notice p { min-width: 0; }
.pg-body { min-height: 0; min-width: 0; position: relative; }
.pane { height: 100%; min-height: 0; min-width: 0; display: grid; gap: 14px; align-content: stretch; }
.pane > * { min-width: 0; min-height: 0; }
.pane.scroll { grid-auto-rows: max-content; }
.pane.scroll > * { min-height: auto; }
@media (max-width: 640px) {
  .pg { gap: 10px; padding: 10px var(--gutter) 12px; }
  .pg-seg { width: 100%; }
  .pg-seg button { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 4px; font-size: 15px; }
  .pg-bar .notice { flex-basis: 100%; padding: 4px 10px; font-size: 12.5px; }
  .pg-long { display: none; }
  .pane { gap: 10px; }
}

/* ───────────── верхняя панель ───────────── */
.app-top { position: relative; z-index: 60; background: var(--bg); border-bottom: 3px solid var(--border); }
.top-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: stretch; column-gap: 28px; height: 64px; padding-inline: var(--gutter); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand:hover { color: inherit; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .01em; color: var(--text); line-height: 1; white-space: nowrap; }
.logo-coin { --s: 40px; }

.tabs { display: flex; align-items: stretch; gap: 2px; min-width: 0; }
.tab { position: relative; display: flex; align-items: center; padding: 0 16px; border-radius: 12px 12px 0 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--text-2); white-space: nowrap; transition: color .15s, background .15s; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-current="page"] { color: var(--gold); }
.tab[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 3px; border-radius: 3px; background: var(--gold); }

.top-actions { display: flex; align-items: center; gap: 8px; }
.top-actions .top-info { display: none; }
.social { display: flex; gap: 4px; }

@media (max-width: 640px) {
  .top-bar { height: auto; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "tabs tabs"; column-gap: 8px; padding-top: 8px; }
  .brand { grid-area: brand; min-height: 44px; gap: 8px; }
  .top-actions { grid-area: actions; }
  .tabs { grid-area: tabs; margin: 6px calc(var(--gutter) * -1) 0; padding-inline: var(--gutter); justify-content: space-between; gap: 0; border-top: 2px solid var(--border); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 1 1 0; justify-content: center; height: 42px; padding: 0 6px; border-radius: 0; font-size: 16px; }
  .tab[aria-current="page"]::after { left: 6px; right: 6px; }
  .brand-word { font-size: 21px; }
  .logo-coin { --s: 36px; }
  .top-social { display: none; }
}

/* ───────────── строка подвала ───────────── */
.app-foot { flex: none; border-top: 2px solid var(--border); background: var(--bg); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 34px; padding-inline: var(--gutter); }
.foot-text { margin: 0; min-width: 0; font-size: 12px; line-height: 1; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-social .icon-btn { width: 28px; height: 28px; border-radius: 8px; }
/* места мало (телефон или низкое окно): подвал прячем, дисклеймер — кнопкой «i» в шапке */
@media not all and (min-width: 641px) and (min-height: 640px) {
  .app-foot { display: none; }
  .top-actions .top-info { display: inline-grid; }
}

/* ───────────── кнопки ───────────── */
.btn {
  --bw: 3px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 10px 22px;
  border: var(--bw) solid var(--ink); border-radius: 14px;
  font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1; letter-spacing: .005em;
  white-space: nowrap; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .12s var(--ease), box-shadow .12s var(--ease), background .15s, border-color .15s, color .15s;
}
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

.btn-primary { background: var(--gold); color: var(--ink); box-shadow: var(--hard); }
.btn-primary:hover { color: var(--ink); background: var(--gold-hi); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--gold-deep); }
.btn-primary:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--gold-deep); }

.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { color: var(--text); border-color: var(--gold); background: var(--surface); }
.btn-secondary:active { transform: translateY(2px); }

.btn-ghost { background: transparent; color: var(--text-2); border-color: transparent; }
.btn-ghost:hover { color: var(--gold-hi); background: var(--surface-2); }

.btn-ink { background: var(--ink); color: var(--gold); box-shadow: 5px 5px 0 var(--text-2); border-color: var(--ink); }
.btn-ink:hover { color: var(--gold-hi); transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--text-2); }
.btn-ink:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--text-2); }

.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 16px; border-radius: 12px; gap: 8px; --bw: 2px; }
.btn-sm.btn-primary { box-shadow: var(--hard-sm); }
.btn-sm.btn-primary:hover { box-shadow: 5px 5px 0 var(--gold-deep); }
.btn-lg { min-height: 58px; padding: 14px 30px; font-size: 21px; border-radius: 16px; }
.btn-block { display: flex; width: 100%; }

.btn.is-loading { pointer-events: none; color: transparent; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 22px; height: 22px; border: 3px solid currentColor; border-color: var(--ink) transparent var(--ink) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-loading::after { border-color: var(--gold) transparent var(--gold) transparent; }

.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 2px solid transparent; border-radius: 12px; background: transparent; color: var(--text-2); transition: background .15s, color .15s, border-color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--gold-hi); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── карточки ───────────── */
.card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); padding: 20px; }
.card--lg { border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); }
.card--flat { background: var(--surface-2); }
.card-hover { transition: transform .15s var(--ease), border-color .15s, box-shadow .15s var(--ease); }
a.card:hover, .card-hover:hover { color: inherit; border-color: var(--gold); transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--gold-deep); }
a.card:active, .card-hover:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--gold-deep); }

/* ───────────── плитки статистики ───────────── */
.stat-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; } }
.stat { position: relative; display: grid; gap: 8px; align-content: start; padding: 18px 20px 20px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--r); min-width: 0; }
.stat-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.stat-label .icon { color: var(--gold); }
.stat-value { font-family: var(--font-display); font-weight: 700; font-size: clamp(34px, 4.6vw, 50px); line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.stat-value .unit { margin-left: 6px; font-size: .46em; font-weight: 600; letter-spacing: .02em; color: var(--gold); }
.stat-sub { font-size: 14px; color: var(--text-3); min-height: 1.4em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat .badge { position: absolute; top: 14px; right: 14px; }

/* ───────────── бейджи и изменение ───────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-family: var(--font-body); font-weight: 800; font-size: 12px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-2); color: var(--text-2); border: 2px solid var(--border-strong); white-space: nowrap; }
.badge-gold { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.badge-outline { background: transparent; border-color: var(--gold); color: var(--gold); }
.badge-up { background: var(--up-bg); color: var(--up); border-color: transparent; }
.badge-down { background: var(--down-bg); color: var(--down); border-color: transparent; }
.badge-muted { color: var(--text-3); }
.badge-sample { background: transparent; border-style: dashed; border-color: var(--gold-dark); color: var(--gold-deep); }

.chg { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; font-family: var(--font-mono); font-weight: 600; font-size: 13px; line-height: 1.2; font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface-2); color: var(--text-3); }
.chg.up { background: var(--up-bg); color: var(--up); }
.chg.down { background: var(--down-bg); color: var(--down); }
.chg .icon { width: 13px; height: 13px; }

/* ───────────── монета-аватар ───────────── */
.coin { --s: 48px; position: relative; flex: none; display: inline-grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; background: #120F0D; }
.coin img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.14); }
.coin--plain { background: var(--surface-2); border: 2px solid var(--border-strong); }
.coin--plain img { transform: none; }
.coin--fallback { background: var(--gold); border: 3px solid var(--gold-deep); box-shadow: inset 0 0 0 3px var(--gold-hi); }
.coin-emoji { font-size: calc(var(--s) * .5); line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', var(--font-display), sans-serif; }
.coin--fallback .coin-emoji:not(:has(*)) { font-weight: 700; }

/* ───────────── таблицы ───────────── */
.table-wrap { overflow-x: auto; border: 2px solid var(--border); border-radius: var(--r); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 14px 16px; text-align: left; white-space: nowrap; border-bottom: 2px solid var(--border); }
.table th { position: sticky; top: 0; background: var(--surface-2); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; }
.table .cell-main { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); }
.th-sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.th-sort:hover, .th-sort[aria-pressed="true"] { color: var(--gold); }

/* ───────────── переключатель (CARDS | TABLE, сортировка) ───────────── */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 2px solid var(--border); border-radius: 14px; }
.seg button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 16px; border: 0; border-radius: 10px; background: transparent; font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: .02em; color: var(--text-2); transition: background .15s, color .15s; }
.seg button:hover { color: var(--text); background: var(--surface-2); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"], .seg button.is-active { background: var(--gold); color: var(--ink); }

/* ───────────── формы ───────────── */
.field { display: grid; gap: 6px; }
.label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; gap: 8px; }
.label .opt { font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-4); }
.input, .select, .textarea { width: 100%; min-height: 48px; padding: 11px 14px; border: 2px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; transition: border-color .15s, background .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--text-4); font-weight: 500; }
.input:hover, .select:hover, .textarea:hover { border-color: #51473A; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); background: var(--surface-2); }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FFC400' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.hint { font-size: 13px; color: var(--text-3); }
.field-error, .input[aria-invalid="true"] ~ .hint { color: var(--down); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--down); }

/* ───────────── модалка ───────────── */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; padding: 0; background: rgba(5, 4, 3, .82); opacity: 0; transition: opacity .18s; overflow-y: auto; overscroll-behavior: contain; }
.modal-backdrop.in { opacity: 1; }
.modal { width: 100%; max-width: 100%; max-height: 94dvh; display: flex; flex-direction: column; background: var(--surface); border: 3px solid var(--border-strong); border-bottom: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -6px 0 var(--gold-deep); transform: translateY(24px); transition: transform .22s var(--ease); }
.modal-backdrop.in .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 2px solid var(--border); }
.modal-title { font-size: 26px; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; gap: 18px; align-content: start; }
.modal-foot { padding: 16px 20px 20px; border-top: 2px solid var(--border); display: grid; gap: 10px; }
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; padding: 24px; }
  .modal { max-width: 560px; max-height: calc(100dvh - 48px); border-bottom: 3px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: 8px 8px 0 var(--gold-deep); }
  .modal--lg { max-width: 760px; }
}

/* ───────────── тосты ───────────── */
.toasts { position: fixed; left: 50%; bottom: 20px; z-index: 120; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--surface-2); border: 2px solid var(--border-strong); border-radius: 14px; box-shadow: 4px 4px 0 #000; font-weight: 700; color: var(--text); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast--ok .icon { color: var(--up); }
.toast--error { border-color: var(--down); }
.toast--error .icon { color: var(--down); }
.toast--info .icon { color: var(--gold); }

/* ───────────── скелетоны, пустые состояния ───────────── */
.skeleton { display: block; background: var(--surface-2); border-radius: 8px; animation: pulse 1.3s ease-in-out infinite; }
.skeleton-text { height: 1em; width: 100%; }
.skeleton-circle { border-radius: 50%; }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

.state { display: grid; justify-items: center; gap: 12px; padding: 40px 24px; text-align: center; border: 2px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--text-3); }
.state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); color: var(--gold); border: 2px solid var(--border-strong); }
.state-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--text); }
.state-text { max-width: 44ch; font-size: 15px; }
.state--error .state-icon { color: var(--down); }

/* ───────────── искра ───────────── */
.sparkle { display: block; width: var(--s, 18px); aspect-ratio: 1; background: var(--c, #FFFDF2); clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%); }

/* ───────────── полоса-бегущая строка ───────────── */
.ticker { overflow: hidden; border-block: 3px solid var(--border); background: var(--surface); }
.ticker-track { display: flex; width: max-content; animation: ticker 60s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-item { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--text); white-space: nowrap; border-right: 2px solid var(--border); }
.ticker-item .t-emoji { font-size: 20px; line-height: 1; }
.ticker-item .t-tick { color: var(--text-3); font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ───────────── анимации входа ───────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .ticker-track { animation: none; }
}

/* узкие телефоны (320–380): шапка должна помещаться в две строки без обрезки */
@media (max-width: 380px) {
  .brand-word { font-size: 19px; }
  .logo-coin { --s: 32px; }
  .top-actions { gap: 2px; }
  .top-launch { padding: 6px 12px; }
  .tab { font-size: 15px; padding: 0 4px; }
}
