/* ==========================================================================
   CryptoViz PRO — Comprehensive Institutional Dark Fintech Design System
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Presets & Color Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Default: Obsidian Cyber */
    --bg-canvas: #05070f;
    --bg-surface: #0a0d1a;
    --bg-island: rgba(13, 17, 33, 0.78);
    --bg-island-hover: rgba(20, 27, 52, 0.88);
    --bg-card: rgba(16, 21, 42, 0.7);
    --bg-input: rgba(10, 13, 26, 0.85);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-glow: rgba(0, 245, 160, 0.35);

    --text-primary: #ffffff;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-dim: #475569;

    --color-gain: #00f5a0;
    --color-gain-glow: rgba(0, 245, 160, 0.5);
    --color-gain-bg: rgba(0, 245, 160, 0.12);

    --color-loss: #ff2a5f;
    --color-loss-glow: rgba(255, 42, 95, 0.5);
    --color-loss-bg: rgba(255, 42, 95, 0.12);

    --color-accent: #00d9ff;
    --color-accent-glow: rgba(0, 217, 255, 0.45);
    --color-gold: #f59e0b;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --font-brand: 'Outfit', sans-serif;
    --font-ui: 'Plus Jakarta Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --shadow-island: 0 12px 40px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.15);
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Theme: Neon Matrix */
[data-theme="matrix"] {
    --bg-canvas: #060a12;
    --bg-surface: #0a1120;
    --bg-island: rgba(10, 18, 34, 0.82);
    --color-gain: #00d9ff;
    --color-gain-glow: rgba(0, 217, 255, 0.5);
    --color-loss: #ff4365;
    --color-loss-glow: rgba(255, 67, 101, 0.5);
    --color-accent: #38bdf8;
}

/* Theme: Tokyo Midnight */
[data-theme="tokyo"] {
    --bg-canvas: #080512;
    --bg-surface: #100b22;
    --bg-island: rgba(18, 12, 36, 0.82);
    --color-gain: #22c55e;
    --color-gain-glow: rgba(34, 197, 94, 0.5);
    --color-loss: #ec4899;
    --color-loss-glow: rgba(236, 72, 153, 0.5);
    --color-accent: #a855f7;
}

/* Theme: Bloomberg Terminal */
[data-theme="bloomberg"] {
    --bg-canvas: #0c0e12;
    --bg-surface: #12151c;
    --bg-island: rgba(18, 22, 28, 0.88);
    --color-gain: #10b981;
    --color-gain-glow: rgba(16, 185, 129, 0.5);
    --color-loss: #ef4444;
    --color-loss-glow: rgba(239, 68, 68, 0.5);
    --color-accent: #f59e0b;
}

/* Alternate Palettes */
[data-palette="synthwave"] {
    --color-gain: #00f5ff;
    --color-gain-glow: rgba(0, 245, 255, 0.5);
    --color-gain-bg: rgba(0, 245, 255, 0.12);
    --color-loss: #ff007f;
    --color-loss-glow: rgba(255, 0, 127, 0.5);
    --color-loss-bg: rgba(255, 0, 127, 0.12);
}

[data-palette="accessible"] {
    --color-gain: #2563eb;
    --color-gain-glow: rgba(37, 99, 235, 0.5);
    --color-gain-bg: rgba(37, 99, 235, 0.12);
    --color-loss: #f97316;
    --color-loss-glow: rgba(249, 115, 22, 0.5);
    --color-loss-bg: rgba(249, 115, 22, 0.12);
}

/* --------------------------------------------------------------------------
   2. Reset & App Layout Viewport
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-ui);
    -webkit-font-smoothing: antialiased;
    user-select: none;
}

.app-viewport {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Ambient Radial Mesh Background */
.ambient-mesh {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 18% 15%, rgba(0, 245, 160, 0.05) 0%, transparent 45%),
        radial-gradient(circle at 82% 82%, rgba(0, 217, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   3. Top Floating Navigation & Telemetry Island
   -------------------------------------------------------------------------- */
.top-nav-island {
    position: relative;
    z-index: 20;
    margin: 10px 14px 6px;
    padding: 8px 16px;
    background: var(--bg-island);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-island);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Brand Badge */
.brand-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: default;
}

.brand-orbit {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-accent), var(--color-gain));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 16px var(--color-gain-glow);
    position: relative;
}

.orbit-particle {
    width: 12px;
    height: 12px;
    background: var(--bg-canvas);
    border-radius: 50%;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-family: var(--font-brand);
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pro-tag {
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-gain), var(--color-accent));
    color: #03080e;
    letter-spacing: 0.08em;
}

.brand-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Mode Switcher Segment */
.nav-mode-pills {
    display: flex;
    background: rgba(8, 11, 22, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
}

.nav-mode-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.nav-mode-btn:hover {
    color: var(--text-primary);
}

.nav-mode-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   4. Market Health Telemetry Modules
   -------------------------------------------------------------------------- */
.nav-center-health {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.health-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.health-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-medium);
}

.health-icon {
    font-size: 1.25rem;
}

.health-stack {
    display: flex;
    flex-direction: column;
}

.stack-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.stack-value {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.2;
}

.stack-value.highlight {
    color: var(--color-gain);
}

/* Fear & Greed Mini Meter */
.fng-mini-meter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid var(--color-gain);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px var(--color-gain-glow);
}

.fng-num {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
}

/* Breadth Ratio Pill */
.breadth-pill {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}

.breadth-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.breadth-ratio-text {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.breadth-track {
    width: 100%;
    height: 5px;
    border-radius: var(--radius-full);
    display: flex;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.breadth-fill {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.breadth-fill.green {
    background: var(--color-gain);
    box-shadow: 0 0 8px var(--color-gain-glow);
}

.breadth-fill.red {
    background: var(--color-loss);
    box-shadow: 0 0 8px var(--color-loss-glow);
}

.breadth-bottom {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
}

.b-gainers { color: var(--color-gain); }
.b-losers { color: var(--color-loss); }
.b-avg { color: var(--text-muted); }

/* Macro Stats */
.macro-pill {
    display: flex;
    gap: 14px;
}

.macro-cell {
    display: flex;
    flex-direction: column;
}

.macro-val {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 800;
}

.macro-val.btc-dom {
    color: var(--color-accent);
}

/* Movers Pill */
.movers-pill {
    gap: 6px;
    padding: 4px 6px;
}

.mini-mover-btn {
    border: none;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-family: var(--font-mono);
    transition: var(--transition);
}

.mini-mover-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.mini-mover-btn.gainer {
    background: var(--color-gain-bg);
    color: var(--color-gain);
    border: 1px solid rgba(0, 245, 160, 0.3);
}

.mini-mover-btn.loser {
    background: var(--color-loss-bg);
    color: var(--color-loss);
    border: 1px solid rgba(255, 42, 95, 0.3);
}

.mover-tag {
    font-size: 0.6rem;
    font-weight: 800;
    opacity: 0.8;
}

.mover-sym {
    font-size: 0.75rem;
    font-weight: 800;
}

/* Portfolio Active Bar */
.portfolio-active-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 14px;
    background: var(--color-gain-bg);
    border: 1px solid rgba(0, 245, 160, 0.3);
    border-radius: var(--radius-sm);
    box-shadow: 0 0 15px rgba(0, 245, 160, 0.1);
}

.port-metric {
    display: flex;
    flex-direction: column;
}

.port-val {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
}

.port-val.pos { color: var(--color-gain); }
.port-val.neg { color: var(--color-loss); }

/* Right Actions */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transition: var(--transition);
    white-space: nowrap;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--color-gain), var(--color-accent));
    color: #040912;
    border: none;
    box-shadow: 0 4px 14px var(--color-gain-glow);
}

.action-btn.primary:hover {
    box-shadow: 0 6px 20px var(--color-gain-glow);
    transform: translateY(-2px);
}

.action-btn.outline {
    background: transparent;
    border-color: var(--border-medium);
}

.action-btn.sm {
    padding: 5px 10px;
    font-size: 0.74rem;
}

.action-btn.xs {
    padding: 3px 8px;
    font-size: 0.68rem;
}

.action-btn.block {
    width: 100%;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   5. Command Dock (Pills, Shapes, Filters)
   -------------------------------------------------------------------------- */
.command-dock {
    position: relative;
    z-index: 20;
    margin: 0 14px 8px;
    padding: 6px 14px;
    background: var(--bg-island);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-island);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.dock-cluster {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dock-cluster-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.dock-pills {
    display: flex;
    background: rgba(8, 11, 22, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
    gap: 2px;
}

.dock-pill {
    padding: 4px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.dock-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.dock-pill.active {
    background: rgba(0, 245, 160, 0.18);
    color: var(--color-gain);
    border: 1px solid rgba(0, 245, 160, 0.35);
    box-shadow: 0 0 10px rgba(0, 245, 160, 0.15);
}

/* Mini Shape Glyphs */
.mini-glyph {
    display: inline-block;
    width: 9px;
    height: 9px;
    border: 1.5px solid currentColor;
}

.mini-glyph.circle {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border-width: 2.5px;
    background: transparent;
}
.mini-glyph.square { border-radius: 2px; }
.mini-glyph.hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: currentColor;
    border: none;
}
.mini-glyph.treemap {
    background: repeating-linear-gradient(45deg, currentColor 0, currentColor 2px, transparent 2px, transparent 4px);
}
.mini-glyph.coin {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border-width: 2px;
    box-shadow: inset 0 -3px 0 currentColor;
}
.mini-glyph.gear {
    width: 11px;
    height: 11px;
    border: none;
    border-radius: 50%;
    background: repeating-conic-gradient(currentColor 0deg 18deg, transparent 18deg 45deg);
    -webkit-mask: radial-gradient(circle, transparent 0 28%, #000 30%);
    mask: radial-gradient(circle, transparent 0 28%, #000 30%);
}
.mini-glyph.band {
    width: 11px;
    height: 13px;
    border: none;
    background:
        linear-gradient(currentColor, currentColor) 0 0 / 11px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 4px / 11px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 8px / 11px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 0 12px / 11px 1px no-repeat;
}
.mini-glyph.eq {
    width: 13px;
    height: 11px;
    border: none;
    background:
        linear-gradient(currentColor, currentColor) 0 4px / 2px 7px no-repeat,
        linear-gradient(currentColor, currentColor) 3.5px 1px / 2px 10px no-repeat,
        linear-gradient(currentColor, currentColor) 7px 5px / 2px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 10.5px 0 / 2px 11px no-repeat;
}
.mini-glyph.lift {
    width: 12px;
    height: 11px;
    border: none;
    background:
        linear-gradient(currentColor, currentColor) 0 5px / 3px 6px no-repeat,
        linear-gradient(currentColor, currentColor) 4px 2px / 3px 9px no-repeat,
        linear-gradient(currentColor, currentColor) 8px 0 / 3px 11px no-repeat;
}

/* Dock Selects */
.dock-select {
    background: rgba(8, 11, 22, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 5px 10px;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.dock-select:hover, .dock-select:focus {
    border-color: var(--border-medium);
    background: rgba(16, 22, 44, 0.9);
}

.dock-select option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Search Field */
.search-cluster {
    flex: 1 1 160px;
}

.search-field {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-glyph {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-field input {
    width: 100%;
    background: rgba(8, 11, 22, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 5px 28px 5px 30px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-size: 0.78rem;
    outline: none;
    transition: var(--transition);
}

.search-field input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.clear-glyph {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
}

.clear-glyph:hover { color: #fff; }

.search-field.large input {
    padding: 12px 16px 12px 40px;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
}

.search-field.large .search-glyph {
    left: 14px;
}

/* Mini Utility Tools */
.tools-cluster {
    margin-left: auto;
}

.mini-tool-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.mini-tool-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.mini-tool-btn.active {
    background: rgba(255, 42, 95, 0.2);
    border-color: var(--color-loss);
    color: var(--color-loss);
}

/* --------------------------------------------------------------------------
   6. Fullscreen Canvas Stage & HUD
   -------------------------------------------------------------------------- */
.canvas-stage {
    flex: 1;
    min-height: 420px;
    position: relative;
    width: calc(100% - 28px);
    margin: 0 14px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: radial-gradient(circle at center, rgba(14, 19, 38, 0.45) 0%, rgba(5, 7, 15, 0.85) 100%);
    box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), var(--shadow-island);
    overflow: hidden;
}

.canvas-stage.shape-band {
    flex: 1 0 860px;
    min-height: 860px;
}

#cryptoCanvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: grab;
}

#cryptoCanvas:active {
    cursor: grabbing;
}

/* Canvas Overlays (Loading & Empty) */
.canvas-veil {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(5, 7, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 30;
    gap: 16px;
}

.radar-pulse {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--color-gain);
    border-right-color: var(--color-accent);
    border-radius: 50%;
    animation: radarSpin 0.75s linear infinite;
}

@keyframes radarSpin {
    to { transform: rotate(360deg); }
}

.veil-text {
    font-family: var(--font-brand);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.empty-glyph { font-size: 3rem; opacity: 0.6; }
.empty-headline { font-family: var(--font-brand); font-size: 1.35rem; font-weight: 800; }
.empty-desc { color: var(--text-muted); font-size: 0.88rem; max-width: 360px; text-align: center; }

/* Bottom Floating HUD Legend */
.stage-hud-legend {
    position: absolute;
    bottom: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(9, 12, 24, 0.85);
    backdrop-filter: blur(14px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    pointer-events: none;
    z-index: 10;
}

.legend-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.legend-circle {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-circle.green { background: var(--color-gain); box-shadow: 0 0 6px var(--color-gain); }
.legend-circle.red { background: var(--color-loss); box-shadow: 0 0 6px var(--color-loss); }
.legend-circle.glow { background: transparent; border: 2px solid #fff; box-shadow: 0 0 6px #fff; }

.legend-pill.coin-spin { display: none; }
.legend-pill.coin-spin.on { display: flex; flex-wrap: wrap; gap: 8px; pointer-events: auto; }
.coin-read {
    margin-left: 4px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(8, 12, 22, 0.72);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.68rem;
}

.legend-pill.hint {
    color: var(--text-muted);
    border-left: 1px solid var(--border-subtle);
    padding-left: 10px;
}

/* Hover HUD Tooltip Card */
.hud-tooltip {
    position: absolute;
    width: 240px;
    background: rgba(12, 16, 32, 0.94);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    z-index: 50;
    transform: translate(-50%, -105%);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.hud-tt-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.hud-tt-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.hud-tt-titles {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.hud-tt-name {
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.1;
}

.hud-tt-symbol {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.hud-tt-rank {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.hud-tt-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
}

.hud-tt-price {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 800;
}

.hud-tt-change {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 800;
}

.hud-tt-change.green { color: var(--color-gain); }
.hud-tt-change.red { color: var(--color-loss); }

.hud-tt-stats {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.72rem;
}

.hud-row {
    display: flex;
    justify-content: space-between;
}

.hud-k { color: var(--text-muted); font-weight: 600; }
.hud-v { font-family: var(--font-mono); font-weight: 700; }
.hud-v.highlight { color: var(--color-accent); }

.hud-tt-cta {
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
    font-size: 0.65rem;
    color: var(--color-accent);
    text-align: center;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   7. Deep-Dive Token Analytics Sheet / Drawer
   -------------------------------------------------------------------------- */
.deep-drawer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.3s;
}

.deep-drawer.open {
    visibility: visible;
    pointer-events: auto;
}

.drawer-curtain {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.deep-drawer.open .drawer-curtain { opacity: 1; }

.drawer-sheet {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 490px;
    max-width: 95vw;
    background: rgba(10, 13, 26, 0.96);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--border-medium);
    box-shadow: -15px 0 50px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.deep-drawer.open .drawer-sheet {
    transform: translateX(0);
}

.drawer-sheet-head {
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.sheet-title-cluster {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sheet-coin-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    border: 1px solid var(--border-subtle);
}

.sheet-headings {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sheet-top-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sheet-coin-name {
    font-family: var(--font-brand);
    font-size: 1.3rem;
    font-weight: 800;
    line-height: 1.1;
}

.sheet-coin-symbol {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sheet-rank-badge {
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.sheet-fav-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    transition: var(--transition);
}

.sheet-fav-btn:hover, .sheet-fav-btn.starred {
    color: var(--color-gold);
    transform: scale(1.15);
}

.sheet-price-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.sheet-live-price {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    font-weight: 800;
}

.sheet-badge-change {
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 800;
}

.sheet-badge-change.green {
    background: var(--color-gain-bg);
    color: var(--color-gain);
    border: 1px solid rgba(0, 245, 160, 0.3);
}

.sheet-badge-change.red {
    background: var(--color-loss-bg);
    color: var(--color-loss);
    border: 1px solid rgba(255, 42, 95, 0.3);
}

.sheet-dismiss-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.sheet-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.drawer-sheet-body {
    padding: 18px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sheet-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sheet-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sheet-block-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.sheet-badge-label {
    font-size: 0.68rem;
    color: var(--color-gain);
    font-weight: 700;
}

.sheet-block-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* 9-Timeframe Matrix Grid */
.matrix-timeframes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.matrix-cell {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.m-tf {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
}

.m-val {
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 800;
}

.m-val.green { color: var(--color-gain); }
.m-val.red { color: var(--color-loss); }

/* Interactive Sparkline Chart Box */
.interactive-chart-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#drawerSparklineCanvas {
    width: 100%;
    height: 125px;
}

.chart-foot-extremes {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* 24h Price Range Slider */
.sheet-range-num {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
}

.range-groove {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    position: relative;
}

.range-spectrum {
    height: 100%;
    background: linear-gradient(90deg, var(--color-loss), var(--color-gold), var(--color-gain));
    border-radius: var(--radius-full);
}

.range-needle {
    position: absolute;
    top: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px var(--color-gain);
    transform: translateX(-50%);
    border: 3px solid var(--bg-surface);
}

.range-extremes-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Fundamentals Grid */
.fundamentals-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.fund-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
}

.f-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 700;
}

.f-val {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    margin-top: 2px;
}

.f-sub {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    margin-top: 2px;
}

/* Portfolio Card in Drawer */
.portfolio-card-section {
    background: var(--color-gain-bg);
    border: 1px solid rgba(0, 245, 160, 0.3);
    border-radius: var(--radius-md);
    padding: 14px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
}

.pos-stat {
    display: flex;
    flex-direction: column;
}

.pos-num {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 800;
}

.pos-num.highlight { color: var(--color-gain); }

.sheet-foot-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* --------------------------------------------------------------------------
   8. Modals (Customizer & Portfolio Holdings Ledger)
   -------------------------------------------------------------------------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.open { display: flex; }

.modal-frame {
    width: 640px;
    max-width: 95vw;
    max-height: 90vh;
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-frame-head {
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.02);
}

.modal-frame-head h2 {
    font-family: var(--font-brand);
    font-size: 1.25rem;
    font-weight: 800;
}

.modal-dismiss-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.6rem;
    cursor: pointer;
}

.modal-dismiss-btn:hover { color: #fff; }

.modal-frame-body {
    padding: 20px 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-title {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.setting-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
}

/* Theme Option Cards */
.theme-options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.theme-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.theme-card:hover {
    border-color: var(--border-medium);
    background: rgba(255, 255, 255, 0.06);
}

.theme-card.active {
    border-color: var(--color-gain);
    background: rgba(0, 245, 160, 0.08);
    box-shadow: 0 0 15px rgba(0, 245, 160, 0.2);
}

.theme-preview {
    width: 100%;
    height: 38px;
    border-radius: 6px;
}

.theme-preview.obsidian { background: linear-gradient(135deg, #05070f, #00f5a0); }
.theme-preview.matrix { background: linear-gradient(135deg, #060a12, #00d9ff); }
.theme-preview.tokyo { background: linear-gradient(135deg, #080512, #a855f7); }
.theme-preview.bloomberg { background: linear-gradient(135deg, #0c0e12, #f59e0b); }

.theme-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Palette Options */
.palette-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.palette-chip {
    padding: 7px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.palette-chip:hover {
    color: #fff;
    border-color: var(--border-medium);
}

.palette-chip.active {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-accent);
    color: #fff;
}

.p-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.p-swatch.green-red { background: linear-gradient(135deg, #00f5a0 50%, #ff2a5f 50%); }
.p-swatch.cyan-pink { background: linear-gradient(135deg, #00d9ff 50%, #ec4899 50%); }
.p-swatch.blue-orange { background: linear-gradient(135deg, #2563eb 50%, #f97316 50%); }

/* Toggle Row & Switch */
.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.82rem;
    font-weight: 600;
}

.modern-switch {
    appearance: none;
    width: 40px;
    height: 22px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    position: relative;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.modern-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modern-switch:checked {
    background: var(--color-gain);
}

.modern-switch:checked::after {
    transform: translateX(18px);
}

/* Label Checkboxes */
.toggle-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.check-pill {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.check-pill:hover {
    background: rgba(255, 255, 255, 0.08);
}

.check-pill input {
    cursor: pointer;
}

/* Modal Search Dropdown */
.holding-search-field {
    position: relative;
}

.modal-search-flyout {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f1428;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.8);
    max-height: 240px;
    overflow-y: auto;
    z-index: 50;
    margin-top: 4px;
}

.search-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition);
}

.search-item-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.item-left-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.item-token-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.item-name { font-weight: 700; font-size: 0.85rem; }
.item-sym { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.item-price { font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; }

/* Popular Quick Add Tokens */
.popular-tokens-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.popular-token-chip {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.popular-token-chip:hover {
    background: var(--color-gain-bg);
    border-color: rgba(0, 245, 160, 0.4);
    color: var(--color-gain);
}

/* Ledger Table */
.holdings-ledger-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ledger-count {
    font-size: 0.74rem;
    color: var(--text-muted);
    font-weight: 700;
}

.ledger-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.ledger-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.ledger-coin-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 130px;
}

.ledger-logo {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.ledger-sym {
    font-weight: 800;
    font-size: 0.85rem;
}

.ledger-input {
    flex: 1;
    background: rgba(8, 11, 22, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
}

.ledger-input:focus {
    border-color: var(--color-accent);
}

.ledger-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 90px;
    text-align: right;
    color: var(--color-gain);
}

.ledger-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 2px 6px;
}

.ledger-del:hover {
    color: var(--color-loss);
}

.modal-frame-foot {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
}

/* --------------------------------------------------------------------------
   9. Toast Notifications
   -------------------------------------------------------------------------- */
.toast-layer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast-msg {
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    background: rgba(14, 18, 36, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    pointer-events: auto;
    animation: toastSlide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast-msg.success { border-color: rgba(0, 245, 160, 0.5); }
.toast-msg.error { border-color: rgba(255, 42, 95, 0.5); }
.toast-msg.info { border-color: rgba(0, 217, 255, 0.5); }

@keyframes toastSlide {
    from { transform: translateX(40px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   11. Killer Features: WebSocket Stream, PRO System, Whale Radar, Alerts & Snapshot
   -------------------------------------------------------------------------- */

/* Live WebSocket Badge */
.live-stream-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: var(--radius-full);
    background: rgba(0, 245, 160, 0.08);
    border: 1px solid rgba(0, 245, 160, 0.25);
    font-size: 0.72rem;
    font-weight: 700;
    color: #e2e8f0;
    transition: var(--transition);
}

.live-stream-badge.disconnected {
    background: rgba(255, 42, 95, 0.08);
    border-color: rgba(255, 42, 95, 0.25);
    color: #94a3b8;
}

.live-stream-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00f5a0;
    box-shadow: 0 0 8px #00f5a0;
    animation: livePulseDot 1.6s ease-in-out infinite;
}

.live-stream-badge.disconnected .live-stream-dot {
    background: #ff2a5f;
    box-shadow: 0 0 6px #ff2a5f;
    animation: none;
}

@keyframes livePulseDot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.5; }
}

.live-stream-ping {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: #00f5a0;
    background: rgba(0, 0, 0, 0.3);
    padding: 1px 5px;
    border-radius: 4px;
}

/* PRO Crown Button */
.action-btn.pro-crown-btn {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(236, 72, 153, 0.25));
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #fef08a;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.25);
    font-weight: 800;
}

.action-btn.pro-crown-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(236, 72, 153, 0.4));
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
    border-color: #f59e0b;
    transform: translateY(-1px);
}

.action-btn.pro-crown-btn.active-pro {
    background: linear-gradient(135deg, rgba(0, 245, 160, 0.25), rgba(0, 217, 255, 0.25));
    border-color: #00f5a0;
    color: #6ee7b7;
    box-shadow: 0 0 18px rgba(0, 245, 160, 0.3);
}

.crown-icon {
    font-size: 0.95rem;
    filter: drop-shadow(0 0 4px #f59e0b);
}

/* Active Alert Notification Dot */
.alert-active-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00f5a0;
    box-shadow: 0 0 8px #00f5a0;
    animation: livePulseDot 1.4s infinite;
}

/* Whale & Smart Money Radar Section in Drawer */
.whale-radar-section {
    background: linear-gradient(145deg, rgba(14, 21, 48, 0.7), rgba(9, 13, 30, 0.85));
    border: 1px solid rgba(0, 217, 255, 0.25);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.whale-radar-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d9ff, #f59e0b, #00f5a0);
}

.whale-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 14px;
}

.whale-metric-card {
    background: rgba(6, 10, 24, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.whale-metric-val {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
}

.whale-metric-val.pos { color: var(--color-gain); }
.whale-metric-val.neg { color: var(--color-loss); }

.whale-pressure-gauge {
    margin-bottom: 12px;
}

.gauge-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.73rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.gauge-label-buy { color: var(--color-gain); }
.gauge-label-sell { color: var(--color-loss); }

.gauge-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    overflow: hidden;
}

.gauge-fill-buy {
    background: linear-gradient(90deg, #00f5a0, #00d9ff);
    height: 100%;
    transition: width 0.4s ease;
}

.gauge-fill-sell {
    background: linear-gradient(90deg, #ff4365, #ff2a5f);
    height: 100%;
    transition: width 0.4s ease;
}

.whale-signal-note {
    font-size: 0.74rem;
    color: #94a3b8;
    line-height: 1.4;
    background: rgba(0, 217, 255, 0.06);
    border-left: 3px solid #00d9ff;
    padding: 6px 10px;
    border-radius: 0 4px 4px 0;
}

/* Wide Modal Frame (Pro & Snapshot) */
.modal-frame.modal-frame-wide {
    width: 960px;
    max-width: 94vw;
}

/* Alert Form & Cards */
#alertsModal .modal-frame {
    max-width: 640px;
}

.alert-form-card {
    background: rgba(14, 19, 40, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-inputs-row {
    display: grid;
    grid-template-columns: 1.4fr 1.3fr 1fr;
    gap: 10px;
}

.alert-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-num-input, .modal-text-input {
    background: rgba(8, 11, 24, 0.9);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
}

.modal-num-input:focus, .modal-text-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.alert-options-row {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.webhook-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 10px;
}

.alert-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(12, 16, 32, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: var(--transition);
}

.alert-item-card:hover {
    border-color: var(--border-medium);
    background: rgba(18, 24, 48, 0.9);
}

.alert-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-coin-badge {
    font-weight: 800;
    color: #fff;
    font-family: var(--font-brand);
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
}

.alert-cond-text {
    font-size: 0.82rem;
    color: #94a3b8;
    font-family: var(--font-mono);
}

.alert-status-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
}

.alert-status-badge.monitoring {
    background: rgba(0, 245, 160, 0.15);
    color: var(--color-gain);
    border: 1px solid rgba(0, 245, 160, 0.3);
}

.alert-status-badge.triggered {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.empty-alerts-placeholder {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
    background: rgba(8, 11, 24, 0.4);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-subtle);
}

/* PRO Paywall Modal Styles */
.pro-hero-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}

.pro-hero-badge {
    display: inline-block;
    background: linear-gradient(90deg, #f59e0b, #ec4899);
    color: #000;
    font-weight: 900;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.pro-hero-heading {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    font-family: var(--font-brand);
}

.pro-hero-sub {
    font-size: 0.84rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.pricing-plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.pricing-card {
    background: rgba(14, 18, 38, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.pricing-card.featured {
    background: linear-gradient(180deg, rgba(20, 28, 64, 0.9), rgba(10, 15, 34, 0.95));
    border: 2px solid #00f5a0;
    box-shadow: 0 0 25px rgba(0, 245, 160, 0.2);
}

.featured-ribbon {
    position: absolute;
    top: -10px;
    right: 14px;
    background: linear-gradient(90deg, #00f5a0, #00d9ff);
    color: #000;
    font-weight: 900;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.plan-tag {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 4px;
}

.plan-tag.highlight { color: #00f5a0; }
.plan-tag.gold { color: #f59e0b; }

.plan-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    font-family: var(--font-brand);
}

.plan-price {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 4px;
}

.plan-price span {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
}

.plan-sub-billing {
    font-size: 0.7rem;
    color: #00f5a0;
    margin-bottom: 12px;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 14px 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.77rem;
    color: #cbd5e1;
}

.plan-features li.dim {
    color: #475569;
}

.pro-checkout-footer-box {
    background: rgba(10, 14, 28, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkout-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.75rem;
    color: #94a3b8;
    justify-content: center;
}

.demo-pro-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.demo-toggle-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.demo-badge {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
}

.demo-text {
    font-size: 0.78rem;
    color: #cbd5e1;
}

#manageBillingBtn[hidden] {
    display: none;
}

.action-btn.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-weight: 800;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.action-btn.gold:hover {
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
    transform: translateY(-1px);
}

/* Social Snapshot Export Stage */
.snapshot-preview-stage {
    background: #03050a;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 14px 0;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.9);
}

.snapshot-img-preview {
    max-width: 100%;
    max-height: 480px;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.8);
}

.snapshot-actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
    .nav-center-health {
        order: 3;
        flex: 1 1 100%;
        margin-top: 6px;
    }
}

@media (max-width: 900px) {
    .top-nav-island {
        flex-direction: column;
        align-items: stretch;
    }
    .command-dock {
        flex-direction: column;
        align-items: stretch;
    }
    .dock-cluster {
        flex-wrap: wrap;
    }
    .theme-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pricing-plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .alert-inputs-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .pricing-plans-grid {
        grid-template-columns: 1fr;
    }
    .whale-metrics-grid {
        grid-template-columns: 1fr;
    }
    .demo-pro-toggle-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
}

/* =============================================================================
   12. Exchange Switcher & Venue Routing Engine
   ============================================================================= */
.exchange-select {
    border-color: rgba(0, 217, 255, 0.4);
    background: rgba(0, 217, 255, 0.08);
    color: #e0f2fe;
}

.exchange-select:hover, .exchange-select:focus {
    border-color: #00d9ff;
    box-shadow: 0 0 12px rgba(0, 217, 255, 0.25);
    background: rgba(0, 217, 255, 0.14);
}

.exchange-venue-section {
    background: rgba(14, 19, 40, 0.7);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px;
}

.exchange-venue-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.venue-stat-card {
    background: rgba(8, 11, 22, 0.65);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.venue-stat-val {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.venue-stat-val.pos {
    color: var(--color-gain);
}

.venue-stat-val.neg {
    color: var(--color-loss);
}

.venue-stat-val.warn {
    color: #f59e0b;
}

.exchange-trade-action {
    background: linear-gradient(135deg, #0052ff, #00d9ff);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 18px rgba(0, 82, 255, 0.35);
    transition: var(--transition);
}

.exchange-trade-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 82, 255, 0.55);
    filter: brightness(1.1);
}

.exchange-trade-action.binance-theme {
    background: linear-gradient(135deg, #f0b90b, #d99904);
    color: #0c0e12;
    box-shadow: 0 4px 18px rgba(240, 185, 11, 0.35);
}

.exchange-trade-action.coinbase-theme {
    background: linear-gradient(135deg, #0052ff, #0a46d1);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(0, 82, 255, 0.35);
}

.exchange-trade-action.kraken-theme {
    background: linear-gradient(135deg, #7047eb, #5731c4);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(112, 71, 235, 0.35);
}

.exchange-trade-action.kucoin-theme {
    background: linear-gradient(135deg, #23af91, #16856d);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(35, 175, 145, 0.35);
}

.exchange-trade-action.bybit-theme {
    background: linear-gradient(135deg, #f7a600, #cc8800);
    color: #0c0e12;
    box-shadow: 0 4px 18px rgba(247, 166, 0, 0.35);
}

.exchange-trade-action.okx-theme {
    background: linear-gradient(135deg, #374151, #111827);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.exchange-trade-action.gateio-theme {
    background: linear-gradient(135deg, #e03131, #c92a2a);
    color: #ffffff;
    box-shadow: 0 4px 18px rgba(224, 49, 49, 0.35);
}

.exchange-trade-action.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(0.8);
}

