/* ═══════════════════════════════════════════════════════════════════
   KFOO Live Analyzer — Urban Blue Pro Theme v4
   Layout: 16:9 Video Top + Cards Grid Bottom
   ═══════════════════════════════════════════════════════════════════ */

:root {
    /* 1. Backgrounds */
    --bg-primary: #0b121c;
    --bg-secondary: #080e16;
    --bg-tertiary: #121a26;
    --bg-card: rgba(18, 26, 38, 0.92);

    /* 2. Action / Brand Colors */
    --accent-blue: #2563eb;
    --accent-blue-light: #3b82f6;
    --accent-green: #2563eb;
    /* mapped for legacy compat */
    --accent-green-dim: #1d4ed8;
    --accent-cyan: #3b82f6;
    /* mapped for legacy compat */
    --accent-purple: #7c3aed;

    /* 3. Market Indicators */
    --bullish: #22c55e;
    --bullish-bg: rgba(34, 197, 94, 0.08);
    --bearish: #ef4444;
    --bearish-bg: rgba(239, 68, 68, 0.08);
    --neutral: #f59e0b;
    --neutral-bg: rgba(245, 158, 11, 0.08);

    /* 4. Typography */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-tertiary: #6b7280;

    /* 5. Borders & Grid */
    --border-primary: #1f2937;
    --border-grid: #1e293b;
    --border-divider: #374151;
    --border-accent: rgba(37, 99, 235, 0.2);

    /* Shadow */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.08);

    /* Fonts */
    --font-ar: 'Cairo', 'Segoe UI', sans-serif;
    --font-en: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --nav-height: 52px;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: var(--bg-primary);
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-ar);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
}

/* ─── BACKGROUND ─── */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    z-index: 0;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
}

.bg-glow-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.08), transparent 70%);
    top: -80px;
    right: -80px;
}

.bg-glow-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.06), transparent 70%);
    bottom: -80px;
    left: -80px;
}

/* ═══════════════════════════════════════════════ */
/* TOP NAV                                        */
/* ═══════════════════════════════════════════════ */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: rgba(11, 18, 28, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-primary);
    z-index: 1000;
}

.nav-right,
.nav-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── NAV BRAND (Logo + KFOO AI) ─── */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    direction: ltr;
    cursor: default;
    user-select: none;
}

.nav-brand-logo {
    height: 34px;
    width: 34px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-brand-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 800;
    color: #e8eaf6;
    letter-spacing: 1px;
    line-height: 1;
    white-space: nowrap;
    direction: ltr;
}

.nav-brand-ai {
    color: #00e676;
    text-shadow: 0 0 10px rgba(0, 230, 118, 0.4);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.logo-subtitle {
    font-size: 9px;
    font-weight: 500;
    color: var(--text-tertiary);
    font-family: var(--font-en);
    letter-spacing: 1.5px;
}

.status-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: var(--radius-full);
}

.status-group.analyzing {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.18);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-tertiary);
}

.status-dot.ready {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(37, 99, 235, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.status-dot.analyzing {
    background: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.5);
    animation: dotPulse 1s ease-in-out infinite;
}

.status-dot.error {
    background: var(--bearish);
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: 0.5;
        transform: scale(0.75)
    }
}

.status-text {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.countdown-badge {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-green);
}

.countdown-unit {
    font-size: 9px;
    opacity: 0.7;
}

/* Analyzing indicator in header */
.nav-analyzing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    animation: navAnalyzingPulse 1.5s ease-in-out infinite;
}

.nav-analyzing-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes navAnalyzingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.nav-analyzing-label {
    font-size: 10px;
    padding: 1px 6px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: var(--radius-full);
    color: var(--accent-green);
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 500;
    transition: all var(--transition-fast);
    outline: none;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-btn.primary-btn {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.06));
    border-color: rgba(37, 99, 235, 0.25);
    color: var(--accent-green);
    font-family: var(--font-ar);
    font-weight: 600;
}

.nav-btn.primary-btn:hover {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(59, 130, 246, 0.12));
    border-color: rgba(37, 99, 235, 0.4);
}

.nav-btn.primary-btn.active {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.06));
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--bearish);
}

/* ═══════════════════════════════════════════════ */
/* MAIN                                           */
/* ═══════════════════════════════════════════════ */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding-top: var(--nav-height);
}

/* ─── WELCOME SCREEN ─── */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height));
    padding: 30px 20px;
    text-align: center;
    animation: fadeUp 0.7s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    animation: iconFloat 4s ease-in-out infinite;
}

@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0)
    }

    50% {
        transform: translateY(-8px)
    }
}

.welcome-icon svg {
    width: 100%;
    height: 100%;
}

.welcome-title {
    font-size: 38px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.welcome-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 420px;
    line-height: 1.7;
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 36px;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    border: none;
    border-radius: var(--radius-lg);
    color: #050508;
    font-family: var(--font-ar);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    margin-bottom: 36px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
}

.pulse-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: btnPulse 3s ease-out infinite;
}

@keyframes btnPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0
    }
}

.start-btn svg,
.start-btn span {
    position: relative;
    z-index: 1;
}

.welcome-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    max-width: 180px;
    text-align: right;
}

.step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 800;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.step-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.step-arrow {
    font-size: 18px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════ */
/* TIMEFRAME SELECTOR                             */
/* ═══════════════════════════════════════════════ */
.timeframe-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-full);
    padding: 2px;
}

.tf-btn {
    padding: 4px 12px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
    user-select: none;
}

.tf-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.tf-btn:active {
    transform: scale(0.92);
}

.tf-btn.active {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    color: var(--bg-primary);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.25);
}

/* ═══════════════════════════════════════════════ */
/* ANALYZER LAYOUT — 3 Columns: Cards | Video | Cards */
/* ═══════════════════════════════════════════════ */
.analyzer-layout {
    display: grid;
    grid-template-columns: 1.5fr minmax(280px, 380px) 1.5fr;
    gap: 14px;
    padding: 14px 20px;
    min-height: calc(100vh - var(--nav-height));
    align-content: start;
}

/* ─── SIDE COLUMNS ─── */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    max-height: calc(100vh - var(--nav-height) - 28px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 4px;
    padding-right: 4px;
    scrollbar-gutter: stable;
}

/* Custom scrollbar for sidebar */
.side-column::-webkit-scrollbar {
    width: 5px;
}

.side-column::-webkit-scrollbar-track {
    background: transparent;
}

.side-column::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-full);
    transition: background 0.2s;
}

.side-column::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.35);
}

/* ─── VIDEO SECTION (center, small) ─── */
.video-section {
    width: 100%;
    align-self: start;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-accent);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Share Control Buttons */
.video-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    width: 100%;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-ar);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.start-share-btn {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    color: var(--bg-primary);
}

.start-share-btn:hover {
    box-shadow: 0 0 20px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.stop-share-btn {
    background: rgba(239, 68, 68, 0.15);
    color: var(--bearish);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.stop-share-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.2);
}

/* LIVE badge */
.live-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    z-index: 10;
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    color: var(--bearish);
    letter-spacing: 1.5px;
}

.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bearish);
    animation: livePulse 1.2s ease-in-out infinite;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4)
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0)
    }
}

/* Analyzing overlay */
.video-analyzing-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(11, 18, 28, 0.88);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-full);
    z-index: 10;
}

.analyzing-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59, 130, 246, 0.15);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.analyzing-text {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-cyan);
}

.analyzing-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 2px 5px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: var(--radius-full);
}

/* ─── INFO CARDS (both columns) ─── */
.info-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: visible;
    min-width: 0;
}

.info-card:hover {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-card), 0 0 20px rgba(37, 99, 235, 0.05);
}

/* ═══════════════════════════════════════════════ */
/* STACK-STYLE CARDS — Premium Finance App Design  */
/* ═══════════════════════════════════════════════ */

/* Base Stack Card */
.stack-card {
    background: linear-gradient(145deg, rgba(15, 23, 35, 0.96), rgba(10, 16, 26, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stack-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* ─── Currency Card Header ─── */
.stack-card-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stack-ticker-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stack-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-en);
    font-size: 14px;
    font-weight: 800;
    color: white;
    flex-shrink: 0;
}

.stack-ticker-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.stack-ticker-symbol {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1.5px;
}

.stack-timeframe-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.stack-trend-pill {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: auto;
}

.stack-trend-pill.bullish {
    background: var(--bullish-bg);
    color: var(--bullish);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.stack-trend-pill.bearish {
    background: var(--bearish-bg);
    color: var(--bearish);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.stack-trend-pill.neutral {
    background: var(--neutral-bg);
    color: var(--neutral);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.stack-trend-pill.bullish .trend-arrow {
    transform: rotate(-45deg);
}

.stack-trend-pill.bearish .trend-arrow {
    transform: rotate(45deg);
}

/* Price Display */
.stack-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 4px;
}

.stack-price {
    font-family: var(--font-mono);
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stack-price-unit {
    font-family: var(--font-en);
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.stack-change-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stack-change {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
}

.stack-change.positive {
    color: var(--bullish);
    background: var(--bullish-bg);
}

.stack-change.negative {
    color: var(--bearish);
    background: var(--bearish-bg);
}

/* ─── Mini Area Chart ─── */
.stack-chart-container {
    position: relative;
    margin: 12px -16px 0;
    height: 100px;
    overflow: hidden;
}

.stack-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-line {
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.4));
}

.stack-chart-labels {
    position: absolute;
    bottom: 4px;
    left: 16px;
    right: 16px;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-tertiary);
}

/* ─── Support/Resistance Stats Row ─── */
.stack-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.stack-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}

.stack-stat-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.stack-stat-item svg {
    opacity: 0.7;
}

.stat-support svg {
    color: var(--bullish);
}

.stat-resistance svg {
    color: var(--bearish);
}

.stack-stat-value {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
}

.stat-support .stack-stat-value {
    color: var(--bullish);
}

.stat-resistance .stack-stat-value {
    color: var(--bearish);
}

.stack-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
}

/* ═══ RECOMMENDATION CARD ═══ */
.stack-rec-card {
    align-items: center;
    text-align: center;
}

.rec-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.rec-badge {
    padding: 10px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-en);
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    transition: all var(--transition-base);
}

.rec-badge.buy {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(34, 197, 94, 0.04));
    color: var(--bullish);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 0 24px rgba(34, 197, 94, 0.1), inset 0 1px 0 rgba(34, 197, 94, 0.15);
}

.rec-badge.sell {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(239, 68, 68, 0.04));
    color: var(--bearish);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 24px rgba(239, 68, 68, 0.1), inset 0 1px 0 rgba(239, 68, 68, 0.15);
}

.rec-badge.hold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(245, 158, 11, 0.04));
    color: var(--neutral);
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.1), inset 0 1px 0 rgba(245, 158, 11, 0.15);
}

.rec-confidence {
    width: 100%;
    margin-bottom: 10px;
}

.confidence-label {
    font-size: 10px;
    color: var(--text-tertiary);
    margin-bottom: 5px;
    text-align: center;
}

.confidence-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.confidence-pct {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 40px;
    text-align: right;
}

.confidence-bar-bg {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.confidence-bar {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan));
    transition: width 1s ease;
    position: relative;
}

.confidence-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%)
    }

    100% {
        transform: translateX(100%)
    }
}

.rec-timestamp {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    direction: ltr;
}

/* ═══ ORDER BOOK CARD ═══ */
.stack-orderbook-card {
    padding: 14px 16px;
    gap: 0;
}

.orderbook-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.orderbook-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.orderbook-title-group svg {
    opacity: 0.5;
}

.orderbook-symbol-badge {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-cyan);
    background: rgba(37, 99, 235, 0.12);
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.orderbook-section {
    position: relative;
}

.orderbook-col-headers {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 4px 6px;
    margin-bottom: 2px;
}

.ob-col-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-align: center;
    letter-spacing: 0.3px;
}

.ob-col-label:first-child {
    text-align: right;
}

.ob-col-label:last-child {
    text-align: left;
}

.orderbook-asks,
.orderbook-bids {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.orderbook-asks {
    flex-direction: column-reverse;
}

.ob-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    padding: 3px 6px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
}

.ob-row::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: -1;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.ob-ask-row::before {
    right: 0;
    background: rgba(239, 68, 68, 0.08);
}

.ob-bid-row::before {
    right: 0;
    background: rgba(34, 197, 94, 0.08);
}

.ob-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.ob-row span {
    text-align: center;
    direction: ltr;
}

.ob-row span:first-child {
    text-align: right;
}

.ob-row span:last-child {
    text-align: left;
}

.ob-ask-row span:first-child {
    color: var(--bearish);
}

.ob-bid-row span:first-child {
    color: var(--bullish);
}

.ob-ask-row span:nth-child(2),
.ob-ask-row span:nth-child(3),
.ob-bid-row span:nth-child(2),
.ob-bid-row span:nth-child(3) {
    color: var(--text-secondary);
}

.ob-placeholder {
    opacity: 0.3;
}

/* Spread Indicator */
.orderbook-spread {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 6px 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.04));
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 8px;
}

.spread-price {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    direction: ltr;
    letter-spacing: -0.3px;
}

.spread-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.spread-label span {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-weight: 700;
}

/* Buy/Sell Ratio */
.orderbook-ratio {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ratio-bar-container {
    display: flex;
    height: 6px;
    border-radius: var(--radius-full);
    overflow: hidden;
    gap: 2px;
}

.ratio-bar-buy {
    background: linear-gradient(90deg, #22c55e, #16a34a);
    border-radius: var(--radius-full) 0 0 var(--radius-full);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ratio-bar-buy::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
}

.ratio-bar-sell {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ratio-bar-sell::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2.5s ease-in-out infinite;
}

.ratio-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 600;
}

.ratio-buy-label {
    color: var(--bullish);
}

.ratio-buy-label span,
.ratio-sell-label span {
    font-family: var(--font-mono);
    font-weight: 700;
}

.ratio-sell-label {
    color: var(--bearish);
}

/* Footer */
.orderbook-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.ob-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 9px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.ob-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    transition: background 0.3s;
}

.ob-status.active .ob-status-dot {
    background: var(--bullish);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: livePulse 1.5s ease-in-out infinite;
}

.ob-update-time {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-tertiary);
    direction: ltr;
}

/* Row entry animation */
@keyframes obRowSlideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ob-row-animated {
    animation: obRowSlideIn 0.2s ease-out;
}

/* ═══ TRADE LEVELS CARD ═══ */
.stack-levels-card {
    padding: 14px 16px;
}

.levels-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.levels-header svg {
    opacity: 0.5;
}

.levels-list {
    display: flex;
    flex-direction: column;
}

.level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}

.level-row:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
}

.level-row:last-child {
    border-bottom: none;
}

.level-row-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.level-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot-entry {
    background: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}

.dot-target {
    background: var(--bullish);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.dot-leverage {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.dot-stoploss {
    background: var(--bearish);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.level-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.level-price {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    direction: ltr;
    text-align: left;
}

.level-price.entry-c {
    color: var(--accent-cyan);
}

.level-price.target-c {
    color: var(--bullish);
}

.level-price.leverage-c {
    color: #f59e0b;
}

.level-price.stoploss-c {
    color: var(--bearish);
    font-weight: 800;
}

.level-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.15), transparent);
    margin: 2px 0;
}

.level-stoploss {
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    padding: 12px 8px;
    border-bottom: none;
}

/* Card 3: Summary */
.card-summary {
    justify-content: flex-start;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.summary-header svg {
    opacity: 0.5;
}

.summary-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 2;
    word-break: break-word;
    flex: 1;
}

/* Card 4: Technicals */
.tech-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.tech-header svg {
    opacity: 0.5;
}

/* ─── Reasons ─── */
.tech-reasons {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.reasons-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.reasons-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.reasons-list li {
    font-size: 11px;
    color: var(--text-secondary);
    padding-right: 14px;
    position: relative;
    line-height: 1.6;
}

.reasons-list li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 7px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent-blue);
}

















/* ═══════════════════════════════════════════════ */
/* TICKER CARDS — Premium Stock-Ticker Design      */
/* ═══════════════════════════════════════════════ */

/* Section Labels */
.ticker-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.section-label-icon {
    font-size: 15px;
}

.section-label-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
}

/* ─── Ticker Card Base ─── */
.ticker-card {
    position: relative;
    display: flex;
    border-radius: var(--radius-md);
    overflow: clip;
    background: linear-gradient(145deg, rgba(15, 23, 35, 0.96), rgba(10, 16, 26, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.ticker-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

/* Colored accent bar on the right side */
.ticker-card-accent {
    width: 4px;
    flex-shrink: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    position: relative;
    overflow: hidden;
}

.ticker-card-accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3) 0%, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    animation: accentShine 3s ease-in-out infinite;
}

@keyframes accentShine {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

/* Card inner content */
.ticker-card-inner {
    flex: 1;
    padding: 12px 14px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ─── Card Header ─── */
.ticker-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ticker-card-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ticker-card-school-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.ticker-card-name-en {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
}

/* ─── Signal Badge — Like صاعد/هابط in the image ─── */
.ticker-signal-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 22px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    transition: all 0.4s ease;
    flex-shrink: 0;
    min-width: 90px;
    letter-spacing: 0.5px;
}

.signal-icon {
    font-size: 12px;
    line-height: 1;
}

.signal-text {
    font-size: 11px;
    font-weight: 700;
}

/* Badge States */
.ticker-signal-badge.waiting {
    background: rgba(100, 116, 139, 0.12);
    border: 2px solid rgba(100, 116, 139, 0.2);
    color: #64748b;
}

.ticker-signal-badge.bullish {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.08));
    border: 2px solid rgba(34, 197, 94, 0.5);
    color: #22c55e;
    box-shadow: 0 0 14px rgba(34, 197, 94, 0.2), inset 0 0 8px rgba(34, 197, 94, 0.08);
    animation: badgePulseBull 2s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.ticker-signal-badge.bearish {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.08));
    border: 2px solid rgba(239, 68, 68, 0.5);
    color: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.2), inset 0 0 8px rgba(239, 68, 68, 0.08);
    animation: badgePulseBear 2s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.ticker-signal-badge.neutral {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.08));
    border: 2px solid rgba(245, 158, 11, 0.45);
    color: #f59e0b;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.15), inset 0 0 8px rgba(245, 158, 11, 0.06);
    animation: badgePulseNeutral 2.5s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

@keyframes badgePulseBull {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(34, 197, 94, 0.15), inset 0 0 6px rgba(34, 197, 94, 0.06);
        border-color: rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.4), inset 0 0 12px rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.7);
    }
}

@keyframes badgePulseBear {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.15), inset 0 0 6px rgba(239, 68, 68, 0.06);
        border-color: rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.4), inset 0 0 12px rgba(239, 68, 68, 0.12);
        border-color: rgba(239, 68, 68, 0.7);
    }
}

@keyframes badgePulseNeutral {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.12), inset 0 0 6px rgba(245, 158, 11, 0.05);
        border-color: rgba(245, 158, 11, 0.35);
    }

    50% {
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.35), inset 0 0 10px rgba(245, 158, 11, 0.1);
        border-color: rgba(245, 158, 11, 0.6);
    }
}

/* ─── Card Body Text ─── */
.ticker-card-body {
    font-size: 12.5px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.85);
    direction: rtl;
    text-align: right;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 4px 0;
}

.summary-body-text {
    max-height: none;
    line-height: 2;
}

/* ─── Strength Bar — Red to Green gradient like the image ─── */
.ticker-strength-bar {
    padding-top: 4px;
    padding-bottom: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 4px;
}

.strength-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.strength-label-weak {
    font-size: 9px;
    font-weight: 600;
    color: #ef4444;
    letter-spacing: 0.3px;
}

.strength-label-strong {
    font-size: 9px;
    font-weight: 600;
    color: #22c55e;
    letter-spacing: 0.3px;
}

.strength-track {
    position: relative;
    height: 6px;
    border-radius: var(--radius-full);
    overflow: visible;
}

.strength-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg,
            #ef4444 0%,
            #f97316 20%,
            #eab308 40%,
            #84cc16 60%,
            #22c55e 80%,
            #10b981 100%);
    opacity: 0.8;
}

.strength-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #fbbf24, #f59e0b);
    border: 2px solid rgba(0, 0, 0, 0.6);
    box-shadow:
        0 0 8px rgba(251, 191, 36, 0.6),
        0 0 16px rgba(251, 191, 36, 0.3);
    z-index: 2;
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.5s ease,
        box-shadow 0.5s ease;
}

.strength-indicator.bullish {
    background: radial-gradient(circle, #4ade80, #22c55e);
    box-shadow:
        0 0 8px rgba(34, 197, 94, 0.6),
        0 0 16px rgba(34, 197, 94, 0.3);
}

.strength-indicator.bearish {
    background: radial-gradient(circle, #f87171, #ef4444);
    box-shadow:
        0 0 8px rgba(239, 68, 68, 0.6),
        0 0 16px rgba(239, 68, 68, 0.3);
}

.strength-indicator.neutral {
    background: radial-gradient(circle, #fbbf24, #f59e0b);
    box-shadow:
        0 0 8px rgba(251, 191, 36, 0.6),
        0 0 16px rgba(251, 191, 36, 0.3);
}

/* ─── Card Glow States — Apply to .ticker-card with pulsing frame + internal flash ─── */
.ticker-card.signal-bullish {
    border-color: rgba(34, 197, 94, 0.5) !important;
    animation: cardGlowBullish 2.5s ease-in-out infinite !important;
}

.ticker-card.signal-bearish {
    border-color: rgba(239, 68, 68, 0.5) !important;
    animation: cardGlowBearish 2.5s ease-in-out infinite !important;
}

.ticker-card.signal-neutral {
    border-color: rgba(245, 158, 11, 0.4) !important;
    animation: cardGlowNeutral 3s ease-in-out infinite !important;
}

/* ═══ Card Frame Glow Animations with Internal Flash ═══ */
@keyframes cardGlowBullish {

    0%,
    100% {
        border-color: rgba(34, 197, 94, 0.3);
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.5),
            0 0 6px rgba(34, 197, 94, 0.1),
            0 0 12px rgba(34, 197, 94, 0.05),
            inset 0 0 12px rgba(34, 197, 94, 0.03),
            inset 0 0 30px rgba(34, 197, 94, 0.02);
    }

    50% {
        border-color: rgba(34, 197, 94, 0.65);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.5),
            0 0 15px rgba(34, 197, 94, 0.25),
            0 0 35px rgba(34, 197, 94, 0.1),
            0 0 50px rgba(34, 197, 94, 0.04),
            inset 0 0 25px rgba(34, 197, 94, 0.08),
            inset 0 0 50px rgba(34, 197, 94, 0.04);
    }
}

@keyframes cardGlowBearish {

    0%,
    100% {
        border-color: rgba(239, 68, 68, 0.3);
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.5),
            0 0 6px rgba(239, 68, 68, 0.1),
            0 0 12px rgba(239, 68, 68, 0.05),
            inset 0 0 12px rgba(239, 68, 68, 0.03),
            inset 0 0 30px rgba(239, 68, 68, 0.02);
    }

    50% {
        border-color: rgba(239, 68, 68, 0.65);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.5),
            0 0 15px rgba(239, 68, 68, 0.25),
            0 0 35px rgba(239, 68, 68, 0.1),
            0 0 50px rgba(239, 68, 68, 0.04),
            inset 0 0 25px rgba(239, 68, 68, 0.08),
            inset 0 0 50px rgba(239, 68, 68, 0.04);
    }
}

@keyframes cardGlowNeutral {

    0%,
    100% {
        border-color: rgba(245, 158, 11, 0.25);
        box-shadow:
            0 4px 20px rgba(0, 0, 0, 0.5),
            0 0 6px rgba(245, 158, 11, 0.08),
            0 0 12px rgba(245, 158, 11, 0.04),
            inset 0 0 12px rgba(245, 158, 11, 0.02),
            inset 0 0 30px rgba(245, 158, 11, 0.01);
    }

    50% {
        border-color: rgba(245, 158, 11, 0.55);
        box-shadow:
            0 4px 24px rgba(0, 0, 0, 0.5),
            0 0 12px rgba(245, 158, 11, 0.2),
            0 0 30px rgba(245, 158, 11, 0.08),
            0 0 45px rgba(245, 158, 11, 0.03),
            inset 0 0 20px rgba(245, 158, 11, 0.06),
            inset 0 0 40px rgba(245, 158, 11, 0.03);
    }
}

/* ═══════════════════════════════════════════════ */
/* SIGNAL GLOW — Pulsing RGB Border for Cards     */
/* ═══════════════════════════════════════════════ */

/* Bullish / Buy — Green pulsing glow */
.info-card.signal-bullish {
    border-color: rgba(34, 197, 94, 0.5) !important;
    animation: glowPulseBullish 2s ease-in-out infinite !important;
}

@keyframes glowPulseBullish {

    0%,
    100% {
        box-shadow:
            0 0 4px rgba(34, 197, 94, 0.15),
            0 0 8px rgba(34, 197, 94, 0.08),
            inset 0 0 4px rgba(34, 197, 94, 0.03);
        border-color: rgba(34, 197, 94, 0.35);
    }

    50% {
        box-shadow:
            0 0 10px rgba(34, 197, 94, 0.35),
            0 0 25px rgba(34, 197, 94, 0.15),
            0 0 40px rgba(34, 197, 94, 0.06),
            inset 0 0 8px rgba(34, 197, 94, 0.06);
        border-color: rgba(34, 197, 94, 0.6);
    }
}

/* Bearish / Sell — Red pulsing glow */
.info-card.signal-bearish {
    border-color: rgba(239, 68, 68, 0.5) !important;
    animation: glowPulseBearish 2s ease-in-out infinite !important;
}

@keyframes glowPulseBearish {

    0%,
    100% {
        box-shadow:
            0 0 4px rgba(239, 68, 68, 0.15),
            0 0 8px rgba(239, 68, 68, 0.08),
            inset 0 0 4px rgba(239, 68, 68, 0.03);
        border-color: rgba(239, 68, 68, 0.35);
    }

    50% {
        box-shadow:
            0 0 10px rgba(239, 68, 68, 0.35),
            0 0 25px rgba(239, 68, 68, 0.15),
            0 0 40px rgba(239, 68, 68, 0.06),
            inset 0 0 8px rgba(239, 68, 68, 0.06);
        border-color: rgba(239, 68, 68, 0.6);
    }
}

/* Neutral / Hold — Amber pulsing glow */
.info-card.signal-neutral {
    border-color: rgba(245, 158, 11, 0.4) !important;
    animation: glowPulseNeutral 2.5s ease-in-out infinite !important;
}

@keyframes glowPulseNeutral {

    0%,
    100% {
        box-shadow:
            0 0 4px rgba(245, 158, 11, 0.12),
            0 0 8px rgba(245, 158, 11, 0.06);
        border-color: rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow:
            0 0 8px rgba(245, 158, 11, 0.25),
            0 0 18px rgba(245, 158, 11, 0.1),
            0 0 30px rgba(245, 158, 11, 0.04);
        border-color: rgba(245, 158, 11, 0.5);
    }
}

/* ═══════════════════════════════════════════════ */
/* SETTINGS & HISTORY PANELS                      */
/* ═══════════════════════════════════════════════ */
.settings-overlay,
.history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: overlayIn 0.2s ease-out;
}

@keyframes overlayIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

.settings-panel,
.history-panel {
    width: min(400px, calc(100vw - 32px));
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-xl);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(37, 99, 235, 0.1);
    overflow: hidden;
    animation: panelIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(16px)
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0)
    }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-primary);
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 700;
}

.panel-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    outline: none;
    transition: all var(--transition-fast);
}

.panel-close:hover {
    background: rgba(239, 68, 68, 0.08);
    color: var(--bearish);
    border-color: rgba(239, 68, 68, 0.2);
}

.panel-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    max-height: 65vh;
}

.sgroup {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sgroup label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.sinput {
    width: 100%;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-ar);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238888a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 28px;
    transition: all var(--transition-fast);
}

.sinput option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sinput:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* History */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.history-item:hover {
    background: rgba(37, 99, 235, 0.05);
    border-color: var(--border-accent);
}

.history-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-green), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-en);
    font-size: 12px;
    font-weight: 800;
    color: var(--bg-primary);
    flex-shrink: 0;
}

.history-item-info {
    flex: 1;
    min-width: 0;
}

.history-item-ticker {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-summary {
    font-size: 10px;
    color: var(--text-tertiary);
    line-height: 1.4;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-time {
    font-size: 9px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    margin-top: 2px;
}

.history-item-rec {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
}

.history-item-rec.buy {
    background: var(--bullish-bg);
    color: var(--bullish);
}

.history-item-rec.sell {
    background: var(--bearish-bg);
    color: var(--bearish);
}

.history-item-rec.hold {
    background: var(--neutral-bg);
    color: var(--neutral);
}

/* ═══ TOAST ═══ */
.toast-container {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(11, 18, 28, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    animation: toastIn 0.3s ease-out;
    white-space: nowrap;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.success {
    border-color: rgba(37, 99, 235, 0.3);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(16px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0)
    }

    to {
        opacity: 0;
        transform: translateY(16px)
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* ═══════════════════════════════════════════════ */
/* KFOO AI TOTAL — TREND SUMMARY CARD             */
/* ═══════════════════════════════════════════════ */
.trend-summary-card {
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(18, 26, 38, 0.96), rgba(11, 18, 28, 0.98));
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(37, 99, 235, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
}

.trend-summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--bullish), var(--accent-cyan), var(--bearish));
    opacity: 0.6;
}

/* ─── Header ─── */
.ts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.ts-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ts-title-group svg {
    color: #f59e0b;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.4));
}

.ts-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.ts-badge {
    font-family: var(--font-en);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--accent-cyan);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(37, 99, 235, 0.25);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

/* ─── Progress Bar ─── */
.ts-bar-container {
    margin-bottom: 14px;
}

.ts-bar-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ts-bar-pct {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    min-width: 36px;
}

.ts-bullish-pct {
    color: var(--bullish);
    text-align: right;
}

.ts-bearish-pct {
    color: var(--bearish);
    text-align: left;
}

.ts-bar-center-pct {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.ts-bar-track {
    display: flex;
    height: 10px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    position: relative;
}

.ts-bar-fill {
    height: 100%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.ts-bar-bullish {
    background: linear-gradient(90deg, #16a34a, #22c55e);
    border-radius: 0 0 0 var(--radius-full);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.ts-bar-neutral {
    background: linear-gradient(90deg, rgba(100, 116, 139, 0.3), rgba(100, 116, 139, 0.2));
}

.ts-bar-bearish {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    border-radius: var(--radius-full) 0 0 0;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* ─── Trend Status ─── */
.ts-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 2px;
}

.ts-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-tertiary);
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.ts-status-dot.bullish {
    background: var(--bullish);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.ts-status-dot.bearish {
    background: var(--bearish);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: dotPulse 2s ease-in-out infinite;
}

.ts-status-dot.neutral {
    background: var(--text-secondary);
    box-shadow: 0 0 6px rgba(156, 163, 175, 0.3);
}

.ts-status-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Verdict Box ─── */
.ts-verdict-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: all 0.4s ease;
}

.ts-verdict-box.bullish {
    background: rgba(34, 197, 94, 0.06);
    border-color: rgba(34, 197, 94, 0.15);
}

.ts-verdict-box.bearish {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.15);
}

.ts-verdict-box.neutral {
    background: rgba(156, 163, 175, 0.06);
    border-color: rgba(156, 163, 175, 0.12);
}

.ts-verdict-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ts-verdict-label svg {
    opacity: 0.5;
}

.ts-verdict-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
}

.ts-verdict-text svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.ts-verdict-text.bullish {
    color: var(--bullish);
}

.ts-verdict-text.bullish svg {
    stroke: var(--bullish);
    opacity: 1;
}

.ts-verdict-text.bearish {
    color: var(--bearish);
}

.ts-verdict-text.bearish svg {
    stroke: var(--bearish);
    opacity: 1;
}

.ts-verdict-text.neutral {
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════ */
/* RISK DISCLAIMER FOOTER                         */
/* ═══════════════════════════════════════════════ */
.risk-disclaimer {
    margin-top: 24px;
    padding: 0 16px 16px;
}

.risk-disclaimer-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), rgba(217, 119, 6, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.12);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.risk-disclaimer-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.5), transparent);
}

.risk-icon {
    flex-shrink: 0;
    color: #f59e0b;
    margin-top: 2px;
    opacity: 0.8;
}

.risk-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.risk-title {
    font-size: 12px;
    font-weight: 700;
    color: #f59e0b;
    letter-spacing: 0.3px;
}

.risk-text {
    font-size: 11px;
    line-height: 1.8;
    color: var(--text-tertiary);
    margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════ */
/* RESPONSIVE — Desktop / Laptop / Tablet / Phone                    */
/* ═══════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────
   1. LAPTOP  (≤ 1440px)
   ──────────────────────────────────────────────── */
@media (max-width: 1440px) {
    .analyzer-layout {
        grid-template-columns: 1.2fr minmax(260px, 340px) 1.2fr;
        gap: 10px;
        padding: 10px 14px;
    }

    .stack-price {
        font-size: 22px;
    }

    .stack-chart-container {
        height: 85px;
    }

    .rec-badge {
        font-size: 16px;
        padding: 8px 22px;
    }

    .ticker-card-inner {
        padding: 10px 12px;
    }

    .level-price {
        font-size: 13px;
    }

    .level-name {
        font-size: 11px;
    }
}

/* ────────────────────────────────────────────────
   2. TABLET LANDSCAPE / SMALL LAPTOP  (≤ 1100px)
   ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .analyzer-layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        height: auto;
        gap: 10px;
        padding: 10px 12px;
    }

    /* Video takes full width on top */
    .video-section {
        grid-column: 1 / -1;
        max-width: 600px;
        margin: 0 auto;
        order: -1;
    }

    /* Side columns become 2 columns below video */
    .side-column {
        max-height: none;
        overflow-y: visible;
    }

    .side-column .info-card,
    .side-column .ticker-card,
    .side-column .stack-card {
        width: 100%;
    }

    /* Nav adjustments */
    .timeframe-group {
        gap: 1px;
    }

    .tf-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .nav-brand-text {
        font-size: 16px;
    }

    .nav-brand-logo {
        width: 28px;
        height: 28px;
    }
}

/* ────────────────────────────────────────────────
   3. TABLET PORTRAIT  (≤ 768px)
   ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    :root {
        --nav-height: 48px;
    }

    .top-nav {
        padding: 0 8px;
        gap: 6px;
    }

    /* Hide non-essential nav text */
    .logo-subtitle {
        display: none;
    }

    .status-text {
        display: none;
    }

    .nav-btn span {
        display: none;
    }

    .nav-btn.primary-btn span {
        display: inline;
        font-size: 11px;
    }

    .nav-btn {
        padding: 5px 8px;
    }

    /* Timeframe buttons — compact */
    .timeframe-group {
        gap: 0;
        padding: 1px;
    }

    .tf-btn {
        padding: 3px 7px;
        font-size: 10px;
    }

    /* Layout — single column */
    .analyzer-layout {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 8px;
    }

    .video-section {
        max-width: 100%;
        grid-column: auto;
    }

    .side-column {
        flex-direction: column;
        max-height: none;
        overflow-y: visible;
    }

    /* Cards full-width */
    .stack-card {
        padding: 14px;
    }

    .stack-price {
        font-size: 20px;
    }

    .stack-chart-container {
        height: 80px;
    }

    .rec-badge {
        font-size: 15px;
        padding: 8px 20px;
    }

    .confidence-pct {
        font-size: 13px;
    }

    .level-price {
        font-size: 13px;
    }

    /* Trend Summary Card */
    .ts-title {
        font-size: 13px;
    }

    .ts-badge {
        font-size: 9px;
        padding: 2px 6px;
    }

    .ts-verdict-text {
        font-size: 12px;
    }

    /* Welcome screen */
    .welcome-title {
        font-size: 28px;
    }

    .welcome-desc {
        font-size: 13px;
    }

    .start-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .welcome-steps {
        flex-direction: column;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    /* Settings & History panels — wider on tablet */
    .settings-panel,
    .history-panel {
        width: 90vw;
        max-width: 440px;
    }

    /* Risk disclaimer */
    .risk-disclaimer {
        padding: 0 8px 12px;
    }

    .risk-disclaimer-inner {
        padding: 12px 14px;
    }

    .risk-text {
        font-size: 10px;
    }
}

/* ────────────────────────────────────────────────
   4. LARGE PHONE  (≤ 576px)
   ──────────────────────────────────────────────── */
@media (max-width: 576px) {
    :root {
        --nav-height: 44px;
    }

    .top-nav {
        padding: 0 6px;
        gap: 4px;
    }

    .nav-brand-text {
        font-size: 14px;
    }

    .nav-brand-logo {
        width: 24px;
        height: 24px;
    }

    .nav-btn.primary-btn {
        padding: 4px 8px;
    }

    .nav-btn.primary-btn span {
        font-size: 10px;
    }

    /* Hide some timeframe buttons to save space */
    .tf-btn[data-tf="30m"],
    .tf-btn[data-tf="4h"] {
        display: none;
    }

    .tf-btn {
        padding: 3px 6px;
        font-size: 10px;
    }

    /* Countdown */
    .countdown-badge {
        padding: 1px 5px;
        font-size: 10px;
    }

    /* Analyzer layout */
    .analyzer-layout {
        padding: 6px;
        gap: 6px;
    }

    /* Stack cards compact */
    .stack-card {
        padding: 12px;
    }

    .stack-ticker-row {
        gap: 8px;
    }

    .stack-icon {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .stack-ticker-symbol {
        font-size: 12px;
    }

    .stack-price {
        font-size: 18px;
    }

    .stack-chart-container {
        height: 70px;
        margin: 8px -12px 0;
    }

    .stack-stat-item {
        padding: 8px 6px;
    }

    .stack-stat-value {
        font-size: 12px;
    }

    /* Recommendation Card */
    .rec-badge {
        font-size: 14px;
        padding: 7px 18px;
        letter-spacing: 1.5px;
    }

    .confidence-pct {
        font-size: 12px;
        min-width: 35px;
    }

    .confidence-bar-bg {
        height: 5px;
    }

    /* Trade Levels */
    .levels-header {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .level-row {
        padding: 8px 2px;
    }

    .level-name {
        font-size: 11px;
    }

    .level-price {
        font-size: 12px;
    }

    .level-dot {
        width: 6px;
        height: 6px;
    }

    /* Ticker cards compact */
    .ticker-card-inner {
        padding: 10px;
        gap: 6px;
    }

    .ticker-card-name,
    .ticker-card-school-name {
        font-size: 13px;
    }

    .ticker-card-body {
        font-size: 12px;
        line-height: 1.8;
    }

    .ticker-signal-badge {
        padding: 2px 8px;
        font-size: 10px;
    }

    .signal-icon {
        font-size: 7px;
    }

    /* Strength bar */
    .strength-label-weak,
    .strength-label-strong {
        font-size: 8px;
    }

    /* Section labels */
    .ticker-section-label {
        font-size: 12px;
        gap: 6px;
    }

    .section-label-icon {
        font-size: 13px;
    }

    /* Trend Summary */
    .trend-summary-card {
        padding: 12px;
    }

    .ts-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .ts-title {
        font-size: 12px;
    }

    .ts-badge {
        font-size: 8px;
        padding: 2px 5px;
    }

    .ts-verdict-text {
        font-size: 11px;
        gap: 6px;
    }

    .ts-verdict-label {
        font-size: 10px;
    }

    /* Share button */
    .share-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    /* Risk Footer */
    .risk-disclaimer-inner {
        flex-direction: column;
        gap: 8px;
        padding: 10px 12px;
    }

    .risk-title {
        font-size: 11px;
    }

    .risk-text {
        font-size: 10px;
        line-height: 1.7;
    }
}

/* ────────────────────────────────────────────────
   5. SMALL PHONE  (≤ 400px)
   ──────────────────────────────────────────────── */
@media (max-width: 400px) {
    .top-nav {
        padding: 0 4px;
    }

    .nav-brand-text {
        font-size: 12px;
    }

    .nav-brand-logo {
        width: 20px;
        height: 20px;
    }

    /* Hide more timeframe buttons */
    .tf-btn[data-tf="15m"],
    .tf-btn[data-tf="1D"] {
        display: none;
    }

    .nav-btn.primary-btn span {
        display: none;
    }

    .analyzer-layout {
        padding: 4px;
        gap: 5px;
    }

    .stack-card {
        padding: 10px;
    }

    .stack-price {
        font-size: 16px;
    }

    .stack-chart-container {
        height: 60px;
    }

    .rec-badge {
        font-size: 13px;
        padding: 6px 14px;
    }

    .level-price {
        font-size: 11px;
    }

    .level-name {
        font-size: 10px;
    }

    .ticker-card-inner {
        padding: 8px;
    }

    .ticker-card-body {
        font-size: 11px;
        line-height: 1.7;
    }

    .welcome-title {
        font-size: 22px;
    }

    .welcome-desc {
        font-size: 12px;
    }

    .trend-summary-card {
        padding: 10px;
    }

    .ts-verdict-text {
        font-size: 10px;
    }
}

/* ─── ENGLISH MODE ─── */
body.lang-en {
    direction: ltr;
    font-family: var(--font-en);
}

body.lang-en .top-nav {
    flex-direction: row-reverse;
}

body.lang-en .nav-right {
    flex-direction: row-reverse;
}

body.lang-en .sinput {
    background-position: right 12px center;
    padding-left: 12px;
    padding-right: 28px;
}

body.lang-en .reasons-list li {
    padding-right: 0;
    padding-left: 14px;
}

body.lang-en .reasons-list li::before {
    right: auto;
    left: 0;
}

/* ═══════════════════════════════════════════════ */
/* VOICE CHAT — Premium AI Voice Conversation      */
/* ═══════════════════════════════════════════════ */

/* ─── Floating Action Button ─── */
.vc-fab {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9500;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.9), rgba(139, 92, 246, 0.9));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 24px rgba(99, 102, 241, 0.5),
        0 0 40px rgba(139, 92, 246, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.vc-fab:hover {
    transform: translateX(-50%) scale(1.08);
    box-shadow:
        0 8px 32px rgba(99, 102, 241, 0.6),
        0 0 60px rgba(139, 92, 246, 0.2);
}

.vc-fab-icon {
    position: relative;
    z-index: 2;
    transition: transform 0.3s;
}

.vc-fab.active .vc-fab-icon {
    transform: scale(0.85);
}

/* Pulsing Rings */
.vc-fab-rings {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.vc-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.4);
    opacity: 0;
    width: 60px;
    height: 60px;
}

/* Listening State */
.vc-fab.listening {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.9), rgba(16, 185, 129, 0.9));
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 4px 24px rgba(34, 197, 94, 0.5);
}

.vc-fab.listening .vc-ring {
    border-color: rgba(34, 197, 94, 0.5);
    animation: vcRingPulse 2s ease-out infinite;
}

.vc-fab.listening .vc-ring-2 {
    animation-delay: 0.4s;
}

.vc-fab.listening .vc-ring-3 {
    animation-delay: 0.8s;
}

@keyframes vcRingPulse {
    0% {
        width: 60px;
        height: 60px;
        opacity: 0.6;
    }

    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
    }
}

/* Thinking State */
.vc-fab.thinking {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    border-color: rgba(59, 130, 246, 0.5);
    animation: vcThinkPulse 1s ease-in-out infinite;
}

@keyframes vcThinkPulse {

    0%,
    100% {
        box-shadow: 0 4px 24px rgba(59, 130, 246, 0.5);
    }

    50% {
        box-shadow: 0 4px 40px rgba(59, 130, 246, 0.8);
    }
}

/* Speaking State */
.vc-fab.speaking {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(234, 88, 12, 0.9));
    border-color: rgba(245, 158, 11, 0.5);
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.5);
}

.vc-fab.speaking .vc-ring {
    border-color: rgba(245, 158, 11, 0.4);
    animation: vcRingPulse 1.2s ease-out infinite;
}

.vc-fab.speaking .vc-ring-2 {
    animation-delay: 0.25s;
}

.vc-fab.speaking .vc-ring-3 {
    animation-delay: 0.5s;
}

/* Active (stop) state */
.vc-fab.active {
    border-color: rgba(239, 68, 68, 0.4);
}

/* ─── Panel ─── */
.vc-panel {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9499;
    width: 360px;
    max-width: 92vw;
    background: linear-gradient(145deg, rgba(15, 23, 35, 0.97), rgba(10, 16, 26, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0;
    backdrop-filter: blur(24px);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.vc-panel.visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Panel Header */
.vc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.vc-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Cairo', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
}

.vc-panel-title svg {
    color: #a78bfa;
}

.vc-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vc-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.vc-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Badge */
.vc-badge {
    font-family: 'Cairo', sans-serif;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    transition: all 0.3s;
}

.vc-badge.listening {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

.vc-badge.thinking {
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    animation: vcBadgePulse 1s ease-in-out infinite;
}

.vc-badge.speaking {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

@keyframes vcBadgePulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ─── Orb Container ─── */
.vc-orb-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0 8px;
}

.vc-orb {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vc-orb-core {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    transition: all 0.4s;
}

.vc-orb-wave {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.3);
    width: 40px;
    height: 40px;
    opacity: 0;
}

/* Orb Listening */
.vc-orb.listening .vc-orb-core {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
    animation: vcOrbBreath 1.5s ease-in-out infinite;
}

.vc-orb.listening .vc-orb-wave {
    border-color: rgba(34, 197, 94, 0.3);
    animation: vcOrbWave 2s ease-out infinite;
}

.vc-orb.listening .vc-w2 {
    animation-delay: 0.5s;
}

.vc-orb.listening .vc-w3 {
    animation-delay: 1s;
}

@keyframes vcOrbBreath {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes vcOrbWave {
    0% {
        width: 40px;
        height: 40px;
        opacity: 0.5;
    }

    100% {
        width: 80px;
        height: 80px;
        opacity: 0;
    }
}

/* Orb Thinking */
.vc-orb.thinking .vc-orb-core {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    animation: vcOrbSpin 1.5s linear infinite;
}

@keyframes vcOrbSpin {
    0% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 8px 0 12px rgba(99, 102, 241, 0.3);
    }

    25% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 8px 12px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), -8px 0 12px rgba(99, 102, 241, 0.3);
    }

    75% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 0 -8px 12px rgba(99, 102, 241, 0.3);
    }

    100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.5), 8px 0 12px rgba(99, 102, 241, 0.3);
    }
}

/* Orb Speaking */
.vc-orb.speaking .vc-orb-core {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.5);
    animation: vcOrbSpeak 0.3s ease-in-out infinite alternate;
}

.vc-orb.speaking .vc-orb-wave {
    border-color: rgba(245, 158, 11, 0.3);
    animation: vcOrbWave 1s ease-out infinite;
}

.vc-orb.speaking .vc-w2 {
    animation-delay: 0.2s;
}

.vc-orb.speaking .vc-w3 {
    animation-delay: 0.4s;
}

@keyframes vcOrbSpeak {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.15);
    }
}

/* ─── Status Text ─── */
.vc-status-text {
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px 18px 0;
}

.vc-live-text {
    text-align: center;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    padding: 4px 18px 8px;
    min-height: 20px;
    direction: rtl;
}

/* ─── Transcript ─── */
.vc-transcript {
    max-height: 180px;
    overflow-y: auto;
    padding: 8px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.vc-transcript::-webkit-scrollbar {
    width: 4px;
}

.vc-transcript::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}

.vc-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 12px;
    animation: vcMsgIn 0.2s ease-out;
}

@keyframes vcMsgIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vc-msg-user {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    align-self: flex-end;
    max-width: 85%;
}

.vc-msg-ai {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.12);
    align-self: flex-start;
    max-width: 85%;
}

.vc-msg-label {
    font-family: 'Cairo', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vc-msg-user .vc-msg-label {
    color: #818cf8;
}

.vc-msg-ai .vc-msg-label {
    color: #4ade80;
}

.vc-msg-text {
    font-family: 'Cairo', sans-serif;
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.6;
    direction: rtl;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .vc-fab {
        bottom: 16px;
        width: 54px;
        height: 54px;
    }

    .vc-panel {
        bottom: 84px;
        width: 95vw;
        border-radius: 16px;
    }

    .vc-ring {
        width: 54px;
        height: 54px;
    }
}