/* ============================================
   OpenJarvisLab Mini App — Cyber Dark Theme
   Inspired by PingWIN AI BOT reference, but
   with OJL brand colors: cyan + deep navy.
   ============================================ */

:root {
    /* Brand palette — OpenJarvisLab */
    --bg-0: #050912;
    --bg-1: #0A0F1E;
    --bg-2: #0E1428;
    --bg-3: #141B33;
    --surf-1: rgba(16, 24, 48, 0.72);
    --surf-2: rgba(22, 32, 60, 0.85);
    --surf-glow: rgba(0, 229, 255, 0.08);

    --accent: #00E5FF;
    --accent-2: #00B8D4;
    --accent-glow: rgba(0, 229, 255, 0.35);
    --accent-soft: rgba(0, 229, 255, 0.15);

    --buy: #00E676;
    --sell: #FF4757;
    --warn: #FFB74D;

    --text-1: #F5F9FF;
    --text-2: #B8C7E5;
    --text-3: #6B7A99;
    --text-dim: #4A587A;

    --border-1: rgba(0, 229, 255, 0.22);
    --border-2: rgba(0, 229, 255, 0.12);
    --border-dim: rgba(107, 122, 153, 0.18);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --shadow-glow: 0 0 24px rgba(0, 229, 255, 0.18);
    --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.45);

    --font-head: 'Rajdhani', -apple-system, system-ui, sans-serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;

    --nav-h: 72px;
    --top-h: 56px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-0);
    color: var(--text-1);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.4;
    overscroll-behavior-y: none;
    overflow-x: hidden;
}

body {
    background:
        radial-gradient(circle at 20% 10%, rgba(0, 229, 255, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 0%, rgba(100, 50, 255, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, #050912 0%, #0A0F1E 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-top: var(--top-h);
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }
.accent { color: var(--accent); text-shadow: 0 0 8px var(--accent-glow); }

/* ============== TOP BAR ============== */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--top-h);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(5, 9, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-dim);
    z-index: 100;
}

.brand { display: flex; flex-direction: column; gap: 2px; }
.brand-name {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
}
.brand-sub {
    font-size: 11px;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
}
.pulse-dot {
    width: 7px; height: 7px;
    background: var(--buy);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--buy);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.lang-picker {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--surf-1);
    border: 1px solid var(--border-1);
    border-radius: 999px;
    color: var(--text-1);
    font-size: 13px;
    cursor: pointer;
}
.chev { font-size: 10px; color: var(--text-3); }

.lang-dropdown {
    position: fixed;
    top: calc(var(--top-h) + 4px);
    right: 16px;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    z-index: 150;
    min-width: 160px;
}
.lang-dropdown button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-1);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.lang-dropdown button:hover,
.lang-dropdown button:active { background: var(--accent-soft); }

/* ============== MAIN ============== */
main {
    padding: 16px 14px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.tab-view { display: none; animation: fadeIn 0.25s ease-out; }
.tab-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.section-head { margin: 4px 0 14px; }
.section-head h2 {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 2px;
    letter-spacing: 0.3px;
}
.section-head.small h3 {
    font-family: var(--font-head);
    font-size: 16px;
    margin: 0 0 10px;
    color: var(--text-2);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.section-sub { color: var(--text-2); font-size: 12.5px; }

/* ============== HERO (HOME) ============== */
.hero-card {
    position: relative;
    background: linear-gradient(135deg, var(--surf-2) 0%, var(--bg-3) 100%);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    gap: 16px;
    align-items: center;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    margin-bottom: 14px;
}
.hero-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 20% 50%, var(--accent-soft), transparent 50%);
    pointer-events: none;
}

.hero-left { position: relative; z-index: 1; }
.hero-avatar {
    position: relative;
    width: 92px; height: 92px;
    display: grid;
    place-items: center;
}
.avatar-ring {
    position: absolute; inset: 0;
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 24px var(--accent-glow), inset 0 0 24px var(--accent-soft);
    animation: avatarRotate 8s linear infinite;
}
.avatar-ring::before {
    content: ''; position: absolute;
    top: -3px; left: 50%;
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
    transform: translateX(-50%);
}
@keyframes avatarRotate { to { transform: rotate(360deg); } }
.avatar-core {
    width: 72px; height: 72px;
    display: grid; place-items: center;
    font-size: 40px;
    background: radial-gradient(circle, #0A0F1E, #050912);
    border-radius: 50%;
    border: 1px solid var(--border-1);
}
.hero-tag {
    margin-top: 8px;
    text-align: center;
    font-family: var(--font-head);
    font-size: 11px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-2);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
}

.hero-right { flex: 1; position: relative; z-index: 1; }
.hero-title {
    font-family: var(--font-head);
    font-size: 30px;
    font-weight: 700;
    margin: 0 0 6px;
    letter-spacing: 0.5px;
    line-height: 1;
}
.hero-sub { color: var(--text-2); font-size: 13px; margin: 0; }

/* ============== STATS ============== */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    text-align: center;
}
.stat-icon { font-size: 20px; margin-bottom: 6px; opacity: 0.9; }
.stat-value {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 2px;
    letter-spacing: 0.5px;
}
.stat-label {
    font-size: 11px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ============== SIGNAL RADAR ============== */
.signal-radar-card {
    position: relative;
    background: linear-gradient(180deg, var(--surf-2), var(--bg-2));
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: var(--shadow-card);
}
.radar-left {
    width: 70px;
    display: grid; place-items: center;
}
.radar-pulse {
    position: relative;
    width: 56px; height: 56px;
    display: grid; place-items: center;
}
.rp-dot {
    width: 14px; height: 14px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 16px var(--accent);
    z-index: 2;
}
.rp-ring {
    position: absolute;
    border: 2px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: rpRing 2.2s ease-out infinite;
}
.rp-ring.r1 { width: 100%; height: 100%; }
.rp-ring.r2 { width: 100%; height: 100%; animation-delay: 0.7s; }
.rp-ring.r3 { width: 100%; height: 100%; animation-delay: 1.4s; }
@keyframes rpRing {
    0%   { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.radar-right { flex: 1; position: relative; }
.radar-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}
.radar-sub { color: var(--text-2); font-size: 12px; }
.radar-svg {
    width: 100%;
    height: 70px;
    margin-top: 8px;
    opacity: 0.65;
}

/* ============== CTA BUTTON ============== */
.cta-btn {
    position: relative;
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #001820;
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 6px 20px var(--accent-glow);
    overflow: hidden;
    margin-bottom: 14px;
}
.cta-btn:active { transform: translateY(1px); }
.cta-pulse {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
    animation: ctaShine 2.4s linear infinite;
    pointer-events: none;
}
@keyframes ctaShine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============== INFO ROW ============== */
.info-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.info-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-2);
}
.chip-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
}
.chip-dot.green { background: var(--buy); box-shadow: 0 0 6px var(--buy); }
.chip-dot.cyan { background: var(--accent); box-shadow: 0 0 6px var(--accent); }

/* ============== SIGNALS TAB ============== */
.cat-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 0 12px;
    margin: 0 -14px 10px;
    padding-left: 14px;
    padding-right: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s;
}
.cat-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #001820;
    font-weight: 700;
    box-shadow: 0 0 14px var(--accent-glow);
}

.field-group { margin-bottom: 14px; }
.field-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-2);
    margin-bottom: 8px;
    font-weight: 600;
}
.field-hint {
    font-size: 11.5px;
    color: var(--text-3);
    margin: -4px 0 8px;
    line-height: 1.35;
}

.dropdown { position: relative; }
.dropdown-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--surf-2);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}
.dropdown-head .pair-flag { font-size: 18px; }
.dropdown-head .pair-name { flex: 1; }
.dropdown-head .pair-payout {
    color: var(--accent);
    font-weight: 700;
    font-size: 15px;
}
.dropdown-head .chev { margin-left: auto; }

.dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-2);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    padding: 6px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    z-index: 50;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-1);
    font-size: 14px;
    border: 1px solid transparent;
}
.dropdown-item:hover,
.dropdown-item:active { background: var(--accent-soft); border-color: var(--border-1); }
.dropdown-item .pair-flag { font-size: 16px; }
.dropdown-item .pair-name { flex: 1; }
.dropdown-item .pair-payout { color: var(--accent); font-weight: 700; }
.dropdown-item.favorited .pair-flag::after { content: ' ⭐'; }

.expiry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.exp-btn {
    padding: 10px 6px;
    background: var(--surf-1);
    border: 1.5px solid var(--border-2);
    color: var(--text-1);
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}
.exp-btn span {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-3);
    letter-spacing: 0.3px;
}
.exp-btn.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
}
.exp-btn.active span { color: var(--text-2); }

.ind-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 10px;
    padding: 10px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
}
.ind-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    background: transparent;
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-size: 11.5px;
    cursor: pointer;
    text-align: left;
    min-height: 36px;
}
.ind-chip .ind-star { color: var(--text-dim); font-size: 11px; flex-shrink: 0; }
.ind-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text-1); }
.ind-chip.active .ind-star { color: var(--accent); }

/* ============== SIGNAL RESULT ============== */
.signal-result-card {
    background: var(--surf-2);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    margin-bottom: 14px;
    min-height: 180px;
    position: relative;
    overflow: hidden;
}
.result-placeholder {
    text-align: center;
    padding: 20px 10px;
}
.ph-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.6; }
.ph-text { color: var(--text-2); font-size: 13px; }

.live-progress { text-align: center; padding: 20px 0; }
.lp-bar {
    width: 80%; height: 4px;
    margin: 0 auto 10px;
    background: var(--surf-1);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
}
.lp-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 40%;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    animation: lpSlide 1.4s ease-in-out infinite;
}
@keyframes lpSlide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(250%); }
}
.lp-text { color: var(--text-2); font-size: 13px; }

.live-signal { text-align: center; }
.ls-direction {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1.5px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}
.ls-direction.buy { background: rgba(0, 230, 118, 0.15); color: var(--buy); box-shadow: 0 0 20px rgba(0, 230, 118, 0.3); }
.ls-direction.sell { background: rgba(255, 71, 87, 0.15); color: var(--sell); box-shadow: 0 0 20px rgba(255, 71, 87, 0.3); }
.ls-arrow { font-size: 28px; }
.ls-pair {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}
.ls-exp {
    color: var(--text-2);
    font-size: 13px;
    margin-bottom: 14px;
}

.ls-confidence { margin-bottom: 14px; }
.lc-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    margin-bottom: 6px;
}
.lc-dots {
    display: inline-flex;
    gap: 6px;
    margin-right: 10px;
}
.lcd {
    width: 10px; height: 10px;
    background: var(--text-dim);
    border-radius: 50%;
}
.lcd.active {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}
.lc-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-soft);
    border: 1px solid var(--border-1);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ls-count {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-2);
}
.ls-timer {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    min-width: 36px;
    text-align: center;
    background: var(--surf-2);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-1);
}

/* ============== LEARN TAB ============== */
.learn-list { display: flex; flex-direction: column; gap: 10px; }
.learn-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-md);
    cursor: pointer;
}
.learn-item:active { background: var(--surf-2); }
.li-icon {
    width: 42px; height: 42px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-sm);
    font-size: 20px;
    flex-shrink: 0;
}
.li-body { flex: 1; min-width: 0; }
.li-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
    color: var(--text-1);
}
.li-sub {
    font-size: 11.5px;
    color: var(--text-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.li-chev { color: var(--text-3); font-size: 16px; }

/* ============== PROFILE TAB ============== */
.profile-card {
    background: linear-gradient(135deg, var(--surf-2), var(--bg-3));
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}
.profile-card::before {
    content: '';
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 60%);
    pointer-events: none;
}
.pc-avatar {
    width: 84px; height: 84px;
    margin: 0 auto 10px;
    display: grid; place-items: center;
    background: var(--bg-0);
    border: 2px solid var(--accent);
    border-radius: 50%;
    font-size: 44px;
    position: relative;
    box-shadow: 0 0 20px var(--accent-glow);
}
.pc-name {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    position: relative;
}
.pc-level {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-soft);
    border: 1px solid var(--border-1);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 1px;
    margin-bottom: 10px;
    position: relative;
}
.pc-id {
    font-size: 12px;
    color: var(--text-3);
    position: relative;
}

.stars-card {
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 14px;
    text-align: center;
}
.sc-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 4px;
}
.sc-icon { font-size: 32px; }
.sc-value {
    font-family: var(--font-head);
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 12px var(--accent-glow);
}
.sc-hint { color: var(--text-2); font-size: 12px; margin-bottom: 12px; }
.sc-topup {
    padding: 10px 22px;
    background: var(--accent);
    color: #001820;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    letter-spacing: 0.4px;
}

.levels-card {
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 14px;
}
.level-row { margin-bottom: 12px; }
.level-row:last-child { margin-bottom: 0; }
.lr-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.lr-badge { font-size: 18px; }
.lr-name { flex: 1; font-weight: 600; }
.lr-prog { color: var(--text-3); font-size: 11.5px; }
.lr-bar {
    height: 6px;
    background: var(--bg-0);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--border-dim);
}
.lr-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    box-shadow: 0 0 6px var(--accent-glow);
    transition: width 0.4s ease;
}

.profile-actions { display: flex; flex-direction: column; gap: 8px; }
.pa-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    color: var(--text-1);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
}
.pa-btn:active { background: var(--surf-2); }
.pa-btn.danger { color: var(--sell); border-color: rgba(255, 71, 87, 0.2); }
.pa-icon { font-size: 18px; }
.pa-chev { margin-left: auto; color: var(--text-3); font-size: 18px; }

/* ============== BOTTOM NAV ============== */
.bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-h);
    padding-bottom: env(safe-area-inset-bottom);
    display: flex;
    align-items: stretch;
    background: rgba(5, 9, 18, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-dim);
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
}
.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding-top: 6px;
    transition: color 0.15s;
}
.nav-icon { font-size: 22px; line-height: 1; }
.nav-label { font-size: 11px; font-weight: 500; letter-spacing: 0.3px; }
.nav-btn.active {
    color: var(--accent);
    position: relative;
}
.nav-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%; right: 20%;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    border-radius: 0 0 4px 4px;
}

/* ============== ARTICLE DETAIL VIEW ============== */
.article-view {
    position: fixed;
    inset: 0;
    background: var(--bg-0);
    z-index: 150;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.22s ease-out;
}
.article-view.hidden { display: none; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0.3; }
    to { transform: translateX(0); opacity: 1; }
}

.article-head {
    position: sticky; top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top));
    background: rgba(5, 9, 18, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-dim);
    z-index: 10;
}
.art-back {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    background: var(--surf-1);
    border: 1px solid var(--border-1);
    border-radius: 50%;
    color: var(--accent);
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}
.art-head-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 40px;
    -webkit-overflow-scrolling: touch;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.art-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--surf-2), var(--bg-3));
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}
.art-hero-icon {
    width: 54px; height: 54px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    font-size: 26px;
    flex-shrink: 0;
}
.art-hero-text { flex: 1; min-width: 0; }
.art-hero-title {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 2px;
}
.art-hero-sub {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.35;
}

.art-p {
    font-size: 15px;
    color: var(--text-1);
    line-height: 1.55;
    margin: 0 0 14px;
    white-space: pre-line;
}
.art-h3 {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
    margin: 20px 0 10px;
    letter-spacing: 0.3px;
}
.art-ul, .art-ol {
    margin: 0 0 14px;
    padding-left: 20px;
}
.art-ul li, .art-ol li {
    font-size: 14.5px;
    color: var(--text-1);
    line-height: 1.5;
    margin-bottom: 6px;
}
.art-ul li::marker { color: var(--accent); }
.art-ol li::marker { color: var(--accent); font-weight: 600; }

.art-tip, .art-warn {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    margin: 14px 0;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    line-height: 1.5;
}
.art-tip {
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid var(--border-1);
    color: var(--text-1);
}
.art-tip::before {
    content: '💡';
    font-size: 18px;
    flex-shrink: 0;
}
.art-warn {
    background: rgba(255, 183, 77, 0.08);
    border: 1px solid rgba(255, 183, 77, 0.3);
    color: var(--text-1);
}
.art-warn::before {
    content: '⚠️';
    font-size: 18px;
    flex-shrink: 0;
}

.art-formula {
    text-align: center;
    font-family: 'Rajdhani', monospace;
    font-size: 26px;
    font-weight: 700;
    color: var(--accent);
    padding: 16px;
    margin: 14px 0;
    background: var(--surf-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px var(--accent-glow);
}

.art-img-wrap {
    margin: 12px -16px 14px;
    text-align: center;
}
.art-img {
    width: 100%;
    max-width: 100%;
    display: block;
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
    background: var(--bg-1);
}
.art-img-cap {
    display: block;
    font-size: 12px;
    color: var(--text-3);
    padding: 6px 16px 0;
    font-style: italic;
}

.art-svg-wrap {
    margin: 14px 0 16px;
    padding: 16px;
    background: var(--bg-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    text-align: center;
}
.art-svg-wrap svg {
    display: block;
    width: 100%;
    max-width: 320px;
    height: auto;
    margin: 0 auto;
}
.art-svg-wrap .art-img-cap { padding: 8px 0 0; }

/* ===== Martingale calculator ===== */
.art-calc {
    background: var(--surf-1);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin: 14px 0 20px;
}
.calc-field { margin-bottom: 12px; }
.calc-field label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-2);
    letter-spacing: 0.6px;
    margin-bottom: 6px;
    font-weight: 600;
}
.calc-field input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-0);
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-size: 16px;
    font-family: var(--font-body);
    font-weight: 600;
}
.calc-field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.calc-field .calc-hint {
    display: block;
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
}
.calc-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #001820;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 14px var(--accent-glow);
    margin-bottom: 14px;
}
.calc-result {
    background: var(--bg-0);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 10px;
}
.calc-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: var(--accent-soft);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    margin-bottom: 10px;
}
.calc-sum-card { text-align: center; }
.calc-sum-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-2);
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.calc-sum-value {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}
.calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.calc-table th,
.calc-table td {
    text-align: right;
    padding: 8px 6px;
    border-bottom: 1px solid var(--border-dim);
}
.calc-table th {
    color: var(--text-2);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.calc-table td:first-child,
.calc-table th:first-child { text-align: left; }
.calc-table tr:last-child td {
    border-bottom: none;
    background: var(--accent-soft);
    font-weight: 700;
    color: var(--accent);
}

/* ============== TELEGRAM-ONLY GATE ============== */
.tg-gate {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 30% 20%, rgba(0, 229, 255, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(100, 50, 255, 0.08) 0%, transparent 50%),
        linear-gradient(180deg, #050912 0%, #0A0F1E 100%);
    animation: fadeIn 0.3s ease-out;
}
.tg-gate.hidden { display: none; }

.tg-gate-card {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, var(--surf-2), var(--bg-3));
    border: 1.5px solid var(--border-1);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-card), 0 0 60px rgba(0, 229, 255, 0.15);
}
.tg-gate-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    font-size: 36px;
    background: var(--accent-soft);
    border: 2px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 24px var(--accent-glow);
}
.tg-gate-title {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
}
.tg-gate-sub {
    color: var(--text-2);
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 24px;
}
.tg-gate-sub strong {
    color: var(--text-1);
    font-weight: 600;
}
.tg-gate-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #001820;
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 20px var(--accent-glow);
    margin-bottom: 16px;
}
.tg-gate-cta:active { transform: translateY(1px); }
.tg-gate-cta-icon { font-size: 20px; }
.tg-gate-foot {
    color: var(--text-3);
    font-size: 11px;
    letter-spacing: 0.5px;
    margin: 0;
}

.tg-gate-steps {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}
.tg-gate-steps li {
    counter-increment: step;
    position: relative;
    padding: 10px 14px 10px 44px;
    margin-bottom: 8px;
    background: var(--surf-1);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--text-1);
}
.tg-gate-steps li::before {
    content: counter(step);
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    width: 24px; height: 24px;
    display: grid; place-items: center;
    background: var(--accent);
    color: #001820;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}
.tg-gate-cta-sec {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    cursor: pointer;
    margin-left: 10px;
    margin-top: 6px;
}
.tg-gate-cta-sec:active { background: var(--accent-soft); }

/* ============== TOAST ============== */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--bg-3);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    color: var(--text-1);
    font-size: 13px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    z-index: 200;
    max-width: 90vw;
    text-align: center;
}
.toast.success { border-color: var(--buy); }
.toast.error { border-color: var(--sell); }
