/* ===========================================================
   Дизайн-система (вдохновлено Claude / Apple)
   Тёплый оранжевый акцент · светло-серый фон · графит · белый
   =========================================================== */
:root {
    /* СВЕТЛАЯ тема (по умолчанию) — белый фон */
    --bg:          #FFFFFF;  /* белый фон */
    --surface:     #F6F5F1;  /* карточки/секции */
    --text:        #1A1A1A;  /* основной текст — почти чёрный */
    --muted:       #6E6D67;  /* серый — второстепенное (контрастный на белом) */
    --border:      #ECEAE1;  /* мягкая граница */
    --accent:      #D97757;  /* Claude clay orange */
    --accent-press:#C2644A;
    --accent-soft: rgba(217, 119, 87, 0.12);
    --up:          #1FA971;  /* рост */
    --down:        #E5484D;  /* падение */
    color-scheme: light;

    --radius:   16px;
    --radius-sm:12px;
    --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
            Roboto, system-ui, sans-serif;
}

:root[data-theme="dark"] {
    /* ТЁМНАЯ тема — тёплый тёмный графит (не чёрный) */
    --bg:          #1E1E1C;  /* тёплый тёмный графит */
    --surface:     #2A2A27;  /* карточки/поля — чуть светлее фона */
    --text:        #FFFFFF;  /* основной текст — белый */
    --muted:       #A4A39B;  /* светло-серый — второстепенное */
    --border:      #393833;  /* граница на тёмном */
    --accent:      #E08A6B;  /* оранжевый, чуть ярче для тёмного фона */
    --accent-press:#D97757;
    --accent-soft: rgba(224, 138, 107, 0.20);
    --up:          #2BBA82;  /* рост (ярче на тёмном) */
    --down:        #F0595E;  /* падение */
    color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }

/* ---------- Экраны + плавный вход ---------- */
.screen {
    height: 100vh;
    height: 100dvh;            /* фикс. высота окна — скроллится контент, не страница */
    max-width: 460px;
    margin: 0 auto;
    padding: 28px 22px calc(20px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.screen:not(.hidden) {
    animation: screenIn 0.4s var(--ease) both;
}
@keyframes screenIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

.screen-head { padding: 36px 4px 8px; text-align: center; }

.title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

/* ===========================================================
   Выбор языка — поиск + список (цвета берутся из темы)
   =========================================================== */
.search-wrap { position: relative; margin: 6px 0 14px; }
.search-ico {
    position: absolute;
    left: 14px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    color: var(--muted);
    pointer-events: none;
}
.search-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    background: var(--surface);          /* светло-серый / тёмный графит по теме */
    border: 1.5px solid transparent;
    border-radius: 14px;
    transition: border-color 0.2s var(--ease);
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* RTL: иконка справа, отступ текста — справа */
[dir="rtl"] .search-ico { left: auto; right: 14px; }
[dir="rtl"] .search-input { padding: 14px 44px 14px 14px; }

.lang-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: none;
}
.lang-list::-webkit-scrollbar { display: none; }

.lang-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: transparent;
    color: var(--text);
    font-family: var(--font);
    font-size: 17px;
    text-align: start;
    cursor: pointer;
    transition: background 0.15s var(--ease);
}
.lang-item .flag { font-size: 24px; line-height: 1; }
.lang-item .lang-name { flex: 1; font-weight: 500; }
.lang-item .check { color: var(--accent); font-weight: 700; opacity: 0; }
.lang-item:active { background: var(--surface); }
.lang-item.selected { background: var(--accent-soft); }
.lang-item.selected .check { opacity: 1; }

.lang-empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 15px; }

/* ===========================================================
   Экран 2 — Welcome
   =========================================================== */
.welcome-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 6px;
    gap: 18px;
}
.brand-mark {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    background: var(--accent);
    box-shadow: 0 12px 30px rgba(217, 119, 87, 0.30);
    margin-bottom: 6px;
}
/* Логотип (картинка). Меняй размеры здесь. */
.logo-img { width: 56px; height: 56px; object-fit: contain; display: block; margin: 0 auto 10px; }
.logo-img--lg { width: 92px; height: 92px; margin: 0 auto 8px; }
.welcome-title {
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.03em;
    margin: 0;
}
.welcome-desc {
    font-size: 17px;
    line-height: 1.55;
    color: var(--muted);
    margin: 0;
    max-width: 340px;
}

/* ===========================================================
   Кнопки
   =========================================================== */
.footer-btn {
    position: relative;
    margin-top: auto;          /* прижата к низу экрана */
    padding-top: 16px;
    background: var(--bg);
    flex-shrink: 0;
}
/* мягкое «затухание» списка под кнопкой */
.footer-btn::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -28px;
    height: 28px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}
/* кнопка плавно выезжает снизу при появлении экрана */
.screen:not(.hidden) .footer-btn {
    animation: footerUp 0.45s var(--ease) both;
}
@keyframes footerUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: none; }
}
.btn {
    display: block;
    width: 100%;
    padding: 16px 18px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.12s var(--ease), background 0.2s var(--ease),
                opacity 0.2s var(--ease);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-press); }
.btn-dark { background: var(--text); color: var(--bg); }  /* инверсия — видна в обеих темах */
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; transform: none; cursor: default; }

/* ===========================================================
   Основной экран — регистрация
   =========================================================== */
.container { width: 100%; }
.lead { color: var(--muted); line-height: 1.55; font-size: 16px; margin: 0 0 22px; }

.steps {
    padding: 0;
    margin: 0 0 22px;
    list-style: none;
    counter-reset: step;
}
.steps li {
    position: relative;
    padding: 0 0 16px 38px;
    line-height: 1.45;
    counter-increment: step;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0; top: -1px;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

#register-link { margin-bottom: 18px; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--muted);
    font-weight: 500;
}
.form input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.2s var(--ease);
}
.form input:focus { outline: none; border-color: var(--accent); }

.status { text-align: center; font-size: 15px; min-height: 22px; margin-top: 14px; }
.status.error   { color: var(--down); }
.status.success { color: var(--up); }

/* ===========================================================
   Приложение с табами
   =========================================================== */
.tab-panels {
    position: relative;
    flex: 1;
    min-height: 0;
}
.tab-panel {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    scrollbar-width: none;
}
.tab-panel::-webkit-scrollbar { display: none; }
.tab-panel.active { opacity: 1; transform: none; pointer-events: auto; }
.panel-scroll { padding-bottom: 14px; }

.app-title {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 2px 0 16px;
}

/* ---------- Markets: график ---------- */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 18px;
}
.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}
.chart-sym { font-size: 14px; font-weight: 600; color: var(--muted); }
.chart-price {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.chart-change {
    font-size: 14px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}
.chart-change.up   { color: var(--up);   background: rgba(43, 186, 130, 0.14); }
.chart-change.down { color: var(--down); background: rgba(240, 89, 94, 0.14); }
.chart-canvas { width: 100%; height: 168px; display: block; }

/* ---------- Баннер «зарегистрируйся» ---------- */
.cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    text-align: start;
    padding: 16px 18px;
    margin-bottom: 18px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-press));
    box-shadow: 0 10px 26px rgba(217, 119, 87, 0.32);
    transition: transform 0.12s var(--ease);
}
.cta-banner:active { transform: scale(0.99); }
.cta-text { display: flex; flex-direction: column; gap: 3px; }
.cta-title { font-weight: 700; font-size: 16px; }
.cta-sub { font-size: 13px; opacity: 0.92; }
.cta-arrow { font-size: 22px; font-weight: 700; flex-shrink: 0; }
[dir="rtl"] .cta-arrow { transform: scaleX(-1); }

/* ---------- Аватары активов ---------- */
.avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c, #888);
    color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
    flex-shrink: 0;
}
.avatar-lg { width: 46px; height: 46px; font-size: 12px; }
.avatar-xl { width: 56px; height: 56px; font-size: 15px; }

/* ---------- Секции ---------- */
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 22px 2px 12px;
}
.section-head > span { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-link {
    border: none; background: none; cursor: pointer;
    color: var(--accent); font-family: var(--font); font-size: 14px; font-weight: 600;
}

/* «Цвета изменения» */
.trend-chg.up, .asset-chg.up, .mover-chg.up { color: var(--up); }
.trend-chg.down, .asset-chg.down, .mover-chg.down { color: var(--down); }

/* ---------- Тренды (2x2) ---------- */
.trend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trend-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 18px; padding: 14px;
    text-align: start; color: var(--text); cursor: pointer;
    transition: transform 0.12s var(--ease);
}
.trend-card:active { transform: scale(0.98); }
.trend-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.trend-spark { width: 70px; height: 30px; }
.trend-name { font-weight: 700; font-size: 15px; }
.trend-chg { font-size: 13px; font-weight: 600; margin-top: 5px; font-variant-numeric: tabular-nums; }
.trend-price { color: var(--muted); font-size: 14px; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* ---------- Список активов ---------- */
.asset-list { display: flex; flex-direction: column; gap: 2px; }
.asset-row {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 11px 8px; border: none; background: none; color: var(--text);
    text-align: start; cursor: pointer; border-radius: 12px;
    transition: background 0.15s var(--ease);
}
.asset-row:active { background: var(--surface); }
.asset-meta { flex: 1; min-width: 0; }
.asset-name { font-weight: 600; font-size: 15px; }
.asset-ticker { color: var(--muted); font-size: 13px; margin-top: 1px; }
.asset-right { text-align: end; }
.asset-price { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.asset-chg { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }

/* ---------- Сегмент гейнеры/лузеры ---------- */
.seg2 {
    display: flex; gap: 6px; padding: 4px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; margin-bottom: 14px;
}
.seg2-btn {
    flex: 1; padding: 9px; border: none; background: none; border-radius: 10px;
    color: var(--muted); font-family: var(--font); font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s var(--ease);
}
.seg2-btn.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Топ / Самые торгуемые (сетка 4) ---------- */
.mover-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.mover-cell {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    border: none; background: none; color: var(--text); cursor: pointer; padding: 2px 0;
}
.mover-ticker { font-size: 12px; font-weight: 600; }
.mover-chg { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ===========================================================
   Детальный экран актива
   =========================================================== */
.detail {
    position: fixed; inset: 0; z-index: 90;
    background: var(--bg);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease);
}
.detail.hidden { display: none; }
.detail.open { transform: none; }
.detail-bar { padding: calc(14px + env(safe-area-inset-top)) 16px 4px; }
.detail-back {
    width: 40px; height: 40px; border: none; border-radius: 50%;
    background: var(--surface); color: var(--text);
    font-size: 26px; line-height: 1; cursor: pointer;
}
.detail-scroll {
    flex: 1; overflow-y: auto; scrollbar-width: none;
    width: 100%; max-width: 460px; margin: 0 auto;
    padding: 8px 22px calc(28px + env(safe-area-inset-bottom));
}
.detail-scroll::-webkit-scrollbar { display: none; }
.detail-id { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.detail-name { font-size: 18px; font-weight: 700; }
.detail-ticker { font-size: 14px; color: var(--muted); margin-top: 2px; }
.detail-price { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.detail-change { display: flex; align-items: center; gap: 10px; margin: 8px 0 20px; flex-wrap: wrap; }
.d-abs { font-weight: 600; font-variant-numeric: tabular-nums; }
.d-abs.up, .d-badge.up { color: var(--up); }
.d-abs.down, .d-badge.down { color: var(--down); }
.d-badge { padding: 3px 9px; border-radius: 8px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.d-badge.up { background: rgba(43, 186, 130, 0.14); }
.d-badge.down { background: rgba(240, 89, 94, 0.14); }
.d-period { color: var(--muted); font-size: 14px; }
.detail-chart { height: 210px; }
.detail-chart canvas { width: 100%; height: 100%; display: block; }
.detail-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: 8px 2px 18px; }
.range-seg { display: flex; gap: 8px; margin-bottom: 22px; }
.range-btn {
    flex: 1; padding: 10px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface); color: var(--muted);
    font-family: var(--font); font-weight: 600; font-size: 13px; cursor: pointer;
    transition: all 0.2s var(--ease);
}
.range-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------- Markets: список инструментов ---------- */
.inst-list { display: flex; flex-direction: column; gap: 8px; }
.inst-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text);
    text-align: start;
    cursor: pointer;
    transition: border-color 0.2s var(--ease);
}
.inst-row.active { border-color: var(--accent); }
.inst-sym { font-weight: 600; font-size: 15px; min-width: 76px; }
.inst-spark { flex: 1; height: 32px; min-width: 0; }
.inst-right { text-align: end; min-width: 86px; }
.inst-price { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.inst-chg { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.inst-chg.up   { color: var(--up); }
.inst-chg.down { color: var(--down); }

/* ---------- Trade ---------- */
.trade-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
}
.trade-sym { font-weight: 700; font-size: 18px; }
.trade-price { margin-left: 10px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.trade-clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.trade-clock .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.field { margin-bottom: 18px; }
.field-label { font-size: 14px; color: var(--muted); font-weight: 500; margin-bottom: 8px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    padding: 9px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.stepper { display: flex; align-items: center; gap: 12px; }
.step-btn {
    width: 48px; height: 48px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
}
.step-btn:active { background: var(--accent-soft); }
.amount { flex: 1; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.dir-row { display: flex; gap: 10px; margin-bottom: 20px; }
.dir-btn {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.dir-up.active   { color: var(--up);   border-color: var(--up);   background: rgba(43, 186, 130, 0.20); }
.dir-down.active { color: var(--down); border-color: var(--down); background: rgba(240, 89, 94, 0.20); }

/* ---------- Info / FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 2px 16px;
}
.faq summary {
    list-style: none;
    cursor: pointer;
    padding: 15px 0;
    font-weight: 600;
    font-size: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 15px; color: var(--muted); line-height: 1.55; font-size: 15px; }

/* ===========================================================
   Сегментированный переключатель (glass pill)
   =========================================================== */
.tabbar {
    position: relative;
    display: flex;
    margin-top: 10px;
    padding: 6px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--surface);                                   /* fallback */
    background: color-mix(in srgb, var(--surface) 72%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    flex-shrink: 0;
}
.tabbar-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.25s var(--ease);
}
.tabbar-btn svg { width: 23px; height: 23px; }
.tabbar-btn.active { color: var(--accent); }
.tabbar-pill {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 0;
    width: 0;
    border-radius: 16px;
    background: var(--accent-soft);
    transition: transform 0.35s var(--ease), width 0.35s var(--ease);
    z-index: 0;
}

/* ===========================================================
   Модалка регистрации (bottom sheet)
   =========================================================== */
.modal { position: fixed; inset: 0; z-index: 100; }
.modal.hidden { display: none; }
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}
.modal.open .modal-backdrop { opacity: 1; }
.sheet {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    max-width: 460px;
    margin: 0 auto;
    background: var(--bg);
    border-radius: 24px 24px 0 0;
    padding: 10px 22px calc(26px + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.38s var(--ease);
    max-height: 92vh;
    overflow-y: auto;
}
.modal.open .sheet { transform: none; }
.sheet-grip {
    width: 42px; height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 6px auto 18px;
    cursor: pointer;
}
.sheet h2 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }

/* ===========================================================
   Markets: баннер статуса · категории · OTC · выплата
   =========================================================== */
.mkt-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 14px;
}
.mkt-banner .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.mkt-banner.open .dot { background: var(--up); animation: pulse 1.6s infinite; }
.mkt-banner.closed .dot { background: var(--down); }
.mkt-banner .muted { color: var(--muted); }

.cat-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 14px;
    padding-bottom: 2px;
}
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: 0 0 auto;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cat-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.otc-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 2px 6px;
    border-radius: 6px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.02em;
}
.payout { font-weight: 700; font-size: 15px; color: var(--up); font-variant-numeric: tabular-nums; }
.payout.na { color: var(--muted); font-weight: 600; }

/* детальный экран: выплата + статус */
.detail-payout-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 10px 0 4px; }
.d-payout { font-size: 17px; font-weight: 700; color: var(--up); }
.d-payout.na { color: var(--muted); }
.d-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.d-status .sdot { width: 8px; height: 8px; border-radius: 50%; }
.d-status.open { color: var(--up); }
.d-status.open .sdot { background: var(--up); }
.d-status.closed { color: var(--muted); }
.d-status.closed .sdot { background: var(--down); }

/* экран «Все активы» */
.detail-bar-title { font-size: 17px; font-weight: 600; margin-inline-start: 4px; }
#full-market { margin-bottom: 14px; }
#asset-list-screen .search-wrap { margin-top: 0; }
#full-list { margin-top: 4px; }

/* Trade: выбор актива */
.asset-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    cursor: pointer;
    transition: border-color 0.2s var(--ease);
}
.asset-select:active { border-color: var(--accent); }
.asset-select-left { display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 700; }
.asset-select-caret { color: var(--muted); font-size: 12px; }

/* Trade: экспирация на всю ширину */
.expiry-row { display: flex; gap: 8px; }
.expiry-btn {
    flex: 1;
    padding: 12px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.expiry-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* липкий поиск в шторке выбора актива */
#asset-sheet .sheet-search {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    margin: 0 0 12px;
    padding-top: 2px;
}
#asset-sheet .field-label { margin-top: 6px; }
#asset-sheet #asset-popular { margin-bottom: 12px; }

/* ---------- Сигнал ---------- */
.sheet-title {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}
.sheet-title .ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-inline-start: 8px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    vertical-align: middle;
}
.signal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.signal-asset { font-size: 18px; font-weight: 700; }
.signal-sub { font-size: 13px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.signal-dir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 22px;
    border-radius: 18px;
    margin-bottom: 20px;
}
.signal-dir.up   { color: var(--up);   background: rgba(43, 186, 130, 0.10); }
.signal-dir.down { color: var(--down); background: rgba(240, 89, 94, 0.10); }
.signal-dir-badge {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: currentColor;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 8px 20px -6px currentColor;
}
.signal-dir-badge svg { width: 30px; height: 30px; }
.signal-dir-text { display: flex; flex-direction: column; }
.signal-dir-label { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; }
.signal-dir-hint { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.signal-conf-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.signal-conf-label { color: var(--muted); font-size: 14px; }
.signal-conf-val { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.signal-bar { height: 8px; border-radius: 4px; background: var(--surface); overflow: hidden; margin-bottom: 20px; }
.signal-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s var(--ease); }
.signal-bar-fill.up   { background: var(--up); }
.signal-bar-fill.down { background: var(--down); }
.signal-timer { text-align: center; font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.signal-timer.expired { color: var(--down); }

/* ---------- AI-поддержка (чат) ---------- */
#support-screen { display: flex; flex-direction: column; }
#support-screen .detail-bar { display: flex; align-items: center; gap: 10px; }
.support-human {
    margin-inline-start: auto;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.support-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.msg {
    max-width: 84%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.msg.bot { align-self: flex-start; background: var(--surface); color: var(--text); border-bottom-left-radius: 6px; }
.msg.typing { display: flex; gap: 5px; align-items: center; padding: 14px; }
.msg.typing .tdot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typingdot 1.2s infinite ease-in-out; }
.msg.typing .tdot:nth-child(2) { animation-delay: 0.18s; }
.msg.typing .tdot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingdot { 0%, 60%, 100% { opacity: 0.3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.support-input-row {
    display: flex;
    gap: 8px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.support-input {
    flex: 1;
    padding: 12px 14px;
    font-size: 16px;
    font-family: var(--font);
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
}
.support-input:focus { outline: none; border-color: var(--accent); }
.support-send {
    width: 46px; height: 46px;
    flex-shrink: 0;
    border: none;
    border-radius: 14px;
    background: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.support-send svg { width: 20px; height: 20px; }
.support-send:active { background: var(--accent-press); }

/* ---------- Триал / доступ ---------- */
.trial-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    border-radius: 14px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}
.trial-timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.or-divider { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 12px; }
.btn-trial { background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); }
.btn-trial:active { background: var(--accent-soft); }

/* блок «регистрация прошла, нужен депозит» */
.reg-done {
    background: rgba(43, 186, 130, 0.12);
    border: 1px solid rgba(43, 186, 130, 0.30);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
.reg-done-title { font-size: 17px; font-weight: 700; color: var(--up); margin-bottom: 4px; }
.reg-done-sub { font-size: 15px; line-height: 1.5; color: var(--text); }

/* гайд из 2 шагов на экране доступа */
.access-steps2 { display: flex; flex-direction: column; gap: 12px; margin-bottom: 10px; }
.astep { display: flex; align-items: center; gap: 12px; }
.astep-num {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 50%;
    background: var(--accent-soft); color: var(--accent);
    font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.astep-btn { flex: 1; }
#register-link { margin-bottom: 0; }   /* в гайде отступ задаёт .access-steps2 */
.access-note { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.45; margin: 8px 0 0; }

/* ветка «у меня уже есть аккаунт» */
.link-btn {
    display: block; width: 100%; text-align: center;
    background: none; border: none;
    color: var(--accent); font-family: var(--font);
    font-size: 14px; font-weight: 600;
    padding: 14px 0 2px; cursor: pointer;
}
.have-account-box {
    margin-top: 12px; padding-top: 14px;
    border-top: 1px solid var(--border);
}
.have-account-note { font-size: 13px; color: var(--muted); line-height: 1.45; margin: 0 0 12px; }

/* анимация анализа */
.signal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 34px 0 26px;
}
.signal-spinner {
    width: 50px; height: 50px;
    border-radius: 50%;
    border: 4px solid var(--surface);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.signal-loading-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    min-height: 20px;
    text-align: center;
}
.signal-progress {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--surface);
    overflow: hidden;
}
.signal-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    background: var(--accent);
}
