:root {
    /* Apple-like Top-Tier Design Variables */
    --bg-body: #f5f5f7;
    /* SF Pro Light Gray Surface */
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.72);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --text-primary: #1d1d1f;
    /* Apple Black */
    --text-secondary: #86868b;
    /* Apple Gray */
    --text-tertiary: #6e6e73;

    /* Accents */
    --accent-blue: #0071e3;
    /* SF Pro Blue */
    --accent-blue-dim: rgba(0, 113, 227, 0.1);
    --accent-green: #34c759;
    /* SF Pro Green */
    --accent-red: #ff3b30;
    /* SF Pro Red */
    --accent-orange: #ff9500;

    /* UI Elements */
    --border-light: rgba(0, 0, 0, 0.05);
    /* Ultra subtle */
    --border-highlight: rgba(0, 0, 0, 0.1);

    /* Shadows - The "Levitation" Effect */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Premium soft depth */
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    /* Floating elements */
    --shadow-glow: 0 0 20px rgba(0, 113, 227, 0.15);

    /* Animation */
    --ease-apple: cubic-bezier(0.25, 1, 0.5, 1);
    /* Smooth spring-like */

    /* Effects */
    --glass-blur: blur(20px);
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Layout */
    --max-width: 1000px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--text-tertiary) transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: content-box;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    line-height: 1.5;
    overflow-x: hidden;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

/* Material Symbols alignment */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
}

.app-container {
    max-width: 1440px;
    /* Increased max-width for 3 columns */
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 300px;
    gap: 0;
}

/* Sidebars */
/* Sidebars */
/* Sidebars */
.sidebar-right {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 32px 24px;
    /* Aligned with Main Header */
    background: transparent;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    border-left: 1px solid var(--border-color);
    border-right: none;
}

/* Sidebar Left handled in components.css for Premium Design */
.sidebar-left {
    display: flex;
    flex-direction: column;
    padding-top: 32px;
    /* Aligned with Headers */
}

.main-column {
    padding: 0 40px;
    overflow-y: auto;
    height: 100vh;
    overflow-x: hidden;
}

/* NEW: Tablet/iPad Media Query (769px - 1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
    .app-container {
        grid-template-columns: 250px minmax(0, 1fr) 190px !important;
        /* Left: 65px (icon only), Middle: flexible, Watchlist: 190px */
    }

    .sidebar-left {
        padding-top: 20px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .sidebar-right {
        padding: 18px 10px !important;
        /* Tight padding */
        display: block !important;
    }

    .main-column {
        padding: 0 48px !important;
        /* Tighter middle column padding */
    }

    .nav-item {
        padding: 10px 6px;
        justify-content: center;
    }
    
    /* Compress watchlist items */
    .watchlist-container {
        padding: 14px 10px;
    }
    
    .watchlist-header h3 {
        font-size: 14px;
    }
    
    .watchlist-item {
        padding: 9px 0;
        font-size: 13px;
    }
    
    /* Make stock table more compact */
    .clx-market-card {
        padding: 14px 16px;
    }
}


@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr;
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    /* Hide both on mobile for now */
    .main-column {
        padding: 0 20px;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
}

/* Utilities */
.text-green {
    color: var(--accent-green) !important;
}

.text-red {
    color: var(--accent-red) !important;
}

.text-orange {
    color: var(--accent-orange) !important;
}
/* Fundamental Analysis Charts */
.fund-charts-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 20px 0;
}

.fund-chart-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.fund-chart-analysis-desc {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
    line-height: 1.4;
    max-width: 90%;
}

.clx-loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--accent-blue);
    border-radius: 50%;
    animation: clx-spin 0.8s linear infinite;
}

@keyframes clx-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading Effect */
.clx-skeleton {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.03) 25%, rgba(0, 0, 0, 0.06) 50%, rgba(0, 0, 0, 0.03) 75%);
    background-size: 200% 100%;
    animation: clx-skeleton-shimmer 2s infinite linear;
    border-radius: 8px;
    color: transparent !important;
    pointer-events: none;
    user-select: none;
    display: inline-block;
    width: 100%;
    min-height: 1em;
}

@keyframes clx-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.clx-info-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    font-family: serif;
    font-style: italic;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.clx-info-icon:hover {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

.fund-chart-info-box {
    display: none;
    margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.05);
    border: 1px solid rgba(0, 113, 227, 0.1);
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    animation: clx-fade-in 0.3s ease;
}

.fund-chart-info-box.is-visible {
    display: block;
}

@keyframes clx-fade-in {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fund-chart-wrap {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 25px;
    transition: transform 0.2s ease;
}

.fund-chart-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.fund-chart-header {
    margin: 20px 0;
    text-align: center;
}

.fund-chart-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.fund-chart-data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.fund-data-item {
    text-align: center;
}

.fund-data-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--apple-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.fund-data-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.fund-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.fund-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.fund-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* Chart SVG Styles */
.clx-fund-bar {
    transition: height 0.3s ease, y 0.3s ease;
}

.clx-fund-bar:hover {
    filter: brightness(1.1);
}

/* --- Search Bar & Filters --- */
.clx-searchbar-container {
    position: relative;
    width: 100%;
}

.clx-filter-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 320px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    padding: 24px;
    z-index: 100;
    animation: clx-pop-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes clx-pop-in {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-text {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-text:hover {
    background: var(--accent-blue-dim);
}

.filter-group {
    margin-bottom: 18px;
}

.filter-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    gap: 8px;
}

.filter-options select {
    flex: 1;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
}

.filter-options select:focus {
    border-color: var(--accent-blue);
    background: #fff;
    box-shadow: 0 0 0 2px var(--accent-blue-dim);
}

.view-header {
    padding-top: 32px;
    /* Standardize alignment with sidebars */
    margin-bottom: 32px;
}

.dash-header-title {
    margin: 0;
    /* Reset margin, controlled by view-header padding */
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.dash-briefing {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    border: 1px solid rgba(0, 113, 227, 0.15);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 20px;
    /* Reduced from 40px */
    display: flex;
    gap: 24px;
    align-items: flex-start;
    box-shadow: 0 10px 40px rgba(0, 113, 227, 0.08);
}

.brief-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: var(--accent-blue);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 113, 227, 0.3);
}

.brief-content h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    /* Reduced from 18px */
    font-weight: 700;
    color: var(--text-primary);
}

.brief-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    /* Reduced from 15px */
    color: var(--text-secondary);
    line-height: 1.6;
}

.brief-meta {
    font-size: 11px;
    /* Reduced from 12px */
    color: var(--accent-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clx-searchbar {
    margin-top: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 10px 24px;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
}

.clx-searchbar:focus-within {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    box-shadow: 0 0 0 2px var(--accent-blue-dim);
}

.clx-searchbar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    font-family: var(--font-stack);
}

.clx-searchbar input::placeholder {
    color: var(--text-secondary);
}

.clx-filter-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}

.clx-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* --- List Items --- */
.clx-coverage {
    text-align: center;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 20px;
}

.clx-list {
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
    padding-left: 0;
    margin: 0;
}

/* --- GRID TABLE LAYOUT --- */
/* Common Grid Template */
.market-header,
.clx-row {
    display: grid;
    /* Increased Ticker width to 220px to push Profile towards center/right */
    grid-template-columns: 220px 2fr 1fr 1fr 1fr 100px 60px;
    align-items: center;
    padding: 0 30px;
    gap: 24px;
}

.market-header {
    margin-bottom: 12px;
    font-size: 10px;
    /* Reduced from 11px */
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-tertiary);
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

/* Header Specific Alignment */
.market-header>div:nth-child(3),
.market-header>div:nth-child(4),
.market-header>div:nth-child(5) {
    text-align: right;
}

.market-header>div:nth-child(6) {
    text-align: center;
}

.clx-row {
    padding: 16px 30px;
    /* Matched to header padding */
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 10px;
    transition: all 0.2s var(--ease-apple);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
}

/* --- WATCHLIST (REDESIGN) --- */
.clx-watchlist-container {
    padding-top: 40px;
}

.watchlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 0 8px;
}

.watchlist-header h3 {
    font-size: 11px;
    /* Reduced from 12px */
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
}

.watchlist-item {
    background: var(--bg-card);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.watchlist-item:hover {
    background: #ffffff;
    transform: scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    z-index: 10;
}

.watchlist-item.is-removing {
    animation: slideOutRight 0.3s var(--ease-apple) forwards;
}

.watchlist-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.wl-ticker {
    font-size: 15px;
    /* Reduced from 17px */
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.wl-price {
    font-size: 14px;
    /* Reduced from 16px */
    font-weight: 600;
    color: var(--text-primary);
    font-feature-settings: "tnum";
}

.wl-meta-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    /* Reduced from 13px */
    margin-bottom: 16px;
}

.wl-intr {
    color: var(--text-secondary);
}

.wl-val-text {
    font-weight: 600;
}

.wl-val-text.text-green {
    color: var(--accent-green);
}

.wl-val-text.text-red {
    color: var(--accent-red);
}

/* Progression Bar */
.wl-prog-track {
    height: 6px;
    /* Thicker bar */
    background: rgba(0, 0, 0, 0.04);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.wl-prog-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s var(--ease-apple);
}

.wl-prog-fill.green {
    background: var(--accent-green);
}

.wl-prog-fill.red {
    background: var(--accent-red);
}

/* Toast Notifications */
.clx-toast-container {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.clx-toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

@keyframes toastUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clx-toast.out {
    animation: toastDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastDown {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* Column Content Alignment */
.clx-row>div:nth-child(3),
.clx-row>div:nth-child(4),
.clx-row>div:nth-child(5) {
    text-align: right;
}

.clx-row>div:nth-child(6) {
    display: flex;
    justify-content: center;
}

.clx-row>div:nth-child(7) {
    display: flex;
    justify-content: flex-end;
}

/* Watchlist Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

.watchlist-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-apple);
    animation: slideInRight 0.4s var(--ease-apple) forwards;
    border: 1px solid transparent;
}

.watchlist-item.is-removing {
    animation: slideOutRight 0.3s var(--ease-apple) forwards;
}

.watchlist-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}


.clx-row {
    padding: 16px;
    /* Row has top/bottom padding */
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.2s var(--ease-apple), transform 0.2s var(--ease-apple);
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
}

.clx-row:hover {
    background: #ffffff;
    box-shadow: var(--shadow-md);
    transform: scale(1.005);
    z-index: 10;
}

/* Explicit scaling for Market Row Items */
.clx-ticker {
    font-size: 14px;
    /* Reduced from 15/16px */
    font-weight: 700;
}

.clx-name {
    font-size: 13px !important;
    /* Force override inline styles if any */
}

.clx-price {
    font-size: 14px;
    font-weight: 600;
    font-feature-settings: "tnum";
}

.clx-iv {
    font-size: 13px !important;
}

.clx-pill {
    font-size: 11px;
    /* Smaller pills */
    padding: 2px 8px;
}

/* Column Content Alignment */
.clx-row>div:nth-child(3),
/* Price */
.clx-row>div:nth-child(4),
/* IV */
.clx-row>div:nth-child(5)

/* Valuation */
    {
    text-align: right;
}

.clx-row>div:nth-child(6) {
    display: flex;
    justify-content: center;
}

/* Trend */

.cmp-ticker {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.cmp-sector {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.cmp-price {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
    margin-bottom: 4px;
}

.clx-ticker {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.clx-name {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.clx-price {
    font-weight: 600;
    font-size: 15px;
    font-feature-settings: "tnum";
}

/* Chips & Pills */
.clx-pill {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    background: var(--bg-body);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Sparklines */
.spark-container {
    width: 80px;
    height: 30px;
}

.spark-line {
    fill: none;
    stroke-width: 2;
    stroke: var(--accent-green);
    stroke-linecap: round;
    stroke-linejoin: round;
}

.spark-line.negative {
    stroke: var(--accent-red);
}

/* Actions */
.clx-actions .clx-act {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.clx-act:hover {
    background: var(--bg-body);
    color: var(--accent-blue);
}

.clx-act.is-active {
    background: var(--accent-blue-dim);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* --- OVERLAY --- */
#clx-ovl {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

#clx-ovl[aria-hidden="false"] {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.clx-ovl-dim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
}

.clx-ovl-card {
    position: relative;
    width: 95%;
    max-width: 1100px;
    height: 90vh;
    margin: auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Header */
.clx-ovl2-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
}

.clx-ovl2-ticker {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
}

.clx-ovl2-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.clx-ovl2-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.clx-ovl2-name {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.01em;
}

/* Close Button */
.clx-ovl-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.clx-ovl-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Tabs (Segmented Control) */
.clx-ovl2-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.clx-ovl2-hero {
    padding: 0 32px 32px 32px;
    flex-shrink: 0;
}

.clx-ovl2-tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px;
    border-radius: 14px;
    margin: 0 32px 24px 32px;
    /* Align with padding */
}

.clx-ovl2-tab {
    padding: 8px 24px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.3s var(--ease-apple);
}

.clx-ovl2-tab.is-active {
    background: #ffffff;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    /* Lifted pill */
}

/* Content Pages */
[id^="page-"] {
    padding: 0 32px 40px 32px;
    animation: fadeIn 0.4s var(--ease-apple);
}

.clx-ovl2-pages {
    margin-top: 20px;
}

.clx-ovl2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

.clx-ovl2-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
}

.clx-ovl2-box-h {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--accent-blue);
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.clx-ovl2-box-p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Radar */
.clx-ovl2-radar-wrap {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 32px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
    padding: 24px;
    margin-top: 20px;
    align-items: start;
    /* Align top so list flows down */
}

.clx-ovl2-mgrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.clx-ovl2-metric {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    grid-template-columns: 1fr;
}

.clx-ovl2-radar {
    justify-self: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Main Layout --- */
.main-layout {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    /* Wider sidebars for breathing room */
    height: 100vh;
    width: 100vw;
}

/* --- SIDEBAR LEFT (Navigation) --- */
.sidebar-left {
    background-color: var(--bg-body);
    /* Seamless blend */
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    /* No border-right, using space to separate */
}

.logo-area {
    font-size: 24px;
    /* Increased from 20px */
    font-weight: 700;
    margin-bottom: 40px;
    padding-left: 12px;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    cursor: pointer;
    /* Clickable */
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
    /* Tighter vertical rhythm */
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    /* Softer pill shape */
    transition: all 0.3s var(--ease-apple);
    justify-content: flex-start;
}

.nav-item:hover {
    background-color: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.nav-item.is-active {
    background-color: #e8e8ed;
    /* Subtle active state, not blue */
    color: var(--text-primary);
    /* Dark text */
    font-weight: 600;
}

.nav-item .material-symbols-outlined {
    font-size: 20px;
    /* Icons are naturally sized */
    .nav-item span:last-child {
       flex: 1;
       text-align: left;
   }
}

/* --- Sidebar Watchlist --- */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.sidebar-header h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    margin: 0;
}

.watchlist-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.watchlist-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.watchlist-item:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.watchlist-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.wl-ticker {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.wl-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.wl-change {
    font-size: 12px;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
    border: 1px dashed var(--border-color);
    border-radius: 12px;
}

/* --- DASHBOARD VIEW (Bento Layout) --- */
.view-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.view-header h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
}

.view-date {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Bento Grid System */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    /* Flexible rows */
    gap: 24px;
    padding-bottom: 40px;
}

/* Generic Bento Card */
.dash-card {
    background: var(--bg-card);
    border-radius: 24px;
    /* Super rounded Apple style */
    padding: 24px;
    box-shadow: var(--shadow-md);
    /* Soft levitation */
    transition: transform 0.3s var(--ease-apple), box-shadow 0.3s var(--ease-apple);
    border: 1px solid rgba(255, 255, 255, 0.5);
    /* Subtle inner light border for depth */
}

.dash-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Morning Briefing: Large Hero Card */
.dash-briefing {
    grid-column: span 3;
    /* Full width */
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.brief-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(0, 113, 227, 0.25);
}

.brief-content h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
}

.brief-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
    max-width: 600px;
}

.brief-meta {
    margin-top: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-blue);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Indices: Mini Cards Row (Now inside grid) */
.dash-indices {
    grid-column: span 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.index-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    background: var(--bg-card);
    /* Ensure solid background for contrast */
}

.idx-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.idx-val {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.idx-change {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Top Movers & Sentiment */
/* Top Movers - Span 2 columns */
.dash-movers {
    grid-column: span 2;
}

.dash-movers h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 20px;
}

.mover-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mover-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 15px;
}

.mover-list li:last-child {
    border-bottom: none;
}

.t-tick {
    font-weight: 600;
    color: var(--text-primary);
}

.t-val {
    font-weight: 600;
}

/* AI Sentiment - Span 1 column */
.dash-ai {
    grid-column: span 1;
    background: linear-gradient(180deg, #ffffff 0%, #f9f9f9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.ai-meter {
    margin: 20px 0;
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ai-meter .material-symbols-outlined {
    font-size: 48px;
    color: var(--accent-blue);
    margin-bottom: 8px;
}

.ai-score {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-blue);
}

.ai-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}


@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {

    .dash-indices,
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

/* --- VISUAL FINANCIALS --- */
.clx-fin-bar-bg {
    fill: var(--accent-blue-dim);
    /* Revenue (Light) */
    transition: all 0.5s var(--ease-apple);
}

.clx-fin-bar-bg:hover {
    fill: rgba(0, 113, 227, 0.2);
}

.clx-fin-bar-fg {
    fill: var(--accent-blue);
    /* Net Income (Solid) */
    transition: all 0.5s var(--ease-apple);
}

.clx-fin-bar-fg:hover {
    fill: #005bb5;
}

#clx-fin-chart {
    overflow: visible;
}

/* Fear & Greed Gauge */
.clx-gauge-container {
    position: relative;
    width: 140px;
    height: 70px;
    margin: 20px auto 10px;
    overflow: hidden;
}

.clx-gauge-arc {
    width: 140px;
    height: 140px;
    background: conic-gradient(from 180deg at 50% 50%,
            var(--accent-red) 0deg 36deg,
            #ff7b7b 36deg 72deg,
            #ffe600 72deg 108deg,
            #b4ff00 108deg 144deg,
            var(--accent-green) 144deg 180deg);
    border-radius: 50%;
    transform: rotate(-90deg);
}

.clx-gauge-mask {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 100px;
    height: 100px;
    background: #ffffff;
    border-radius: 50%;
}

.clx-gauge-needle {
    position: absolute;
    bottom: 0px;
    left: 50%;
    width: 4px;
    height: 60px;
    background: var(--text-primary);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-45deg);
    border-radius: 4px;
    z-index: 10;
    transition: transform 1s cubic-bezier(0.4, 2, 0.55, 0.44);
}

.clx-gauge-needle::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--text-primary);
    border-radius: 50%;
}

.clx-gauge-score {
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: -10px;
}

/* Overlay Quick Grid (Apple Style Columns) */
.clx-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.clx-quick-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.clx-quick-label {
    font-size: 13px;
    color: var(--text-tertiary);
    /* Light gray */
    margin-bottom: 6px;
    font-weight: 500;
}

.clx-quick-val {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.clx-sector-label {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-left: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border-color);
}

.clx-ovl2-icon.watching {
    background: var(--accent-blue);
    color: white;
}

/* --- PREMIUM SIDEBAR NAVIGATION --- */
.sidebar-left {
    background: rgba(255, 255, 255, 0.4);
    /* Vibrant translucency */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Spacing between pills */
    margin-top: 40px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 0 12px;
    /* Float the pill inside the sidebar */
    border-radius: 16px;
    /* Pill shape */
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-decoration: none;
    background: transparent;
}

/* Hover State */
.nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    transform: translateX(2px);
}

/* Active State - Floating Pill */
.nav-item.is-active {
    background: rgba(0, 113, 227, 0.08);
    /* Subtle blue tint */
    color: var(--accent-blue);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.05);
    /* Soft float */
}

.nav-item .material-symbols-outlined {
    font-size: 20px;
    transition: color 0.2s ease;
}

.nav-item.is-active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500;
    /* Fill icon on active */
}

.logo-area {
    padding: 0 28px;
    /* Align with nav items margin */
    font-size: 24px;
    /* Increased from 18px */
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    height: 40px;
    /* Reduced from 64px for alignment */
    cursor: pointer;
    /* Clickable */
    /* Vertical rhythm */
}

/* --- NEWS: BE RIGHT BACK --- */
.clx-brb-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80vh;
    /* Centered in main view */
    text-align: center;
    color: #f5f5f7;
    /* Apple off-white */
}

#view-news {
    background: #000000;
    border-radius: 24px;
    padding: 40px;
    margin-top: 24px;
    /* Align with layout */
    /* Ensure it fills the space appropriately */
    min-height: calc(100vh - 48px);
}

.clx-brb-logo {
    width: 140px;
    /* Increased from 64px */
    height: auto;
    margin-bottom: 24px;
    /* Reduced to bring things closer */
    animation: pulseLogo 3s infinite ease-in-out;
}

.clx-brb-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 6px 0;
    /* Reduced from 12px for tighter spacing */
    letter-spacing: -0.02em;
    color: #f5f5f7;
}

.clx-brb-msg {
    font-size: 19px;
    /* Slightly larger for emphasis */
    color: var(--accent-blue);
    /* Apple Blue as requested */
    font-weight: 500;
}

@keyframes pulseLogo {
    0% {
        opacity: 0.5;
        transform: scale(0.98);
    }

    50% {
        opacity: 1;
        transform: scale(1.02);
    }

    100% {
        opacity: 0.5;
        transform: scale(0.98);
    }
}

/* --- VALUATION OVERLAY TAB (Vertical Stack) --- */
.clx-val-model {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding: 2px 0;
    /* Minimized vertical padding */
}

/* 1. Top Section: Fair Value Hero */
.val-result {
    padding: 0 0 16px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.val-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.val-big-num {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.val-sub {
    font-size: 15px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* 2. Middle Section: Sliders */
.val-controls {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.val-control-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.val-control-group label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.val-control-group label span {
    color: var(--accent-blue);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Refined Accessibile Sliders */
.clx-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.05);
    /* Track */
    border-radius: 4px;
    outline: none;
}

.clx-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    /* Floating Thumb */
    cursor: pointer;
    transition: transform 0.1s ease;
}

.clx-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 3. Footer: Methodology */
.val-explainer {
    margin-top: 12px;
    padding: 24px;
    background: #fbfbfd;
    /* Apple 'secondary system background' light */
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.val-explainer h4 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- OVERLAY METRICS GRID --- */
.clx-ovl2-metric {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--bg-card);
}

.clx-ovl2-chip-k {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.clx-metric-row {
    display: flex;
    gap: 20px;
}

.clx-metric-val-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clx-metric-period {
    font-size: 9px;
    font-weight: 700;
    color: var(--apple-sub);
    text-transform: uppercase;
}

.clx-metric-num {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* --- PREMIUM SMART TOOLTIPS --- */
.clx-tooltip-trigger {
    position: relative;
    cursor: help;
    text-decoration: underline dotted var(--text-tertiary);
    text-underline-offset: 3px;
    width: fit-content;
}

.clx-tooltip-trigger:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: 220px;
    background: rgba(40, 40, 40, 0.95);
    /* Dark tooltip for contrast */
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
    line-height: 1.4;
    text-transform: none;
    /* Reset uppercase */
}

.clx-tooltip-trigger:hover::before {
    /* Arrow */
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 6px solid transparent;
    border-top-color: rgba(40, 40, 40, 0.95);
    opacity: 0;
    animation: fadeInTooltip 0.2s forwards;
}

@keyframes fadeInTooltip {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(-8px);
    }
}

/* --- OVERLAY TABS (iOS Segmented Control) --- */
.clx-ovl2-tabs {
    background: var(--bg-secondary);
    /* or rgba(118, 118, 128, 0.12) for Apple gray */
    padding: 4px;
    border-radius: 9px;
    display: inline-flex;
    gap: 0;
    margin-bottom: 24px;
}

.clx-seg-btn {
    background: transparent;
    border: none;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    min-width: 80px;
    text-align: center;
}

.clx-seg-btn:hover {
    color: var(--text-primary);
}

.clx-seg-btn.is-active {
    background: var(--bg-card);
    /* White in light, Dark Gray in dark */
    color: var(--text-primary);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 3px 1px rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

/* Period Toggle */
.clx-ovl2-period-toggle {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    padding: 3px;
    border-radius: 10px;
}

.clx-period-btn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    border-radius: 7px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    transition: all 0.2s;
}

.clx-period-btn.active {
    background: var(--bg-card);
    color: var(--accent-blue);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Split Sentiment */
.clx-mini-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 2px;
    width: 100%;
}

.clx-mini-row .l {
    color: var(--text-tertiary);
    font-weight: 500;
}

.clx-mini-row .v {
    font-weight: 600;
    color: var(--text-primary);
}

.clx-mini-row .v.text-green {
    color: var(--accent-green);
}

.clx-mini-row .v.text-red {
    color: var(--accent-red);
}

/* --- THESIS JOURNAL (Premium Writer) --- */
.thesis-container {
    padding: 8px 4px;
    animation: fadeIn 0.3s ease-out;
}

.thesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.thesis-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.thesis-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.thesis-editor-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-highlight);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.thesis-editor-wrap:focus-within {
    border-color: var(--accent-blue-dim);
    box-shadow: 0 0 0 4px var(--accent-blue-dim);
}

#thesis-input {
    width: 100%;
    min-height: 240px;
    border: none;
    background: transparent;
    resize: vertical;
    outline: none;
    font-family: var(--font-primary);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

#thesis-input::placeholder {
    color: var(--text-tertiary);
    opacity: 0.6;
}

.thesis-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.clx-btn-primary {
    background: var(--text-primary);
    /* Black/Dark Gray */
    color: var(--bg-card);
    /* White */
    border: none;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.1s ease, opacity 0.2s;
}

.clx-btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.clx-btn-primary:active {
    transform: scale(0.98);
}

/* Thesis History List */
.thesis-history {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.thesis-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 14px;
    animation: slideDown 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thesis-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thesis-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.thesis-card-date {
    font-weight: 500;
}

.thesis-card-del {
    cursor: pointer;
    font-size: 16px;
    color: var(--text-tertiary);
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    /* Fix alignment */
}

.thesis-card-del:hover {
    color: var(--accent-red);
}

.thesis-card-body {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    /* Preserve line breaks */
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- PREMIUM SIDEBAR (Glass + Floating Pills) --- */
.sidebar-left {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 260px;
    background: rgba(245, 245, 247, 0.65);
    /* More translucent for glass effect */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
    /* Very subtle border */
    padding: 32px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.clx-logo-small {
    margin-bottom: 32px;
    padding-left: 12px;
    /* Opacity transition for hover effects if added later */
    transition: opacity 0.2s;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    /* Tighter padding for pill shape */
    margin-bottom: 4px;
    border-radius: 12px;
    /* Smooth corners */
    color: var(--text-secondary);
    /* Gray default */
    font-weight: 500;
    font-size: 14px;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    /* Apple Ease */
    position: relative;
    text-decoration: none;
    /* Ensure no underline */
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
    transform: translateX(2px);
    /* Subtle nudges */
}

/* Active State: Floating Pill */
.nav-item.is-active {
    background: white;
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.02);
    /* Soft elevation */
    font-weight: 600;
    transform: translateY(-1px);
    /* Lift up */
}

.nav-item.is-active .material-symbols-outlined {
    color: var(--accent-blue);
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.nav-item .material-symbols-outlined {
    font-size: 20px;
    transition: color 0.3s;
    color: inherit;
}

/* --- SMART COMPARISON --- */
.cmp-container {
    padding-top: 24px;
    max-width: 1200px;
}

.cmp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}


/* --- Professional Comparison Table --- */

/* Controls */
.cmp-controls {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 32px;
}

.cmp-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    /* More square */
    padding: 8px 12px;
    width: 280px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    position: relative;
    /* Anchor for dropdown */
    z-index: 200;
    /* Above grid */
}

.cmp-search-box:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px var(--accent-blue-dim);
}

.cmp-results-dropdown {
    position: absolute;
    top: 110%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    /* Hidden by default */
    flex-direction: column;
}

.cmp-search-row {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.1s;
}

.cmp-search-row:last-child {
    border-bottom: none;
}

.cmp-search-row:hover {
    background: var(--bg-surface);
}

.cmp-search-row .sub {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
}

.cmp-search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    color: var(--text-primary);
    font-weight: 500;
}

.cmp-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cmp-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.cmp-chip:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: #FFF5F5;
}

/* Grid / Table Layout */
.cmp-grid {
    display: grid;
    /* Label Col (180px) + Dynamic Columns */
    grid-template-columns: 180px repeat(auto-fit, minmax(200px, 1fr));
    align-items: stretch;
    border-top: 1px solid var(--border-light);
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    /* Fixed: Allow scrolling */
    overflow-y: hidden;
    padding-bottom: 8px;
    /* Space for scrollbar */
}

/* Column Wrapper */
.cmp-col {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-light);
    position: relative;
    background: white;
}

.cmp-col:last-child {
    border-right: none;
}

/* Overall Winner Highlight */
.cmp-col.is-winner {
    background: linear-gradient(to bottom, #F9FCFF, #fff);
    position: relative;
}

.cmp-col.is-winner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-blue);
    /* Professional Blue Highlight */
    z-index: 2;
}

/* Header Section */
.cmp-header-cell {
    padding: 24px 20px;
    height: 140px;
    /* Fixed height for header */
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    text-align: center;
}

.cmp-ticker {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.cmp-price {
    font-size: 15px;
    color: var(--text-tertiary);
    font-weight: 500;
    font-family: 'Roboto Mono', monospace;
}

.cmp-verdict {
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-blue);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    align-self: center;
    text-transform: uppercase;
}

/* Metric Rows */
.cmp-metric-box {
    padding: 16px 20px;
    height: 80px;
    /* Consistent row height */
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.cmp-metric-val {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cmp-metric-val.winner {
    color: var(--accent-green);
    font-weight: 700;
}

.cmp-metric-val.winner::after {
    content: 'check_circle';
    font-family: 'Material Symbols Outlined';
    font-size: 16px;
    font-weight: normal;
}

/* Smaller Bars */
.cmp-visual-bar {
    height: 4px;
    background: var(--bg-surface);
    border-radius: 2px;
    width: 100%;
    overflow: hidden;
}

.cmp-visual-fill {
    height: 100%;
    background: var(--text-tertiary);
    /* Neutral gray default */
    border-radius: 2px;
}

.cmp-metric-val.winner~.cmp-visual-bar .cmp-visual-fill {
    background: var(--accent-green);
    /* Green fill for winners */
}

/* Labels Column */
.cmp-label-col {
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
}

.cmp-label-header {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-tertiary);
    font-weight: 600;
    padding: 20px;
    text-align: right;
}

.cmp-label-item {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.cmp-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.cmp-empty .icon {
    font-size: 48px;
    opacity: 0.3;
}

/* Comparison Rows */
/* Stock Column */
.cmp-card-header.is-gold {
    border: 1px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.2), 0 10px 30px rgba(255, 215, 0, 0.15);
    background: linear-gradient(to bottom, #FFFBED, #FFF);
    z-index: 2;
    transform: translateY(-2px);
}



/* Winner Badge */
.cmp-winner {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-green);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
    z-index: 2;
    text-transform: uppercase;
    margin-top: 6px;
    overflow: hidden;
    width: 100%;
}

.cmp-visual-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 2px;
}

/* Intrinsic Value Badge */
.clx-iv-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 1px 4px;
    margin-left: 6px;
    vertical-align: middle;
    cursor: help;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    top: -1px;
    transition: all 0.2s ease;
}

.clx-iv-badge:hover {
    color: var(--accent-blue);
    border-color: var(--accent-blue);
    background: rgba(0, 113, 227, 0.05);
}

/* Market List Footer */
.clx-market-footer {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 0 60px;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.clx-market-footer:hover {
    opacity: 1;
    color: var(--accent-blue);
}

/* Fear & Greed Gauge */
.fg-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.fg-val {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: -40px;
}

.fg-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-top: 4px;
}

/* --- Radar Tooltip --- */
.clx-radar-label {
    cursor: help;
    transition: fill 0.2s;
}

.clx-radar-label:hover {
    fill: var(--accent-blue);
    font-weight: 700;
}

#clx-radar-tooltip {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 12px;
    width: 200px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    pointer-events: none;
    font-size: 11px;
    line-height: 1.5;
    color: var(--text-primary);
    opacity: 0;
    transition: opacity 0.2s;
    transform: translate(-50%, -100%);
    /* Center above cursor roughly */
    margin-top: -10px;
}

#clx-radar-tooltip strong {
    display: block;
    margin-bottom: 4px;
    color: var(--accent-blue);
    font-size: 12px;
}

.fg-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.fg-needle {
    transition: transform 1s ease-out;
    transform-origin: 100px 100px;
}

/* Business Pills/Chips in Overlay */
.clx-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--bg-secondary);
    /* System Gray 6 */
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* Comparison Business List */
.cmp-biz-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 6px 0 8px;
}

.cmp-biz-list span {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

/* --- News BRB Screen (Apple Design) --- */
.clx-news-brb-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
    width: 100%;
}

.clx-news-brb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #000000;
    padding: 80px 40px;
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    border: none;
}

.clx-news-logo {
    width: 160px;
    height: auto;
    margin-bottom: 32px;
    animation: clx-breathe 4s ease-in-out infinite;
}

.clx-news-brb-card h2 {
    font-size: 40px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 16px 0;
    letter-spacing: -0.02em;
}

.clx-news-brb-card p {
    font-size: 19px;
    color: #0A84FF;
    line-height: 1.5;
    margin: 0;
}

@keyframes clx-breathe {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* --- Valuation Badge --- */
.clx-valuation-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(0, 113, 227, 0.04);
    border: 1px solid rgba(0, 113, 227, 0.08);
    border-radius: 99px;
    font-size: 9px;
    font-weight: 500;
    color: var(--accent-blue);
    letter-spacing: 0.02em;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: none;
    /* Keep natural case for the method name */
    transition: all 0.2s var(--ease-apple);
}

.clx-valuation-badge:hover {
    background: rgba(0, 113, 227, 0.08);
    transform: translateY(-1px);
}

/* --- Company Health List (Redesign) --- */
.clx-health-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 20px;
}

.clx-health-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.clx-health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.clx-health-score {
    font-family: var(--font-mono);
    color: var(--text-secondary);
}

.clx-health-bar-bg {
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.clx-health-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--accent-blue);
    width: 0%;
    transition: width 1s var(--ease-apple);
}

.clx-health-desc {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Gemini Branding Badge */
.clx-gemini-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 100px;
    width: fit-content;
    margin: 32px auto 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
    animation: clx-fade-in 0.8s ease;
}

.clx-gemini-badge:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(66, 133, 244, 0.2);
}

.clx-gemini-logo {
    width: 20px;
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clx-gemini-icon {
    width: 100%;
    height: 100%;
}

.clx-gemini-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #4285F4 0%, #9171FF 50%, #FF719A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.clx-ai-disclaimer {
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: 32px;
    opacity: 0.6;
    font-weight: 400;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

/* Starlight Shimmer Animation */
.clx-gemini-logo::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    animation: clx-gemini-sparkle 6s infinite ease-in-out;
    pointer-events: none;
}

@keyframes clx-gemini-sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.4) rotate(0deg);
    }

    15% {
        opacity: 0.6;
        transform: scale(1.3) rotate(45deg);
    }

    30% {
        opacity: 0;
        transform: scale(0.4) rotate(90deg);
    }
}
