/* CoinW — дизайн-система мини-аппа.
   Палитра снята с логотипа: фирменный индиго #5226FF + почти чёрный. Один акцент, плоские заливки, без градиентов. */

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

:root {
  --bg: #ffffff;
  --card: #f5f5f8;
  --card-2: #ebebf1;
  --text: #121218;
  --muted: #666676;
  --line: #e9e9ef;
  --brand: #5226ff;
  --brand-soft: #efebff;
  --up: #00b076;
  --down: #f0354b;
  --up-soft: #e0f6ee;
  --down-soft: #fde8eb;
  --overlay: rgba(12, 12, 20, 0.5);
  --shadow: 0 12px 32px rgba(20, 16, 60, 0.14);
  --font: 'Onest', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --sheet-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tab-h: 76px;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #08080d;
  --card: #121219;
  --card-2: #1c1c26;
  --text: #f3f3f8;
  --muted: #8e8ea1;
  --line: #1d1d28;
  --brand: #7456ff;
  --brand-soft: #1b1542;
  --up: #17d08f;
  --down: #ff4d63;
  --up-soft: #0d2b23;
  --down-soft: #321219;
  --overlay: rgba(0, 0, 0, 0.66);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  overflow: hidden;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img, svg { display: block; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
#app { height: 100%; max-width: 560px; margin: 0 auto; position: relative; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: var(--safe-t) 16px calc(var(--tab-h) + var(--safe-b) + 28px); animation: enter-tab 0.34s var(--ease-out) both; }
.screen::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: none; }
.screen.no-tabs { padding-bottom: calc(var(--safe-b) + 24px); }
.screen.has-cta { padding-bottom: calc(var(--safe-b) + 96px); }
.screen[data-dir='fwd'] { animation-name: enter-fwd; }
.screen[data-dir='back'] { animation-name: enter-back; }
@keyframes enter-tab { from { opacity: 0; transform: translateY(10px); } }
@keyframes enter-fwd { from { opacity: 0; transform: translateX(32px); } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-32px); } }

/* ---------- нижняя панель: тонкое прозрачное стекло ---------- */
.tabbar {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + 12px); height: 66px; z-index: 20;
  padding: 6px; border-radius: 33px; transform-origin: 50% 100%;
  background: color-mix(in srgb, var(--bg) 34%, transparent);
  -webkit-backdrop-filter: blur(6px) saturate(1.6); backdrop-filter: blur(6px) saturate(1.6);
  box-shadow: 0 8px 28px rgba(16, 12, 48, 0.13), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform 0.5s var(--spring), opacity 0.25s ease;
}
[data-theme='dark'] .tabbar {
  background: rgba(22, 22, 32, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}
/* компактный режим при прокрутке вниз: панель опускается и уменьшается, подписи гаснут (только transform/opacity — без перекладки) */
.tabbar.compact { transform: translateY(12px) scale(0.9); }
.tabbar.compact .tab span { opacity: 0; }
.tabbar.hide { transform: translateY(calc(100% + var(--safe-b) + 28px)); opacity: 0; pointer-events: none; }
.tabs-track { position: relative; height: 100%; }
.tabs-row { position: absolute; inset: 0; display: flex; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.01em; min-width: 0; }
.tab svg { width: 24px; height: 24px; }
.tab span { line-height: 1; transition: opacity 0.2s ease; }
.tabs-row .tab { transition: opacity 0.1s linear; }
.tabs-row .tab.under { opacity: 0; }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -3px; border-radius: 24px; }
/* «прыжок» иконки при выборе вкладки */
.tab.bump svg { animation: tab-bump 0.5s var(--spring); }
@keyframes tab-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22) translateY(-2px); }
  100% { transform: scale(1); }
}
/* «пузырь» (жидкое стекло) под выбранной вкладкой. Движением, масштабом, наклоном и бликом управляет tabbar.js (пружины).
   Слои: заливка с градиентом → обод с цветной дисперсией (::before) → блики сверху и снизу (::after) → увеличенные иконки.
   Преломление фона убрано: оно считалось на CPU каждый кадр и затягивало в пузырь соседние иконки. */
.lens { position: absolute; top: 0; bottom: 0; left: 0; z-index: 2; pointer-events: none; will-change: transform; }
.lens-glass {
  position: absolute; inset: 0; border-radius: 999px; overflow: hidden; will-change: transform;
  background:
    radial-gradient(60% 45% at 28% 8%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.1) 55%, rgba(255, 255, 255, 0.22));
  box-shadow:
    0 6px 18px rgba(20, 16, 60, 0.14),
    inset 0 1px 1.5px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1.5px rgba(255, 255, 255, 0.5),
    inset 0 0 14px rgba(255, 255, 255, 0.26);
}
/* обод стекла: тонкая кромка с лёгкой цветной дисперсией (синий слева-сверху, розовый справа-снизу) */
.lens-glass::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; pointer-events: none; z-index: 0;
  background: conic-gradient(from 200deg, rgba(255, 255, 255, 0.95), rgba(150, 185, 255, 0.4) 18%, rgba(255, 255, 255, 0.12) 40%, rgba(255, 160, 215, 0.42) 62%, rgba(255, 255, 255, 0.12) 80%, rgba(255, 255, 255, 0.95));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* блики: верхний «окошком» и нижний каустик (статичные — не перерисовываются во время движения) */
.lens-glass::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background:
    radial-gradient(38% 26% at 30% 14%, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0) 72%),
    radial-gradient(70% 50% at 55% 112%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 70%);
  opacity: 0.7; transition: opacity 0.3s ease;
}
[data-theme='dark'] .lens-glass {
  background:
    radial-gradient(60% 45% at 28% 8%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0.1));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 1.5px rgba(255, 255, 255, 0.5), inset 0 -1px 1.5px rgba(255, 255, 255, 0.2), inset 0 0 14px rgba(255, 255, 255, 0.08);
}
[data-theme='dark'] .lens-glass::after { opacity: 0.45; }
[data-theme='dark'] .lens-glass::before { opacity: 0.8; }
/* зажали: стекло «оживает» — ярче блики, глубже тень, преломление фона (где поддерживается) */
.tabbar.pressed .lens-glass::after { opacity: 1; }
/* глубокая тень зажатого пузыря: отдельный слой, анимируется только opacity (дёшево) */
.lens::before { content: ''; position: absolute; left: 4px; right: 4px; top: 8px; bottom: -6px; border-radius: 999px; box-shadow: 0 14px 28px rgba(20, 16, 60, 0.26); opacity: 0; transition: opacity 0.25s ease; }
.tabbar.pressed .lens::before { opacity: 1; }
[data-theme='dark'] .lens::before { box-shadow: 0 16px 32px rgba(0, 0, 0, 0.55); }
[data-theme='dark'] .tabbar.pressed .lens-glass::after { opacity: 0.7; }
.lens-icons { position: absolute; top: 0; bottom: 0; left: 0; z-index: 1; display: flex; color: var(--brand); will-change: transform; }
.lens-icons .tab { color: inherit; } /* иконки внутри пузыря — фирменного цвета, а не приглушённого серого */
[data-theme='dark'] .lens-icons { color: #c9bcff; }

/* ---------- шапка ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 10px; }
.top .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; min-width: 0; letter-spacing: -0.01em; }
.top .brand img { width: 25px; height: 30px; object-fit: contain; }
.top .title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; position: relative; color: var(--text); transition: background 0.2s, transform 0.3s var(--spring); }
.icon-btn:active { background: var(--card); transform: scale(0.9); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; font-style: normal; animation: pop 0.45s var(--spring) both; }
.pill .mono, .pill { white-space: nowrap; }
.pill { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); font-size: 12.5px; font-weight: 700; transition: transform 0.3s var(--spring); }
.pill:active { transform: scale(0.95); }
.pill .avatar { width: 26px; height: 26px; }
.back { width: 40px; height: 40px; margin-left: -10px; display: grid; place-items: center; border-radius: 13px; transition: transform 0.3s var(--spring); }
.back:active { transform: scale(0.88) translateX(-2px); }
.back svg { width: 24px; height: 24px; }
.avatar { border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 12px; flex: none; overflow: hidden; }

/* ---------- баланс ---------- */
.balance { padding: 8px 0 4px; }
.balance .label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; }
.balance .label button { display: grid; place-items: center; color: var(--muted); transition: transform 0.3s var(--spring); }
.balance .label button:active { transform: scale(0.8); }
.balance .label svg { width: 17px; height: 17px; }
.balance-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 12px; margin-top: 2px; }
.balance-row .btn { flex: none; margin-left: auto; padding: 0 16px; height: 44px; }
.amount { font-size: 29px; font-weight: 750; letter-spacing: -0.035em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.amount small { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }
.amount.sm { font-size: 26px; }

.btn { height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 650; font-size: 15px; letter-spacing: -0.005em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.4s var(--spring), opacity 0.2s, background 0.2s; white-space: nowrap; }
.btn:active { transform: scale(0.955); transition-duration: 0.12s; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.buy { background: var(--up); color: #fff; }
.btn.sell { background: var(--down); color: #fff; }
.btn.soft { background: var(--card); color: var(--text); }
.btn.brand-soft { background: var(--brand-soft); color: var(--brand); }
.btn.block { width: 100%; }
.btn.sm { height: 38px; font-size: 13.5px; padding: 0 14px; border-radius: 12px; }
.btn svg { width: 19px; height: 19px; }

/* ---------- быстрые действия ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 18px 0 20px; }
.quick button { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 11px; font-weight: 550; color: var(--text); }
.quick .ic { width: 52px; height: 52px; border-radius: 18px; background: var(--card); display: grid; place-items: center; transition: background 0.2s, transform 0.4s var(--spring); }
.quick button:active .ic { transform: scale(0.88); background: var(--card-2); }
.quick .ic svg { width: 22px; height: 22px; }

/* ---------- промо-карточки ---------- */
.promos { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 22px; padding: 0 16px; scrollbar-width: none; }
.promos::-webkit-scrollbar { display: none; }
.promo { flex: 0 0 82%; max-width: 330px; height: 124px; border-radius: 22px; padding: 14px 16px; text-align: left; position: relative; overflow: hidden; scroll-snap-align: start; color: var(--text); background-color: var(--card); background-image: radial-gradient(color-mix(in srgb, var(--muted) 30%, transparent) 1px, transparent 1.2px); background-size: 9px 9px; transition: transform 0.4s var(--spring); }
.promo:active { transform: scale(0.97); }
.promo .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
.promo .kicker b { font-weight: 600; padding: 2px 7px; border-radius: 10px; background: var(--bg); color: var(--muted); font-size: 11px; }
.promo .headline { margin-top: 30px; font-size: 18px; font-weight: 700; max-width: 56%; line-height: 1.15; letter-spacing: -0.02em; }
.promo .tgs { position: absolute; right: 6px; bottom: -6px; --s: 116px; }

/* ---------- вкладки, чипы ---------- */
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 -16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 0 11px; font-size: 16px; font-weight: 650; color: var(--muted); position: relative; white-space: nowrap; letter-spacing: -0.01em; transition: color 0.2s; }
.tabs button.on { color: var(--text); }
.tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2.5px; background: var(--brand); border-radius: 2px; animation: underline 0.35s var(--ease-out) both; transform-origin: left; }
@keyframes underline { from { transform: scaleX(0); } }
.chips { display: flex; gap: 6px; margin: 14px 0 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; transition: background 0.25s, color 0.25s, transform 0.35s var(--spring); }
.chips button:active { transform: scale(0.92); }
.chips button.on { background: var(--brand-soft); color: var(--brand); }
.seg { display: flex; padding: 3px; background: var(--card); border-radius: 13px; gap: 2px; }
.seg button { flex: 1; height: 34px; border-radius: 10px; font-weight: 650; font-size: 13.5px; color: var(--muted); transition: background 0.25s, color 0.25s, transform 0.35s var(--spring); }
.seg button:active { transform: scale(0.96); }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 4px rgba(20, 20, 50, 0.12); }
.seg.trade button.on.buy { background: var(--up); color: #fff; }
.seg.trade button.on.sell { background: var(--down); color: #fff; }

/* ---------- монеты и строки ---------- */
.coin { --c: #888; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-weight: 800; font-size: 11px; background: var(--c); }
.coin.l4 { font-size: 9.5px; }
.coin.lg { width: 44px; height: 44px; }
.coin.sm { width: 32px; height: 32px; font-size: 9px; }
.coin img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.coin:has(img) { background: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; width: 100%; text-align: left; transition: transform 0.3s var(--spring), background 0.2s; }
button.row:active { transform: scale(0.985); }
.row.in { animation: row-in 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 34ms); }
@keyframes row-in { from { opacity: 0; transform: translateY(12px); } }
.row .grow { flex: 1; min-width: 0; }
.row .tick { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.row .tick span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.row .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row .price { position: relative; isolation: isolate; font-size: 15.5px; font-weight: 650; text-align: right; min-width: 72px; padding: 3px 6px; margin-right: -6px; border-radius: 8px; }
.row .price::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 8px; opacity: 0; pointer-events: none; }
.frac { opacity: 0.5; font-weight: 500; }
.row .price.flash-up { animation: flash-up 0.6s ease-out; }
.row .price.flash-down { animation: flash-down 0.6s ease-out; }
.row .price.flash-up::before { background: var(--up-soft); animation: flash-bg 0.6s ease-out; }
.row .price.flash-down::before { background: var(--down-soft); animation: flash-bg 0.6s ease-out; }
@keyframes flash-up { 0% { color: var(--up); } 100% { color: var(--text); } }
@keyframes flash-down { 0% { color: var(--down); } 100% { color: var(--text); } }
@keyframes flash-bg { 0% { opacity: 1; } 100% { opacity: 0; } }
.pair-price.flash-up { animation: pair-flash-up 0.8s ease-out; }
.pair-price.flash-down { animation: pair-flash-down 0.8s ease-out; }
@keyframes pair-flash-up { 0% { color: var(--up); } 100% { color: var(--text); } }
@keyframes pair-flash-down { 0% { color: var(--down); } 100% { color: var(--text); } }

/* мини-график в строке рынка */
.spark { flex: none; width: 56px; height: 24px; color: var(--up); overflow: visible; }
.spark.neg { color: var(--down); }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: spark-draw 0.9s var(--ease-out) both; }
.spark .a { fill: currentColor; opacity: 0.12; stroke: none; }
@keyframes spark-draw { from { stroke-dashoffset: 1; } }
@media (max-width: 359px) { .spark { display: none; } }
.badge { min-width: 72px; padding: 8px 6px; border-radius: 10px; text-align: center; font-size: 13px; font-weight: 700; color: #fff; background: var(--up); font-variant-numeric: tabular-nums; transition: background 0.3s; }
.badge.neg { background: var(--down); }
.badge.soft { background: var(--up-soft); color: var(--up); padding: 3px 8px; min-width: 0; font-size: 12.5px; border-radius: 8px; display: inline-block; }
.badge.soft.neg { background: var(--down-soft); color: var(--down); }
.icon-btn.star { color: var(--muted); }
.icon-btn.star.on { color: #f5a623; }
.icon-btn.star.on svg { fill: currentColor; animation: pop 0.5s var(--spring); }

.empty { text-align: center; color: var(--muted); padding: 30px 24px; font-size: 14px; }
.empty .tgs { margin: 0 auto 6px; --s: 112px; }
.skel { border-radius: 10px; background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- TGS-стикеры ---------- */
.tgs { display: block; width: var(--s, 96px); height: var(--s, 96px); flex: none; }
.tgs svg { width: 100% !important; height: 100% !important; }
.celebrate { position: fixed; inset: 0; display: grid; place-items: center; z-index: 90; pointer-events: none; }
.celebrate .tgs { --s: 220px; animation: pop 0.55s var(--spring) both; filter: drop-shadow(0 12px 24px rgba(20, 16, 60, 0.25)); }
.celebrate.out { animation: fade-out 0.4s ease forwards; }
@keyframes fade-out { to { opacity: 0; transform: scale(0.94); } }

/* ---------- карточки и секции ---------- */
.card { background: var(--card); border-radius: 20px; padding: 16px; }
.section-title { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 22px 0 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 14px; animation: row-in 0.5s var(--ease-out) both; }
.stat:nth-child(2) { animation-delay: 0.05s; } .stat:nth-child(3) { animation-delay: 0.1s; } .stat:nth-child(4) { animation-delay: 0.15s; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 15px; font-weight: 700; margin-top: 3px; letter-spacing: -0.01em; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.list-card { background: var(--card); border-radius: 20px; padding: 4px 16px; }
.list-card .row + .row { border-top: 1px solid var(--line); }
.link-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; width: 100%; text-align: left; font-weight: 550; transition: transform 0.3s var(--spring); }
.link-row:active { transform: scale(0.985); }
.link-row + .link-row { border-top: 1px solid var(--line); }
.link-row .ic { width: 34px; height: 34px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.link-row .ic svg { width: 19px; height: 19px; }
.link-row .chev { margin-left: auto; color: var(--muted); }
.link-row .chev svg { width: 18px; height: 18px; }

/* ---------- пара / график ---------- */
.pair-head { padding: 4px 0 8px; }
.pair-price { font-size: 34px; font-weight: 750; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.pair-price small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.chart-wrap { position: relative; margin: 6px -16px 0; height: 230px; touch-action: pan-y; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-tip { position: absolute; top: 4px; left: 16px; font-size: 12px; color: var(--muted); pointer-events: none; opacity: 0; transition: opacity 0.15s; }
.chart-tip b { color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-wrap.hover .chart-tip { opacity: 1; }
.cta-bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(var(--safe-b) + 12px); display: flex; gap: 10px; background: color-mix(in srgb, var(--bg) 96%, transparent); border-top: 1px solid var(--line); z-index: 15; animation: cta-in 0.35s var(--ease-out) both; }
@keyframes cta-in { from { transform: translateY(100%); } }
.cta-bar .btn { flex: 1; }
.holding { display: flex; align-items: center; gap: 12px; }
.holding .grow { flex: 1; }

/* ---------- формы ---------- */
.field { position: relative; }
.field input { width: 100%; height: 56px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); padding: 0 64px 0 16px; font-size: 20px; font-weight: 700; outline: none; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s; font-variant-numeric: tabular-nums; }
.field input:focus { border-color: var(--brand); background: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
.field .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); }
.field-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.search { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 15px; background: var(--card); color: var(--muted); transition: box-shadow 0.2s; }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand); }
.search svg { width: 19px; height: 19px; flex: none; }
.search input { flex: 1; background: none; border: 0; outline: none; font-size: 16px; color: var(--text); min-width: 0; }
.quick-amounts { display: flex; gap: 8px; margin: 10px 0 14px; }
.quick-amounts button { flex: 1; height: 36px; border-radius: 11px; background: var(--card); font-weight: 650; font-size: 13px; transition: transform 0.35s var(--spring), background 0.2s; }
.quick-amounts button:active { background: var(--brand-soft); color: var(--brand); transform: scale(0.93); }
.method { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); margin-bottom: 8px; transition: border-color 0.25s, background 0.25s, transform 0.35s var(--spring); }
.method:active { transform: scale(0.985); }
.method.on { border-color: var(--brand); background: var(--brand-soft); }
.method .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--card); display: grid; place-items: center; color: var(--brand); flex: none; }
.method.on .ic { background: var(--bg); }
.method .ic svg { width: 20px; height: 20px; }
.method .t { font-weight: 650; }
.method .d { font-size: 12px; color: var(--muted); }
.method .check { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; flex: none; transition: all 0.3s var(--spring); }
.method.on .check { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.1); }
.method .check svg { width: 12px; height: 12px; }
.switch { position: relative; width: 48px; height: 28px; border-radius: 14px; background: var(--card-2); transition: background 0.25s; flex: none; margin-left: auto; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); transition: transform 0.4s var(--spring), width 0.2s; }
.switch:active::after { width: 27px; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(20px); }
.switch.on:active::after { transform: translateX(15px); }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.status { display: inline-block; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 650; }
.status.pending { background: #fff4d6; color: #a06a00; }
.status.approved { background: var(--up-soft); color: var(--up); }
.status.rejected, .status.error { background: var(--down-soft); color: var(--down); }
[data-theme='dark'] .status.pending { background: #33290f; color: #f2c04d; }

/* ---------- уведомления, поддержка ---------- */
/* каждое уведомление — плашка: зелёная (ok), красная (error) или нейтральная */
.notif { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px; border-radius: 18px; background: var(--card); animation: row-in 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.notif.ok { background: var(--up-soft); }
.notif.error { background: var(--down-soft); }
.notif .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--card-2); color: var(--muted); display: grid; place-items: center; flex: none; }
.notif.ok .ic { background: var(--up); color: #fff; }
.notif.error .ic { background: var(--down); color: #fff; }
.notif .ic svg { width: 20px; height: 20px; }
.notif .t { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.notif .t i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.notif.ok .t i { background: var(--up); }
.notif.error .t i { background: var(--down); }
.notif .b { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.notif.ok .b, .notif.error .b { color: color-mix(in srgb, var(--text) 72%, transparent); }
.notif .w { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.faq { border-bottom: 1px solid var(--line); }
.faq button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 0; font-weight: 600; text-align: left; }
.faq button svg { width: 18px; height: 18px; color: var(--muted); transition: transform 0.35s var(--spring); flex: none; }
.faq.open button svg { transform: rotate(90deg); }
.faq .ans { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease-out); }
.faq.open .ans { grid-template-rows: 1fr; }
.faq .ans > p { overflow: hidden; margin: 0; color: var(--muted); font-size: 14px; }
.faq.open .ans > p { padding-bottom: 14px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 18px; text-align: center; }
.profile-head .avatar { width: 84px; height: 84px; font-size: 30px; margin-bottom: 6px; animation: pop 0.6s var(--spring) both; }
.profile-head .name { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.copy { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 4px 10px; border-radius: 10px; background: var(--card); transition: transform 0.3s var(--spring); }
.copy:active { transform: scale(0.94); }
.copy svg { width: 14px; height: 14px; }

/* ---------- оверлеи ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 50; opacity: 0; transition: opacity 0.3s ease; }
.sheet-backdrop.show { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(var(--safe-b) + 18px); z-index: 51; transform: translateY(100%); transition: transform 0.45s var(--sheet-ease); max-height: 92%; overflow-y: auto; box-shadow: var(--shadow); scrollbar-width: none; }
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--card-2); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.02em; }

/* плашки уведомлений: те же цвета, что у карточки «ставка сыграла» (.result-card) */
.toasts { position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%); width: calc(100% - 32px); max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 10px 16px 10px 10px; border-radius: 18px; color: #fff; font-size: 14px; font-weight: 600; line-height: 1.3; opacity: 0; transform: translateY(-24px) scale(0.96); transition: opacity 0.25s, transform 0.5s var(--spring); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26); }
.toast.show { opacity: 1; transform: none; }
.toast.ok { background: linear-gradient(135deg, #00a874, #008558); }
.toast.error { background: linear-gradient(135deg, #f0354b, #cf1f37); }
.toast.neutral { background: linear-gradient(135deg, #565665, #3d3d4a); }
.toast.tap { pointer-events: auto; cursor: pointer; }
.toast.bump { animation: toast-bump 0.35s var(--spring); }
@keyframes toast-bump { 40% { transform: scale(1.05); } }
.t-ic { flex: none; width: 28px; height: 28px; border-radius: 50%; background: rgba(255, 255, 255, 0.2); display: grid; place-items: center; }
.t-ic svg { width: 16px; height: 16px; stroke-width: 2.2; }
.t-text { min-width: 0; }
.t-title { font-weight: 750; }
.t-title + .t-msg { font-size: 13px; font-weight: 500; opacity: 0.92; margin-top: 1px; }
.t-msg { overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.boot { flex: 1; display: grid; place-items: center; }
.boot .logo { width: 54px; height: 64px; object-fit: contain; animation: breathe 1.5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(0.9); opacity: 0.75; } }
.fatal { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 32px; }
.fatal h2 { margin: 0; letter-spacing: -0.02em; }
.fatal p { color: var(--muted); margin: 0 0 8px; }

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

.about-logo { margin: 4px 0 14px; }
.about-logo img { height: 34px; width: auto; }
.logo-dark { display: none !important; }
[data-theme='dark'] .logo-dark { display: block !important; }
[data-theme='dark'] .logo-light { display: none !important; }

/* ---------- маржинальные позиции: лонг / шорт ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tabs .count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; vertical-align: 2px; animation: pop 0.4s var(--spring) both; }
.seg.mode button { font-size: 13px; }
.dir { display: inline-block; padding: 2px 7px; border-radius: 7px; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
.dir.long { background: var(--up-soft); color: var(--up); }
.dir.short { background: var(--down-soft); color: var(--down); }
.pos { background: var(--card); border-radius: 20px; padding: 14px; margin-bottom: 10px; animation: row-in 0.5s var(--ease-out) both; }
.pos-top { display: flex; align-items: center; gap: 10px; }
.pos-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.pos-pnl { text-align: right; font-weight: 700; }
.pos-pnl > div:first-child { font-size: 16px; }
.pos-pnl > div:last-child { font-size: 12px; margin-top: 1px; }
.pos-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 12px 0 10px; }
.pos-grid > div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.pos-grid .k { color: var(--muted); }
.risk { height: 5px; border-radius: 3px; background: var(--card-2); overflow: hidden; margin-bottom: 12px; }
.risk i { display: block; height: 100%; border-radius: 3px; background: var(--up); transition: width 0.6s var(--ease-out), background 0.3s; }
.risk i.hot { background: var(--down); }
.pos-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; }
.pos-summary > div { background: var(--card); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.pos-summary .k { font-size: 12px; color: var(--muted); }
.pos-summary b { font-size: 16px; letter-spacing: -0.01em; }
/* ползунок экспирации */
.exp { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 12px 0 6px; border-radius: 3px; background: var(--card-2); outline: none; }
.exp::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); border: 3px solid var(--bg); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35); cursor: pointer; }
.exp::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid var(--bg); cursor: pointer; }
.exp-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }
.exp-ticks span.on { color: var(--text); }
/* окно ставки без лишних анимаций */
.sheet button, .sheet .seg button { transition: background 0.15s, color 0.15s; }
.sheet button:active { transform: none; }
.pos .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.seg.mode button { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; }
.seg.mode svg { width: 18px; height: 18px; }
.seg.mode button.on svg { color: var(--brand); }

/* ================= Десктоп и широкие окна ================= */

/* обёртки колонок на телефоне «прозрачны» — вёрстка та же, что и раньше */
.home-side, .home-main, .pair-layout, .pair-main, .pair-side { display: contents; }
.cta-inline { display: none; }
.sidebar { display: none; }

/* фокус с клавиатуры */
button:focus-visible, .link-row:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.row:focus-visible { outline-offset: -2px; border-radius: 12px; }

/* мышь: наведение и обычные полосы прокрутки вместо скрытых */
@media (hover: hover) and (pointer: fine) {
  .screen, .sheet { scrollbar-width: thin; scrollbar-color: var(--card-2) transparent; }
  .screen::-webkit-scrollbar, .sheet::-webkit-scrollbar { display: block; width: 10px; }
  .screen::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb { background: var(--card-2); border-radius: 5px; border: 2px solid var(--bg); }
  .screen::-webkit-scrollbar-track, .sheet::-webkit-scrollbar-track { background: transparent; }

  .btn.primary:hover, .btn.buy:hover, .btn.sell:hover { filter: brightness(1.08); }
  .btn.soft:hover { background: var(--card-2); }
  .btn.brand-soft:hover { filter: brightness(0.97); }
  .icon-btn:hover, .back:hover, .pill:hover { background: var(--card); }
  .list .row:hover { background: var(--card); box-shadow: 0 0 0 10px var(--card); border-radius: 12px; }
  .list-card .row:hover, .link-row:hover { background: var(--card-2); }
  .quick button:hover .ic { background: var(--card-2); }
  .promo:hover { transform: translateY(-2px); }
  .method:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
  .chips button:hover:not(.on) { background: var(--card); color: var(--text); }
  .tabs button:hover:not(.on) { color: var(--text); }
  .seg button:hover:not(.on) { color: var(--text); }
  .quick-amounts button:hover { background: var(--brand-soft); color: var(--brand); }
  
  .copy:hover { background: var(--card-2); }
  .faq button:hover { color: var(--brand); }
}


/* ---------- плашка «ставка сыграла» ---------- */
.result-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 28px;
  background: var(--overlay);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.result-overlay.show { opacity: 1; visibility: visible; }
.result-card {
  width: min(360px, 100%);
  border-radius: 26px;
  padding: 26px 22px 20px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
  transform: scale(0.9) translateY(12px);
  opacity: 0;
  transition: transform 0.4s var(--spring), opacity 0.28s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.result-overlay.show .result-card { transform: scale(1) translateY(0); opacity: 1; }
.result-card.up { background: linear-gradient(160deg, #00c98a, #009e6e); }
.result-card.down { background: linear-gradient(160deg, #ff5468, #d81f38); }
.result-card.muted { background: linear-gradient(160deg, #52525f, #3a3a46); }
/* лёгкий «блик» сверху карточки */
.result-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.28), transparent 60%);
  pointer-events: none;
}
.r-emoji { font-size: 46px; line-height: 1; }
.r-title { font-size: 19px; font-weight: 800; margin-top: 8px; letter-spacing: 0.2px; }
.r-coin { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; font-size: 14px; font-weight: 600; opacity: 0.95; }
.r-coin .coin { display: inline-grid; place-items: center; background: rgba(255, 255, 255, 0.2); }
.r-coin img { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); }
.r-amount { font-size: 40px; font-weight: 900; letter-spacing: 0.5px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.r-sub { font-size: 13px; opacity: 0.9; margin-top: 4px; }
.r-hint { font-size: 11px; opacity: 0.7; margin-top: 16px; }

/* ---------- админ-панель: сетка ---------- */
.admin-desktop { max-width: 1200px; margin: 0 auto; }
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 0 32px; }
.admin-col { min-width: 0; }

/* ---------- админ-панель: карточка пользователя ---------- */
.admin-head { display: flex; gap: 14px; align-items: flex-start; padding: 4px 2px 16px; }
.admin-head-name { font-size: 20px; font-weight: 700; letter-spacing: -0.015em; }
.admin-head-meta { font-size: 14px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 650; line-height: 1; white-space: nowrap;
  background: var(--card-2); color: var(--muted); border: 1px solid transparent;
}
.chip-ok   { background: var(--up-soft);    color: var(--up); }
.chip-err  { background: var(--down-soft);  color: var(--down); }
.chip-warn { background: #fff4d6; color: #a06a00; }
[data-theme='dark'] .chip-warn { background: #33290f; color: #f2c04d; }
.chip-neutral { background: var(--card-2); color: var(--muted); }

.btn-pair { display: flex; gap: 10px; }
.btn-pair .btn { flex: 1; }
.btn.danger-soft { background: var(--down-soft); color: var(--down); }
.btn.danger-soft:active { filter: brightness(0.95); }

.card.card-accent { outline: 1.5px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 0; }

.log-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log-item:last-child { border-bottom: 0; }

/* ---------- админ-панель на больших экранах (остальные экраны остаются мобильными) ---------- */
@media (min-width: 900px) {
  #app.wide { max-width: 1280px; }
  #app.wide .screen { padding-left: 32px; padding-right: 32px; }
  .admin-desktop { max-width: none; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  .admin-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
  .admin-cols .row { border-top: 0 !important; border-bottom: 1px solid var(--line); }
  .admin-pos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
  .admin-head { padding-bottom: 20px; }
  .admin-head-name { font-size: 24px; }
  /* вкладки и поиск не растягиваются на всю ширину */
  #app.wide .screen > .seg, #app.wide .screen > [data-k="users-tab"] .search { max-width: 520px; }
  #app.wide .admin-desktop > .seg { max-width: 360px; }
}
@media (min-width: 1500px) {
  #app.wide { max-width: 1520px; }
  .admin-grid { gap: 0 48px; }
  .admin-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .admin-pos { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- админ-панель: компактные формы ---------- */
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.inline-form .field { flex: 1; min-width: 0; margin: 0; }
.inline-form .btn { flex: none; height: 44px; padding: 0 16px; }
.divider { height: 1px; background: var(--line); margin: 16px 0 14px; }
.hint { margin-top: 10px; }
.hint summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; list-style: none; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary::after { content: ' ▾'; }
.hint[open] summary::after { content: ' ▴'; }
.hint ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.5; }
.link-row.danger { color: var(--down); }
.link-row.danger .ic { color: var(--down); }
@media (max-width: 520px) {
  /* четыре режима вывода не помещаются в одну строку на телефоне — 2×2 */
  .seg[data-seg="method"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- утилиты админ-панели (раньше были inline-стилями) ---------- */
.mt-2 { margin-top: 2px !important; } .mt-6 { margin-top: 6px !important; } .mt-8 { margin-top: 8px !important; }
.mt-10 { margin-top: 10px !important; } .mt-12 { margin-top: 12px !important; } .mt-14 { margin-top: 14px !important; } .mt-20 { margin-top: 20px !important; }
.mb-10 { margin-bottom: 10px !important; } .mb-14 { margin-bottom: 14px !important; }
.m-0 { margin: 0 !important; } .m-8-0-0 { margin: 8px 0 0 !important; } .m-6-0-0 { margin: 6px 0 0 !important; } .m-0-0-10 { margin: 0 0 10px !important; }
.fw-7 { font-weight: 700 !important; } .fw-5 { font-weight: 500 !important; }
.fl-1 { flex: 1 !important; } .ta-r { text-align: right !important; } .min-w-0 { min-width: 0 !important; }
.h-44 { height: 44px !important; } .h-48 { height: 48px !important; }
.in-15 { height: 100% !important; font-size: 15px !important; } .in-17 { height: 100% !important; font-size: 17px !important; }
.btn.danger-soft { background: var(--down-soft) !important; color: var(--down) !important; }
.btn-neutral { background: var(--card-2) !important; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.req-row { padding: 10px 0 !important; flex-wrap: wrap !important; }
.act-row { display: flex; gap: 8px; width: 100%; margin-top: 8px; }
.act-col { display: flex; gap: 8px; flex-direction: column; align-items: flex-end; }
.settle-row { display: flex; gap: 8px; margin-top: 12px; align-items: flex-end; }
.avatar-tile { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.avatar-tile.lg { width: 56px; height: 56px; border-radius: 18px; font-size: 24px; }
.skel-avatar { width: 40px; height: 40px; border-radius: 12px; }
.skel-l1 { height: 14px; width: 50%; } .skel-l2 { height: 12px; width: 30%; margin-top: 6px; } .skel-l3 { height: 24px; width: 90px; }
.log-time { font-size: 12px; color: var(--muted); }

/* закреплённые вкладки админки: остаются на виду при прокрутке */
.sticky-bar { position: sticky; top: 0; z-index: 6; background: var(--bg); padding: 6px 0 10px; margin-bottom: 4px; }
.nick-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--card-2); border: 1px solid var(--line); color: var(--muted); font-size: 12px; flex: none; margin-right: 8px; cursor: pointer; }
.chip-row.sm { margin-top: 6px; gap: 4px; }
.chip-row.sm .chip { padding: 3px 8px; font-size: 11.5px; }

/* переключатель вида графика: линия / свечи */
.chart-mode { position: absolute; top: 2px; right: 16px; display: flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--card); }
.chart-mode button { width: 30px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); transition: background 0.2s, color 0.2s; }
.chart-mode button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(20, 20, 50, 0.14); }
.chart-wrap.hover .chart-mode { opacity: 0; pointer-events: none; }
.chart-mode { transition: opacity 0.15s; }

/* ---------- переход «список → пара»: иконка монеты перелетает в шапку ---------- */
.vt-coin { view-transition-name: coin-hero; }
::view-transition-group(coin-hero) { animation-duration: 0.4s; animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1); }
::view-transition-old(coin-hero), ::view-transition-new(coin-hero) { height: 100%; object-fit: cover; border-radius: 50%; }
::view-transition-old(root) { animation: vt-out 0.2s ease both; }
::view-transition-new(root) { animation: vt-in 0.26s ease both; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
/* экран, открытый через переход, остаётся без собственной анимации навсегда — иначе она «выстрелила» бы после перехода */
.screen[data-vt] { animation: none !important; }

/* ползунок ставки и экран успеха в листе */
.exp.amt { margin: 4px 0 2px; }
.done { display: grid; justify-items: center; gap: 6px; padding: 28px 8px 26px; text-align: center; }
.done svg { color: var(--up); overflow: visible; }
.done-ring { fill: none; stroke: currentColor; stroke-width: 3; opacity: 0.25; }
.done-tick { fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; animation: done-draw 0.45s 0.1s var(--ease-out) both; }
.done svg { animation: pop 0.45s var(--spring) both; }
.done-title { font-size: 19px; font-weight: 700; margin-top: 8px; letter-spacing: -0.01em; }
.done-sub { font-size: 14px; color: var(--muted); }
@keyframes done-draw { from { stroke-dashoffset: 1; } }

/* скелетон плавно гаснет поверх появляющегося содержимого, пустые состояния мягко появляются */
.skel-host { position: relative; }
.skel-ghost { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: var(--bg); animation: ghost-out 0.32s 0.05s ease forwards; overflow: hidden; }
@keyframes ghost-out { to { opacity: 0; } }
.empty { animation: empty-in 0.5s var(--ease-out) both; }
@keyframes empty-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* профиль: баланс сверху, кнопки под ним на всю ширину — любая сумма (хоть 10 000 000 ₽) помещается */
.profile-balance { display: grid; gap: 4px; }
.profile-balance .amount { font-size: clamp(22px, 7.4vw, 30px); overflow-wrap: anywhere; }
.profile-balance .btn-pair { margin-top: 12px; }
.profile-balance .btn { height: 44px; }

/* стикеры появляются плавно, когда кадр готов */
.tgs { opacity: 0; transition: opacity 0.3s ease; }
.tgs[data-shown] { opacity: 1; }

/* ---------- iOS 26+: системный материал Liquid Glass от Apple вместо нашего самодельного ---------- */
/* Свойство есть только в WebKit на iOS 26+; в остальных браузерах весь блок игнорируется и работает наш вариант выше.
   Родной материал сам рисует блики, тонировку и тёмную тему, поэтому свои фон, размытие, обод и блики отключаем. */
@supports (-apple-visual-effect: -apple-system-glass-material) {
  .tabbar {
    -apple-visual-effect: -apple-system-glass-material;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    box-shadow: 0 8px 28px rgba(16, 12, 48, 0.12);
  }
  [data-theme='dark'] .tabbar { background: none; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
  .lens-glass, [data-theme='dark'] .lens-glass {
    -apple-visual-effect: -apple-system-glass-material;
    background: none; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none;
  }
  .lens-glass::before, .lens-glass::after { display: none; }
}
