@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Cairo:wght@400;500;600;700&display=swap');

/* ═══════════════════════════════════════════════════════════════
   portal/css/portal.css — Client Portal Styles
   Dark/Light mode via Bootstrap 5.3 data-bs-theme
   ═══════════════════════════════════════════════════════════════ */

/* ── Theme Variables ─────────────────────────────────────────── */

[data-bs-theme="dark"] {
    --portal-bg: #060c1a;
    --portal-surface: #0d1425;
    --portal-text: #e2e8f0;
    --portal-text-muted: #94a3b8;
    --portal-border: #1e293b;
    --portal-svg-bg: radial-gradient(ellipse at 50% 50%, #0d1a30 0%, #060c1a 70%);
    --portal-bubble-bg: #020210;
    --portal-bubble-bg-center: #0a0e2a;
    --portal-bubble-label: #f1f5f9;
    --portal-bubble-sublabel: #94a3b8;
    --portal-tooltip-bg: #1e293b;
    --portal-tooltip-text: #e2e8f0;
    --portal-tooltip-border: #334155;
    --portal-card-bg: #141b2d;
    --portal-card-hover: #1a2340;
    --portal-login-gradient: linear-gradient(135deg, #0b1120 0%, #1a1a3e 50%, #0b1120 100%);
    --portal-glass-bg: rgba(20, 27, 45, 0.85);
    --portal-connection-bg: #7f1d1d;
}

[data-bs-theme="light"] {
    --portal-bg: #f1f5f9;
    --portal-surface: #ffffff;
    --portal-text: #1e293b;
    --portal-text-muted: #64748b;
    --portal-border: #e2e8f0;
    --portal-svg-bg: radial-gradient(ellipse at 50% 50%, #ffffff 0%, #eef2f7 70%);
    --portal-bubble-bg: #e2e8f0;
    --portal-bubble-bg-center: #ffffff;
    --portal-bubble-label: #1e293b;
    --portal-bubble-sublabel: #475569;
    --portal-tooltip-bg: #ffffff;
    --portal-tooltip-text: #1e293b;
    --portal-tooltip-border: #e2e8f0;
    --portal-card-bg: #ffffff;
    --portal-card-hover: #f8fafc;
    --portal-login-gradient: linear-gradient(135deg, #e0e7ff 0%, #f0f4ff 50%, #e8ecf4 100%);
    --portal-glass-bg: rgba(255, 255, 255, 0.85);
    --portal-connection-bg: #fef2f2;
}

/* ── Signal Colors (same in both themes) ─────────────────────── */

:root {
    --signal-strong-buy: #089981;
    --signal-buy: #0aac92;
    --signal-neutral: #a855f7;
    --signal-sell: #f23645;
    --signal-strong-sell: #d42e3c;
    --signal-error: #5a5e64;
    --signal-text-strong-buy: #ffffff;
    --signal-text-buy: #ffffff;
    --signal-text-neutral: #ffffff;
    --signal-text-sell: #ffffff;
    --signal-text-strong-sell: #ffffff;
}

/* ── Base ─────────────────────────────────────────────────────── */

html {
    overflow-x: hidden;
}

body {
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    max-width: 100vw;
    transition: background-color 0.3s ease, color 0.3s ease;
    display: flex;
    flex-direction: column;
}

main.container-fluid {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

main.container-fluid > .position-relative {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Arabic font */
[lang="ar"] body,
[lang="ar"] .login-form-box,
[lang="ar"] .login-hero-tagline,
[lang="ar"] .login-hero-subtitle {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* ── Login / Register ────────────────────────────────────────── */

/* Auth pages: let the page scroll (body is locked to 100vh for the app shell) */
body:has(.login-wrapper) {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
}

/* Single-column centered layout (GEX Bubbles style) */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: linear-gradient(160deg, #030014 0%, #0a0a2e 35%, #0f172a 65%, #061218 100%);
    position: relative;
    overflow: hidden;
    padding: 0;
}

/* Animated chart canvas background */
.login-chart-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

/* Decorative gradient orbs */
.login-hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    animation: orbPulse 8s ease-in-out infinite alternate;
}

.login-hero-orb--1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 163, 225, 0.25) 0%, rgba(6, 182, 212, 0.10) 60%, transparent 100%);
    top: -12%;
    left: -10%;
    animation-delay: 0s;
}

.login-hero-orb--2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.22) 0%, rgba(139, 92, 246, 0.10) 60%, transparent 100%);
    bottom: -10%;
    right: -8%;
    animation-delay: -4s;
}

@keyframes orbPulse {
    0%   { transform: scale(1) translate(0, 0); opacity: 0.7; }
    50%  { transform: scale(1.12) translate(10px, -8px); opacity: 1; }
    100% { transform: scale(0.95) translate(-5px, 5px); opacity: 0.8; }
}

/* ── Single column container ─────────────────────────────────── */

.login-column {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-hero-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, #00A3E1, #0082B3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 163, 225, 0.25);
}

.login-hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    color: #f0fdf4;
    letter-spacing: -0.02em;
}

.login-hero-tagline {
    font-size: 1rem;
    line-height: 1.7;
    color: #6b7280;
    margin: 0 0 0.75rem;
}

.login-hero-subtitle {
    font-size: 0.875rem;
    font-weight: 600;
    color: #00A3E1;
    margin: 0 0 2rem;
    letter-spacing: 0.02em;
}

/* ── Login / Register — Form box (text-align: start for RTL compat) ── */

.login-form-box {
    text-align: start;
}

.login-form-box .form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #d1d5db;
    margin-bottom: 0.4rem;
}

.login-form-box .form-control {
    padding: 0.7rem 0.875rem;
    border-radius: 8px;
    font-size: 0.925rem;
    background: rgba(17, 17, 25, 0.7);
    border: 1px solid #1f2937;
    color: #e5e7eb;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form-box .form-control::placeholder {
    color: #4b5563;
}

.login-form-box .form-control:focus {
    background: rgba(17, 17, 25, 0.9);
    border-color: #00A3E1;
    box-shadow: 0 0 0 3px rgba(0, 163, 225, 0.15);
    color: #e5e7eb;
}

.login-forgot-link {
    font-size: 0.825rem;
    color: #00A3E1;
    text-decoration: none;
}

.login-forgot-link:hover {
    text-decoration: underline;
    color: #33BDFF;
}

.login-submit-btn {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #00A3E1;
    border-color: #00A3E1;
    color: #fff;
    transition: background-color 0.2s ease;
}

.login-submit-btn:hover {
    background: #0082B3;
    border-color: #0082B3;
    color: #fff;
}

.login-submit-btn:disabled {
    background: #005A80;
    border-color: #005A80;
    color: rgba(255, 255, 255, 0.6);
}

.login-signup-text {
    font-size: 0.875rem;
    color: #6b7280;
}

.login-signup-link {
    color: #00A3E1;
    text-decoration: none;
    font-weight: 500;
    margin-inline-start: 0.25rem;
}

.login-signup-link:hover {
    text-decoration: underline;
    color: #33BDFF;
}

/* ── Login card (register page keeps old card style) ──────────── */

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--portal-glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-brand .brand-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.login-brand h4 {
    margin: 0;
    font-weight: 700;
    color: var(--portal-text);
}

.login-brand p {
    margin: 0.25rem 0 0;
    color: var(--portal-text-muted);
    font-size: 0.875rem;
}

/* ── Login flip cards ─────────────────────────────────────────── */

.login-split {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 1rem 3.5rem;
}

.login-split .login-features {
    margin-bottom: 2rem;
}

.login-split .login-column {
    width: 100%;
    max-width: 420px;
}

.login-features {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
}

[lang="ar"] .login-features {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

.flip-card {
    width: 320px;
    height: 178px;
    perspective: 1200px;
    cursor: pointer;
    background: transparent;
    --flip-accent: #00A3E1;
    --flip-accent-2: #0082B3;
    --flip-accent-soft: rgba(0, 163, 225, 0.18);
}

.flip-card--timeframes {
    --flip-accent: #06b6d4;
    --flip-accent-2: #3b82f6;
    --flip-accent-soft: rgba(6, 182, 212, 0.18);
}

.flip-card--ai {
    --flip-accent: #a855f7;
    --flip-accent-2: #6366f1;
    --flip-accent-soft: rgba(168, 85, 247, 0.18);
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(.4, .2, .2, 1);
}

.flip-card.is-flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 16px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(135deg, var(--flip-accent-soft) 0%, transparent 55%),
        rgba(13, 13, 22, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow: hidden;
    transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.flip-card-front::before,
.flip-card-back::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--flip-accent), var(--flip-accent-2));
    opacity: 0.9;
}

.flip-card-back {
    transform: rotateY(180deg);
}

.flip-card:hover .flip-card-front,
.flip-card:hover .flip-card-back {
    border-color: var(--flip-accent);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.45),
        0 0 0 1px var(--flip-accent-soft);
}

/* ── Front face ──────────────────────────────────────────────── */

.flip-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.flip-card-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--flip-accent), var(--flip-accent-2));
    box-shadow: 0 6px 20px var(--flip-accent-soft);
    color: #fff;
}

.flip-card-icon {
    font-size: 1.35rem;
    color: #fff;
    line-height: 1;
}

.flip-card-icon-wrap--glow {
    animation: flipGlow 3s ease-in-out infinite;
}

@keyframes flipGlow {
    0%, 100% { box-shadow: 0 6px 20px var(--flip-accent-soft); }
    50%      { box-shadow: 0 8px 28px var(--flip-accent), 0 0 0 4px var(--flip-accent-soft); }
}

.flip-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: var(--flip-accent-soft);
    color: var(--flip-accent);
    border: 1px solid var(--flip-accent);
}

.flip-card-badge--ai {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(99, 102, 241, 0.25));
    color: #fff;
    border-color: rgba(168, 85, 247, 0.6);
}

.flip-card-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--flip-accent);
    box-shadow: 0 0 0 0 var(--flip-accent);
    animation: flipPulse 1.6s ease-out infinite;
}

@keyframes flipPulse {
    0%   { box-shadow: 0 0 0 0 var(--flip-accent); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.flip-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f9fafb;
    margin: 0 0 0.2rem;
    letter-spacing: -0.01em;
}

.flip-card-sub {
    font-size: 0.8rem;
    color: #9ca3af;
    margin: 0 0 0.7rem;
    font-weight: 500;
}

/* Sparkline bars (signals card) */
.flip-card-spark {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 28px;
    margin-top: auto;
}

.flip-card-spark span {
    flex: 1;
    background: linear-gradient(180deg, var(--flip-accent), var(--flip-accent-2));
    border-radius: 2px;
    animation: flipSpark 1.4s ease-in-out infinite;
    opacity: 0.85;
}

.flip-card-spark span:nth-child(1) { animation-delay: 0s;    height: 40%; }
.flip-card-spark span:nth-child(2) { animation-delay: 0.1s;  height: 70%; }
.flip-card-spark span:nth-child(3) { animation-delay: 0.2s;  height: 50%; }
.flip-card-spark span:nth-child(4) { animation-delay: 0.3s;  height: 90%; }
.flip-card-spark span:nth-child(5) { animation-delay: 0.4s;  height: 60%; }
.flip-card-spark span:nth-child(6) { animation-delay: 0.5s;  height: 80%; }
.flip-card-spark span:nth-child(7) { animation-delay: 0.6s;  height: 45%; }
.flip-card-spark span:nth-child(8) { animation-delay: 0.7s;  height: 75%; }

@keyframes flipSpark {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(0.55); }
}

/* Timeframe pills */
.flip-card-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: auto;
}

.flip-card-pills span {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.flip-card-pills span.is-active {
    background: var(--flip-accent-soft);
    color: var(--flip-accent);
    border-color: var(--flip-accent);
    box-shadow: 0 0 12px var(--flip-accent-soft);
}

/* AI horizontal bars */
.flip-card-bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
}

.flip-card-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.flip-card-bar span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--flip-accent), var(--flip-accent-2));
    border-radius: 999px;
    animation: flipBarGrow 1.8s ease-out;
    transform-origin: left center;
}

[dir="rtl"] .flip-card-bar span {
    transform-origin: right center;
}

@keyframes flipBarGrow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* ── Back face ───────────────────────────────────────────────── */

.flip-card-desc {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #d1d5db;
    margin: 0 0 0.7rem;
}

.flip-card-stats {
    list-style: none;
    margin: auto 0 0;
    padding: 0.7rem 0 0;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.flip-card-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
}

.flip-card-stat-num {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--flip-accent);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

.flip-card-stat-lbl {
    font-size: 0.65rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.2rem;
    font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
    .flip-card-inner,
    .flip-card-spark span,
    .flip-card-icon-wrap--glow,
    .flip-card-pulse,
    .flip-card-bar span { animation: none; transition: none; }
}

/* ── Login responsive ────────────────────────────────────────── */

@media (max-width: 900px) {
    .login-features {
        width: 100%;
        max-width: 440px;
    }

    .flip-card {
        height: 168px;
    }
}

@media (max-width: 575.98px) {
    .login-hero-title {
        font-size: 1.5rem;
    }

    .login-hero-tagline {
        font-size: 0.9rem;
    }

    .login-hero-icon {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .flip-card-stat-num { font-size: 1rem; }
    .flip-card-stat-lbl { font-size: 0.6rem; }

    .login-features {
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    .flip-card {
        width: 100%;
        height: 168px;
    }
}

/* ── Navbar ───────────────────────────────────────────────────── */

.portal-navbar {
    background: var(--portal-surface) !important;
    border-bottom: 1px solid var(--portal-border);
    transition: background-color 0.3s ease;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.portal-navbar .navbar-brand {
    font-weight: 700;
    color: var(--portal-text);
}

.portal-navbar .navbar-brand i {
    color: #3b82f6;
}

/* ── Navbar Icon Buttons (unified) ────────────────────────────── */

.nav-icon-btn {
    background: none;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    padding: 0;
}

.nav-icon-btn:hover {
    background: var(--portal-card-hover);
    border-color: var(--portal-text-muted);
    color: var(--portal-text);
}

.nav-icon-btn.user-btn {
    width: auto;
    padding: 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    gap: 0.25rem;
    color: var(--portal-text);
}

/* ── Navbar Separator ─────────────────────────────────────────── */

.nav-separator {
    width: 1px;
    height: 24px;
    background: var(--portal-border);
    display: inline-block;
    flex-shrink: 0;
    margin: 0 0.15rem;
}

/* ── Filter Buttons ───────────────────────────────────────────── */

.filter-group {
    gap: 2px;
}

.filter-btn {
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--portal-border);
    color: var(--portal-text-muted);
    background: transparent;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.filter-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.filter-btn i {
    font-size: 0.85rem;
}

.interval-group .filter-btn {
    padding: 0.35rem 0.7rem;
    min-width: 36px;
    justify-content: center;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Signal Bar (container) ───────────────────────────────────── */

.signal-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
}

/* ── Signal Legend ────────────────────────────────────────────── */

.signal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
    font-size: 0.82rem;
    color: var(--portal-text-muted);
}

.signal-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--portal-border);
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    font-size: 0.78rem;
    white-space: nowrap;
    background: transparent;
}

.signal-legend-item:hover {
    background: var(--portal-card-hover, rgba(255,255,255,0.05));
    border-color: var(--portal-text-muted);
}

.signal-legend-item.active {
    border-color: var(--portal-text-muted);
    background: var(--portal-card-hover, rgba(255,255,255,0.08));
    color: var(--portal-text);
    font-weight: 600;
}

.signal-legend-item[data-signal="all"].active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.signal-legend-item[data-signal="strong-buy"].active {
    border-color: var(--signal-strong-buy);
    background: rgba(8, 153, 129, 0.12);
    color: var(--signal-strong-buy);
}

.signal-legend-item[data-signal="buy"].active {
    border-color: var(--signal-buy);
    background: rgba(10, 172, 146, 0.12);
    color: var(--signal-buy);
}

.signal-legend-item[data-signal="neutral"].active {
    border-color: var(--signal-neutral);
    background: rgba(138, 147, 164, 0.12);
    color: var(--signal-neutral);
}

.signal-legend-item[data-signal="sell"].active {
    border-color: var(--signal-sell);
    background: rgba(242, 54, 69, 0.12);
    color: var(--signal-sell);
}

.signal-legend-item[data-signal="strong-sell"].active {
    border-color: var(--signal-strong-sell);
    background: rgba(212, 46, 60, 0.12);
    color: var(--signal-strong-sell);
}

/* ── Signal Chips ─────────────────────────────────────────────── */

.signal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--portal-border);
    transition: all 0.2s ease;
    user-select: none;
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
}

.signal-chip:hover {
    background: var(--portal-card-hover, rgba(255,255,255,0.05));
    border-color: var(--portal-text-muted);
}

.signal-chip.active {
    border-color: var(--portal-text-muted);
    background: var(--portal-card-hover, rgba(255,255,255,0.08));
    color: var(--portal-text);
    font-weight: 600;
}

/* Strong Buy chip active state */
.signal-chip[data-signal="strong-buy"].active {
    border-color: var(--signal-strong-buy);
    background: rgba(8, 153, 129, 0.12);
    color: var(--signal-strong-buy);
}

/* Buy chip active state */
.signal-chip[data-signal="buy"].active {
    border-color: var(--signal-buy);
    background: rgba(10, 172, 146, 0.12);
    color: var(--signal-buy);
}

/* Neutral chip active state */
.signal-chip[data-signal="neutral"].active {
    border-color: var(--signal-neutral);
    background: rgba(138, 147, 164, 0.12);
    color: var(--signal-neutral);
}

/* Sell chip active state */
.signal-chip[data-signal="sell"].active {
    border-color: var(--signal-sell);
    background: rgba(242, 54, 69, 0.12);
    color: var(--signal-sell);
}

/* Strong Sell chip active state */
.signal-chip[data-signal="strong-sell"].active {
    border-color: var(--signal-strong-sell);
    background: rgba(212, 46, 60, 0.12);
    color: var(--signal-strong-sell);
}

/* All chip */
.signal-chip-all {
    border-color: var(--portal-border);
}

.signal-chip-all.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.signal-chip-all i {
    font-size: 0.85rem;
}

/* ── Signal Dot ───────────────────────────────────────────────── */

.signal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.signal-dot.strong-buy { background: var(--signal-strong-buy); box-shadow: 0 0 6px var(--signal-strong-buy); }
.signal-dot.buy { background: var(--signal-buy); box-shadow: 0 0 6px var(--signal-buy); }
.signal-dot.neutral { background: var(--signal-neutral); box-shadow: 0 0 4px var(--signal-neutral); }
.signal-dot.sell { background: var(--signal-sell); box-shadow: 0 0 6px var(--signal-sell); }
.signal-dot.strong-sell { background: var(--signal-strong-sell); box-shadow: 0 0 6px var(--signal-strong-sell); }

/* ── Three.js Bubble Container ─────────────────────────────── */

#bubble-container {
    width: 100%;
    flex: 1;
    min-height: 400px;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(0, 163, 225, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--portal-bubble-bg-center) 0%, var(--portal-bubble-bg) 100%);
    border-radius: 16px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    box-shadow:
        0 0 40px rgba(0, 163, 225, 0.04),
        0 0 80px rgba(99, 102, 241, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    position: relative;
}

#bubble-container::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background:
        radial-gradient(circle at 15% 85%, rgba(0, 163, 225, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(139, 92, 246, 0.06) 0%, transparent 40%);
    pointer-events: none;
    z-index: 1;
    animation: bubbleAmbient 12s ease-in-out infinite alternate;
}

@keyframes bubbleAmbient {
    0%   { opacity: 0.5; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Zoom controls */
.bubble-zoom-controls {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 4px 8px;
}

[data-bs-theme="light"] .bubble-zoom-controls {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.08);
}

.bubble-zoom-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bubble-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-bs-theme="light"] .bubble-zoom-btn {
    color: rgba(0, 0, 0, 0.6);
}

[data-bs-theme="light"] .bubble-zoom-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
}

.bubble-zoom-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    min-width: 36px;
    text-align: center;
    user-select: none;
}

[data-bs-theme="light"] .bubble-zoom-label {
    color: rgba(0, 0, 0, 0.5);
}

#bubble-container canvas {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 2;
}

[data-bs-theme="light"] #bubble-container {
    border-color: rgba(99, 102, 241, 0.08);
    box-shadow:
        0 0 30px rgba(99, 102, 241, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-bs-theme="light"] #bubble-container::before {
    background:
        radial-gradient(circle at 15% 85%, rgba(0, 163, 225, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 15%, rgba(99, 102, 241, 0.04) 0%, transparent 40%);
}

/* ── Bubble Pulse Animation (legacy, unused — kept for potential SVG fallback) ── */

@keyframes bubble-pulse {
    0% { opacity: 0.2; }
    50% { opacity: 0.06; }
    100% { opacity: 0.2; }
}

.bubble-pulse-ring {
    animation: bubble-pulse 2.5s ease-in-out infinite;
}

@keyframes outer-glow-rotate {
    0% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 100; }
}

.bubble-outer-glow {
    stroke-dasharray: 8 4;
    animation: outer-glow-rotate 4s linear infinite;
}

/* ── Tooltip ──────────────────────────────────────────────────── */

.bubble-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--portal-tooltip-bg);
    color: var(--portal-tooltip-text);
    border: 1px solid var(--portal-tooltip-border);
    border-radius: 12px;
    padding: 0.875rem 1.1rem;
    font-size: 0.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25), 0 0 40px rgba(59, 130, 246, 0.05);
    backdrop-filter: blur(16px);
    z-index: 1000;
    min-width: 220px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bubble-tooltip.visible {
    opacity: 1;
}

.bubble-tooltip .tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--portal-tooltip-border);
}

.bubble-tooltip .tooltip-symbol {
    font-weight: 700;
    font-size: var(--symbol-font-size-tooltip, 0.9rem);
}

.bubble-tooltip .tooltip-signal {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    color: #fff;
}

.bubble-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    padding: 0.15rem 0;
}

.bubble-tooltip .tooltip-label {
    color: var(--portal-text-muted);
}

.bubble-tooltip .tooltip-value {
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.78rem;
}

.bubble-tooltip .tooltip-time {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--portal-tooltip-border);
    font-size: 0.7rem;
    color: var(--portal-text-muted);
}

/* ── Loading Overlay ──────────────────────────────────────────── */

.loading-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at 50% 50%, var(--portal-bubble-bg-center) 0%, var(--portal-bubble-bg) 100%);
    border-radius: 12px;
    z-index: 10;
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #3b82f6;
}

.loading-overlay p {
    margin-top: 1rem;
    color: var(--portal-text-muted);
    font-size: 0.9rem;
}

/* ── Empty State ──────────────────────────────────────────────── */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--portal-text-muted);
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--portal-text);
    margin-bottom: 0.5rem;
}

/* ── Connection Lost Banner ───────────────────────────────────── */

.connection-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1025;
    background: var(--portal-connection-bg);
    color: #fca5a5;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.connection-banner.visible {
    /* Slide down to sit just below the sticky navbar (~56px tall) */
    transform: translateY(56px);
}

[data-bs-theme="light"] .connection-banner {
    color: #dc2626;
}

[data-bs-theme="light"] #bubble-container {
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ── Mobile Card Layout ───────────────────────────────────────── */

.mobile-cards {
    display: none;
}

.symbol-card {
    background: var(--portal-card-bg);
    border: 1px solid var(--portal-border);
    border-radius: 12px;
    padding: 0.875rem;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
    cursor: pointer;
}

.symbol-card:hover {
    background: var(--portal-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.symbol-card .signal-bar {
    width: 4px;
    height: 48px;
    border-radius: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

/* ── Symbol logos ── */

.card-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.card-logo-forex {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0;
}

.card-logo-forex .flag-base,
.card-logo-forex .flag-quote {
    border-radius: 3px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.card-logo-forex .flag-quote {
    margin-left: -4px;
}

.panel-logo-wrap {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.panel-logo-wrap .card-logo {
    width: 40px;
    height: 40px;
}

.panel-logo-wrap .card-logo-forex {
    width: 48px;
    height: 36px;
}

.symbol-card .signal-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
}

.symbol-card .card-info {
    flex: 1;
    min-width: 0;
}

.symbol-card .card-symbol {
    font-weight: 600;
    font-size: var(--symbol-font-size-card, 0.95rem);
    color: var(--portal-text);
}

.symbol-card .card-signal-text {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.symbol-card .card-rsi {
    text-align: right;
}

.symbol-card .card-rsi-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--portal-text);
}

.symbol-card .card-rsi-label {
    font-size: 0.65rem;
    color: var(--portal-text-muted);
    text-transform: uppercase;
}

/* Card expand details */
.symbol-card .card-details {
    display: none;
    width: 100%;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--portal-border);
}

.symbol-card.expanded {
    flex-wrap: wrap;
}

.symbol-card.expanded .card-details {
    display: block;
}

.card-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
    font-size: 0.8rem;
}

.card-details .detail-label {
    color: var(--portal-text-muted);
}

.card-details .detail-value {
    font-weight: 600;
    color: var(--portal-text);
}

.card-section-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-text-muted);
    margin: 1rem 0 0.5rem;
}

/* Error card */
.symbol-card.error-card {
    opacity: 0.6;
}

/* VIP-locked card (out-of-tier symbol) */
.symbol-card.vip-blocked {
    position: relative;
    cursor: pointer;
}
.symbol-card.vip-blocked .card-symbol,
.symbol-card.vip-blocked .card-signal-text {
    color: var(--portal-text-muted, #6c757d);
}
.symbol-card.vip-blocked .card-rsi-value {
    color: #d4a017;
    font-size: 1.25rem;
}
.symbol-card.vip-blocked .card-rsi-label {
    color: #d4a017;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.symbol-card .card-lock-overlay {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.15);
    color: #d4a017;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    pointer-events: none;
    z-index: 2;
}
[dir="rtl"] .symbol-card .card-lock-overlay {
    right: auto;
    left: 0.85rem;
}

/* ── Last Updated ─────────────────────────────────────────────── */

.last-updated {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    padding: 0.25rem 0.6rem;
    border-radius: 16px;
    background: var(--portal-card-hover, rgba(255,255,255,0.04));
    white-space: nowrap;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
    flex-shrink: 0;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { opacity: 0.6; box-shadow: 0 0 6px 2px rgba(34, 197, 94, 0.3); }
}

/* ── Toast Container ──────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 767.98px) {
    #bubble-container {
        display: none;
    }

    .mobile-cards {
        display: block;
    }

    /* Allow vertical scrolling on mobile when cards layout is shown */
    html,
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
    }

    main.container-fluid {
        overflow: visible;
        flex: 0 0 auto;
    }

    main.container-fluid > .position-relative {
        flex: 0 0 auto;
    }

    .signal-legend {
        justify-content: center;
    }

    .signal-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .signal-bar .last-updated {
        justify-content: center;
    }

    .portal-navbar .navbar-brand span {
        font-size: 0.9rem;
    }

    .dashboard-controls {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .dashboard-controls .filter-group {
        order: -1;
        flex: 0 0 auto;
    }

    .dashboard-controls .form-select {
        flex: 0 0 auto;
    }

    .nav-separator {
        display: none;
    }
}

@media (min-width: 768px) {
    .mobile-cards {
        display: none;
    }

    #bubble-container {
        display: block;
    }
}

/* ── Login Top Controls (language + theme) ────────────────────── */

.login-top-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[dir="rtl"] .login-top-controls {
    right: auto;
    left: 1rem;
}

/* ── Language Switcher ────────────────────────────────────────── */

/* Legacy toggle classes (used on login/register/profile pages) */
.lang-toggle,
.theme-toggle {
    background: none;
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--portal-text);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.lang-toggle:hover,
.theme-toggle:hover {
    background: var(--portal-card-hover);
    border-color: var(--portal-text-muted);
}

/* On login/register dark wrapper, force light text */
.login-wrapper .nav-icon-btn,
.login-wrapper .lang-toggle,
.login-wrapper .theme-toggle {
    border-color: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.7);
}

.login-wrapper .nav-icon-btn:hover,
.login-wrapper .lang-toggle:hover,
.login-wrapper .theme-toggle:hover {
    border-color: rgba(255,255,255,0.3);
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.lang-toggle-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.lang-dropdown {
    min-width: 140px;
}

.lang-dropdown .dropdown-item {
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
}

.lang-dropdown .dropdown-item.active {
    background: var(--ma-primary-light, #3b82f6);
    color: #fff;
}

/* ── Portal Footer ────────────────────────────────────────────── */

/* (shape-toggle styles now unified under .nav-icon-btn above) */

.shape-dropdown {
    min-width: 150px;
}

.shape-dropdown .dropdown-item {
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
}

.shape-dropdown .dropdown-item.active {
    background: var(--ma-primary-light, #3b82f6);
    color: #fff;
}

.shape-dropdown .dropdown-item i {
    font-size: 0.95rem;
}

/* (bg-toggle styles now unified under .nav-icon-btn above) */

.bg-dropdown {
    min-width: 160px;
    max-height: 70vh;
    overflow-y: auto;
}

.bg-dropdown .dropdown-item {
    font-size: 0.875rem;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
}

.bg-dropdown .dropdown-item.active {
    background: var(--ma-primary-light, #3b82f6);
    color: #fff;
}

.bg-dropdown .dropdown-item i {
    font-size: 0.95rem;
}

.bubble-bg-canvas {
    opacity: 0.85;
}

.portal-footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--portal-text-muted);
    border-top: 1px solid var(--portal-border);
}

/* Login/Register page footer — positioned at bottom of wrapper */
.login-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0.75rem;
    font-size: 0.7rem;
    color: rgba(255,255,255,0.35);
    z-index: 1;
}

/* ── Scrollbar (dark mode) ────────────────────────────────────── */

[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--portal-surface);
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

/* ── Symbol Detail Panel ──────────────────────────────────────── */

.symbol-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1060;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.symbol-panel-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.symbol-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: var(--portal-surface);
    border-left: 1px solid var(--portal-border);
    z-index: 1070;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.symbol-panel.open {
    transform: translateX(0);
}

.symbol-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--portal-border);
    flex-shrink: 0;
}

.symbol-panel-title {
    margin: 0;
    font-weight: 700;
    font-size: var(--symbol-font-size-panel, 1.15rem);
    color: var(--portal-text);
}

.symbol-panel-type {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-text-muted);
}

.symbol-panel-signal-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px currentColor;
}

.symbol-panel-close {
    color: var(--portal-text-muted);
    border: none;
    padding: 0.25rem;
    line-height: 1;
    font-size: 1.1rem;
    transition: color 0.2s ease;
}

.symbol-panel-close:hover {
    color: var(--portal-text);
}

.symbol-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
}

.symbol-panel-signal {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    color: #fff;
    flex-shrink: 0;
    white-space: nowrap;
}

.symbol-panel-chart {
    width: 100%;
    min-height: 280px;
    max-height: 320px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--portal-border);
    background: var(--portal-card-bg);
    flex-shrink: 0;
}

/* ── Panel Timeframe Bar ─────────────────────── */
.panel-timeframe-bar {
    display: flex;
    gap: 4px;
    padding: 6px 0;
    flex-shrink: 0;
}
.panel-tf-btn {
    border: none;
    background: var(--portal-card-bg);
    color: var(--bs-secondary-color, #6c757d);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: 1px solid var(--portal-border);
}
.panel-tf-btn:hover {
    background: var(--bs-tertiary-bg, #e9ecef);
    color: var(--bs-body-color);
}
.panel-tf-btn.active {
    background: var(--bs-primary, #0d6efd);
    color: #fff;
    border-color: var(--bs-primary, #0d6efd);
}

/* ── Panel Info (rich sections) ─────────────────────── */
.symbol-panel-info {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 0;
}

/* Price row */
.pi-price-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0.25rem 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    margin-bottom: 0.75rem;
}

.pi-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--portal-text);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.pi-updated {
    font-size: 0.68rem;
    color: var(--portal-text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.pi-live-prices {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    flex: 1;
}

.pi-live-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    min-width: 80px;
    flex: 1;
}

.pi-live-box.bid {
    background: rgba(46, 204, 113, 0.08);
    border: 1px solid rgba(46, 204, 113, 0.25);
}

.pi-live-box.ask {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.25);
}

.pi-live-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem;
}

.pi-live-box.bid .pi-live-label {
    color: #2ecc71;
}

.pi-live-box.ask .pi-live-label {
    color: #e74c3c;
}

.pi-bid {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2ecc71;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.pi-ask {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e74c3c;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.pi-spread {
    font-size: 0.6rem;
    color: var(--portal-text-muted);
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    align-self: center;
    white-space: nowrap;
}

/* Section containers */
.sp-section {
    margin-bottom: 1rem;
}

.sp-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--portal-text-muted);
    margin: 0 0 0.6rem 0;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--portal-border);
}

.pi-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.pi-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
    white-space: nowrap;
}

.pi-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--portal-text);
    white-space: nowrap;
}

.pi-value.pi-green { color: #089981; }
.pi-value.pi-red   { color: #f23645; }

.pi-signals {
    flex-direction: column;
}

.pi-pills {
    display: flex;
    gap: 0.3rem;
}

.pi-pill {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 10px;
    white-space: nowrap;
}

.pi-pill-buy     { background: rgba(8,153,129,0.15); color: #089981; }
.pi-pill-neutral { background: rgba(168,85,247,0.15); color: #a855f7; }
.pi-pill-sell    { background: rgba(242,54,69,0.15); color: #f23645; }

.pi-time {
    margin-left: auto;
}

.pi-time .pi-label {
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pi-breakdown {
    flex-basis: 100%;
}

.pi-bd-rows {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-top: 0.2rem;
}

.pi-bd-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pi-bd-cat {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--portal-text-muted);
    min-width: 5.5rem;
}

.pi-bd-overall {
    padding-top: 0.25rem;
    border-top: 1px solid var(--portal-border);
}

.pi-bd-overall .pi-bd-cat {
    font-weight: 700;
    color: var(--portal-text);
}

.symbol-panel-section {
    margin-bottom: 1.25rem;
}

.symbol-panel-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--portal-text-muted);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--portal-border);
}

.symbol-panel-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.panel-metric {
    background: var(--portal-card-bg);
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    transition: background-color 0.2s ease;
}

.panel-metric:hover {
    background: var(--portal-card-hover);
}

.panel-metric-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
    margin-bottom: 0.15rem;
}

.panel-metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-text);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.panel-metric-value.small {
    font-size: 0.85rem;
}

.panel-metric.full-width {
    grid-column: 1 / -1;
}

.panel-strategy-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--portal-text);
    margin-bottom: 0.25rem;
}

.panel-strategy-scope {
    font-size: 0.75rem;
    color: var(--portal-text-muted);
}

.panel-strategy-rules {
    margin-top: 0.5rem;
    font-size: 0.78rem;
}

.panel-strategy-rule {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0;
    color: var(--portal-text-muted);
}

.panel-strategy-rule .rule-signal {
    padding: 0.1rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
}

.symbol-panel-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--portal-border);
    font-size: 0.72rem;
    color: var(--portal-text-muted);
    text-align: center;
}

.rsi-gauge {
    grid-column: 1 / -1;
    background: var(--portal-card-bg);
    border: 1px solid var(--portal-border);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
}

.rsi-gauge-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.rsi-gauge-label span:first-child {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
}

.rsi-gauge-label span:last-child {
    font-size: 1rem;
    font-weight: 700;
    color: var(--portal-text);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.rsi-gauge-bar {
    height: 6px;
    background: var(--portal-border);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.rsi-gauge-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
}

.rsi-gauge-zones {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--portal-text-muted);
    margin-top: 0.2rem;
}

/* ── Signal Strength Bar ──────────────────────── */

.signal-strength-bar {
    display: flex;
    height: 4px;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
}

.signal-strength-bar .str-seg {
    height: 100%;
    transition: width 0.4s ease;
}

.signal-strength-bar .str-seg.buy    { background: #10b981; }
.signal-strength-bar .str-seg.neutral { background: #6b7280; }
.signal-strength-bar .str-seg.sell   { background: #ef4444; }

/* ── Collapsible Sections ─────────────────────── */

.panel-collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.panel-collapsible:hover {
    color: var(--portal-text);
}

.panel-chevron {
    font-size: 0.55rem;
    transition: transform 0.25s ease;
    display: inline-block;
}

.panel-collapsible.collapsed .panel-chevron {
    transform: rotate(-90deg);
}

.panel-collapsible-body {
    overflow: hidden;
    max-height: 800px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 1;
}

.panel-collapsible-body.collapsed {
    max-height: 0;
    opacity: 0;
}

/* ── Metric Card Accent ───────────────────────── */

.panel-metric.accent-green {
    border-left: 3px solid #10b981;
}

.panel-metric.accent-red {
    border-left: 3px solid #ef4444;
}

@media (max-width: 575.98px) {
    .symbol-panel {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 767.98px) {
    #symbolPanel .symbol-panel-chart,
    #symbolPanel .panel-timeframe-bar {
        display: none !important;
    }
}
