/* undetect.su — дизайн-система сервиса сигналов */
:root {
    --bg: #0a0b0f;
    --bg-elevated: #111318;
    --card: #16181e;
    --card-hover: #1a1d25;
    --text: #e6e8ec;
    --text-muted: #8b8f99;
    --border: #252830;
    --accent: #06b6d4;
    --accent-dim: #0891b2;
    --green: #10b981;
    --green-strong: #22c55e;
    --red: #ef4444;
    --red-soft: #dc2626;
    --yellow: #eab308;
    --orange: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
    --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    --shadow: 0 4px 24px rgba(0,0,0,0.25);
    --transition: 0.2s ease;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    overflow-x: hidden;
}

/* ——— Animated background canvas ——— */
.bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ——— Layout ——— */
.site-header {
    background: rgba(17, 19, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-top: max(0.75rem, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .wrap {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.logo {
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
    color: var(--text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}
.logo-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.4));
    transition: filter 0.3s ease, transform 0.3s ease;
}
.logo-text {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
}
.logo span {
    background: linear-gradient(135deg, var(--accent), #38bdf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo:hover { color: #fff; }
.logo:hover .logo-icon {
    filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.7));
    transform: scale(1.08);
}
.logo:hover span {
    background: linear-gradient(135deg, #38bdf8, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), #38bdf8);
    border-radius: 1px;
    transition: width 0.3s ease;
}
.logo:hover::after { width: 100%; }

.main-nav {
    display: flex;
    gap: 0.25rem;
}
.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color var(--transition), background var(--transition);
}
.main-nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.main-nav a.active { color: var(--accent); }
.main-nav a.nav-binance {
    background: #f0b90b;
    color: #000;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    transition: opacity var(--transition), transform var(--transition);
}
.main-nav a.nav-binance:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    background: #f0b90b;
    color: #000;
}
.main-nav a.nav-bybit {
    background: #f7a600;
    color: #000;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.85rem;
    transition: opacity var(--transition), transform var(--transition);
}
.main-nav a.nav-bybit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    background: #f7a600;
    color: #000;
}

/* ——— Burger menu ——— */
.burger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 200;
    flex-direction: column;
    gap: 5px;
}
.burger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
    .burger {
        display: flex;
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }
    .main-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: min(280px, 100vw - 3rem);
        height: 100vh;
        height: 100dvh;
        background: var(--bg-elevated);
        flex-direction: column;
        padding: 5rem 1.5rem 2rem;
        padding-right: max(1.5rem, env(safe-area-inset-right));
        padding-bottom: max(2rem, env(safe-area-inset-bottom) + 1rem);
        gap: 0.25rem;
        transition: right 0.3s ease;
        z-index: 150;
        box-shadow: -4px 0 24px rgba(0,0,0,0.5);
        overflow-y: auto;
    }
    .main-nav.open { right: 0; }
    .main-nav a {
        font-size: 1.05rem;
        padding: 0.75rem 1rem;
        min-height: 44px;
        display: flex;
        align-items: center;
        border-radius: var(--radius-sm);
    }
    .main-nav a.nav-binance,
    .main-nav a.nav-bybit {
        margin-top: 0.5rem;
        text-align: center;
    }
}

main {
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    padding: 1.5rem 2rem;
    padding-left: max(1.5rem, env(safe-area-inset-left) + 0.5rem);
    padding-right: max(1.5rem, env(safe-area-inset-right) + 0.5rem);
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom) + 0.5rem);
    position: relative;
    z-index: 1;
}

.site-footer {
    border-top: 1px solid var(--border);
    background: rgba(17, 19, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem 1.5rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    position: relative;
    z-index: 1;
}
.site-footer .wrap {
    max-width: 1800px;
    margin: 0 auto;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

.footer-project-note {
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    margin-bottom: 0.75rem;
}
.footer-project-note p {
    margin: 0 0 0.5rem;
    line-height: 1.5;
    color: var(--text-secondary, #9ca3af);
}
.footer-tg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    background: #229ed9;
    color: #fff !important;
    font-weight: 600;
    font-size: 0.8125rem;
    transition: background 0.2s;
}
.footer-tg-btn:hover {
    background: #1a8abf;
    text-decoration: none !important;
}

/* ——— Кнопка «Вверх» (слева внизу) ——— */
.scroll-to-top {
    position: fixed;
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1.5rem, env(safe-area-inset-left));
    z-index: 1000;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(22, 24, 30, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--accent);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--transition), visibility var(--transition), transform var(--transition), color var(--transition), background var(--transition), border-color var(--transition);
}
.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.scroll-to-top:hover {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

/* ——— Hero (главная) ——— */
.page-hero {
    margin-bottom: 1.5rem;
}
.page-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.02em;
}
.page-hero .meta {
    color: var(--text-muted);
    font-size: 0.875rem;
}
.page-hero .meta span { margin-right: 0.5rem; }

/* ——— Dashboard ——— */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.dashboard.hidden { display: none; }

.dash-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}
.dash-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
}
.dash-sentiment-bar {
    height: 8px;
    background: var(--red);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.dash-sentiment-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--green-strong));
    border-radius: 4px;
    transition: width 0.6s ease;
}
.dash-sentiment-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    white-space: nowrap;
    min-width: 0;
}
.dash-sentiment-labels .negative,
.dash-sentiment-labels .positive {
    flex-shrink: 0;
}
.dash-sentiment-value {
    font-weight: 700;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.dash-signals-grid {
    display: flex;
    gap: 0.75rem;
}
.dash-signal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.dash-signal-num {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
}
.dash-signal-item.positive .dash-signal-num { color: var(--green); }
.dash-signal-item.negative .dash-signal-num { color: var(--red); }

.dash-big-number {
    font-size: 2rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--accent);
    line-height: 1.1;
}
.dash-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.dash-best {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.dash-best .symbol {
    font-size: 1.1rem;
}

/* ——— Filters bar ——— */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    gap: 0.35rem;
}
.filter-btn {
    font-size: 0.8125rem;
    padding: 0.4rem 0.85rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.filter-btn.filter-buy.active { background: var(--green); border-color: var(--green); }
.filter-btn.filter-sell.active { background: var(--red); border-color: var(--red); }
.filter-btn.filter-hold.active { background: var(--text-muted); border-color: var(--text-muted); }

.search-group {
    display: flex;
    align-items: center;
}
.symbol-search-input {
    font-size: 0.8125rem;
    padding: 0.4rem 0.75rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 10rem;
    min-width: 8rem;
}
.symbol-search-input::placeholder { color: var(--text-muted); }
.symbol-search-input:focus { outline: none; border-color: var(--accent); }

.sort-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.sort-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
.sort-select {
    font-size: 0.8125rem;
    padding: 0.35rem 0.6rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    width: auto;
    margin-bottom: 0;
}
.sort-select:focus { outline: none; border-color: var(--accent); }

/* ——— Promote toggle ——— */
.promote-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}
.promote-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.promote-switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.promote-switch input { opacity: 0; width: 0; height: 0; }
.promote-slider {
    position: absolute;
    inset: 0;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s;
}
.promote-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.25s, background 0.25s;
}
.promote-switch input:checked + .promote-slider {
    background: var(--accent);
    border-color: var(--accent);
}
.promote-switch input:checked + .promote-slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* ——— Депозит input ——— */
.deposit-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.deposit-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.deposit-currency {
    position: absolute;
    left: 0.5rem;
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 600;
    pointer-events: none;
}
.deposit-input {
    font-size: 0.8125rem;
    padding: 0.35rem 0.6rem 0.35rem 1.3rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    width: 90px;
    font-family: var(--font-mono);
    margin-bottom: 0;
}
.deposit-input:focus { outline: none; border-color: var(--accent); }
.deposit-input::placeholder { color: var(--text-muted); opacity: 0.5; }
.commission-input {
    padding: 0.35rem 1.5rem 0.35rem 0.6rem;
    width: 80px;
}
.commission-currency {
    position: absolute;
    right: 0.5rem;
    font-size: 0.8125rem;
    color: var(--accent);
    font-weight: 600;
    pointer-events: none;
}
.deposit-hint {
    font-size: 0.6875rem;
    color: var(--accent);
    font-weight: 400;
    opacity: 0.8;
}

/* ——— Leverage select ——— */
.leverage-select {
    font-size: 0.8125rem;
    padding: 0.35rem 0.6rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    width: 72px;
    font-family: var(--font-mono);
    font-weight: 600;
    margin-bottom: 0;
}
.leverage-select:focus { outline: none; border-color: var(--accent); }

/* ——— Leverage picker в карточке ——— */
.leverage-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
}
.leverage-picker-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.leverage-picker-btns {
    display: flex;
    gap: 0.25rem;
}
.lev-btn {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    font-weight: 600;
    padding: 0.25rem 0.55rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    line-height: 1.2;
}
.lev-btn:hover {
    color: var(--text);
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
}
.lev-btn.lev-btn-active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* ——— Предупреждение о ликвидации ——— */
.dc-liquidation-warn {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--red);
    text-align: center;
}
.dc-fees-hint {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-align: center;
}

/* ——— Inline leverage hint ——— */
.leverage-hint-inline {
    color: var(--accent);
    font-weight: 600;
}

/* ——— Блок расчёта по депозиту ——— */
.deposit-calc-section {
    margin-top: 0.6rem;
    padding: 0.6rem;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 6px;
}
.deposit-calc-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.5rem;
}
.deposit-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.4rem;
}
.deposit-calc-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
}
.deposit-calc-item.dc-loss {
    border-left: 2px solid var(--red);
}
.deposit-calc-item.dc-profit {
    border-left: 2px solid var(--green);
}
.dc-label {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}
.dc-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-mono);
}
.dc-balance {
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    font-family: var(--font-mono);
}

/* ——— Карточки сигналов ——— */
.cards {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: repeat(2, 1fr);
}
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    min-width: 0;
    transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.card:hover { border-color: var(--accent); background: var(--card-hover); transform: translateY(-2px); }

.card-animate {
    animation: cardFadeIn 0.4s ease both;
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.fav-btn {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 4px;
    transition: color 0.2s, transform 0.15s;
}
.fav-btn:hover { color: var(--accent); }
.fav-btn.fav-active { color: var(--accent); }
.symbol {
    font-weight: 700;
    font-size: 1.125rem;
    font-family: var(--font-mono);
}
.signal {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.signal-STRONG_BUY { background: var(--green-strong); color: #000; }
.signal-BUY { background: #16a34a; color: #fff; }
.signal-WEAK_BUY { background: #84cc16; color: #000; }
.signal-HOLD { background: var(--text-muted); color: #fff; }
.signal-WEAK_SELL { background: var(--orange); color: #000; }
.signal-SELL { background: var(--red-soft); color: #fff; }
.signal-STRONG_SELL { background: var(--red); color: #fff; }

/* ——— Sparkline ——— */
.sparkline {
    display: block;
    width: 100%;
    height: 50px;
    margin-bottom: 0.5rem;
    border-radius: 4px;
}

/* ——— Card price row ——— */
.card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.card .price {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
}
.chart-btn {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: 6px;
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--accent);
    line-height: 1;
}
.chart-btn:hover { background: rgba(6, 182, 212, 0.2); border-color: var(--accent); }

/* ——— Card indicators section ——— */
.card-indicators {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ——— RSI Gauge ——— */
.rsi-gauge { padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); }
.rsi-gauge-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.rsi-gauge-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rsi-gauge-value { font-size: 0.9375rem; font-weight: 700; font-family: var(--font-mono); }
.rsi-gauge-track {
    position: relative;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--green) 0%, var(--green) 30%, var(--accent) 40%, var(--accent) 60%, var(--orange) 70%, var(--red) 100%);
    margin-bottom: 0.25rem;
}
.rsi-gauge-zones { position: absolute; inset: 0; border-radius: 3px; }
.rsi-gauge-needle {
    position: absolute;
    top: -3px;
    width: 4px;
    height: 12px;
    background: #fff;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(255,255,255,0.4);
    transition: left 0.6s ease;
}
.rsi-gauge-status { font-size: 0.6875rem; text-align: center; font-weight: 600; }

/* ——— Score Bar ——— */
.score-bar { padding: 0.5rem; background: rgba(0,0,0,0.2); border-radius: var(--radius-sm); }
.score-bar-header { display: flex; justify-content: space-between; font-size: 0.6875rem; margin-bottom: 0.35rem; }
.score-bar-track {
    height: 6px;
    background: var(--red);
    border-radius: 3px;
    overflow: hidden;
}
.score-bar-bull {
    height: 100%;
    background: var(--green);
    border-radius: 3px;
    transition: width 0.6s ease;
}

/* ——— Bollinger Bands indicator ——— */
.bb-indicator {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-sm);
}
.bb-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; }
.bb-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.bb-width { font-size: 0.6875rem; color: var(--text-muted); }
.bb-track {
    position: relative;
    height: 6px;
    background: linear-gradient(90deg, var(--green) 0%, rgba(255,255,255,0.15) 20%, rgba(255,255,255,0.15) 80%, var(--red) 100%);
    border-radius: 3px;
    margin-bottom: 0.25rem;
}
.bb-marker {
    position: absolute;
    top: -3px;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    transform: translateX(-50%);
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
    transition: left 0.6s ease;
}
.bb-values { display: flex; justify-content: space-between; font-size: 0.65rem; color: var(--text-muted); font-family: var(--font-mono); }

/* ——— Stoch RSI ——— */
.stoch-rsi-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
    margin-bottom: 0.25rem;
}
.stoch-rsi-label { font-weight: 600; color: var(--text-muted); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.03em; min-width: 5rem; }
.stoch-rsi-kd { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text); }
.stoch-rsi-status { font-weight: 600; font-size: 0.75rem; margin-left: auto; }

/* ——— Price levels visualization ——— */
.price-levels { margin-bottom: 0.6rem; min-width: 0; overflow: hidden; }
.price-levels-track {
    position: relative;
    height: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    overflow: visible;
    max-width: 100%;
}
.pl-zone {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 4px;
}
.pl-loss { background: rgba(239, 68, 68, 0.15); }
.pl-profit { background: rgba(16, 185, 129, 0.15); }
.pl-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 24px;
    transform: translateX(-50%);
}
.pl-marker span {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
}
.pl-sl { background: var(--red); }
.pl-sl span { color: var(--red); }
.pl-entry { background: var(--accent); }
.pl-entry span { color: var(--accent); }
.pl-tp { background: var(--green); }
.pl-tp span { color: var(--green); }

.card .row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.card .row span:last-child { color: var(--text); }

.reasons {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.reasons ul { margin: 0; padding-left: 1.25rem; }
.reasons li { margin-bottom: 0.25rem; }

/* ——— Аналитика рисков в карточке ——— */
.risk-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(6, 182, 212, 0.05);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: var(--radius-sm);
}
.risk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}
.risk-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.risk-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
.risk-badge.risk-low { background: var(--green); color: #000; }
.risk-badge.risk-medium { background: var(--yellow); color: #000; }
.risk-badge.risk-high { background: var(--red); color: #fff; }

.risk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.risk-item {
    display: flex;
    flex-direction: column;
    padding: 0.4rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}
.risk-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}
.risk-value {
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
}

/* ——— Editable entry price ——— */
.entry-input-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.entry-dollar {
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
}
.entry-price-input {
    width: 100%;
    max-width: 140px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.9375rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 0.15rem 0.3rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.entry-price-input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.15);
}
.entry-price-input.entry-price-custom {
    border-color: var(--yellow);
    color: var(--yellow);
}
.entry-reset-btn {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 182, 212, 0.15);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: 4px;
    color: var(--cyan);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    padding: 0;
    line-height: 1;
}
.entry-reset-btn:hover {
    background: rgba(6, 182, 212, 0.3);
}
.entry-reset-btn.entry-reset-hidden {
    opacity: 0;
    pointer-events: none;
}

.risk-pct {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: right;
}

/* ——— Таблица риска по плечам ——— */
.leverage-table-wrap {
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(6, 182, 212, 0.1);
}
.leverage-table-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}
.leverage-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    font-family: var(--font-mono);
}
.leverage-table thead th {
    font-size: 0.625rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    padding: 0.3rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.leverage-table tbody td {
    padding: 0.3rem 0.35rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    color: var(--text);
    font-weight: 500;
}
.leverage-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.leverage-table tbody tr.leverage-row-active {
    background: rgba(6, 182, 212, 0.12);
    box-shadow: inset 3px 0 0 var(--accent);
}
.leverage-table tbody tr.leverage-row-active td {
    color: var(--text);
    font-weight: 700;
}
.leverage-table tbody tr.leverage-row-active td.positive { color: var(--green); }
.leverage-table tbody tr.leverage-row-active td.negative { color: var(--red); }
.leverage-table tbody tr.leverage-row-active td.warn { color: var(--yellow); }

/* ——— Прогноз входа ——— */
.forecast-section {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: var(--radius-sm);
}
.forecast-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.forecast-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    min-width: 0;
}
.forecast-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    color: #000;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.forecast-action {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}
.forecast-summary {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.45;
}
.forecast-optimal {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
}
.forecast-score-bar {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.6rem;
}
.forecast-score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.fc-conditions {
    margin-bottom: 0.35rem;
}
.fc-cond-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
}
.fc-conditions ul {
    margin: 0;
    padding-left: 1.1rem;
}
.fc-conditions li {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    line-height: 1.4;
}

/* ——— Рекомендации ——— */
.tips-section {
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(16, 185, 129, 0.06);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.tips-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}
.tips-section ul {
    margin: 0;
    padding-left: 1.1rem;
}
.tips-section li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

/* ——— На что обратить внимание ——— */
.watch-section {
    margin-top: 0.6rem;
    padding: 0.6rem 0.75rem;
    background: rgba(234, 179, 8, 0.06);
    border-left: 3px solid var(--yellow);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.watch-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.35rem;
}
.watch-section ul {
    margin: 0;
    padding-left: 1.1rem;
}
.watch-section li {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.card-actions { margin-top: 0.75rem; }
.card-actions a {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}
.card-actions a:hover { text-decoration: underline; color: #38bdf8; }

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    grid-column: 1 / -1;
}
.empty code {
    background: var(--bg-elevated);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875em;
}
.loading { opacity: 0.7; pointer-events: none; }

/* ——— Кнопка-ссылка «Настроить пары» ——— */
.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.btn-link:hover { color: var(--accent-dim); }

/* ——— Watchlist-панель (модалка) ——— */
.watchlist-panel { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; }
.watchlist-panel.hidden { display: none; }
.watchlist-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }

.watchlist-modal {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 620px;
    max-width: 95vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}
.watchlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.watchlist-header h2 { margin: 0; font-size: 1.125rem; font-weight: 700; }
.watchlist-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
}
.watchlist-close:hover { color: var(--text); }

/* ——— Exchange switcher ——— */
.exchange-switcher {
    display: flex;
    gap: 0;
    padding: 0.75rem 1.25rem 0;
}
.exchange-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.exchange-btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.exchange-btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.exchange-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.exchange-btn:not(.active):hover {
    background: var(--card-hover);
    color: var(--text);
}

.exchange-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.exchange-badge.exchange-binance {
    background: rgba(243, 186, 47, 0.15);
    color: #f3ba2f;
}
.exchange-badge.exchange-bybit {
    background: rgba(246, 160, 54, 0.15);
    color: #f6a036;
}

.watchlist-search { padding: 0.75rem 1.25rem 0; }
.watchlist-search input {
    margin-bottom: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    width: 100%;
    color: var(--text);
    font-size: 0.9375rem;
}
.watchlist-search input:focus { outline: none; border-color: var(--accent); }
.watchlist-search input::placeholder { color: var(--text-muted); }

.watchlist-actions-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.watchlist-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.25rem 1rem;
}
.watchlist-category { margin-bottom: 1rem; }
.watchlist-cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.watchlist-cat-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}
.btn-sm:hover { color: var(--text); border-color: var(--accent); }

.pair-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pair-chip {
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    padding: 0.35rem 0.65rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.pair-chip:hover { border-color: var(--accent); color: var(--text); }
.pair-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
    font-weight: 600;
}

.watchlist-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border);
}
.btn-primary {
    padding: 0.55rem 1.25rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background var(--transition);
}
.btn-primary:hover { background: var(--accent-dim); }
.btn-secondary {
    padding: 0.55rem 1.25rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all var(--transition);
}
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }

/* ——— Chart Modal ——— */
.chart-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chart-modal.hidden { display: none; }
.chart-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.75); }
.chart-modal-content {
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 960px;
    max-width: 96vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 48px rgba(0,0,0,0.4);
}
.chart-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.chart-modal-header h2 { margin: 0; font-size: 1.125rem; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0; }
.chart-tf-buttons { display: flex; gap: 0.3rem; flex: 1; }
.chart-tf-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.chart-tf-btn:hover { color: var(--text); border-color: var(--accent); }
.chart-tf-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.chart-modal-body { padding: 1rem; }
.chart-modal-body canvas {
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}
.chart-legend {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0 0;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

/* ——— Блок реферальных ссылок (Binance / Bybit) ——— */
.exchanges-block {
    margin-top: 2rem;
    padding: 1.25rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-width: 100%;
}
.exchanges-block p { margin: 0 0 0.75rem 0; font-size: 0.9375rem; color: var(--text-muted); }
.exchanges-block strong { color: var(--text); }
.exchanges-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.exchange-ref-btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    color: #000;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: opacity var(--transition), transform var(--transition);
}
.exchange-ref-btn:hover { opacity: 0.95; transform: translateY(-1px); }
.binance-btn { background: #f0b90b; }
.bybit-btn { background: #f7a600; }

/* ——— О сервисе ——— */
.about-section {
    margin-top: 3rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}
.about-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.about-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.6rem 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.about-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 860px;
    margin: 0 auto;
    line-height: 1.6;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}
.about-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: border-color var(--transition), transform var(--transition);
}
.about-card:hover {
    border-color: rgba(6, 182, 212, 0.35);
    transform: translateY(-2px);
}
.about-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(6, 182, 212, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--accent);
}
.about-card-icon svg {
    width: 20px;
    height: 20px;
}
.about-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}
.about-card p {
    font-size: 0.8375rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}
.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.85rem;
}
.about-tags span {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    padding: 0.2rem 0.5rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 4px;
    color: var(--accent);
    white-space: nowrap;
}

/* Strategy block */
.about-strategy {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2.5rem;
}
.about-strategy-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    color: var(--text);
}
.about-strategy-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.about-strategy-point {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}
.about-strategy-num {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: rgba(6, 182, 212, 0.25);
    flex-shrink: 0;
    min-width: 2.5rem;
    line-height: 1.2;
}
.about-strategy-point strong {
    display: block;
    font-size: 0.9375rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.about-strategy-point p {
    font-size: 0.8375rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin: 0;
}

/* Tools grid */
.about-tools {
    margin-bottom: 1rem;
}
.about-tools-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.about-tools-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
.about-tool {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: border-color var(--transition), background var(--transition);
}
a.about-tool:hover {
    border-color: var(--accent);
    background: var(--card-hover);
}
.about-tool-passive {
    cursor: default;
}
.about-tool-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
}
a.about-tool .about-tool-name {
    color: var(--accent);
}
.about-tool-desc {
    font-size: 0.775rem;
    color: var(--text-muted);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-tools-grid { grid-template-columns: 1fr; }
    .about-strategy { padding: 1.25rem; }
    .about-strategy-num { font-size: 1.2rem; min-width: 2rem; }
}

/* ——— Дисклеймер ——— */
.disclaimer {
    margin-top: auto;
    padding: 1.25rem 2rem;
    background: rgba(234, 179, 8, 0.04);
    border: 1px solid rgba(234, 179, 8, 0.15);
    border-radius: var(--radius);
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}
.disclaimer .wrap {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    max-width: 1800px;
    margin: 0 auto;
}
.disclaimer-icon {
    font-size: 1.35rem;
    line-height: 1;
    flex-shrink: 0;
    color: var(--yellow);
    margin-top: 0.1rem;
}
.disclaimer-text strong {
    display: block;
    font-size: 0.8125rem;
    color: var(--yellow);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}
.disclaimer-text p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text-muted);
}

/* ——— HTF & BTC context ——— */
.htf-section, .btc-section {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.5rem 0; font-size: 0.8125rem; border-top: 1px solid var(--border);
}
.htf-title, .btc-title {
    font-weight: 600; color: var(--text-muted); min-width: 8rem;
}
.htf-badge {
    padding: 0.15rem 0.5rem; border-radius: 4px; font-weight: 600; font-size: 0.75rem;
}
.htf-ok { background: rgba(16,185,129,0.15); color: var(--green); }
.htf-warn { background: rgba(245,158,11,0.15); color: var(--yellow); }
.htf-trend, .btc-trend { color: var(--text-muted); }

/* ——— Калькулятор ——— */
.calc-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem 0; }
.grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
}
@media (max-width: 700px) { .grid { grid-template-columns: 1fr; } }

.card h2 { font-size: 1rem; font-weight: 600; margin: 0 0 1rem 0; color: var(--text-muted); }
label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.25rem; }
input, select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
button {
    padding: 0.65rem 1.25rem;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background var(--transition), opacity var(--transition);
}
button:hover { background: var(--accent-dim); opacity: 0.95; }

.result-section { margin-top: 1rem; }
.result-section h3 { font-size: 0.9rem; color: var(--text-muted); margin: 1rem 0 0.5rem 0; font-weight: 600; }
.row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 0.35rem; }
.row .muted { color: var(--text-muted); }
.positive { color: var(--green); }
.negative { color: var(--red); }
.warn { color: var(--yellow); }
.row-total {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-weight: 600;
}
#result { display: none; }
#result.visible { display: block; }
#noResult.muted { color: var(--text-muted); font-size: 0.9375rem; }

/* ——— Explanation section ——— */
.explanation-section {
    background: rgba(6,182,212,0.06);
    border: 1px solid rgba(6,182,212,0.18);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin: 0.75rem 0;
}
.explanation-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.explanation-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.explanation-summary {
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
    margin: 0 0 0.6rem 0;
}
.explanation-item {
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.4rem;
}
.explanation-item p {
    margin: 0.2rem 0 0 0;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.45;
}
.explanation-item-label {
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.explanation-item.expectation {
    background: rgba(16,185,129,0.08);
    border-left: 3px solid var(--green);
}
.explanation-item.expectation .explanation-item-label { color: var(--green); }
.explanation-item.invalidation {
    background: rgba(239,68,68,0.08);
    border-left: 3px solid var(--red);
}
.explanation-item.invalidation .explanation-item-label { color: var(--red); }
.explanation-item.action {
    background: rgba(6,182,212,0.08);
    border-left: 3px solid var(--accent);
}
.explanation-item.action .explanation-item-label { color: var(--accent); }

/* ——— Score breakdown ——— */
.score-breakdown {
    margin: 0.5rem 0;
}
.score-breakdown-toggle {
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0.4rem 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.score-breakdown-toggle::before {
    content: '▸';
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.score-breakdown[open] .score-breakdown-toggle::before {
    transform: rotate(90deg);
}
.score-breakdown-toggle:hover { color: var(--accent); }
.score-breakdown-body {
    padding: 0.5rem 0;
}
.bd-row {
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.bd-row:last-child { border-bottom: none; }
.bd-row-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.bd-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.bd-points {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.bd-points .positive { margin-right: 0.3rem; }
.bd-points .negative { margin-right: 0.3rem; }
.bd-points .muted { color: var(--text-muted); }
.bd-bar-track {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    display: flex;
    gap: 1px;
    margin-bottom: 0.2rem;
}
.bd-bar-bull {
    height: 100%;
    background: var(--green);
    border-radius: 2px;
    min-width: 2px;
}
.bd-bar-bear {
    height: 100%;
    background: var(--red);
    border-radius: 2px;
    min-width: 2px;
}
.bd-desc {
    font-size: 0.73rem;
    color: var(--text-dim);
    line-height: 1.35;
}

/* ——— News section ——— */
.news-section {
    margin: 1.5rem 0;
}
.news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.news-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.news-refresh-btn {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.news-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.news-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}
.news-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    transition: border-color var(--transition);
}
.news-item:hover { border-color: var(--accent); }
.news-item.news-important {
    border-left: 3px solid var(--orange);
}
.news-item.news-bearish {
    border-left: 3px solid var(--red);
}
.news-item.news-bullish {
    border-left: 3px solid var(--green);
}
.news-sentiment {
    font-size: 1.1rem;
    flex-shrink: 0;
    width: 1.5rem;
    text-align: center;
}
.news-body {
    flex: 1;
    min-width: 0;
}
.news-title-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.35;
    display: block;
}
.news-title-link:hover { color: var(--accent); }
.news-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.news-tag {
    background: rgba(6,182,212,0.12);
    color: var(--accent);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
}
.news-empty {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    grid-column: 1 / -1;
}

/* ——— Живые элементы ——— */
.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    margin-right: 0.35rem;
    vertical-align: middle;
    animation: livePulse 2s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
    50% { opacity: 0.5; transform: scale(0.8); box-shadow: 0 0 2px rgba(16, 185, 129, 0.3); }
}

.pulse-icon {
    display: inline-block;
    animation: iconPulse 2.5s ease-in-out infinite;
}
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.thinking-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.mood-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.2rem 0.55rem;
    background: rgba(255,255,255,0.06);
    border-radius: 6px;
    white-space: nowrap;
}
.mood-icon {
    font-size: 1.1rem;
}

.temperature-line {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.3rem 0.5rem;
    background: rgba(255,255,255,0.03);
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-style: italic;
}

/* ——— Responsive ——— */
@media (max-width: 960px) {
    main { padding: 1.25rem 1rem; }
    .cards { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; }
    .about-tools-grid { grid-template-columns: 1fr; }
    .news-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .cards { grid-template-columns: 1fr; }
    .card-indicators { grid-template-columns: 1fr; }
    .dashboard { grid-template-columns: 1fr 1fr; }
    .chart-modal-content { max-width: 100vw; border-radius: 0; }
    .filters-bar { flex-direction: column; align-items: stretch; gap: 0.6rem; }
    .filter-group { flex-wrap: wrap; }
    .filter-btn { font-size: 0.75rem; padding: 0.35rem 0.65rem; }
    .sort-group { margin-left: 0; }
    .promote-group { margin-left: 0; }
    .deposit-group { margin-left: 0; width: 100%; }
    .deposit-group .deposit-input { width: 100%; }
    .page-hero h1 { font-size: 1.3rem; }
    .page-hero .meta { font-size: 0.78rem; }
    .dash-card { padding: 0.75rem 0.85rem; }
    .dash-big-number { font-size: 1.3rem; }
    .exchanges-block { padding: 1rem; }
    .exchanges-block p { font-size: 0.85rem; }
    .card { padding: 1rem; }
    .card-header .symbol { font-size: 0.95rem; }
    .card-summary { padding: 0.5rem; }
    .card-summary-metrics { gap: 0.2rem 0.5rem; }
    .csm-item { font-size: 0.72rem; }
    .csm-label { font-size: 0.65rem; }
    .csm-value { font-size: 0.72rem; }
    .card-compact-actions { flex-direction: row; gap: 0.4rem; }
    .card-details-btn { font-size: 0.75rem; padding: 0.45rem 0.6rem; }
    .ai-prompt-btn-compact { font-size: 0.7rem; padding: 0.45rem 0.6rem; }
}
@media (max-width: 480px) {
    .watchlist-modal { max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
    .chart-modal-content { max-width: 100vw; max-height: 100vh; max-height: 100dvh; border-radius: 0; }
    .chart-modal-header { flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 0.75rem; }
    .chart-modal-header h2 { font-size: 0.95rem; }
    .chart-tf-btn { font-size: 0.7rem; padding: 0.25rem 0.45rem; }
}
@media (max-width: 400px) {
    main { padding: 1rem 0.5rem; }
    .dashboard { grid-template-columns: 1fr; }
    .site-header { padding: 0.5rem 0.75rem; }
    .logo { font-size: 1.1rem; }
    .logo-icon { width: 26px; height: 26px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   MARKET CONTEXT BLOCK
   ═══════════════════════════════════════════════════════════════════════ */

.market-context.hidden { display: none; }
.market-context {
    margin: 0 auto 1.5rem;
    max-width: 1800px;
    padding: 0;
}
.market-context-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.market-context-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}
.market-context-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.market-context-updated {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.market-context-refresh-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}
.market-context-refresh-btn.is-loading::before {
    content: '';
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.35rem;
    vertical-align: middle;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin-refresh 0.8s linear infinite;
}
.market-context-empty {
    font-size: 0.9rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}
.market-context-empty.hidden { display: none; }
.market-context-grid.hidden { display: none; }

.market-context-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.mc-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: border-color 0.2s;
}
.mc-card:hover {
    border-color: var(--accent);
}
.mc-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}
.mc-big-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
}
.mc-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Fear & Greed gauge */
.mc-fear-greed {
    grid-row: span 2;
}
.mc-fg-gauge {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem 0;
}
.mc-fg-circle {
    position: relative;
    width: 120px;
    height: 120px;
}
.mc-fg-svg {
    width: 100%;
    height: 100%;
}
.mc-fg-svg circle {
    transition: stroke-dasharray 0.8s ease, stroke 0.5s ease;
}
.mc-fg-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    font-size: 1.8rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}
.mc-fg-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Long/Short bar */
.mc-ls-bar {
    height: 8px;
    background: var(--red);
    border-radius: 4px;
    overflow: hidden;
    margin: 0.5rem 0 0.4rem;
}
.mc-ls-long {
    height: 100%;
    background: var(--green);
    border-radius: 4px 0 0 4px;
    transition: width 0.5s ease;
}
.mc-taker-buy {
    background: var(--green);
}
.mc-ls-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

/* Market signals */
.mc-signals {
    margin-top: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
}
.mc-signals:empty {
    display: none;
}
.mc-signals-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    display: block;
    margin-bottom: 0.4rem;
}
.mc-signals ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mc-signals li {
    padding: 0.25rem 0;
    font-size: 0.82rem;
    color: var(--text-secondary, #b0b5c0);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mc-signals li:last-child {
    border-bottom: none;
}
.mc-signals li::before {
    content: '•';
    color: var(--accent);
    margin-right: 0.4rem;
}

/* Market context in signal cards */
.market-ctx-section {
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}
.market-ctx-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

@media (max-width: 1024px) {
    .market-context-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mc-fear-greed {
        grid-row: span 1;
    }
}
@media (max-width: 600px) {
    .market-context-grid {
        grid-template-columns: 1fr 1fr;
    }
    .mc-big-value {
        font-size: 1.1rem;
    }
    .mc-fg-circle {
        width: 90px;
        height: 90px;
    }
    .mc-fg-value {
        font-size: 1.4rem;
    }
}

/* ========== Quality Gate ========== */
.quality-gate-section {
    margin: 0.6rem 0;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}
.quality-gate-section.qg-enter {
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.04);
}
.quality-gate-section.qg-skip {
    border-color: rgba(239,68,68,0.3);
    background: rgba(239,68,68,0.04);
}
.quality-gate-section.qg-partial {
    border-color: rgba(245,158,11,0.3);
    background: rgba(245,158,11,0.04);
}
.qg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}
.qg-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.qg-recommendation {
    font-size: 0.85rem;
    font-weight: 700;
}
.qg-skip-bar {
    margin-bottom: 0.5rem;
}
.qg-skip-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}
.qg-skip-track {
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.qg-skip-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}
.qg-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.qg-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
}
.qg-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.qg-stat-value {
    font-size: 0.9rem;
    font-weight: 700;
}
.qg-reasons {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.qg-reasons-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.2rem;
}
.qg-reasons ul {
    margin: 0;
    padding-left: 1.1rem;
    list-style: disc;
}
.qg-reasons li {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Skip-карточки */
.card.card-skip {
    opacity: 0.55;
    filter: grayscale(0.3);
    position: relative;
}
.card.card-skip:hover {
    opacity: 0.85;
    filter: none;
}
.card-skip-banner {
    background: rgba(239,68,68,0.12);
    color: var(--red);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}

/* Recommended-карточки */
.card.card-recommended {
    border-color: rgba(16,185,129,0.35);
    box-shadow: 0 0 12px rgba(16,185,129,0.08);
}

/* Outcome stats в дашборде */
.dash-outcomes {
    min-width: 180px;
}
.outcome-stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.os-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 55px;
}
.os-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.os-value {
    font-size: 1rem;
    font-weight: 700;
}

/* Фильтр "Рекомендованные" */
.filter-recommended {
    color: #10b981;
    border-color: rgba(16,185,129,0.3);
}
.filter-recommended.active {
    background: rgba(16,185,129,0.15);
    color: #10b981;
    border-color: #10b981;
}
.filter-approved {
    color: #06b6d4;
    border-color: rgba(6,182,212,0.3);
}
.filter-approved.active {
    background: rgba(6,182,212,0.15);
    color: #06b6d4;
    border-color: #06b6d4;
}

/* ──── Блок-шпаргалка «Когда входить» ──── */
.entry-guide {
    background: var(--card-bg);
    border: 1px solid rgba(6,182,212,0.15);
    border-radius: 10px;
    margin: 1rem auto;
    max-width: 1320px;
}
.entry-guide[open] {
    border-color: rgba(6,182,212,0.28);
}
.entry-guide-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color .2s;
}
.entry-guide-toggle::-webkit-details-marker { display: none; }
.entry-guide-toggle::after {
    content: '';
    margin-left: auto;
    border: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: transform .2s;
}
.entry-guide[open] .entry-guide-toggle::after {
    transform: rotate(180deg);
}
.entry-guide-toggle:hover { color: var(--accent); }
.entry-guide-icon {
    color: var(--accent);
    display: flex;
    align-items: center;
}
.eg-body {
    padding: 0 1.1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}
.entry-guide-notice {
    margin-top: 0.75rem;
    margin-bottom: 1.5rem;
    padding: 0.9rem 1rem;
    background: rgba(6,182,212,0.06);
    border: 1px solid rgba(6,182,212,0.2);
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.entry-guide-notice p { margin: 0; }
.entry-guide-notice p + p { margin-top: 0.6em; }

/* Шкалы */
.eg-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.35rem;
}
.eg-scale {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    height: 42px;
}
.eg-scale-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 0 4px;
    min-width: 0;
    transition: filter .15s;
}
.eg-scale-segment:hover { filter: brightness(1.3); }
.eg-seg-red    { background: rgba(239,68,68,0.18); }
.eg-seg-orange { background: rgba(249,115,22,0.16); }
.eg-seg-cyan   { background: rgba(6,182,212,0.16); }
.eg-seg-green  { background: rgba(16,185,129,0.18); }
.eg-seg-pct {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}
.eg-seg-label {
    font-size: 0.62rem;
    font-weight: 500;
    opacity: 0.85;
    line-height: 1;
    white-space: nowrap;
}
.eg-seg-red .eg-seg-pct    { color: var(--red); }
.eg-seg-red .eg-seg-label  { color: var(--red); }
.eg-seg-orange .eg-seg-pct { color: var(--orange); }
.eg-seg-orange .eg-seg-label { color: var(--orange); }
.eg-seg-cyan .eg-seg-pct   { color: var(--accent); }
.eg-seg-cyan .eg-seg-label { color: var(--accent); }
.eg-seg-green .eg-seg-pct  { color: var(--green); }
.eg-seg-green .eg-seg-label{ color: var(--green); }

/* Карточки */
.eg-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.eg-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.6rem 0.7rem;
}
.eg-card-title {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.4rem;
}
.eg-card-rows {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.eg-card-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    line-height: 1.4;
}
.eg-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.eg-dot-green  { background: var(--green); }
.eg-dot-orange { background: var(--orange); }
.eg-dot-red    { background: var(--red); }
.eg-dot-cyan   { background: var(--accent); }
.eg-card-key {
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    min-width: 58px;
    flex-shrink: 0;
}
.eg-card-val {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

@media (max-width: 700px) {
    .eg-cards {
        grid-template-columns: 1fr;
    }
    .eg-scale {
        height: 38px;
    }
    .eg-seg-label {
        font-size: 0.56rem;
    }
    .eg-body {
        padding: 0 0.7rem 0.8rem;
    }
}

/* Мобильные: шпаргалка и кнопки без обрезки текста */
@media (max-width: 600px) {
    .entry-guide {
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    .entry-guide-toggle {
        white-space: normal;
        word-break: break-word;
        padding: 0.85rem 1rem;
        min-height: 48px;
        align-items: center;
    }
    .entry-guide-toggle::after {
        flex-shrink: 0;
    }
    .signals-refresh-bar {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }
    .card {
        overflow: hidden;
    }
    .risk-grid {
        grid-template-columns: 1fr;
    }
    .validation-grid {
        grid-template-columns: 1fr 1fr;
    }
    .reasons ul,
    .validation-reasons ul {
        word-break: break-word;
    }
    .disclaimer {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        margin-left: 0;
        margin-right: 0;
        max-width: 100%;
    }
    .forecast-header {
        align-items: flex-start;
    }
    .forecast-badge {
        white-space: normal;
        word-break: break-word;
        max-width: 100%;
    }
}

/* ──── Кнопка «Обновить сигналы» (в строке с фильтрами) ──── */
.signals-refresh-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}
.signals-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    padding: 0.35rem 0.85rem;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: border-color .2s, color .2s;
}
.signals-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.signals-refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.signals-refresh-btn svg {
    flex-shrink: 0;
}
.signals-refresh-btn.is-loading svg {
    animation: spin-refresh 0.8s linear infinite;
}
@keyframes spin-refresh {
    to { transform: rotate(360deg); }
}
.signals-refresh-status {
    font-size: 0.72rem;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .qg-stats {
        gap: 0.3rem;
    }
    .qg-stat {
        min-width: 45px;
    }
    .outcome-stats-grid {
        gap: 0.4rem;
    }
}

/* ——— Trade Validator Badge ——— */
.validation-section {
    margin: 0.6rem 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.validation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    transition: background var(--transition);
}

.validation-header:hover {
    filter: brightness(1.1);
}

.validation-approve .validation-header {
    background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05));
    border: 1px solid rgba(16,185,129,0.25);
    border-radius: var(--radius-sm);
}

.validation-reject .validation-header {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05));
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
}

.validation-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.validation-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.validation-approve .validation-badge {
    background: rgba(16,185,129,0.2);
    color: var(--green);
}

.validation-reject .validation-badge {
    background: rgba(239,68,68,0.2);
    color: var(--red);
}

.validation-badge-icon {
    font-size: 0.85rem;
}

.validation-confidence {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.validation-body {
    padding: 0.6rem 0.8rem 0.8rem;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    background: rgba(0,0,0,0.15);
}

.validation-approve .validation-body {
    border-color: rgba(16,185,129,0.15);
}

.validation-reject .validation-body {
    border-color: rgba(239,68,68,0.15);
}

.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.validation-stat {
    text-align: center;
    padding: 0.35rem 0.25rem;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
}

.validation-stat-label {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.validation-stat-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.validation-rr-good { color: var(--green); }
.validation-rr-ok { color: var(--yellow); }
.validation-rr-bad { color: var(--red); }

.validation-reasons {
    margin-top: 0.4rem;
}

.validation-reasons-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.validation-reasons-label.positive { color: var(--green); }
.validation-reasons-label.negative { color: var(--red); }
.validation-reasons-label.warn { color: var(--orange); }

.validation-reasons ul {
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: none;
}

.validation-reasons ul li {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
    position: relative;
    padding-left: 0.5rem;
}

.validation-reasons ul li::before {
    content: '→';
    position: absolute;
    left: -0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.validation-score-bar {
    margin-top: 0.4rem;
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 2px;
    overflow: hidden;
}

.validation-score-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.card-approved {
    border-left: 3px solid var(--green);
}

.card-rejected {
    opacity: 0.7;
    border-left: 3px solid var(--red);
}

.card-rejected:hover {
    opacity: 0.9;
}

/* ══════════════════════════════════════════════
   ИСТОРИЯ СДЕЛОК (history.php)
   ══════════════════════════════════════════════ */

/* ─── Наблюдаемые монеты ─── */
.hist-watchlist-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 1800px;
    margin: 0 auto 1.2rem;
    padding: 0.7rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hist-watchlist-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.hist-watchlist-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.hist-wl-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-mono);
    border-radius: 4px;
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ─── Статистика ─── */
.hist-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 1800px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}
.hist-stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1rem;
    text-align: center;
}
.hist-stat-card.hist-stat-winrate {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(6,182,212,0.08), var(--card));
}
.hist-stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
.hist-stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text);
    line-height: 1.2;
}
.hist-stat-value.positive { color: var(--green); }
.hist-stat-value.negative { color: var(--red); }
.hist-stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ─── Секции ─── */
.hist-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}
.hist-winloss-section,
.hist-equity-section,
.hist-open-section,
.hist-table-section {
    max-width: 1800px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}

/* ─── Win/Loss Bar ─── */
.hist-winloss-bar-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.hist-winloss-bar {
    display: flex;
    height: 32px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    gap: 2px;
}
.hist-wl-wins {
    background: linear-gradient(135deg, var(--green), #22c55e);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    transition: width 0.8s ease;
    min-width: 2px;
}
.hist-wl-losses {
    background: linear-gradient(135deg, var(--red), #dc2626);
    transition: width 0.8s ease;
    min-width: 2px;
}
.hist-wl-expired {
    background: linear-gradient(135deg, var(--yellow), #ca8a04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    transition: width 0.8s ease;
    min-width: 2px;
}
.hist-winloss-labels {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}
.hist-wl-label {
    font-size: 0.82rem;
    font-weight: 500;
}
.hist-wl-label.positive { color: var(--green); }
.hist-wl-label.negative { color: var(--red); }
.hist-wl-label.muted { color: var(--yellow); }

/* ─── Equity Chart ─── */
.hist-equity-chart-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow: hidden;
}
.hist-equity-chart-wrap canvas {
    width: 100%;
    height: 300px;
    display: block;
}

/* ─── Открытые сделки ─── */
.hist-open-count {
    font-size: 0.8rem;
    background: var(--accent);
    color: #000;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-left: 0.3rem;
}
.hist-trades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.hist-open-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.hist-open-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}
.hist-open-symbol {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}
.hist-open-side {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
}
.side-long { background: rgba(16,185,129,0.15); color: var(--green); }
.side-short { background: rgba(239,68,68,0.15); color: var(--red); }
.hist-open-prices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    font-size: 0.82rem;
    margin-bottom: 0.6rem;
}
.hist-open-prices .muted { color: var(--text-muted); }
.hist-open-pnl {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-align: center;
    margin: 0.5rem 0;
}
.hist-open-pnl.positive { color: var(--green); }
.hist-open-pnl.negative { color: var(--red); }
.hist-open-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* ─── Таблица журнала ─── */
.hist-table-wrap {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow-x: auto;
}
.hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    white-space: nowrap;
}
.hist-table th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.7rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.hist-table td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid rgba(37,40,48,0.5);
    color: var(--text);
}
.hist-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
.hist-table .positive { color: var(--green); font-weight: 600; }
.hist-table .negative { color: var(--red); font-weight: 600; }
.hist-td-symbol {
    font-weight: 700;
    color: var(--accent) !important;
}
.hist-side {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 3px;
}
.hist-status {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}
.hist-status-win {
    background: rgba(16,185,129,0.15);
    color: var(--green);
}
.hist-status-loss {
    background: rgba(239,68,68,0.15);
    color: var(--red);
}
.hist-status-expired {
    background: rgba(234,179,8,0.15);
    color: var(--yellow);
}
.hist-status-open {
    background: rgba(6,182,212,0.15);
    color: var(--accent);
}
.hist-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem !important;
    font-size: 0.9rem;
}

/* ─── Адаптив ─── */
@media (max-width: 768px) {
    .hist-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 1rem;
    }
    .hist-winloss-section,
    .hist-equity-section,
    .hist-open-section,
    .hist-table-section {
        padding: 0 1rem;
    }
    .hist-trades-grid {
        grid-template-columns: 1fr;
    }
    .hist-stat-value {
        font-size: 1.3rem;
    }
}
@media (max-width: 480px) {
    .hist-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.6rem;
    }
    .hist-stat-card {
        padding: 0.8rem 0.6rem;
    }
    .hist-table {
        font-size: 0.72rem;
    }
    .hist-table th, .hist-table td {
        padding: 0.4rem 0.5rem;
    }
}

/* ─── Описание: Как работает автотрейдинг ─── */
.hist-about-section {
    max-width: 1800px;
    margin: 1rem auto 2.5rem;
    padding: 0 1.5rem;
}
.hist-about-header {
    text-align: center;
    margin-bottom: 2rem;
}
.hist-about-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.5rem;
}
.hist-about-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ─── Pipeline (шаги) ─── */
.hist-pipeline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.hist-pipe-step {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: border-color var(--transition);
}
.hist-pipe-step:hover {
    border-color: var(--accent-dim);
}
.hist-pipe-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #38bdf8);
    color: #000;
    font-weight: 800;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hist-pipe-content strong {
    display: block;
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.hist-pipe-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

/* ─── Criteria cards (критерии / стратегия / портфель) ─── */
.hist-criteria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.hist-criteria-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.hist-criteria-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.8rem;
}
.hist-criteria-rows {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.hist-cr-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
}
.hist-cr-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.hist-cr-green { background: var(--green); }
.hist-cr-cyan { background: var(--accent); }
.hist-cr-red { background: var(--red); }
.hist-cr-yellow { background: var(--yellow); }
.hist-cr-dim { background: var(--text-muted); opacity: 0.35; }
.hist-cr-sub { font-size: 0.72rem; opacity: 0.7; }
.hist-cr-key {
    color: var(--text-muted);
    flex: 1;
}
.hist-cr-val {
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-align: right;
}

.hist-criteria-desc {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.hist-criteria-desc p { margin: 0 0 0.4rem; }
.hist-criteria-desc strong { color: var(--text); }
.hist-criteria-desc ul {
    margin: 0.3rem 0 0.5rem 1rem;
    padding: 0;
    list-style: disc;
}
.hist-criteria-desc li { margin-bottom: 0.2rem; }

/* ─── Легенда ─── */
.hist-legend {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem 1.5rem;
    margin-bottom: 2rem;
}
.hist-legend-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}
.hist-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.6rem;
}
.hist-legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.hist-legend-item .hist-status,
.hist-legend-item .hist-side {
    flex-shrink: 0;
    font-size: 0.72rem;
}

/* ─── Адаптив описательных блоков ─── */
@media (max-width: 768px) {
    .hist-about-section {
        padding: 0 1rem;
    }
    .hist-pipeline {
        grid-template-columns: 1fr;
    }
    .hist-criteria-grid {
        grid-template-columns: 1fr;
    }
    .hist-legend-grid {
        grid-template-columns: 1fr;
    }
    .hist-about-title {
        font-size: 1.2rem;
    }
}

/* ─── Trade Toast Notifications ─── */
.toast-container {
    position: fixed;
    top: 70px;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}
.toast {
    pointer-events: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.45);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toastIn 0.35s ease-out;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.3s, transform 0.3s;
}
.toast.toast-out {
    opacity: 0;
    transform: translateX(100%);
}
.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}
.toast-open::before { background: var(--accent); }
.toast-win::before { background: var(--green); }
.toast-loss::before { background: var(--red); }
.toast-expired::before { background: var(--yellow); }
.toast-signal::before { background: var(--accent); }

.toast-icon {
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
    margin-top: 1px;
}
.toast-body {
    flex: 1;
    min-width: 0;
}
.toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.toast-title .toast-side {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
}
.toast-side.side-long { background: rgba(16,185,129,0.15); color: var(--green); }
.toast-side.side-short { background: rgba(239,68,68,0.15); color: var(--red); }

.toast-details {
    font-size: 0.73rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.toast-details span {
    display: inline-block;
    margin-right: 0.6rem;
}
.toast-details .toast-pnl {
    font-weight: 700;
    font-family: var(--font-mono);
}
.toast-details .toast-pnl.positive { color: var(--green); }
.toast-details .toast-pnl.negative { color: var(--red); }

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.toast-close:hover { opacity: 1; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 0 var(--radius-sm);
    animation: toastProgress 8s linear forwards;
}
.toast-open .toast-progress { background: var(--accent); }
.toast-win .toast-progress { background: var(--green); }
.toast-loss .toast-progress { background: var(--red); }
.toast-expired .toast-progress { background: var(--yellow); }
.toast-signal .toast-progress { background: var(--accent); animation: toastProgress 6s linear forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

@media (max-width: 480px) {
    .toast-container {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

/* ——— AI Prompt Button ——— */
.ai-prompt-section {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ai-prompt-btn {
    width: 100%;
    padding: 0.65rem 1rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(6,182,212,0.15));
    border: 1px solid rgba(139,92,246,0.3);
    border-radius: var(--radius-sm);
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.ai-prompt-btn:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(6,182,212,0.25));
    border-color: rgba(139,92,246,0.5);
    color: #ddd6fe;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139,92,246,0.2);
}
.ai-prompt-btn:active {
    transform: translateY(0);
}

/* ——— Card Summary (compact view) ——— */
.card-summary {
    margin: 0.5rem 0 0;
    padding: 0.6rem 0.65rem;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.04);
}
.card-summary-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 0.75rem;
}
.csm-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    padding: 0.15rem 0;
}
.csm-item.csm-mood {
    grid-column: 1 / -1;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 0.35rem;
    margin-top: 0.1rem;
}
.csm-label {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}
.csm-value {
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text);
}
.csm-sep {
    color: var(--text-muted);
    margin: 0 0.15rem;
}

/* ——— Hint (tooltip) icon next to labels ——— */
.label-with-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.label-with-hint-text {
    /* label text as-is */
}
.hint-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: help;
    border-radius: 50%;
    transition: color 0.2s;
    flex-shrink: 0;
}
.hint-icon:hover {
    color: var(--accent);
}
.eg-card-title-hint,
.dash-label-hint,
.mc-label-hint {
    cursor: help;
}

/* ——— Card compact actions (AI + Details) ——— */
.card-compact-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.65rem;
}
.ai-prompt-btn-compact {
    flex: 0 0 auto;
    width: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(6,182,212,0.12));
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: var(--radius-sm);
    color: #c4b5fd;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.ai-prompt-btn-compact:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.22), rgba(6,182,212,0.22));
    border-color: rgba(139,92,246,0.45);
    color: #ddd6fe;
}
.ai-prompt-btn-compact svg {
    flex-shrink: 0;
}
.card-details-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.card-details-btn:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
}
.card-details-btn svg {
    transition: transform 0.3s ease;
    flex-shrink: 0;
}
.card-details-btn-open svg {
    transform: rotate(180deg);
}

/* ——— Card details body (expandable) ——— */
.card-details-body {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    animation: cardDetailsIn 0.3s ease both;
}
@keyframes cardDetailsIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ——— Copy Toast ——— */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(16,185,129,0.95);
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.copy-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.stale-notice {
    grid-column: 1 / -1;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--accent, #00d4ff);
    border-radius: 12px;
    padding: 14px 20px;
    text-align: center;
    color: var(--accent, #00d4ff);
    font-size: .93rem;
    margin-bottom: 4px;
    animation: stale-fade-in .3s ease;
}
@keyframes stale-fade-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ——— Symbol search input ——— */
.search-group { display: flex; align-items: center; }
.symbol-search-input {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    width: 160px;
    transition: border-color var(--transition), width var(--transition);
}
.symbol-search-input:focus {
    outline: none;
    border-color: var(--accent);
    width: 200px;
}
.symbol-search-input::placeholder { color: var(--text-muted); }

/* ——— Favorites star ——— */
.fav-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color var(--transition), transform var(--transition);
    opacity: 0.4;
}
.fav-btn:hover { color: var(--yellow); opacity: 1; transform: scale(1.2); }
.fav-btn.fav-active { color: var(--yellow); opacity: 1; }

/* ——— Signal notification toast ——— */
.toast-signal { border-left-color: var(--accent); }

/* ——— Lazy load: show more button ——— */
.cards-show-more {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1.5rem auto;
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9375rem;
    transition: background var(--transition), border-color var(--transition);
}
.cards-show-more:hover { background: var(--card); border-color: var(--accent); }

/* ——— History filters bar ——— */
.hist-filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.hist-filter-group { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.hist-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8125rem;
    transition: all var(--transition);
}
.hist-filter-btn:hover { color: var(--text); border-color: var(--text-muted); }
.hist-filter-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(6,182,212,0.1); }
.hist-filter-win.active { color: var(--green); border-color: var(--green); background: rgba(16,185,129,0.1); }
.hist-filter-loss.active { color: var(--red); border-color: var(--red); background: rgba(239,68,68,0.1); }
.hist-filter-expired.active { color: var(--yellow); border-color: var(--yellow); background: rgba(234,179,8,0.1); }
.hist-search-group { margin-left: auto; }

/* ——— History load more button ——— */
.hist-load-more-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 1rem auto;
    padding: 0.6rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background var(--transition), border-color var(--transition);
}
.hist-load-more-btn:hover { background: var(--card); border-color: var(--accent); }

/* ——— FAQ Section ——— */
.faq-section {
    max-width: 900px;
    margin: 2.5rem auto;
    padding: 0 1rem;
}
.faq-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.faq-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color var(--transition);
}
.faq-item[open] {
    border-color: var(--accent);
}
.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    user-select: none;
    transition: color var(--transition);
}
.faq-question:hover { color: var(--accent); }
.faq-question::after {
    content: '+';
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.faq-item[open] .faq-question::after {
    content: '−';
    color: var(--accent);
}
.faq-question::-webkit-details-marker { display: none; }
.faq-answer {
    padding: 0 1.25rem 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}
.faq-answer p { margin: 0; }

@media (max-width: 768px) {
    .symbol-search-input { width: 120px; }
    .symbol-search-input:focus { width: 150px; }
    .hist-filters-bar { padding: 0.5rem; }
    .hist-search-group { margin-left: 0; width: 100%; }
    .hist-search-group .symbol-search-input { width: 100%; }
}

/* ─── Legal pages ─── */
.legal-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.legal-page h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.legal-page .legal-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}
.legal-page h2 {
    font-size: 1.25rem;
    margin: 2rem 0 0.75rem;
    color: var(--text);
}
.legal-page p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}
.legal-page ul {
    color: var(--text-secondary);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.legal-page li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}
.legal-page a {
    color: var(--cyan);
    text-decoration: none;
}
.legal-page a:hover {
    text-decoration: underline;
}

.donate-page .donate-intro {
    font-size: 1.05rem;
    color: var(--text);
}
.donate-cta {
    margin: 2.5rem 0;
    text-align: center;
}
.donate-btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #0a0b0f !important;
    font-weight: 600;
    border-radius: var(--radius);
    text-decoration: none !important;
    transition: transform var(--transition), box-shadow var(--transition);
}
.donate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
    text-decoration: none;
}
.donate-note {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.donate-thanks {
    margin-top: 2rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ─── Cookie Banner ─── */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: slideUp 0.3s ease;
}
.cookie-banner p {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
}
.cookie-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-shrink: 0;
}
.cookie-accept {
    background: var(--accent);
    color: #0a0b0f;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background var(--transition);
}
.cookie-accept:hover {
    background: var(--accent-dim);
}
.cookie-more {
    color: var(--text);
    font-size: 0.9rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-more:hover {
    color: var(--accent);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
}

/* ─── Footer legal links ─── */
.footer-legal {
    display: inline-flex;
    gap: 1rem;
    margin-left: 1rem;
}
.footer-legal a {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition);
}
.footer-legal a:hover {
    color: var(--cyan);
}

/* ─── Accessibility ─── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 100000;
    background: var(--cyan);
    color: #000;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s;
}
.skip-link:focus {
    top: 1rem;
}
