/* ========================================
   Financial Data Aggregator - Styles
   Inspired by roic.ai modern design
   ======================================== */

/* CSS Variables */
:root {
    /* Colors */
    --color-bg-primary: #0a0e14;
    --color-bg-secondary: #181c22;
    --color-bg-card: #1c2026;
    --color-bg-card-hover: #262a31;

    --color-text-primary: #dfe2eb;
    --color-text-secondary: #c2c6d6;
    --color-text-muted: #8c909f;

    --color-accent-primary: #4d8eff;
    --color-accent-secondary: #adc6ff;
    --color-accent-glow: rgba(173, 198, 255, 0.24);
    --color-accent-primary-hover: #adc6ff;

    --color-positive: #4edea3;
    --color-negative: #ffb4ab;
    --color-warning: #f3c969;

    --color-border: #424754;
    --color-border-light: rgba(255, 255, 255, 0.08);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #adc6ff 0%, #7aa2ff 45%, #4d8eff 100%);
    --gradient-bg: linear-gradient(180deg, #0a0e14 0%, #10141a 100%);
    --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-display: 'Manrope', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--color-accent-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    color: var(--color-text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-primary);
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-md) 0;
}

.navbar-marketing {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1100;
    padding: 0;
    background: rgba(10, 14, 20, 0.6);
    backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(66, 71, 84, 0.18);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
}

.nav-container-marketing {
    max-width: 1536px;
    height: 5rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.nav-brand-group {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.logo-mark {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: linear-gradient(135deg, rgba(91, 155, 255, 0.16) 0%, rgba(47, 111, 237, 0.10) 100%);
    border: 1px solid rgba(91, 155, 255, 0.32);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.nav-logo:hover .logo-mark {
    background: linear-gradient(135deg, rgba(91, 155, 255, 0.26) 0%, rgba(47, 111, 237, 0.16) 100%);
    border-color: rgba(91, 155, 255, 0.5);
    transform: scale(1.05);
}

.logo-bar {
    width: 5px;
    border-radius: 2px;
    background: var(--gradient-primary);
    transition: all var(--transition-base);
}

.logo-bar.bar-1 {
    height: 40%;
}

.logo-bar.bar-2 {
    height: 70%;
}

.logo-bar.bar-3 {
    height: 100%;
}

.nav-logo:hover .logo-bar.bar-1 {
    height: 55%;
}

.nav-logo:hover .logo-bar.bar-2 {
    height: 80%;
}

.nav-logo:hover .logo-bar.bar-3 {
    height: 100%;
}

.nav-search {
    flex: 1;
    max-width: 400px;
}

.nav-links-marketing {
    /* Visible by default via `.nav-links { display: flex }`; the mobile
       hamburger collapse hides this row below 1100px (see the
       `max-width: 1099.98px` block). A plain `display: none` here does NOT
       work — `.nav-links` (later in the file, equal specificity) wins the
       cascade and re-shows it, which is exactly how the links leaked back
       into the top bar alongside the hamburger. */
    align-items: center;
    gap: 2.5rem;
}

.nav-links-actions {
    gap: 2rem;
}

.nav-link-muted {
    opacity: 0.8;
}

@media (min-width: 1100px) {
    .nav-links-marketing {
        display: flex;
    }
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-container.large .search-input {
    padding: var(--spacing-md) var(--spacing-lg);
    padding-left: 3rem;
    font-size: var(--font-size-base);
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    font-size: var(--font-size-lg);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--spacing-xs);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    max-height: 300px;
    overflow-y: auto;
    display: none;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:hover {
    background: var(--color-bg-card-hover);
}

.search-result-ticker {
    font-weight: 600;
    color: var(--color-accent-secondary);
}

.search-result-name {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.navbar-marketing .nav-link {
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8c909f;
}

.navbar-marketing .nav-link:hover {
    color: #adc6ff;
    background: transparent;
}

.nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.7rem 1.1rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #adc6ff 0%, #7aa2ff 45%, #4d8eff 100%);
    color: #081120;
    font-size: var(--font-size-sm);
    font-weight: 800;
    letter-spacing: 0.04em;
    box-shadow: 0 14px 32px rgba(77, 142, 255, 0.18);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.navbar-marketing .nav-btn {
    min-height: 3.25rem;
    padding: 0.875rem 2rem;
    border-radius: 0.75rem;
    background: #4d8eff;
    color: #00285d;
    box-shadow: 0 24px 48px rgba(77, 142, 255, 0.18);
    font-size: 0.875rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-btn:hover {
    color: #081120;
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(77, 142, 255, 0.24);
}

.navbar-marketing .nav-btn:hover {
    background: #adc6ff;
    color: #001a42;
}

.ad-banner {
    border-bottom: 1px solid var(--color-border);
    background: rgba(99, 102, 241, 0.08);
}

.ad-banner-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.ad-label {
    display: inline-block;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: var(--color-accent-secondary);
}

.ad-copy {
    flex: 1;
}

.ad-link {
    color: var(--color-accent-secondary);
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .ad-banner-inner {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .ad-copy {
        min-width: 100%;
    }
}

@media (max-width: 980px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: relative;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .app-sidebar-frame {
        border-radius: 1.25rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        height: auto;
        padding: 0.75rem;
    }

    .app-sidebar-nav,
    .app-sidebar-footer {
        flex-direction: row;
        flex-wrap: wrap;
        width: auto;
    }

    .app-sidebar-spacer {
        display: none;
    }
}

/* ========================================
   Main Content
   ======================================== */
.main-content {
    min-height: calc(100vh - 200px);
}

.marketing-body {
    background: var(--gradient-bg);
}

.app-body {
    background: var(--color-bg-primary);
}

.app-layout {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 0.85rem;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.98) 0%, rgba(8, 11, 18, 1) 100%);
    border-right: 1px solid rgba(173, 198, 255, 0.05);
}

.app-sidebar-frame {
    position: relative;
    height: 100%;
    border-radius: 1.75rem;
    padding: 0.95rem 0.55rem 0.75rem;
    background: linear-gradient(180deg, rgba(18, 26, 40, 0.95) 0%, rgba(10, 14, 20, 0.96) 55%, rgba(8, 11, 18, 0.98) 100%);
    border: 1px solid rgba(173, 198, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 24px 60px rgba(0, 0, 0, 0.22);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    overflow: hidden;
}

.app-sidebar-frame::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 8%, rgba(77, 142, 255, 0.18), transparent 28%), radial-gradient(circle at 50% 100%, rgba(173, 198, 255, 0.07), transparent 32%);
    pointer-events: none;
}

.app-sidebar-top {
    padding: 0.1rem 0 0.25rem;
}

.app-rail-logo {
    position: relative;
    z-index: 1;
    width: 2.8rem;
    height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(173, 198, 255, 0.08);
    border: 1px solid rgba(173, 198, 255, 0.14);
    color: #eef4ff;
    font-family: var(--font-family-display);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.06em;
    box-shadow: 0 10px 26px rgba(77, 142, 255, 0.14);
}

.app-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
    align-items: center;
}

.app-sidebar-nav-icons {
    margin-top: 0.35rem;
}

.app-nav-icon {
    position: relative;
    z-index: 1;
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    color: #90a0bd;
    border: 1px solid transparent;
    background: transparent;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.app-nav-icon .material-symbols-outlined {
    font-size: 1.3rem;
}

.app-nav-icon:hover,
.app-nav-icon.active {
    color: #dce8ff;
    background: linear-gradient(180deg, rgba(77, 142, 255, 0.16) 0%, rgba(173, 198, 255, 0.06) 100%);
    border-color: rgba(173, 198, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 24px rgba(77, 142, 255, 0.12);
}

.app-nav-icon-muted {
    color: #8c909f;
}

.app-nav-icon-accent {
    color: #eaf2ff;
    background: linear-gradient(180deg, rgba(77, 142, 255, 0.22) 0%, rgba(173, 198, 255, 0.08) 100%);
    border-color: rgba(173, 198, 255, 0.2);
}

.app-sidebar-spacer {
    flex: 1;
}

.app-sidebar-footer {
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
}

.app-sidebar-footer-icons {
    width: 100%;
}

.app-main-content {
    min-height: 100vh;
    padding: 1rem 0 2rem;
    background: radial-gradient(circle at top right, rgba(173, 198, 255, 0.06), transparent 28%), var(--color-bg-primary);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-3xl);
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-3xl) var(--spacing-xl);
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-full);
    font-size: var(--font-size-sm);
    color: var(--color-accent-secondary);
    margin-bottom: var(--spacing-lg);
}

.hero-title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--spacing-lg);
}

.gradient-text {
    display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--color-text-secondary);
    max-width: 500px;
    margin-bottom: var(--spacing-xl);
}

.hero-search {
    margin-bottom: var(--spacing-lg);
}

.hero-examples {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.examples-label {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.example-link {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.example-link:hover {
    color: var(--color-text-primary);
    border-color: var(--color-accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.hero-visual {
    display: flex;
    justify-content: center;
}

.metrics-preview {
    width: 100%;
    max-width: 400px;
}

.preview-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-glow);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.preview-title {
    font-weight: 600;
    color: var(--color-text-primary);
}

.preview-badge {
    font-size: var(--font-size-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-positive);
    border-radius: var(--radius-full);
}

.preview-metrics {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.metric-item:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.metric-value {
    font-weight: 600;
    font-size: var(--font-size-base);
}

.metric-value.positive {
    color: var(--color-positive);
}

.metric-value.negative {
    color: var(--color-negative);
}

.metric-value.na {
    color: var(--color-text-muted);
}

/* ========================================
   Features Section
   ======================================== */
.features {
    background: var(--color-bg-secondary);
    padding: var(--spacing-3xl) 0;
}

.features-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.section-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all var(--transition-base);
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.feature-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.feature-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* ========================================
   Metrics Showcase
   ======================================== */
.metrics-showcase {
    padding: var(--spacing-3xl) 0;
}

.showcase-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.metric-category {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.category-title {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-accent-secondary);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.metric-list {
    list-style: none;
}

.metric-list li {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) 0;
}

/* ========================================
   Featured Companies
   ======================================== */
.featured {
    background: var(--color-bg-secondary);
    padding: var(--spacing-3xl) 0;
}

.featured-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.featured-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-base);
    display: block;
}

.featured-card:hover {
    transform: translateY(-2px);
    border-color: var(--color-accent-primary);
    background: var(--color-bg-card-hover);
}

.company-ticker {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-accent-secondary);
    margin-bottom: var(--spacing-xs);
}

.company-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-sector {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Featured Card with Price */
.featured-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.featured-card-header .company-ticker {
    margin-bottom: 0;
}

.company-price {
    text-align: right;
}

.price-value {
    display: block;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-text-primary);
}

.price-change {
    display: block;
    font-size: var(--font-size-xs);
    margin-top: 2px;
}

/* Price color classes - used across the app */
.price-up {
    color: #10b981;
}

.price-down {
    color: #ef4444;
}

.price-neutral {
    color: var(--color-text-secondary);
}

/* ========================================
   CTA Section
   ======================================== */
.cta {
    padding: var(--spacing-3xl) 0;
    text-align: center;
}

.cta-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.cta-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.cta-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
}

.cta-button {
    display: inline-block;
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    color: var(--color-text-primary);
    font-weight: 600;
    font-size: var(--font-size-base);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.cta-button:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
    color: var(--color-text-primary);
}

/* ========================================
   Company Page
   ======================================== */
.company-page {
    max-width: 1536px;
    margin: 0 auto;
    padding: 1.5rem 2.5rem 2rem;
}


/* ========================================
   Company Header Redesign
   ======================================== */
.company-header-redesign {
    margin-bottom: 1.5rem;
    padding: 1.35rem;
    border-bottom: 0;
    border-radius: 2rem;
}

.header-breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--color-text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.breadcrumb-item {
    color: var(--color-text-secondary);
}

.breadcrumb-separator {
    color: var(--color-text-muted);
    font-size: 0.5rem;
}

.sync-freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: var(--font-size-xs);
    font-weight: 500;
    white-space: nowrap;
}

.sync-freshness-badge .sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.sync-freshness-badge.fresh {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

.sync-freshness-badge.fresh .sync-dot {
    background: #10b981;
}

.sync-freshness-badge.aging {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
}

.sync-freshness-badge.aging .sync-dot {
    background: #f59e0b;
}

.sync-freshness-badge.stale {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.sync-freshness-badge.stale .sync-dot {
    background: #ef4444;
}

.header-main-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--spacing-xl);
}

.company-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: 1rem;
    align-items: stretch;
}

.company-hero-main,
.company-hero-side {
    display: flex;
    flex-direction: column;
}

.company-hero-main {
    justify-content: space-between;
}

.company-eyebrow {
    color: var(--color-text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 0.7rem;
}

.company-trust-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.company-trust-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #d4d9e5;
    font-size: 0.78rem;
}

.company-hero-side {
    gap: 0.8rem;
}

.company-price-card,
.company-mini-stats {
    background: rgba(10, 14, 20, 0.64);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.15rem;
    padding: 0.8rem 0.9rem;
}

.company-side-label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 0.65rem;
}

.company-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.company-actions-clean {
    margin-top: auto;
}

.company-identity {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.company-identity-clean {
    align-items: flex-start;
}

.company-titles {
    display: flex;
    flex-direction: column;
}

.company-titles-clean {
    max-width: 44rem;
}

.company-name-large {
    font-family: var(--font-family-display);
    font-size: clamp(2.1rem, 3.4vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.0;
    margin-bottom: 0.45rem;
    color: var(--color-text-primary);
    max-width: 16ch;
}

.company-meta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1rem;
}

.company-ticker-text {
    font-weight: 600;
    color: var(--color-text-secondary);
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

.exchange-text {
    color: var(--color-text-muted);
}

.header-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-lg);
}

.header-stats-row {
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-2xl);
}

.stat-group {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-value-large {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: baseline;
    gap: var(--spacing-xs);
}

.stat-value-large .currency {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    font-weight: 500;
}

.stat-change {
    font-size: var(--font-size-lg);
    font-weight: 500;
}

.positive {
    color: var(--color-positive);
}

.negative {
    color: var(--color-negative);
}

.key-stats-grid {
    display: flex;
    gap: var(--spacing-xl);
}

.key-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.key-stat-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.key-stat-label {
    font-size: 0.64rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    margin-top: 0.35rem;
}

/* Price Loading States */
.price-loading {
    color: var(--color-text-muted);
    font-size: var(--font-size-2xl);
    animation: pulse 1.5s ease-in-out infinite;
}

.price-error {
    color: var(--color-text-muted);
    font-size: var(--font-size-xl);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-btn.notifications {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
}

.header-btn.notifications:hover {
    border-color: var(--color-text-secondary);
    color: var(--color-text-primary);
}

.header-btn.back {
    background: rgba(10, 14, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--color-text-secondary);
    border-radius: 1rem;
}

.header-btn.back:hover {
    border-color: rgba(173, 198, 255, 0.2);
    color: var(--color-text-primary);
}

/* Legacy Header Styles (Keeping slightly modified for transition if needed) */
.company-header {
    margin-bottom: var(--spacing-xl);
}

.period-toggle {
    display: flex;
    background: rgba(10, 14, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    overflow: hidden;
}

.toggle-btn {
    padding: 0.8rem 1rem;
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

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

.toggle-btn.active {
    background: rgba(77, 142, 255, 0.16);
    color: #dce8ff;
}

/* ========================================
   Metrics Table
   ======================================== */
.metrics-section {
    margin-bottom: var(--spacing-xl);
}

.metrics-container {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.46) 0%, rgba(10, 14, 20, 0.24) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.table-wrapper {
    overflow-x: auto;
}

.metrics-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.metrics-table th,
.metrics-table td {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.metrics-table th {
    background: rgba(10, 14, 20, 0.9);
    font-weight: 700;
    color: var(--color-text-secondary);
    position: sticky;
    top: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
}

.metric-name-header,
.metric-name-cell {
    text-align: left !important;
    position: sticky;
    left: 0;
    background: var(--color-bg-card);
    min-width: 240px;
    width: 34%;
    padding-left: var(--spacing-lg);
    z-index: 1;
}

.metric-name-header {
    background: var(--color-bg-secondary);
    z-index: 2;
}

.metric-display-name {
    font-weight: 500;
    color: var(--color-text-primary);
}

.metric-unit {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    margin-left: var(--spacing-xs);
}

.period-header {
    min-width: 100px;
}

.period-header .period-label {
    display: block;
    font-weight: 600;
}

.period-header .period-end-date {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
}

.period-header .period-source-link {
    display: inline-block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-text-muted);
    white-space: nowrap;
}

.period-header .period-source-link:hover {
    color: var(--color-accent, var(--color-text-secondary));
    border-bottom-color: currentColor;
}

.metric-row:hover {
    background: var(--color-bg-card-hover);
}

.metric-row:hover .metric-name-cell {
    background: var(--color-bg-card-hover);
}

.metric-value-cell {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* ========================================
   Error & No Data States
   ======================================== */
.error-container,
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-3xl);
    text-align: center;
}

.error-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    max-width: 400px;
}

.error-icon,
.no-data-icon {
    font-size: 1.75rem !important;
    margin-bottom: var(--spacing-lg);
    line-height: 1 !important;
}
span.error-icon.material-symbols-outlined,
span.no-data-icon.material-symbols-outlined {
    display: inline-grid !important;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    background: rgba(243, 201, 105, 0.15);
    color: #f3c969;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

.error-title,
.no-data-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.error-description,
.no-data-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.error-button {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.error-button:hover {
    border-color: var(--color-accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* ========================================
   Data Info
   ======================================== */
.data-info {
    margin-top: var(--spacing-lg);
}

.info-container {
    text-align: center;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.data-source {
    margin-bottom: var(--spacing-xs);
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--color-bg-secondary);
    border-top: 1px solid var(--color-border);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-3xl);
}

.footer-marketing {
    background: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6rem 2.5rem;
}

.footer-marketing-shell {
    max-width: 1536px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.footer-marketing-brand {
    max-width: 24rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-marketing-wordmark {
    font-family: var(--font-family-display);
    font-size: 2.25rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.05em;
}

.footer-marketing-copy {
    color: #c2c6d6;
    font-size: 0.95rem;
    line-height: 1.8;
    font-weight: 300;
}

.footer-marketing-meta,
.footer-marketing-heading {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.footer-marketing-meta {
    color: #8c909f;
}

.footer-marketing-legal {
    margin-top: 0.5rem;
    font-size: 0.8rem;
}

.footer-marketing-legal a {
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-right: 1.25rem;
}

.footer-marketing-legal a:hover {
    color: var(--color-accent-primary);
}

.footer-marketing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 3rem;
}

.footer-marketing-grid div {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-marketing-heading {
    color: #fff;
}

.footer-marketing-grid a {
    color: #8c909f;
    font-size: 0.9rem;
    font-weight: 500;
}

.footer-marketing-grid a:hover {
    color: #adc6ff;
}

.footer-marketing-item {
    color: #8c909f;
    font-size: 0.9rem;
    font-weight: 500;
}

@media (min-width: 1024px) {
    .footer-marketing-shell {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 5rem;
    }

    .footer-marketing-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 2rem 4rem;
    }
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
    text-align: center;
}

.footer-text {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
}

.footer-disclaimer {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
}

.footer-legal {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-xs);
}

.footer-legal a {
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-right: 1.25rem;
}

.footer-legal a:hover {
    color: var(--color-accent-primary);
}

/* ========================================
   Legal pages (Terms, Privacy)
   ======================================== */
.legal-page {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 24px 96px;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.7;
}
.legal-page h1 {
    color: var(--color-text-primary);
    font-size: 34px;
    line-height: 1.2;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}
.legal-updated {
    color: var(--color-text-muted);
    font-size: 13px;
    margin: 0 0 32px;
}
.legal-page h2 {
    color: var(--color-text-primary);
    font-size: 20px;
    margin: 40px 0 12px;
    letter-spacing: -0.01em;
}
.legal-page h3 {
    color: var(--color-text-primary);
    font-size: 16px;
    margin: 24px 0 8px;
}
.legal-page p { margin: 0 0 14px; }
.legal-page ul { margin: 0 0 14px; padding-left: 22px; }
.legal-page li { margin: 0 0 8px; }
.legal-page a { color: var(--color-accent-primary); }
.legal-page strong { color: var(--color-text-primary); }
.legal-toc {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin: 0 0 40px;
}
.legal-toc-title {
    color: var(--color-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 12px;
}
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.legal-toc li { margin: 0 0 6px; font-size: 14px; break-inside: avoid; }
@media (max-width: 640px) {
    .legal-toc ol { columns: 1; }
    .legal-page h1 { font-size: 28px; }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-examples {
        justify-content: center;
    }

    .hero-visual {
        order: -1;
    }

    .header-main-row {
        gap: var(--spacing-lg);
    }

    .header-stats-row {
        gap: var(--spacing-xl);
    }

    .company-name-large {
        font-size: var(--font-size-3xl);
    }

    .stat-value-large {
        font-size: var(--font-size-3xl);
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-search {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: var(--spacing-md);
    }

    .hero-title {
        font-size: var(--font-size-4xl);
    }

    .company-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-main-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-lg);
    }

    .header-stats {
        align-items: flex-start;
        width: 100%;
    }

    .header-stats-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        width: 100%;
    }

    .stat-group {
        align-items: flex-start;
    }

    .key-stats-grid {
        width: 100%;
        justify-content: flex-start;
    }

    .key-stat {
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
        justify-content: flex-start;
    }

    .metrics-table {
        font-size: var(--font-size-xs);
    }

    .metric-name-header,
    .metric-name-cell {
        min-width: 150px;
        width: auto;
        padding-left: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: var(--font-size-3xl);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .period-toggle {
        width: 100%;
    }

    .toggle-btn {
        flex: 1;
        text-align: center;
    }
}

/* ========================================
   Company Page Enhancements
   ======================================== */

/* Back Link */
.back-link {
    display: inline-block;
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-md);
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-accent-secondary);
}

/* Company Title Row */
.company-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.company-title-row .company-name {
    margin-bottom: 0;
}

/* Filters Section */
.filters-section {
    margin-bottom: var(--spacing-lg);
}

.filters-container {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-label {
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

/* Year Range Filter */
.year-range-filter {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.year-select,
.category-select {
    padding: 0.85rem 1rem;
    background: rgba(10, 14, 20, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.year-select:hover,
.category-select:hover {
    border-color: rgba(173, 198, 255, 0.18);
}

.year-select:focus,
.category-select:focus {
    outline: none;
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.range-separator {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.apply-btn {
    padding: 0.85rem 1rem;
    background: #4d8eff;
    border: none;
    border-radius: 1rem;
    color: #00285d;
    font-size: var(--font-size-sm);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.apply-btn:hover {
    background: #adc6ff;
    transform: none;
}

/* Metric Search */
.metric-filter {
    min-width: 200px;
}

.metric-search-input {
    width: 100%;
    padding: 0.9rem 1rem;
    background: rgba(10, 14, 20, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.metric-search-input:focus {
    outline: none;
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.metric-search-input::placeholder {
    color: var(--color-text-muted);
}

/* Quick Stats */
.quick-stats {
    margin-bottom: var(--spacing-lg);
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-xs);
}

.stat-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-accent-secondary);
}

/* Table Toolbar */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
}

.toolbar-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.toolbar-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.toolbar-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toolbar-btn:hover {
    color: var(--color-text-primary);
    border-color: var(--color-accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

/* Keyboard Shortcuts */
.keyboard-shortcuts {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: center;
}

.shortcuts-toggle {
    color: var(--color-text-muted);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.shortcuts-toggle:hover {
    color: var(--color-accent-secondary);
}

.shortcuts-list {
    display: none;
    margin-top: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.shortcuts-list.visible {
    display: flex;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.shortcut-item kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: var(--font-size-xs);
    color: var(--color-accent-secondary);
}

/* Sync Button */
.sync-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.sync-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.sync-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Smooth row transitions */
.metric-row {
    transition: transform var(--transition-fast), background var(--transition-fast);
}

/* Responsive Filters */
@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .year-range-filter {
        flex-wrap: wrap;
    }

    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .table-toolbar {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
}

/* ========================================
   Stock Screener Page
   ======================================== */
.screener-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.screener-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.screener-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.screener-description {
    color: var(--color-text-secondary);
    font-size: var(--font-size-lg);
}

/* Screener Filters */
.screener-filters {
    margin-bottom: var(--spacing-xl);
}

.filters-form {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 2px var(--color-accent-glow);
}

.filter-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.filter-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-btn.primary {
    background: var(--color-accent-primary);
    color: var(--color-text-primary);
    border: none;
}

.filter-btn.primary:hover {
    background: var(--color-accent-secondary);
    transform: translateY(-1px);
}

.filter-btn.secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.filter-btn.secondary:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-text-primary);
}

/* Screener Results */
.screener-results {
    margin-bottom: var(--spacing-2xl);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.results-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
}

.results-count {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.results-table-wrapper {
    overflow-x: auto;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.results-table th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

.results-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.results-table th.sortable:hover {
    color: var(--color-accent-secondary);
}

.results-table th.sort-asc::after {
    content: ' ▲';
    font-size: 0.7em;
}

.results-table th.sort-desc::after {
    content: ' ▼';
    font-size: 0.7em;
}

.result-row:hover {
    background: var(--color-bg-card-hover);
}

.ticker-cell a {
    color: var(--color-accent-secondary);
    font-weight: 600;
    text-decoration: none;
}

.ticker-cell a:hover {
    color: var(--color-accent-primary);
}

.name-cell {
    color: var(--color-text-primary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sector-cell {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-cell {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.view-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--color-accent-primary);
    border-radius: var(--radius-sm);
    color: var(--color-accent-secondary);
    font-size: var(--font-size-xs);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.view-btn:hover {
    background: var(--color-accent-primary);
    color: var(--color-text-primary);
}

.no-results {
    text-align: center;
    padding: var(--spacing-3xl);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.no-results h3 {
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.no-results p {
    color: var(--color-text-secondary);
}

.error-message {
    padding: var(--spacing-lg);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-lg);
    color: var(--color-negative);
    text-align: center;
}

/* Screener Tips */
.screener-tips {
    margin-top: var(--spacing-2xl);
}

.screener-tips h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.tip-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-base);
}

.tip-card:hover {
    border-color: var(--color-accent-primary);
    transform: translateY(-2px);
}

.tip-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.tip-card h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.tip-card p {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
}

/* Screener Filter Chips */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.6rem 0.35rem 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.15));
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #c4b5fd;
    font-weight: 500;
    transition: all 0.2s;
}

.filter-chip:hover {
    border-color: rgba(99, 102, 241, 0.6);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(139, 92, 246, 0.2));
}

.chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #a5b4fc;
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s;
}

.chip-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Screener Sort Indicators */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
}

.data-table th.sortable:hover {
    color: var(--color-accent-secondary);
}

.data-table th[data-active="true"] {
    color: #a5b4fc;
}

.sort-arrow {
    margin-left: 0.3rem;
    font-size: 0.7rem;
    opacity: 0.85;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .filter-actions {
        width: 100%;
        justify-content: center;
    }

    .results-header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
}

/* Auth Pages */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.auth-page::before {
    content: '';
    position: absolute;
    width: 640px;
    height: 640px;
    background: rgba(173, 198, 255, 0.08);
    filter: blur(120px);
    opacity: 1;
    z-index: 0;
}

.auth-container {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.68) 0%, rgba(10, 14, 20, 0.5) 100%);
    padding: 3rem;
    border-radius: 2rem;
    width: 100%;
    max-width: 460px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(12px);
}

.auth-eyebrow {
    display: block;
    text-align: center;
    margin-bottom: 1rem;
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 0.75rem;
    color: var(--color-text-primary);
    font-size: 2.25rem;
    font-family: var(--font-family-display);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.auth-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    line-height: 1.75;
    margin-bottom: 2rem;
}

.auth-form p {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
}

.auth-form label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-weight: 700;
    color: var(--color-text-muted);
}

.auth-form input {
    width: 100%;
    padding: 1rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 14, 20, 0.78);
    color: var(--color-text-primary);
    margin-bottom: 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 3px rgba(173, 198, 255, 0.12);
}

/* Django form error/help output (form.as_p renders raw ul.errorlist and
   span.helptext) — without these the signup page dumps unstyled HTML. */
.auth-form .errorlist {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(229, 57, 53, 0.4);
    background: rgba(229, 57, 53, 0.12);
    border-radius: 0.75rem;
    color: #ffb4ab;
    font-size: 0.85rem;
}

.auth-form .errorlist li + li {
    margin-top: 0.35rem;
}

.auth-form .helptext {
    display: block;
    margin: -0.75rem 0 1.25rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

.auth-form .helptext ul {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.auth-btn {
    width: 100%;
    min-height: 3.4rem;
    padding: 1rem;
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    color: #06111f;
    border: none;
    border-radius: 1rem;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 1rem;
    transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 18px 55px rgba(77,142,255,0.22), 0 0 0 1px rgba(255,255,255,0.12) inset;
}

.auth-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.auth-footer a {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Pricing Page */
.pricing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.pricing-title {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.pricing-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 4rem;
    font-size: 1.25rem;
}

.pricing-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    align-items: start;
}

.pricing-card {
    background: linear-gradient(180deg, rgba(173,198,255,0.055) 0%, rgba(10,14,20,0.55) 100%);
    border: 1px solid rgba(255,255,255,0.055);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(18px);
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(173,198,255,0.12);
}

.pricing-card.free {
    border-top: 4px solid var(--color-text-muted);
}

.pricing-card--featured,
.pricing-card.pro {
    background: linear-gradient(180deg, rgba(173,198,255,0.10) 0%, rgba(10,14,20,0.65) 100%);
    border-color: rgba(173,198,255,0.2);
    box-shadow: 0 8px 32px rgba(77,142,255,0.15), 0 0 0 1px rgba(173,198,255,0.15) inset;
}

.popular-tag {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    transform: none;
    border-radius: 2rem;
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    color: #06111f;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
}

.card-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.card-header h3 {
    font-size: 1.5rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.price {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    letter-spacing: -1px;
}

.price span {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: normal;
}

.features-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2.5rem;
    flex-grow: 1;
}

.features-list li {
    margin-bottom: 1rem;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.features-list li::before {
    content: '✓';
    color: var(--color-positive);
    font-weight: 700;
}

.features-list li strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.plan-btn {
    display: block;
    width: 100%;
    padding: 1rem;
    text-align: center;
    border-radius: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 1rem;
}

.free-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

.free-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pro-btn, .upgrade-btn {
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    color: #06111f;
    box-shadow: 0 18px 55px rgba(77,142,255,0.22), 0 0 0 1px rgba(255,255,255,0.12) inset;
    border-radius: 0.75rem;
    border: none;
    font-weight: 700;
    padding: 0.85rem 2rem;
    width: 100%;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

.pro-btn:hover, .upgrade-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.plan-note {
    margin-top: 0.6rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.current-plan-badge {
    text-align: center;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-positive);
    border-radius: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.upgrade-form {
    width: 100%;
}

/* Billing period toggle (monthly / annual) */
.pricing-cadence-toggle {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0 auto 1.75rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
}
.cadence-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.cadence-option.is-active {
    background: var(--color-accent-primary);
    color: #fff;
}
.cadence-save {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
}
.cadence-option.is-active .cadence-save { color: #052e1c; background: #6ee7b7; }

/* Currency toggle (EUR / USD) — same pill styling, sits above the cadence row */
.pricing-currency-toggle {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0 auto 0.75rem;
    padding: 0.3rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
}
.currency-option {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}
.currency-option.is-active {
    background: var(--color-accent-primary);
    color: #fff;
}

/* Billing success / pending landing */
.billing-success {
    max-width: 520px;
    margin: 4rem auto;
    text-align: center;
}
.billing-success-icon .material-symbols-outlined { font-size: 4rem; line-height: 1; }
.billing-success-icon.success .material-symbols-outlined { color: var(--color-positive); }
.billing-success-icon.pending .material-symbols-outlined { color: var(--color-accent-secondary); }
.billing-success-title {
    font-family: var(--font-family-display);
    font-size: 2rem;
    font-weight: 800;
    margin: 1rem 0 0.5rem;
    color: var(--color-text-primary);
}
.billing-success-sub { color: var(--color-text-secondary); margin: 0 auto 1.75rem; max-width: 420px; }
.billing-success-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.billing-success-actions .plan-btn { width: auto; padding-left: 1.5rem; padding-right: 1.5rem; }

/* Account & Billing settings page */
.account-page { max-width: 900px; margin: 0 auto; }
.account-header { margin-bottom: 1.5rem; }
.account-title {
    font-family: var(--font-family-display);
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
    margin: 0.3rem 0 0.4rem;
}
.account-subtitle { color: var(--color-text-muted); margin: 0; }
.account-messages { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.account-message {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    background: rgba(173, 198, 255, 0.08);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
}
.account-message.error { background: rgba(229, 57, 53, 0.1); border-color: rgba(229, 57, 53, 0.35); }
.account-message.success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.1rem;
}
.account-card { padding: 1.6rem 1.7rem; border-radius: 1.4rem; }
.account-card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 1.2rem; }
.account-card-icon { color: var(--color-accent-secondary); font-size: 1.4rem; }
.account-card-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); margin: 0; }
.account-plan-badge {
    margin-left: auto;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
}
.account-plan-badge.pro { color: #06111f; background: linear-gradient(135deg, #FFD700, #FDB931); }
.account-plan-badge.free { color: var(--color-text-muted); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--color-border-light); }
.account-detail-list { margin: 0 0 1.2rem; padding: 0; display: flex; flex-direction: column; gap: 0.9rem; }
.account-detail { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.account-detail dt { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-text-muted); margin: 0; }
.account-detail dd { margin: 0; font-size: 0.95rem; font-weight: 600; color: var(--color-text-primary); text-align: right; overflow-wrap: anywhere; }
.account-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.4rem; background: var(--color-text-muted); vertical-align: middle; }
.account-status-dot.status-active, .account-status-dot.status-trialing { background: var(--color-positive); }
.account-status-dot.status-past_due, .account-status-dot.status-unpaid { background: #fbbf24; }
.account-status-dot.status-canceled { background: var(--color-negative); }
.account-card-note { font-size: 0.85rem; color: var(--color-text-muted); margin: 0 0 1.1rem; line-height: 1.5; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.05rem;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.account-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(173, 198, 255, 0.3); }
.account-btn .material-symbols-outlined { font-size: 1.05rem; }
.account-btn-primary {
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    color: #06111f;
    border-color: transparent;
}
.account-btn-primary:hover { filter: brightness(1.07); border-color: transparent; }
.account-btn-ghost { background: transparent; border-color: transparent; color: var(--color-text-muted); }
.account-btn-ghost:hover { background: rgba(255, 255, 255, 0.05); color: var(--color-text-secondary); }
.account-signout { margin-top: 1.4rem; }

/* Navbar Badges & Links */
.nav-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 800;
    align-self: center;
    letter-spacing: 0.05em;
}

.nav-badge.pro {
    background: linear-gradient(135deg, #FFD700 0%, #FDB931 100%);
    color: #000;
    box-shadow: 0 2px 10px rgba(253, 185, 49, 0.3);
}

.nav-link.highlight {
    color: white;
    font-weight: 600;
    background: var(--color-accent-primary);
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    margin-left: 0.5rem;
    transition: background 0.2s;
    border: none;
    box-shadow: 0 4px 12px var(--color-accent-glow);
}

.nav-link.highlight:hover {
    background: var(--color-accent-secondary);
    transform: translateY(-1px);
}

.nav-pro-tag {
    font-size: 9px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: super;
    margin-left: 2px;
}

/* Upsell & Locked Data */
.premium-upsell {
    background: linear-gradient(180deg, rgba(26, 26, 36, 0.8) 0%, rgba(26, 26, 36, 1) 100%);
    padding: 3rem 2rem;
    border-radius: 1rem;
    margin: 3rem 0;
    text-align: center;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.premium-upsell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-accent-primary), transparent);
    opacity: 0.5;
}

.upsell-content h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--color-text-primary);
}

.upsell-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.upgrade-btn {
    text-decoration: none;
    display: inline-block;
    font-size: 1.1rem;
    transition: filter 0.2s, transform 0.2s;
}

.upgrade-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.affiliate-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.affiliate-section h4 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.broker-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.broker-link {
    padding: 0.75rem 2rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
    font-weight: 500;
    transition: all 0.2s;
    min-width: 140px;
    text-align: center;
}

.broker-link:hover {
    border-color: var(--color-accent-primary);
    transform: translateY(-2px);
    background: var(--color-bg-card-hover);
}

.pro-lock {
    opacity: 0.5;
    pointer-events: none;
    background: var(--color-bg-secondary);
}

/* Portfolio & New Components */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.metric-card {
    background: var(--color-bg-card);
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.metric-card:hover {
    transform: translateY(-3px);
    border-color: var(--color-border-light);
}

.metric-card h3 {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
}

.metric-card .sub-value {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.metric-card .sub-value.positive {
    color: var(--color-positive);
}

.metric-card .sub-value.negative {
    color: var(--color-negative);
}

.table-card {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border-radius: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.table-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.1s;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.data-table .text-right {
    text-align: right;
}

.data-table .text-center {
    text-align: center;
}

.data-table .ticker-link {
    text-decoration: none;
    color: white;
    background: var(--color-accent-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    font-weight: 700;
    font-size: 0.85rem;
}

.data-table .font-bold {
    font-weight: 600;
}

.data-table .sub-text {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.btn-icon-delete {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.btn-icon-delete:hover {
    color: var(--color-negative);
}

.empty-state {
    padding: 4rem;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

.empty-state a {
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-actions h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions .subtitle {
    color: var(--color-text-secondary);
    font-size: 1.1rem;
}

.btn-primary {
    background: #4d8eff;
    color: #00285d;
    padding: 0.95rem 1.6rem;
    border-radius: 1rem;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 18px 40px var(--color-accent-glow);
    display: inline-block;
}

.btn-primary:hover {
    background: #adc6ff;
    box-shadow: 0 24px 44px var(--color-accent-glow);
}

.form-actions-stacked {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.cancel-link {
    text-align: center;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.cancel-link:hover {
    color: var(--color-text-primary);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
}

.error-msg {
    color: var(--color-negative);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination a {
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    text-decoration: none;
    color: var(--color-text-primary);
    transition: all 0.2s;
    font-weight: 600;
}

.pagination a:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pagination span {
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Portfolio Price Status */
.price-status {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    animation: pulse 1.5s ease-in-out infinite;
}

.page-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 1.5rem 2.5rem 2rem;
}

.app-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 2rem;
}

.app-page-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.85rem;
}

.app-page-title {
    font-family: var(--font-family-display);
    font-size: clamp(2.25rem, 4vw, 3.75rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    color: var(--color-text-primary);
}

.app-page-subtitle {
    margin-top: 0.85rem;
    max-width: 42rem;
    color: var(--color-text-secondary);
    font-size: 1.02rem;
    line-height: 1.8;
}

.app-surface-card {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

/* ========================================
   Portfolio Page Redesign
   ======================================== */

.portfolio-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    text-align: left;
}

/* Portfolio Header */
.portfolio-header {
    width: 100%;
    margin-bottom: var(--spacing-2xl);
}

.portfolio-header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.portfolio-title-section {
    flex: 1;
}

.portfolio-title {
    font-family: var(--font-family-display);
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.portfolio-subtitle {
    color: var(--color-text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

/* Add Stock Button */
.add-stock-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px var(--color-accent-glow);
}

.add-stock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--color-accent-glow);
}

.add-stock-icon {
    font-size: 1.25rem;
    font-weight: 300;
}

/* Portfolio Metrics Dashboard */
.portfolio-metrics {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.metric-card-large {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: var(--spacing-xl);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.metric-card-large:hover {
    border-color: rgba(173, 198, 255, 0.12);
}

.metric-card-large.primary {
    background: linear-gradient(145deg, rgba(77, 142, 255, 0.12) 0%, rgba(10, 14, 20, 0.35) 100%);
    border-color: rgba(173, 198, 255, 0.14);
}

.metric-icon {
    font-size: 1.6rem !important;
    line-height: 1 !important;
}
/* When .metric-icon is a Material Symbol (post-emoji-sweep), give it the
   same colored-chip treatment used by dashboard cards. */
span.metric-icon.material-symbols-outlined {
    display: grid !important;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    flex-shrink: 0;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

.metric-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.metric-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value-xl {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

.metric-change {
    font-size: var(--font-size-base);
    font-weight: 500;
}

.metric-subtext {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.metrics-row-small {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.metric-card-small {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
}

.metric-value-md {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Holdings Section */
.holdings-section {
    width: 100%;
    margin-bottom: var(--spacing-2xl);
}

.holdings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.holdings-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Holdings Grid */
.holdings-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.holding-card {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: var(--spacing-lg);
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.holding-card:hover {
    border-color: rgba(173, 198, 255, 0.12);
    box-shadow: 0 28px 64px rgba(0, 0, 0, 0.16);
}

.holding-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.holding-identity {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.holding-ticker {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.holding-ticker:hover {
    color: var(--color-accent-primary);
}

.holding-shares {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.holding-delete {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.5;
    transition: all var(--transition-fast);
}

.holding-delete:hover {
    opacity: 1;
    color: #ffb4ab;
}

.holding-price-section {
    display: flex;
    gap: var(--spacing-xl);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-md);
}

.holding-current-price,
.holding-avg-cost {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.price-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.price-value {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.holding-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.holding-metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.holding-metric-label {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 800;
}

.holding-metric-value {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text-primary);
}

.holding-metric-value small {
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

/* Empty Portfolio State */
.empty-portfolio {
    text-align: center;
    padding: var(--spacing-3xl);
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px dashed rgba(173, 198, 255, 0.18);
    border-radius: 1.75rem;
}

.empty-icon {
    font-size: 2rem !important;
    margin-bottom: var(--spacing-lg);
    line-height: 1 !important;
}
/* When .empty-icon is a Material Symbol (post-emoji-sweep), render it
   inside a colored chip — matches the dashboard's empty-state pattern. */
span.empty-icon.material-symbols-outlined {
    display: inline-grid !important;
    place-items: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1.25rem;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

.empty-title {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.empty-description {
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xl);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.add-first-stock-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-2xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-lg);
    color: white;
    font-size: var(--font-size-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px var(--color-accent-glow);
}

.add-first-stock-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--color-accent-glow);
}

/* ============================================================
   Portfolio — cockpit redesign (hero, allocation, income, cards)
   Newer rules below intentionally override the legacy portfolio
   metric/holding styles above (same specificity, later wins).
   ============================================================ */

/* ---- Topbar ---- */
.pf-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
    margin-bottom: 1.4rem;
}
.pf-topbar-titles { min-width: 0; }
.pf-topbar .portfolio-subtitle { margin-top: 0.3rem; }
.add-stock-btn .material-symbols-outlined { font-size: 1.2rem; }

/* ---- Hero ---- */
.pf-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: clamp(1.6rem, 3vw, 2.6rem);
    border-radius: 2rem;
    margin-bottom: 1.1rem;
}
.pf-hero-main { display: flex; flex-direction: column; min-width: 0; }
.pf-hero-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0.4rem;
}
.pf-hero-value {
    font-family: var(--font-family-display);
    font-size: clamp(2.6rem, 5.5vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--color-text-primary);
}
.pf-hero-deltas {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-top: 0.85rem;
}
.pf-hero-change {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    border-radius: 999px;
}
.pf-hero-change.positive { color: var(--color-positive); }
.pf-hero-change.negative { color: var(--color-negative); }
.pf-hero-daily {
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border-light);
}
.pf-hero-daily.positive { color: var(--color-positive); }
.pf-hero-daily.negative { color: var(--color-negative); }
.pf-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}
.pf-status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--color-accent-secondary);
    box-shadow: 0 0 0 0 rgba(173, 198, 255, 0.5);
    animation: pf-blink 1.4s ease-in-out infinite;
}
.pf-status-dot.offline { background: var(--color-text-muted); animation: none; }
.pf-hero-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.85rem;
    text-align: right;
}
.pf-hero-yoc { display: flex; flex-direction: column; gap: 0.15rem; }
.pf-hero-yoc-value {
    font-family: var(--font-family-display);
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--color-accent-secondary);
    line-height: 1;
}
.pf-hero-yoc-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.pf-freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
}
.pf-freshness-badge .sync-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- Summary strip ---- */
.pf-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}
.pf-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.95rem 1.15rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--color-border-light);
}
.pf-summary-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.pf-summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-primary);
}
.pf-summary-value.positive { color: var(--color-positive); }

/* ---- Visualization grid ---- */
.pf-viz-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    gap: 1.1rem;
    margin-bottom: 1.8rem;
}
.pf-viz-card { padding: 1.5rem 1.6rem; border-radius: 1.5rem; }
.pf-viz-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.pf-viz-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); }
.pf-viz-sub { font-size: 0.78rem; color: var(--color-text-muted); }

/* Donut */
.pf-donut-block { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.pf-donut-wrap { position: relative; width: 152px; height: 152px; flex-shrink: 0; }
.pf-donut { width: 152px; height: 152px; transform: rotate(-90deg); }
.pf-donut-track { fill: none; stroke: rgba(255, 255, 255, 0.06); stroke-width: 3.4; }
.pf-donut-seg {
    fill: none;
    stroke-width: 3.4;
    stroke-linecap: butt;
    opacity: 0;
    animation: pf-fade-in 0.55s ease forwards;
    transition: stroke-width 0.18s ease;
}
.pf-donut-seg:hover { stroke-width: 4.2; }
.pf-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.pf-donut-center-value { font-family: var(--font-family-display); font-size: 1.9rem; font-weight: 800; color: var(--color-text-primary); line-height: 1; }
.pf-donut-center-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.pf-legend { display: flex; flex-direction: column; gap: 0.6rem; flex: 1; min-width: 150px; list-style: none; padding: 0; margin: 0; }
.pf-legend-row { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; }
.pf-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pf-legend-name { color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pf-legend-pct { color: var(--color-text-primary); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Income bars */
.pf-income-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.95rem; }
.pf-income-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.pf-income-ticker { font-weight: 700; color: var(--color-text-primary); font-size: 0.9rem; }
.pf-income-amt { font-weight: 700; color: var(--color-positive); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.pf-income-yr { color: var(--color-text-muted); font-weight: 500; font-size: 0.72rem; }
.pf-income-track { height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.pf-income-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10b981, #4edea3);
    transform-origin: left;
    animation: pf-bar-grow 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.pf-viz-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.6rem; padding: 1.5rem 0; color: var(--color-text-muted); }
.pf-viz-empty .material-symbols-outlined { font-size: 2rem; opacity: 0.6; }
.pf-viz-empty p { font-size: 0.85rem; max-width: 280px; margin: 0; }

/* ---- Dividend income by year ---- */
.pf-divincome { margin-bottom: 1.8rem; }
.pf-year-select-wrap { display: inline-flex; align-items: center; gap: 0.5rem; }
.pf-year-select-label { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-text-muted); }
.pf-year-select {
    appearance: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 1.9rem 0.4rem 0.8rem;
    border-radius: 0.6rem;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c909f' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
}
.pf-year-select:hover { border-color: var(--color-border); }
.pf-divincome-table { width: 100%; border-collapse: collapse; }
.pf-divincome-table thead th {
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--color-text-muted); text-align: left; padding: 0 0.5rem 0.7rem; border-bottom: 1px solid var(--color-border-light);
}
.pf-divincome-table th.num, .pf-divincome-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-divincome-table tbody td { padding: 0.7rem 0.5rem; border-bottom: 1px solid var(--color-border-light); font-size: 0.9rem; color: var(--color-text-primary); }
.pf-divincome-id { display: flex; flex-direction: column; gap: 0.1rem; }
.pf-divincome-ticker { font-weight: 700; color: var(--color-accent-secondary); text-decoration: none; }
.pf-divincome-ticker:hover { color: var(--color-accent-primary); }
.pf-divincome-name { font-size: 0.74rem; color: var(--color-text-muted); }
.pf-divincome-amt { font-weight: 700; color: var(--color-positive); }
.pf-divincome-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 1rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-muted); }
.pf-divincome-total #div-income-total { font-size: 1.4rem; letter-spacing: 0; text-transform: none; }
.pf-divincome-note { margin: 0.7rem 0 0; font-size: 0.72rem; color: var(--color-text-muted); }
[data-theme="light"] .pf-year-select { background-color: rgba(15, 23, 42, 0.03); }

/* ---- Holdings ---- */
.holdings-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-accent-secondary);
    background: rgba(173, 198, 255, 0.12);
    margin-left: 0.6rem;
}
.holdings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.1rem;
}
.holding-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 1.4rem;
    border-radius: 1.4rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 100%);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.holding-card:hover {
    transform: translateY(-3px);
    border-color: rgba(173, 198, 255, 0.22);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.26);
}

/* Zone 1 */
.holding-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.holding-id { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.holding-ticker { font-size: 1.2rem; font-weight: 800; color: var(--color-accent-secondary); text-decoration: none; letter-spacing: 0.01em; }
.holding-ticker:hover { color: var(--color-accent-primary); }
.holding-name { font-size: 0.82rem; color: var(--color-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.holding-sector-chip {
    align-self: flex-start;
    margin-top: 0.15rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.holding-price { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; text-align: right; margin-right: 1.6rem; }
.holding-price-value { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.holding-price-change { font-size: 0.78rem; font-weight: 700; }
.holding-price-change.price-up { color: var(--color-positive); }
.holding-price-change.price-down { color: var(--color-negative); }

/* Delete + inline confirm */
.delete-form { position: absolute; top: 1.05rem; right: 1.05rem; }
.holding-delete {
    display: grid;
    place-items: center;
    width: 1.7rem; height: 1.7rem;
    border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.holding-card:hover .holding-delete { opacity: 1; }
.holding-delete:hover { background: rgba(255, 180, 171, 0.15); color: var(--color-negative); }
.holding-delete .material-symbols-outlined { font-size: 1rem; }
.holding-delete-confirm { display: inline-flex; align-items: center; gap: 0.4rem; background: rgba(10, 14, 20, 0.85); border: 1px solid var(--color-border); border-radius: 999px; padding: 0.2rem 0.3rem 0.2rem 0.6rem; }
/* The display rules above outrank the UA [hidden] style, so guard explicitly. */
.holding-delete[hidden], .holding-delete-confirm[hidden] { display: none; }
.holding-delete-q { font-size: 0.72rem; color: var(--color-text-secondary); }
.holding-confirm-yes, .holding-confirm-no { border: none; border-radius: 999px; font-size: 0.7rem; font-weight: 700; padding: 0.2rem 0.55rem; cursor: pointer; }
.holding-confirm-yes { background: var(--color-negative); color: #2a0f0c; }
.holding-confirm-yes:disabled { opacity: 0.6; cursor: default; }
.holding-confirm-no { background: rgba(255, 255, 255, 0.08); color: var(--color-text-secondary); }

/* Zone 2 */
.holding-value-strip {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--color-border-light);
}
.holding-value-main { display: flex; flex-direction: column; gap: 0.2rem; }
.holding-value-label { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.holding-value-big { font-size: 1.55rem; font-weight: 800; color: var(--color-text-primary); font-variant-numeric: tabular-nums; line-height: 1; }
.holding-gain-block { display: flex; flex-direction: column; align-items: flex-end; gap: 0.3rem; }
.holding-gain { font-size: 0.92rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.holding-gain.positive { color: var(--color-positive); }
.holding-gain.negative { color: var(--color-negative); }
.holding-gain-pill { font-size: 0.74rem; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 999px; font-variant-numeric: tabular-nums; }
.holding-gain-pill.pill-up { color: var(--color-positive); background: rgba(78, 222, 163, 0.12); }
.holding-gain-pill.pill-down { color: var(--color-negative); background: rgba(255, 180, 171, 0.12); }

/* Weight */
.holding-weight { margin-top: 0.95rem; }
.holding-weight-track { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.holding-weight-bar { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4d8eff, #adc6ff); transform-origin: left; transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1); animation: pf-bar-grow 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.holding-weight-label { display: block; margin-top: 0.4rem; font-size: 0.72rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* Zone 3 */
.holding-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 1rem; margin-top: 1.1rem; }
.holding-foot-item { display: flex; flex-direction: column; gap: 0.18rem; }
.holding-foot-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.holding-foot-value { font-size: 0.92rem; font-weight: 600; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.holding-foot-value.positive { color: var(--color-positive); }

/* Thesis */
.holding-thesis { margin-top: 1rem; border-top: 1px solid var(--color-border-light); padding-top: 0.7rem; }
.holding-thesis summary { display: flex; align-items: center; gap: 0.4rem; cursor: pointer; list-style: none; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-muted); }
.holding-thesis summary::-webkit-details-marker { display: none; }
.holding-thesis summary .material-symbols-outlined { font-size: 0.95rem; }
.holding-thesis summary:hover { color: var(--color-accent-secondary); }
.holding-thesis-body { margin: 0.55rem 0 0; font-size: 0.86rem; line-height: 1.5; color: var(--color-text-secondary); }
.holding-thesis-date { display: block; margin-top: 0.4rem; font-size: 0.72rem; color: var(--color-text-muted); }

/* Hover CTA */
.holding-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-accent-secondary);
    text-decoration: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.25s ease, margin-top 0.25s ease;
}
.holding-cta .material-symbols-outlined { font-size: 1rem; transition: transform 0.18s ease; }
.holding-card:hover .holding-cta { max-height: 2.5rem; opacity: 1; }
.holding-cta:hover .material-symbols-outlined { transform: translateX(3px); }
@media (hover: none) {
    .holding-delete { opacity: 0.5; }
    .holding-cta { max-height: 2.5rem; opacity: 1; }
}

/* ---- Empty state (first run) ---- */
.pf-empty {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 2rem;
    text-align: left;
    padding: clamp(1.75rem, 4vw, 3rem);
}
.pf-empty-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; color: var(--color-text-primary); margin-bottom: 0.6rem; }
.pf-empty-desc { color: var(--color-text-secondary); margin-bottom: 1.1rem; }
.pf-empty-list { list-style: none; padding: 0; margin: 0 0 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; }
.pf-empty-list li { display: flex; align-items: center; gap: 0.65rem; color: var(--color-text-secondary); font-size: 0.92rem; }
.pf-empty-list .material-symbols-outlined { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 0.6rem; background: rgba(173, 198, 255, 0.12); color: var(--color-accent-secondary); font-size: 1.15rem; flex-shrink: 0; }
.pf-empty-ghost { display: flex; justify-content: center; }
.pf-ghost-card { width: 100%; max-width: 280px; padding: 1.4rem; border-radius: 1.4rem; background: rgba(255, 255, 255, 0.025); border: 1px solid var(--color-border-light); filter: blur(0.4px); opacity: 0.7; }
.pf-ghost-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.pf-ghost-ticker { font-weight: 800; color: var(--color-text-muted); }
.pf-ghost-price { width: 3.5rem; height: 0.9rem; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.08); }
.pf-ghost-big { width: 60%; height: 1.6rem; border-radius: 0.5rem; background: rgba(255, 255, 255, 0.09); margin-bottom: 1rem; }
.pf-ghost-bar { width: 100%; height: 0.5rem; border-radius: 999px; background: rgba(173, 198, 255, 0.18); margin-bottom: 1.2rem; }
.pf-ghost-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.pf-ghost-grid span { height: 1.4rem; border-radius: 0.4rem; background: rgba(255, 255, 255, 0.05); }

/* ---- Attribution ---- */
.pf-attribution { margin-top: 1.6rem; text-align: center; font-size: 0.74rem; color: var(--color-text-muted); }

/* ---- Animations ---- */
@keyframes pf-fade-in { to { opacity: 1; } }
@keyframes pf-bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pf-blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(173, 198, 255, 0.45); } 50% { box-shadow: 0 0 0 4px rgba(173, 198, 255, 0); } }
@keyframes pf-pulse-up { 0% { box-shadow: 0 0 0 0 rgba(78, 222, 163, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(78, 222, 163, 0); } }
@keyframes pf-pulse-down { 0% { box-shadow: 0 0 0 0 rgba(255, 180, 171, 0.55); } 100% { box-shadow: 0 0 0 9px rgba(255, 180, 171, 0); } }
.pf-pulse-up { animation: pf-pulse-up 1.2s ease-out; }
.pf-pulse-down { animation: pf-pulse-down 1.2s ease-out; }
@media (prefers-reduced-motion: reduce) {
    .pf-donut-seg, .pf-income-bar, .holding-weight-bar { animation: none; opacity: 1; transform: none; }
    .pf-status-dot { animation: none; }
    .pf-pulse-up, .pf-pulse-down { animation: none; }
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
    .pf-viz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .pf-hero { flex-direction: column; }
    .pf-hero-side { align-items: flex-start; text-align: left; flex-direction: row; justify-content: space-between; width: 100%; }
    .pf-summary-strip { grid-template-columns: 1fr 1fr; }
    .pf-empty { grid-template-columns: 1fr; }
    .pf-empty-ghost { display: none; }
    .pf-topbar { flex-direction: column; align-items: stretch; }
    .pf-topbar .add-stock-btn { justify-content: center; }
}

/* ---- Light theme ---- */
[data-theme="light"] .holding-card {
    background: linear-gradient(155deg, rgba(15, 23, 42, 0.04) 0%, rgba(15, 23, 42, 0.01) 100%);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .pf-summary-item,
[data-theme="light"] .pf-ghost-card { background: rgba(15, 23, 42, 0.025); }
[data-theme="light"] .pf-income-track,
[data-theme="light"] .holding-weight-track { background: rgba(15, 23, 42, 0.07); }
[data-theme="light"] .pf-donut-track { stroke: rgba(15, 23, 42, 0.08); }
[data-theme="light"] .holding-delete { background: rgba(15, 23, 42, 0.05); }
[data-theme="light"] .holding-delete-confirm { background: rgba(255, 255, 255, 0.95); }

/* ========================================
   Modal Styles
   ======================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.72) 0%, rgba(10, 14, 20, 0.56) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.75rem;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform var(--transition-base);
    margin: var(--spacing-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-title {
    font-family: var(--font-family-display);
    font-size: 1.6rem;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: var(--color-text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-text-primary);
}

/* Add Stock Form */
.add-stock-form {
    padding: var(--spacing-xl);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-sm);
}

.optional-label {
    font-weight: 400;
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(10, 14, 20, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    color: var(--color-text-primary);
    font-size: var(--font-size-base);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

/* Stock Search Autocomplete */
.stock-search-container {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-xs);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    display: none;
    box-shadow: var(--shadow-lg);
}

.search-results-dropdown.active {
    display: block;
}

.search-results-dropdown .search-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--color-border);
}

.search-results-dropdown .search-result-item:last-child {
    border-bottom: none;
}

.search-results-dropdown .search-result-item:hover {
    background: var(--color-bg-card-hover);
}

.result-ticker {
    font-weight: 600;
    color: var(--color-accent-secondary);
}

.result-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    text-align: right;
    flex: 1;
    margin-left: var(--spacing-md);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-no-results {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--color-text-muted);
}

/* Selected Stock Display */
.selected-stock {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
}

.selected-ticker {
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--color-accent-secondary);
}

.selected-name {
    flex: 1;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.change-stock-btn {
    background: none;
    border: none;
    color: var(--color-accent-primary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.change-stock-btn:hover {
    color: var(--color-accent-secondary);
    text-decoration: underline;
}

/* Quick Preview */
.quick-preview {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: center;
}

.preview-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.preview-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.preview-value {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

.btn-secondary {
    padding: 0.95rem 1.4rem;
    background: rgba(10, 14, 20, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    color: var(--color-text-secondary);
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: rgba(173, 198, 255, 0.2);
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.btn-primary-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary-action:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px var(--color-accent-glow);
}

.btn-primary-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 1.1rem;
    transition: transform var(--transition-fast);
}

.btn-primary-action:hover:not(:disabled) .btn-icon {
    transform: translateX(3px);
}

/* Portfolio Responsive */
@media (max-width: 1024px) {
    .portfolio-metrics {
        grid-template-columns: 1fr 1fr;
    }

    .metrics-row-small {
        grid-column: span 2;
        flex-direction: row;
    }

    .metric-card-small {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .portfolio-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .add-stock-btn {
        width: 100%;
        justify-content: center;
    }

    .portfolio-metrics {
        grid-template-columns: 1fr;
    }

    .metrics-row-small {
        grid-column: span 1;
    }

    .holdings-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Categorized Metrics Display
   ======================================== */

.categorized-metrics {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
}

.category-section {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.46) 0%, rgba(10, 14, 20, 0.24) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.35rem;
    overflow: hidden;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.category-section:hover {
    border-color: rgba(173, 198, 255, 0.12);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
}

.category-section[data-category="growth"] {
    border-left: 4px solid #10b981;
}

.category-section[data-category="profitability"] {
    border-left: 4px solid #f59e0b;
}

.category-section[data-category="returns"] {
    border-left: 4px solid #6366f1;
}

.category-section[data-category="leverage"] {
    border-left: 4px solid #ef4444;
}

.category-section[data-category="per_share"] {
    border-left: 4px solid #8b5cf6;
}

.category-section[data-category="balance_sheet"] {
    border-left: 4px solid #3b82f6;
}

.category-section[data-category="income"] {
    border-left: 4px solid #14b8a6;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-bg-card);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}

.category-header:hover {
    background: var(--color-bg-card-hover);
}

.category-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.category-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.category-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.category-count {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
}

/* ========================================
   Category Navigation Bar (Sticky Tabs)
   ======================================== */

.category-nav-bar {
    position: sticky;
    top: 24px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    padding: 0.8rem 0.95rem;
    background: rgba(10, 14, 20, 0.84);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.15rem;
    margin-bottom: var(--spacing-lg);
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.8rem 1rem;
    background: rgba(10, 14, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.category-tab:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-primary);
    border-color: rgba(173, 198, 255, 0.14);
}

.category-tab.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--color-accent-secondary);
}

.category-tab .tab-icon {
    display: none;
}

.category-tab .tab-name {
    display: inline;
}

.nav-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.nav-bar-actions .toolbar-info {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    padding-right: var(--spacing-sm);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

/* Metrics container spacing */
.categorized-metrics {
    margin-top: var(--spacing-md);
}

/* Category section spacing */
.category-section {
    margin-bottom: var(--spacing-lg);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.category-section:first-child {
    margin-top: 0;
}

/* Static category header (non-collapsible) */
.category-header-static {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    border-left: 3px solid var(--color-accent-primary);
    border-bottom: 1px solid var(--color-border);
}

.category-header-static .category-icon {
    font-size: 1.25rem;
}

.category-header-static .category-name {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--color-text-primary);
}

.category-header-static .category-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: auto;
}

/* Remove old toggle styles */
.category-toggle {
    display: none;
}

.category-content {
    /* Always visible - no collapse */
}

.category-section .table-wrapper {
    /* No border needed - section has its own border */
}

.category-section .metrics-table {
    background: var(--color-bg-card);
}

.category-section .metrics-table th {
    background: rgba(0, 0, 0, 0.2);
}

.category-section .metric-name-cell {
    background: var(--color-bg-card);
}

.category-section .metric-row:hover .metric-name-cell {
    background: var(--color-bg-card-hover);
}

/* Growth metrics highlight */
.category-section[data-category="growth"] .metric-value.positive {
    color: #10b981;
    font-weight: 600;
}

.category-section[data-category="growth"] .metric-value.negative {
    color: #ef4444;
    font-weight: 600;
}

/* Category-specific table styles */
.category-table {
    width: 100%;
    border-collapse: collapse;
}

.category-table tbody tr:last-child td {
    border-bottom: none;
}

/* Responsive adjustments for categorized metrics */
@media (max-width: 768px) {
    .categorized-metrics {
        padding: var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .category-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

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

    .category-name {
        font-size: var(--font-size-base);
    }

    .category-count {
        font-size: var(--font-size-xs);
    }
}

/* ========================================
   Metric Interpretation & Status Indicators
   ======================================== */

/* Status badge styles */
.metric-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.metric-status.excellent {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.metric-status.good {
    background: rgba(52, 211, 153, 0.1);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.metric-status.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.25);
}

.metric-status.caution {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.metric-status.weak {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Trend indicators */
.trend-indicator {
    display: inline-flex;
    align-items: center;
    margin-left: 0.35rem;
    font-size: 0.9em;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

.trend-stable {
    color: #9ca3af;
}

/* Metric value container for status + trend */
.metric-value-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tooltip styles for interpretation details */
.interpretation-tooltip {
    position: relative;
    cursor: help;
}

.interpretation-tooltip .tooltip-content {
    visibility: hidden;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 280px;
    max-width: 320px;
    padding: var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
    text-align: left;
}

.interpretation-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: var(--color-border) transparent transparent transparent;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
}

.tooltip-status {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.tooltip-trend {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

.tooltip-explanation {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
}

.tooltip-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    font-size: var(--font-size-xs);
}

.tooltip-detail-row {
    display: flex;
    justify-content: space-between;
    color: var(--color-text-muted);
}

.tooltip-detail-value {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* Insights toggle button */
.insights-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    height: 2.65rem;
    padding: 0 0.95rem;
    background: rgba(8, 11, 18, 0.6);
    border: 1px solid rgba(173, 198, 255, 0.1);
    border-radius: 0.95rem;
    color: rgba(198, 205, 224, 0.74);
    font-size: 0.8rem;
    font-weight: 650;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.insights-toggle:hover {
    border-color: rgba(173, 198, 255, 0.26);
    color: var(--color-text-primary);
}

.insights-toggle.active {
    background: rgba(77, 142, 255, 0.14);
    border-color: rgba(173, 198, 255, 0.28);
    color: #dce8ff;
}

.insights-toggle-icon {
    font-size: 1rem;
}

/* Export / Pro-lock button — same toolbar pill family as the lens + insights
   toggles so the action row reads as one cohesive control cluster. */
.nav-bar-actions .toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.65rem;
    padding: 0 0.95rem;
    border-radius: 0.95rem;
    background: rgba(8, 11, 18, 0.6);
    border: 1px solid rgba(173, 198, 255, 0.1);
    color: rgba(198, 205, 224, 0.74);
    font-size: 0.8rem;
    font-weight: 650;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.nav-bar-actions .toolbar-btn:hover {
    color: #ffffff;
    border-color: rgba(173, 198, 255, 0.28);
    background: rgba(173, 198, 255, 0.08);
}

.nav-bar-actions .toolbar-btn .material-symbols-outlined {
    font-size: 1.05rem;
}

/* Hide insights by default, show when enabled */
.insights-hidden .metric-status,
.insights-hidden .trend-indicator,
.insights-hidden .interpretation-tooltip .tooltip-content {
    display: none !important;
}

/* Data quality indicator */
.data-quality-warning {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.4rem;
    background: rgba(245, 158, 11, 0.1);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: #f59e0b;
}

/* Sector comparison badge */
.vs-sector-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.4rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-xs);
    color: var(--color-accent-secondary);
    margin-left: 0.35rem;
}

/* Responsive adjustments for interpretation */
@media (max-width: 768px) {
    .metric-status {
        padding: 0.1rem 0.35rem;
        font-size: 0.65rem;
    }

    .interpretation-tooltip .tooltip-content {
        min-width: 220px;
        max-width: 260px;
        left: auto;
        right: 0;
        transform: none;
    }

    .interpretation-tooltip .tooltip-content::after {
        left: auto;
        right: 20px;
    }
}

/* ========================================
   Red Flags Banner & Row Highlighting
   ======================================== */

.red-flags-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 1rem 1.1rem;
    background: linear-gradient(90deg, rgba(255, 180, 171, 0.12) 0%, rgba(255, 180, 171, 0.04) 100%);
    border: 1px solid rgba(255, 180, 171, 0.18);
    border-left: 0;
    border-radius: 1rem;
    margin-bottom: var(--spacing-md);
}

.red-flags-banner .banner-icon {
    font-size: 1.25rem;
}

.red-flags-banner .banner-text {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-primary);
}

.red-flags-banner .banner-dismiss {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: var(--spacing-xs);
    font-size: var(--font-size-base);
    transition: color var(--transition-fast);
}

.red-flags-banner .banner-dismiss:hover {
    color: var(--color-text-primary);
}

/* Red flag row highlighting */
.metric-row.red-flag-row {
    background: rgba(239, 68, 68, 0.08) !important;
}

.metric-row.red-flag-row:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

.metric-row.caution-row {
    background: rgba(245, 158, 11, 0.06) !important;
}

.metric-row.caution-row:hover {
    background: rgba(245, 158, 11, 0.1) !important;
}

/* Metrics that are structurally not applicable to a company's business model
   (e.g. Debt/EBITDA for a bank) — de-emphasized, with the reason on hover. */
.metric-row.metric-na-row {
    opacity: 0.55;
}

.metric-na-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 0 6px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1px solid var(--border-color, #3a3a3a);
    border-radius: 4px;
    color: var(--text-muted, #9ca3af);
    cursor: help;
    vertical-align: middle;
}

/* ========================================
   Sparklines
   ======================================== */

.sparkline {
    display: inline-flex;
    align-items: center;
    margin-left: var(--spacing-sm);
    vertical-align: middle;
}

.sparkline-svg {
    display: block;
}

/* Hide sparklines when insights are hidden */
.insights-hidden .sparkline {
    display: none !important;
}

/* Latest period cell styling */
.metric-value-cell.latest-period {
    position: relative;
}

/* ========================================
   Category Scroll-spy & Collapse
   ======================================== */

/* Scroll offset for sticky nav bars (main nav + category nav) */
.category-section {
    scroll-margin-top: 120px;
}

/* Category header — clickable for collapse toggle */
.category-header-static {
    cursor: pointer;
    user-select: none;
}

.category-header-static:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.category-collapse-icon {
    margin-left: auto;
    transition: transform 200ms ease;
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    opacity: 0.6;
}

.category-header-static:hover .category-collapse-icon {
    opacity: 1;
}

/* Collapsed state */
.category-section.collapsed .category-collapse-icon {
    transform: rotate(-90deg);
}

.category-section.collapsed .category-content {
    display: none;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   Report Tab & Pro Badge
   ======================================== */

.category-tab.report-tab {
    position: relative;
}

.category-tab .pro-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    background: linear-gradient(135deg, #FFD700, #FDB931);
    color: #000;
    border-radius: var(--radius-sm);
    margin-left: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.category-tab.pro-locked {
    opacity: 0.7;
}

.category-tab.pro-locked:hover {
    opacity: 1;
}

/* ========================================
   Report Section (Pro Feature)
   ======================================== */

.report-section {
    padding: var(--spacing-lg) 0;
}

.report-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.report-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.report-subtitle {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

@media (max-width: 768px) {
    .report-grid {
        grid-template-columns: 1fr;
    }
}

.report-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.report-card.bullish {
    border-left: 4px solid #10b981;
}

.report-card.bearish {
    border-left: 4px solid #ef4444;
}

.report-card-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--color-border);
}

.report-card-icon {
    font-size: 1.5rem;
}

.report-card-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.report-card-content {
    padding: var(--spacing-lg);
    max-height: 400px;
    overflow-y: auto;
}

.signal-item {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-border);
}

.signal-item.strong {
    border-left-color: var(--color-accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.report-card.bullish .signal-item.strong {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.report-card.bearish .signal-item.strong {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.signal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
}

.signal-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.signal-value {
    font-weight: 500;
    color: var(--color-text-secondary);
}

.signal-reason {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.signal-trend {
    display: inline-block;
    font-size: var(--font-size-xs);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-xs);
}

.signal-trend.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.signal-trend.trend-down {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.no-signals {
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    padding: var(--spacing-lg);
}

/* Report Summary Section */
.report-summary {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.summary-icon {
    font-size: 1.5rem;
}

.summary-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
}

.summary-content {
    text-align: center;
}

.sentiment-badge {
    display: inline-block;
    font-size: var(--font-size-lg);
    font-weight: 700;
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-md);
}

.sentiment-badge.bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sentiment-badge.bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sentiment-badge.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.summary-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--spacing-lg);
    line-height: 1.6;
}

.summary-stats {
    display: flex;
    justify-content: center;
    gap: var(--spacing-2xl);
}

.summary-stats .stat {
    text-align: center;
}

.summary-stats .stat-num {
    display: block;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--color-text-primary);
}

/* Key Metrics Section */
.key-metrics-section {
    margin-bottom: var(--spacing-2xl);
}

.key-metrics-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.key-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-md);
}

.key-metric-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.key-metric-card:hover {
    border-color: var(--color-border-light);
    transform: translateY(-2px);
}

.key-metric-card.excellent {
    border-top: 3px solid #10b981;
}

.key-metric-card.good {
    border-top: 3px solid #34d399;
}

.key-metric-card.neutral {
    border-top: 3px solid #9ca3af;
}

.key-metric-card.caution {
    border-top: 3px solid #f59e0b;
}

.key-metric-card.weak {
    border-top: 3px solid #ef4444;
}

.key-metric-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.key-metric-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.key-metric-status {
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
}

/* ========================================
   Report Narrative Section
   ======================================== */

.report-narrative {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.narrative-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.narrative-icon {
    font-size: 1.5rem;
}

.narrative-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

.narrative-text {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-lg);
}

.sentiment-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: var(--font-size-base);
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-full);
}

.sentiment-badge.sentiment-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sentiment-badge.sentiment-moderately-bullish {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.3);
}

.sentiment-badge.sentiment-neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.3);
}

.sentiment-badge.sentiment-moderately-bearish {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sentiment-badge.sentiment-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.sentiment-score {
    font-weight: 400;
    opacity: 0.8;
}

/* ========================================
   Percentile Rankings Section
   ======================================== */

.percentile-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-xs);
}

.section-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-lg);
}

.percentile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.percentile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.percentile-card.leaderboard-trigger {
    appearance: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.percentile-card.leaderboard-trigger:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.percentile-card.leaderboard-trigger:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.percentile-metric-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.percentile-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.percentile-bar {
    height: 8px;
    background: var(--color-bg-secondary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
}

.percentile-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.percentile-fill.excellent {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.percentile-fill.good {
    background: linear-gradient(90deg, #34d399, #6ee7b7);
}

.percentile-fill.fair {
    background: linear-gradient(90deg, #9ca3af, #d1d5db);
}

.percentile-fill.weak {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.percentile-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.percentile-rank {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.sector-rank {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

.percentile-card-cta {
    display: inline-flex;
    margin-top: var(--spacing-sm);
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.leaderboard-modal-container {
    max-width: 960px;
}

.leaderboard-modal-body {
    padding: var(--spacing-xl);
}

.leaderboard-modal-subtitle {
    margin-top: var(--spacing-xs);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
}

.leaderboard-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.leaderboard-scope-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 999px;
}

.leaderboard-scope-btn {
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.leaderboard-scope-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

.leaderboard-company-summary {
    min-height: 2.5rem;
    text-align: right;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

.leaderboard-company-summary strong {
    color: var(--color-text-primary);
}

.leaderboard-status {
    padding: var(--spacing-lg);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    text-align: center;
}

.leaderboard-table-wrap {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: middle;
}

.leaderboard-table th {
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tbody tr.is-target {
    background: rgba(16, 185, 129, 0.08);
}

.leaderboard-rank-cell {
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.leaderboard-company-link {
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: 600;
}

.leaderboard-company-link:hover {
    color: var(--color-accent);
}

.leaderboard-company-name {
    color: var(--color-text-secondary);
}

.leaderboard-current-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    color: #6ee7b7;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.leaderboard-value-cell {
    text-align: right;
    font-weight: 700;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.leaderboard-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.leaderboard-page-btn {
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text-primary);
    border-radius: var(--radius-md);
    padding: 0.7rem 1rem;
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.leaderboard-page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.leaderboard-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.leaderboard-page-info {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
}

@media (max-width: 768px) {
    .leaderboard-modal-body {
        padding: var(--spacing-lg);
    }

    .leaderboard-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .leaderboard-company-summary {
        text-align: left;
    }

    .leaderboard-sector-column,
    .leaderboard-table td[data-column="sector"] {
        display: none;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.75rem 0.8rem;
    }

    .leaderboard-pagination {
        flex-wrap: wrap;
    }
}

/* ========================================
   Peer Comparison Section
   ======================================== */

.peer-comparison-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.peer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

.peer-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
}

.peer-metric-name {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.peer-company-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.company-badge {
    background: var(--color-accent-primary);
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

.peer-company-value .peer-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
}

.peer-company-value .peer-value.best {
    color: #10b981;
}

.peer-rank {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: auto;
}

.peer-list {
    margin-bottom: var(--spacing-md);
}

.peer-item {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    font-size: var(--font-size-sm);
}

.peer-ticker {
    color: var(--color-text-secondary);
}

.peer-item .peer-value {
    color: var(--color-text-primary);
    font-weight: 500;
}

.peer-median {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    padding-top: var(--spacing-sm);
    border-top: 1px solid var(--color-border);
}

/* ========================================
   Pro Upsell Section
   ======================================== */

.pro-upsell-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.pro-upsell-content {
    max-width: 400px;
    margin: 0 auto;
}

.pro-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.pro-upsell-section h4 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
}

.pro-upsell-section p {
    font-size: var(--font-size-base);
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
}

.pro-upgrade-btn {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pro-upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

/* ========================================
   Anomalies Section
   ======================================== */

.anomalies-section {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.anomaly-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.anomaly-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-border);
}

.anomaly-item.positive {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.anomaly-item.negative {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.anomaly-metric {
    font-weight: 600;
    color: var(--color-text-primary);
    min-width: 150px;
}

.anomaly-interpretation {
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    flex: 1;
}

.anomaly-zscore {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
}

/* Signal percentile badge */
.signal-percentile {
    display: inline-block;
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-top: var(--spacing-xs);
}

/* ========================================
   Pro-Locked Interpretation Styles
   ======================================== */

.metric-status.pro-locked {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.metric-status.pro-locked:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.3));
    border-color: rgba(139, 92, 246, 0.5);
}

.pro-lock-link {
    text-decoration: none;
    font-size: var(--font-size-xs);
}

/* Comparison Tool Styles */
.comparison-page {
    max-width: 1536px;
    margin: 0 auto;
    padding: 1.5rem 2.5rem 2rem;
}

.comparison-header {
    text-align: left;
    margin-bottom: var(--spacing-2xl);
}

.comparison-title {
    font-family: var(--font-family-display);
    font-size: clamp(2.25rem, 4vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--color-text-primary);
    margin-bottom: 0.65rem;
}

.comparison-subtitle {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.ticker-selector {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: flex-start;
    margin-bottom: var(--spacing-xl);
}

.ticker-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.ticker-input {
    width: 110px;
    padding: 0.95rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    background: rgba(10, 14, 20, 0.8);
    color: var(--color-text-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
}

.ticker-input:focus {
    outline: none;
    border-color: var(--color-accent-secondary);
    box-shadow: 0 0 0 3px rgba(173, 198, 255, 0.12);
}

.add-ticker-btn,
.compare-btn {
    min-height: 3.25rem;
    padding: 0.85rem 1.5rem;
    background: #4d8eff;
    color: #00285d;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all var(--transition-fast);
}

.add-ticker-btn:hover,
.compare-btn:hover {
    background: var(--color-accent-primary-hover);
    transform: none;
    box-shadow: 0 18px 36px rgba(173, 198, 255, 0.14);
}

.comparison-heatmap {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

.heatmap-table {
    width: 100%;
    border-collapse: collapse;
}

.heatmap-table th,
.heatmap-table td {
    padding: var(--spacing-md);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}

.heatmap-table th {
    background: var(--color-bg-secondary);
    font-weight: 600;
    color: var(--color-text-primary);
}

.heatmap-table th.metric-col {
    text-align: left;
    min-width: 200px;
}

.heatmap-cell {
    position: relative;
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.heatmap-cell.best {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.heatmap-cell.good {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
}

.heatmap-cell.average {
    background: rgba(156, 163, 175, 0.1);
    color: var(--color-text-secondary);
}

.heatmap-cell.poor {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.heatmap-cell.worst {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.winner-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #10b981;
    color: white;
    font-size: 10px;
    padding: 1px 4px;
    border-radius: 4px;
}

/* Report History Styles */
.report-history-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.report-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.report-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: all var(--transition-fast);
}

.report-history-item:hover {
    border-color: var(--color-border-light);
    transform: translateX(4px);
}

.report-info {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.report-ticker {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--color-accent-primary);
}

.report-company-name {
    color: var(--color-text-primary);
    font-weight: 500;
}

.report-date {
    color: var(--color-text-muted);
    font-size: var(--font-size-sm);
}

.report-sentiment-badge {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.report-sentiment-badge.bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.report-sentiment-badge.bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.report-sentiment-badge.neutral {
    background: rgba(156, 163, 175, 0.15);
    color: var(--color-text-secondary);
}

.report-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.report-action-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.report-action-btn:hover {
    background: var(--color-bg-card-hover);
    color: var(--color-text-primary);
}

/* PDF Export Button */
.export-pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.export-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Percentile Bar */
.percentile-bar {
    width: 100%;
    height: 8px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--spacing-xs);
}

.percentile-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.percentile-fill.top-10 {
    background: #10b981;
}

.percentile-fill.top-25 {
    background: #34d399;
}

.percentile-fill.top-50 {
    background: #fbbf24;
}

.percentile-fill.bottom-50 {
    background: #f97316;
}

.percentile-fill.bottom-25 {
    background: #ef4444;
}

.percentile-label {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-top: var(--spacing-xs);
}

/* Save Report Button */
.save-report-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.save-report-btn:hover {
    background: var(--color-bg-card-hover);
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
}

.save-report-btn.saved {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

/* ========================================
   Insights Dashboard (Health Score + Key Metrics)
   ======================================== */
.insights-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.insights-panel {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    transition: border-color 0.2s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

/* Single panel takes full width */
.insights-panel:only-child {
    grid-column: 1 / -1;
    max-width: 600px;
}

.insights-panel:hover {
    border-color: rgba(173, 198, 255, 0.12);
}

/* --- Health Panel --- */
.panel-header {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.score-ring-compact {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.score-ring-compact svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.score-circle-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 6;
}

.score-circle-progress {
    fill: none;
    stroke-width: 6;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-out;
}

.score-circle-progress.grade-a {
    stroke: #10b981;
}

.score-circle-progress.grade-b {
    stroke: #34d399;
}

.score-circle-progress.grade-c {
    stroke: #fbbf24;
}

.score-circle-progress.grade-d {
    stroke: #f97316;
}

.score-circle-progress.grade-f {
    stroke: #ef4444;
}

.score-ring-compact .score-value-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-ring-compact .score-number {
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1;
    color: var(--color-text-primary);
}

.panel-header-text {
    flex: 1;
    min-width: 0;
}

.panel-title-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.grade-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.grade-badge.grade-a {
    background: linear-gradient(135deg, #10b981, #059669);
}

.grade-badge.grade-b {
    background: linear-gradient(135deg, #34d399, #10b981);
}

.grade-badge.grade-c {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.grade-badge.grade-d {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.grade-badge.grade-f {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.grade-label-text {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.sentiment-pill {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.sentiment-pill.sentiment-bullish {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.sentiment-pill.sentiment-moderately-bullish {
    background: rgba(52, 211, 153, 0.12);
    color: #34d399;
}

.sentiment-pill.sentiment-neutral {
    background: rgba(156, 163, 175, 0.15);
    color: #9ca3af;
}

.sentiment-pill.sentiment-moderately-bearish {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sentiment-pill.sentiment-bearish {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.panel-narrative {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Compact component bars */
.components-compact {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.comp-row {
    display: grid;
    grid-template-columns: 112px 1fr 28px;
    gap: 0.6rem;
    align-items: center;
}

.comp-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
}

.component-trend {
    font-size: 0.65rem;
}

.component-trend.up {
    color: #10b981;
}

.component-trend.down {
    color: #ef4444;
}

.component-trend.stable {
    color: var(--color-text-muted);
}

.comp-bar {
    height: 6px;
    background: var(--color-bg-secondary);
    border-radius: 999px;
    overflow: hidden;
}

.comp-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.comp-fill.excellent {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.comp-fill.good {
    background: linear-gradient(90deg, #34d399, #6ee7b7);
}

.comp-fill.fair {
    background: linear-gradient(90deg, #fbbf24, #fcd34d);
}

.comp-fill.weak {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.comp-fill.poor {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.comp-score {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: right;
}

/* Compact signals */
.signals-compact {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.sig {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

.sig.bullish {
    background: rgba(16, 185, 129, 0.06);
}

.sig.bearish {
    background: rgba(239, 68, 68, 0.06);
}

.sig-icon {
    font-size: 0.55rem;
    flex-shrink: 0;
}

.sig.bullish .sig-icon {
    color: #10b981;
}

.sig.bearish .sig-icon {
    color: #ef4444;
}

.sig-text strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

.signals-limited-compact {
    text-align: center;
    padding-top: 4px;
}

.signals-limited-compact a {
    font-size: 0.7rem;
    color: var(--color-accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.signals-limited-compact a:hover {
    text-decoration: underline;
}

/* --- Metrics Panel --- */
.panel-header-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-label {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.panel-meta {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.16em;
}

/* Valuation strip */
.valuation-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.val-tile,
.val-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.85rem 0.95rem;
    background: rgba(10, 14, 20, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    min-height: 4.25rem;
}

.val-num {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.val-num.good {
    color: #10b981;
}

.val-num.high {
    color: #f59e0b;
}

.val-num.low {
    color: #ef4444;
}

.val-label {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* Key metrics grid */
.km-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex: 1;
}

.km-card {
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: rgba(10, 14, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.km-card:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(173, 198, 255, 0.12);
}

.km-card.status-excellent {
    border-left: 3px solid #10b981;
}

.km-card.status-good {
    border-left: 3px solid #34d399;
}

.km-card.status-fair {
    border-left: 3px solid #9ca3af;
}

.km-card.status-caution {
    border-left: 3px solid #f59e0b;
}

.km-card.status-weak {
    border-left: 3px solid #ef4444;
}

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

.km-name {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.km-trend {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.km-trend.trend-up {
    color: #10b981;
}

.km-trend.trend-down {
    color: #ef4444;
}

.km-trend.trend-stable {
    color: #9ca3af;
}

.km-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.2;
}

.km-sector {
    font-size: 0.65rem;
    color: var(--color-text-muted);
}

.km-sector.positive {
    color: #10b981;
}

.km-sector.negative {
    color: #ef4444;
}

/* --- Deep Dive Signals (in report tab) --- */
.deep-dive-signals-section {
    margin-bottom: var(--spacing-2xl);
}

.signals-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.signals-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.signals-column-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-sm);
}

.signals-column-header.bullish {
    color: #10b981;
}

.signals-column-header.bearish {
    color: #ef4444;
}

.signals-column-icon {
    font-size: var(--font-size-lg);
}

.signals-column-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.signal-count {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    margin-left: auto;
}

.signals-limited-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-md);
    font-size: var(--font-size-sm);
}

.signals-limited-notice a {
    color: var(--color-accent-primary);
    font-weight: 500;
}

/* Signal Strength Badge (Deep Dive) */
.signal-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.signal-strength-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.4rem;
    border-radius: var(--radius-sm);
}

.signal-strength-badge.strength-strong {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-accent-secondary);
}

.signal-strength-badge.strength-moderate {
    background: rgba(156, 163, 175, 0.15);
    color: var(--color-text-secondary);
}

/* ========================================
   Collapsible Sections
   ======================================== */
.collapsible-section {
    margin-bottom: var(--spacing-md);
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.1rem;
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.collapsible-header:hover {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.6) 0%, rgba(10, 14, 20, 0.34) 100%);
    border-color: rgba(173, 198, 255, 0.12);
}

.collapsible-header.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.collapsible-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    color: var(--color-text-primary);
}

.collapsible-icon {
    transition: transform var(--transition-fast);
    color: var(--color-text-muted);
}

.collapsible-header.open .collapsible-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    border: 1px solid var(--color-border);
    border-top: none;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.collapsible-content.open {
    max-height: 2000px;
}

.collapsible-inner {
    padding: var(--spacing-md);
}

/* Chart Collapsible Wrapper */
.chart-collapsible {
    margin-bottom: var(--spacing-md);
}

.chart-collapsible .collapsible-content {
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
}

.chart-collapsible .collapsible-content.open {
    max-height: 500px;
}

/* Metrics Section Collapsed by Default for Free */
.metrics-collapsed-default {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.metrics-collapsed-default.expanded {
    max-height: none;
}

/* ========================================
   Responsive: Insights Dashboard
   ======================================== */
@media (max-width: 900px) {
    .insights-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .signals-grid {
        grid-template-columns: 1fr;
    }

    .km-grid {
        grid-template-columns: 1fr;
    }

    .comp-row {
        grid-template-columns: 80px 1fr 24px;
    }
}

/* ========================================
   Stitch-inspired homepage redesign
   ======================================== */
.landing-hero-section {
    position: relative;
    overflow: hidden;
    padding: 4rem 0 3rem;
}

.landing-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.18), transparent 35%),
        radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.14), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.landing-hero-shell,
.landing-proof-grid,
.landing-feature-story,
.landing-workflow-section,
.landing-showcase-section,
.landing-company-strip,
.landing-final-shell {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: var(--spacing-xl);
    padding-right: var(--spacing-xl);
}

.landing-hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 3rem;
    align-items: center;
}

.landing-kicker,
.landing-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(129, 140, 248, 0.18);
    color: #c7d2fe;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-kicker-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #93c5fd, #818cf8);
    box-shadow: 0 0 18px rgba(129, 140, 248, 0.55);
}

.landing-hero-title,
.landing-section-heading h2,
.landing-final-shell h2,
.logo-wordmark {
    font-family: var(--font-family-display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--color-text-primary);
}


.landing-hero-title {
    margin-top: 1.25rem;
    font-size: clamp(3.2rem, 7vw, 5.7rem);
    line-height: 0.94;
    letter-spacing: -0.06em;
    font-weight: 800;
    max-width: 10.5ch;
}

.landing-hero-title span {
    display: block;
    margin-top: 0.35rem;
    background: linear-gradient(135deg, #ffffff 0%, #b8c6ff 55%, #8ea4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero-description {
    margin-top: 1.4rem;
    max-width: 42rem;
    color: #b6bdd0;
    font-size: 1.14rem;
    line-height: 1.8;
}

.landing-hero-actions {
    margin-top: 2rem;
}

.hero-search-panel {
    max-width: 42rem;
}

.hero-search-input {
    min-height: 4.25rem;
    background: rgba(10, 10, 15, 0.72);
    border-color: rgba(129, 140, 248, 0.14);
    border-radius: 1.2rem;
    font-size: 1rem;
}

.hero-search-input:focus {
    border-color: rgba(129, 140, 248, 0.55);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18), 0 0 40px rgba(99, 102, 241, 0.14);
}

.landing-cta-row {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.landing-cta-row.centered {
    justify-content: center;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3.35rem;
    padding: 0.9rem 1.45rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.landing-btn:hover {
    transform: translateY(-1px);
}

.landing-btn-primary {
    background: linear-gradient(135deg, #adc6ff 0%, #7aa2ff 45%, #4d8eff 100%);
    color: #081120;
    box-shadow: 0 18px 45px rgba(77, 142, 255, 0.2);
}

.landing-btn-primary:hover {
    color: #081120;
    box-shadow: 0 24px 52px rgba(77, 142, 255, 0.28);
}

.landing-btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text-primary);
}

.landing-btn-secondary:hover {
    color: var(--color-text-primary);
    border-color: rgba(173, 198, 255, 0.35);
    background: rgba(255, 255, 255, 0.05);
}

.landing-trust-pills,
.landing-popular-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.15rem;
}

.landing-pill,
.landing-symbol-chip,
.landing-filter-chip,
.landing-preview-badge,
.landing-table-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #d4d9e5;
    font-size: 0.78rem;
}

.landing-popular-label {
    color: var(--color-text-muted);
    align-self: center;
    font-size: 0.85rem;
}

.landing-symbol-chip:hover {
    color: var(--color-text-primary);
    border-color: rgba(173, 198, 255, 0.32);
}

.landing-hero-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-preview-card,
.landing-proof-item,
.landing-bento-card,
.landing-step-card,
.landing-showcase-panel,
.landing-company-card,
.landing-final-shell {
    background: linear-gradient(145deg, rgba(26, 26, 36, 0.95) 0%, rgba(17, 20, 28, 0.92) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.landing-preview-card {
    border-radius: 1.6rem;
    padding: 1.35rem;
}

.landing-preview-main {
    padding: 1.6rem;
}

.landing-preview-header,
.landing-table-topline {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.landing-preview-header h3,
.landing-side-header strong,
.landing-table-topline strong,
.landing-proof-item h2,
.landing-bento-card h3,
.landing-step-card h3,
.landing-showcase-copy h2,
.landing-final-shell h2 {
    color: var(--color-text-primary);
}

.landing-preview-header h3 {
    font-family: var(--font-family-display);
    font-size: 1.45rem;
    margin-top: 0.25rem;
}

.landing-preview-label,
.landing-side-header span,
.landing-table-topline span,
.landing-mini-label,
.landing-chart-caption,
.landing-proof-label {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.landing-preview-header p,
.landing-mini-copy,
.landing-proof-item.stat span,
.landing-bento-card p,
.landing-step-card p,
.landing-showcase-copy p,
.landing-company-sector,
.landing-final-shell p,
.landing-table-topline span {
    color: #aeb5c7;
}

.landing-score-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1rem;
    margin-top: 1.4rem;
}

.landing-score-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 10rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
}

.landing-score-ring {
    position: relative;
    width: 5.6rem;
    height: 5.6rem;
    border-radius: 50%;
    background: conic-gradient(#8ea4ff 0 325deg, rgba(255, 255, 255, 0.07) 325deg 360deg);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.landing-score-ring::before {
    content: '';
    width: 4.35rem;
    height: 4.35rem;
    border-radius: 50%;
    background: #111620;
    position: absolute;
}

.landing-score-ring span {
    position: relative;
    z-index: 1;
    font-family: var(--font-family-display);
    font-size: 1.5rem;
    font-weight: 800;
}

.landing-metric-stack {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.landing-mini-metric {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: #c9cfdd;
}

.landing-mini-metric strong {
    color: #c9f7e4;
    font-size: 1rem;
}

.landing-preview-chart {
    margin-top: 1.35rem;
    padding: 1rem;
    border-radius: 1.25rem;
    background: rgba(8, 10, 16, 0.55);
}

.landing-chart-bars {
    display: flex;
    align-items: end;
    gap: 0.45rem;
    height: 10rem;
}

.landing-chart-bars span {
    flex: 1;
    border-radius: 0.9rem 0.9rem 0 0;
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.9) 0%, rgba(77, 142, 255, 0.35) 100%);
}

.landing-chart-caption {
    margin-top: 0.9rem;
}

.landing-preview-side {
    max-width: 20rem;
    margin-left: auto;
}

.landing-side-header {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.8rem;
}

.landing-integrity-strip {
    padding: 1rem 0 0;
}

.landing-integrity-shell {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.25rem var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.015);
}

.landing-integrity-label {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-weight: 800;
    white-space: nowrap;
}

.landing-integrity-items {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2.2rem;
    opacity: 0.7;
}

.landing-integrity-item {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #d5dae5;
    font-family: var(--font-family-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.landing-integrity-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.landing-proof-section,
.landing-workflow-section,
.landing-showcase-section,
.landing-company-strip {
    padding: 1.25rem 0 0;
}

.landing-proof-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 1rem;
}

.landing-proof-item {
    border-radius: 1.4rem;
    padding: 1.45rem;
}

.landing-proof-item h2 {
    margin-top: 0.8rem;
    font-family: var(--font-family-display);
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.landing-proof-item.stat strong {
    display: block;
    font-family: var(--font-family-display);
    font-size: 2.3rem;
    letter-spacing: -0.05em;
    margin-bottom: 0.5rem;
}

.landing-feature-story {
    padding-top: 5rem;
}

.landing-section-heading {
    max-width: 48rem;
    margin-bottom: 2rem;
}

.landing-section-heading-split {
    max-width: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
}

.landing-inline-link {
    align-self: flex-end;
    color: #b8c6ff;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    white-space: nowrap;
}

.landing-inline-link:hover {
    color: #d8e2ff;
}

.landing-section-heading.centered,
.landing-section-heading.compact,
.landing-final-shell {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.landing-section-heading h2,
.landing-final-shell h2 {
    margin-top: 1rem;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
    font-weight: 800;
}

.landing-section-heading p,
.landing-final-shell p {
    margin-top: 0.9rem;
    color: #aeb5c7;
    font-size: 1.02rem;
    line-height: 1.75;
}

.landing-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.landing-bento-grid-tall {
    align-items: stretch;
}

.landing-bento-card {
    grid-column: span 4;
    border-radius: 1.4rem;
    padding: 1.5rem;
}

.landing-bento-hero-card {
    grid-column: span 8;
    min-height: 31rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.landing-bento-wide {
    grid-column: span 6;
}

.landing-bento-horizontal {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.landing-bento-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    border-radius: 1rem;
    background: rgba(173, 198, 255, 0.1);
    color: #d3dcff;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.landing-bento-card h3,
.landing-step-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.55rem;
}

.landing-bento-card p,
.landing-step-card p,
.landing-showcase-list li {
    font-size: 0.97rem;
    line-height: 1.7;
}

.landing-bento-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.6rem;
}

.landing-bento-list span {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    background: rgba(8, 10, 16, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #d6dbeb;
    font-size: 0.88rem;
    font-weight: 600;
}

.landing-bento-visual-chart {
    margin-top: 2rem;
    padding: 1.6rem;
    border-radius: 1.35rem;
    background: rgba(8, 10, 16, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.landing-bento-bars {
    display: flex;
    align-items: end;
    gap: 0.55rem;
    height: 12.5rem;
}

.landing-bento-bars span {
    flex: 1;
    border-radius: 0.85rem 0.85rem 0 0;
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.32) 0%, rgba(77, 142, 255, 0.68) 100%);
    transition: background 0.2s ease;
}

.landing-bento-card:hover .landing-bento-bars span {
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.48) 0%, rgba(77, 142, 255, 0.82) 100%);
}

.landing-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.landing-step-card {
    border-radius: 1.35rem;
    padding: 1.45rem;
}

.landing-step-number {
    display: inline-flex;
    margin-bottom: 1rem;
    font-family: var(--font-family-display);
    font-size: 0.95rem;
    font-weight: 800;
    color: #8ea4ff;
    letter-spacing: 0.14em;
}

.landing-showcase-grid {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 1.4rem;
    align-items: center;
    padding-top: 4.75rem;
}

.landing-showcase-copy h2 {
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 4vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.05em;
    margin-top: 1rem;
}

.landing-showcase-list {
    list-style: none;
    margin-top: 1.1rem;
    display: grid;
    gap: 0.8rem;
}

.landing-showcase-list li {
    position: relative;
    padding-left: 1.2rem;
}

.landing-showcase-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #8ea4ff;
}

.landing-showcase-panel {
    border-radius: 1.6rem;
    padding: 1.4rem;
}

.landing-table-card {
    padding: 1.1rem;
    border-radius: 1.2rem;
    background: rgba(8, 10, 16, 0.48);
}

.landing-table-metrics {
    margin-top: 1rem;
    border-radius: 1rem;
    overflow: hidden;
}

.landing-table-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0.95rem;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-table-row:last-child {
    border-bottom: 0;
}

.landing-table-row strong {
    color: var(--color-text-primary);
}

.landing-table-row.muted strong {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.landing-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
}

.landing-company-card {
    border-radius: 1.25rem;
    padding: 1.2rem;
    transition: transform 0.18s ease, border-color 0.2s ease;
}

.landing-company-card:hover {
    transform: translateY(-2px);
    border-color: rgba(173, 198, 255, 0.25);
}

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

.landing-company-ticker {
    font-family: var(--font-family-display);
    font-size: 1.15rem;
    font-weight: 800;
    color: #d5ddff;
}

.landing-company-arrow {
    color: #8ea4ff;
}

.landing-company-name {
    margin-top: 0.85rem;
    color: var(--color-text-primary);
    font-weight: 600;
    line-height: 1.5;
}

.landing-company-sector {
    margin-top: 0.35rem;
    font-size: 0.88rem;
}

.landing-final-cta {
    padding: 5rem 0 3rem;
}

.landing-final-shell {
    max-width: 900px;
    padding-top: 3rem;
    padding-bottom: 3rem;
    border-radius: 1.8rem;
}

@media (max-width: 1100px) {
    .landing-hero-shell,
    .landing-showcase-grid,
    .landing-proof-grid {
        grid-template-columns: 1fr;
    }

    .landing-section-heading-split {
        display: block;
    }

    .landing-inline-link {
        display: inline-flex;
        margin-top: 1rem;
    }

    .landing-bento-card,
    .landing-bento-wide,
    .landing-bento-hero-card {
        grid-column: span 12;
        min-height: auto;
    }

    .landing-preview-side {
        max-width: none;
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
    }

    .nav-container-marketing {
        height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .nav-brand-group {
        gap: 1rem;
    }

    .nav-search {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: var(--spacing-md);
    }

    .navbar-marketing .nav-search {
        display: none;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .nav-links-actions {
        width: auto;
        margin-left: auto;
    }

    .nav-btn {
        width: auto;
    }

    .company-page,
    .comparison-page,
    .page-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .company-hero-grid,
    .company-mini-stats {
        grid-template-columns: 1fr;
    }

    .landing-hero-section {
        padding-top: 2rem;
    }

    .landing-hero-shell,
    .landing-proof-grid,
    .landing-steps-grid,
    .landing-showcase-grid {
        gap: 1rem;
    }

    .landing-integrity-shell,
    .landing-score-grid,
    .landing-steps-grid {
        grid-template-columns: 1fr;
    }

    .landing-integrity-shell {
        display: block;
    }

    .landing-integrity-items {
        margin-top: 1rem;
        justify-content: flex-start;
    }

    .landing-hero-title {
        max-width: none;
        font-size: 3rem;
    }

    .landing-hero-description {
        font-size: 1rem;
    }

    .landing-btn {
        width: 100%;
    }

    .landing-cta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-preview-main,
    .landing-preview-card,
    .landing-proof-item,
    .landing-bento-card,
    .landing-step-card,
    .landing-showcase-panel,
    .landing-company-card,
    .landing-final-shell {
        padding: 1.15rem;
        border-radius: 1.2rem;
    }

    .landing-score-card,
    .landing-bento-horizontal {
        min-height: auto;
        display: block;
    }
}

/* ========================================
   Stitch fidelity pass — issue #24
   Tightens the app toward the original "Digital Architect" Stitch language:
   editorial spacing, tonal surfaces, soft boundaries, and one coherent accent.
   ======================================== */
:root {
    --color-bg-primary: #0a0e14;
    --color-bg-secondary: #10141a;
    --color-bg-card: #181c22;
    --color-bg-card-hover: #1c2026;
    --color-bg-elevated: #262a31;
    --color-text-primary: #dfe2eb;
    --color-text-secondary: #c2c6d6;
    --color-text-muted: #8c909f;
    --color-accent-primary: #adc6ff;
    --color-accent-secondary: #d8e2ff;
    --color-accent-blue: #4d8eff;
    --color-accent-glow: rgba(173, 198, 255, 0.22);
    --color-positive: #4edea3;
    --color-negative: #ffb4ab;
    --color-border: rgba(66, 71, 84, 0.58);
    --color-border-light: rgba(255, 255, 255, 0.055);
    --gradient-bg: radial-gradient(circle at 18% 0%, rgba(77, 142, 255, 0.11), transparent 34%), radial-gradient(circle at 88% 8%, rgba(111, 251, 190, 0.045), transparent 28%), linear-gradient(180deg, #0a0e14 0%, #10141a 44%, #0a0e14 100%);
    --gradient-primary: linear-gradient(135deg, #d8e2ff 0%, #adc6ff 42%, #4d8eff 100%);
    --gradient-card: linear-gradient(145deg, rgba(28, 32, 38, 0.88) 0%, rgba(16, 20, 26, 0.72) 52%, rgba(10, 14, 20, 0.88) 100%);
    --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.34);
    --shadow-glow: 0 0 64px rgba(173, 198, 255, 0.12);
}

body {
    background: var(--gradient-bg);
    letter-spacing: -0.006em;
}

.app-body::before,
.marketing-body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 70%);
}

/* Marketing nav: closer to Stitch export, less generic SaaS chrome. */
.navbar-marketing {
    background: rgba(10, 14, 20, 0.52);
    border-bottom: 1px solid rgba(173, 198, 255, 0.08);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.nav-container-marketing {
    max-width: 1536px;
    height: 5.25rem;
    padding-inline: clamp(1.5rem, 4vw, 3rem);
}

.logo-wordmark,
.footer-marketing-wordmark {
    font-family: var(--font-family-display);
    font-weight: 900;
    letter-spacing: -0.07em;
    color: #f4f7ff;
}

.logo-wordmark {
    font-size: 1.75rem;
}

.nav-link {
    color: rgba(223, 226, 235, 0.76);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

.nav-link:hover {
    color: #ffffff;
}

.nav-btn,
.nav-link.highlight,
.btn-primary,
.landing-btn-primary {
    background: var(--gradient-primary) !important;
    color: #06111f !important;
    border: 0 !important;
    box-shadow: 0 18px 55px rgba(77, 142, 255, 0.22), 0 0 0 1px rgba(255,255,255,0.12) inset !important;
}

/* Marketing nav, mobile: must live AFTER the unconditional
   `.nav-container-marketing { height: 5.25rem }` above, which otherwise
   clobbers the mobile height and crushes the wrapped rows into the fixed bar
   (CTA overlapping the wordmark). Single slim row: wordmark left,
   Login + compact CTA right. Inline nav links are display:none below 1024px. */
@media (max-width: 768px) {
    .nav-container-marketing {
        height: auto;
        min-height: 4rem;
        padding-block: 0.65rem;
        padding-inline: 1rem;
        flex-wrap: nowrap;
        gap: 0.75rem;
    }

    .nav-container-marketing .nav-brand-group {
        width: auto;
    }

    .nav-container-marketing .nav-links-actions {
        width: auto;
        margin-left: auto;
        flex-wrap: nowrap;
        gap: 0.9rem;
    }

    .navbar-marketing .logo-wordmark {
        font-size: 1.45rem;
    }

    .navbar-marketing .nav-btn {
        min-height: 2.6rem;
        padding: 0.6rem 0.95rem;
        border-radius: 0.65rem;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .nav-container-marketing .nav-links-actions {
        gap: 0.65rem;
    }

    .navbar-marketing .nav-btn {
        padding: 0.55rem 0.75rem;
        font-size: 0.66rem;
        letter-spacing: 0.03em;
    }
}

/* ---------------------------------------------------------------------------
   Marketing nav — mobile hamburger drawer.
   Below 1100px the horizontal links + actions collapse into a single menu
   button (wordmark left, button right). Tapping it drops a full-width drawer
   from the bar with every link stacked — instead of cramming Companies /
   Screener / Compare / About / Pricing / Login / CTA across one row.
--------------------------------------------------------------------------- */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0.6rem;
    cursor: pointer;
}

.nav-mobile-toggle-bar {
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: #dfe2eb;
    transition: transform 0.22s ease, opacity 0.18s ease;
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle[aria-expanded="true"] .nav-mobile-toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile-menu[hidden] {
    display: none;
}

.nav-mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 18, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1090;
}

.nav-mobile-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1101;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.85rem clamp(1rem, 5vw, 1.75rem) 1.4rem;
    background: rgba(11, 15, 23, 0.98);
    border-top: 1px solid rgba(173, 198, 255, 0.1);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
}

.nav-mobile-link {
    display: block;
    padding: 0.85rem 0.4rem;
    color: rgba(223, 226, 235, 0.82);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 0.5rem;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-mobile-link:hover {
    color: #ffffff;
    background: rgba(173, 198, 255, 0.06);
}

.nav-mobile-divider {
    height: 1px;
    margin: 0.5rem 0;
    background: rgba(173, 198, 255, 0.1);
}

.nav-mobile-cta {
    margin-top: 0.6rem;
    width: 100%;
}

@media (max-width: 1099.98px) {
    /* Collapse the horizontal nav into the hamburger: hide BOTH the inline
       marketing links and the action buttons, then reveal the toggle. The
       `.navbar-marketing` prefix lifts specificity to (0,2,0) so it beats the
       base `.nav-links { display: flex }` (0,1,0) — without it the links stay
       in the top row and duplicate the drawer. */
    .navbar-marketing .nav-links-marketing,
    .navbar-marketing .nav-links-actions {
        display: none;
    }

    .navbar-marketing .nav-mobile-toggle {
        display: inline-flex;
    }
}

@media (min-width: 1100px) {
    .nav-mobile-menu,
    .nav-mobile-toggle {
        display: none !important;
    }
}

/* App shell: icon rail should feel like a premium instrument panel, not a plugin sidebar. */
.app-layout {
    grid-template-columns: 104px minmax(0, 1fr);
}

.app-sidebar {
    padding: 1rem 0.85rem;
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.96), rgba(8, 11, 18, 0.98));
    border-right: 0;
}

.app-sidebar-frame {
    border-radius: 2.25rem;
    background: linear-gradient(180deg, rgba(24, 28, 34, 0.88) 0%, rgba(10, 14, 20, 0.94) 100%);
    border: 1px solid rgba(173, 198, 255, 0.075);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.app-rail-logo {
    width: 3.15rem;
    height: 3.15rem;
    border-radius: 1.25rem;
    background: linear-gradient(145deg, rgba(173,198,255,0.16), rgba(77,142,255,0.06));
    border-color: rgba(173, 198, 255, 0.16);
    color: #ffffff;
    box-shadow: 0 18px 42px rgba(77, 142, 255, 0.18);
}

.app-nav-icon {
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 1.25rem;
    color: rgba(194, 198, 214, 0.66);
}

.app-nav-icon:hover,
.app-nav-icon.active {
    color: #f4f7ff;
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.14), rgba(77, 142, 255, 0.06));
    border-color: rgba(173, 198, 255, 0.16);
    box-shadow: 0 16px 36px rgba(77, 142, 255, 0.14), inset 0 1px 0 rgba(255,255,255,0.05);
}

.app-main-content {
    padding: clamp(1.25rem, 2.4vw, 2.5rem) clamp(1rem, 2vw, 1.75rem) 3rem 0;
}

/* Shared app surfaces: no harsh boxed dashboard look. */
.page-container,
.company-page,
.portfolio-page,
.compare-page,
.app-body-inner {
    max-width: 1536px;
    margin-inline: auto;
    padding-inline: clamp(1.25rem, 3vw, 3rem);
    width: 100%;
}

.app-page-header,
.company-header-redesign,
.app-surface-card,
.table-card,
.insights-panel,
.chart-collapsible,
.collapsible-section,
.landing-preview-card,
.landing-proof-item,
.landing-bento-card,
.landing-step-card,
.landing-showcase-panel,
.landing-company-card,
.landing-final-shell {
    background: var(--gradient-card) !important;
    border: 1px solid rgba(255, 255, 255, 0.055) !important;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.app-page-header,
.company-header-redesign {
    position: relative;
    overflow: hidden;
    border-radius: 2.75rem !important;
    padding: clamp(1.8rem, 3vw, 3.2rem) !important;
    margin-bottom: 1.5rem;
}

.app-page-header::before,
.company-header-redesign::before {
    content: '';
    position: absolute;
    inset: -35% -10% auto auto;
    width: 48rem;
    height: 28rem;
    background: radial-gradient(circle, rgba(173, 198, 255, 0.12), transparent 66%);
    pointer-events: none;
}

.app-page-eyebrow,
.company-eyebrow,
.panel-label,
.company-side-label,
.landing-section-kicker,
.landing-kicker,
.table-header h3 {
    letter-spacing: 0.24em !important;
    text-transform: uppercase;
}

.app-page-title,
.company-name-large,
.landing-hero-title,
.landing-section-heading h2,
.panel-title,
.table-header h3 {
    font-family: var(--font-family-display);
    letter-spacing: -0.06em;
}

.app-page-title {
    font-size: clamp(2.6rem, 5vw, 5.25rem);
    line-height: 0.96;
    color: #f4f7ff;
}

.app-page-subtitle,
.company-trust-pill,
.panel-narrative,
.sub-text {
    color: rgba(194, 198, 214, 0.82) !important;
}

.company-page {
    padding-top: 0.5rem;
}

.company-hero-grid {
    grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
    gap: clamp(1.25rem, 2vw, 2.4rem);
}

.company-name-large {
    font-size: clamp(1.75rem, 3vw, 3.4rem);
    line-height: 1.05;
    color: #f4f7ff;
}

.company-meta {
    color: rgba(194, 198, 214, 0.76);
    margin-top: 1rem;
}

.company-ticker-text {
    color: var(--color-accent-primary);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.company-price-card,
.company-mini-stats,
.km-card,
.landing-score-card,
.landing-mini-metric,
.preset-card {
    background: rgba(10, 14, 20, 0.58) !important;
    border: 1px solid rgba(255, 255, 255, 0.055) !important;
    border-radius: 1.45rem !important;
}

.preset-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    text-decoration: none;
    transition: all 0.2s;
}

.stat-value-large,
.key-stat-value,
.km-value,
.val-num,
.landing-proof-item.stat strong {
    font-family: var(--font-family-display);
    letter-spacing: -0.055em;
}

/* Tables: reduce spreadsheet harshness, increase editorial row rhythm. */
.data-table,
.metrics-table {
    border-collapse: separate;
    border-spacing: 0 0.35rem;
}

.data-table th,
.metrics-table th {
    border-bottom: 0 !important;
    color: rgba(140, 144, 159, 0.9) !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.2em !important;
    text-transform: uppercase;
    background: transparent !important;
}

.data-table td,
.metrics-table td {
    background: rgba(10, 14, 20, 0.34);
    border-top: 1px solid rgba(255, 255, 255, 0.035) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.035) !important;
}

.data-table tbody tr:hover td,
.metrics-table tbody tr:hover td {
    background: rgba(173, 198, 255, 0.045) !important;
}

.data-table td:first-child,
.metrics-table td:first-child {
    border-left: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 1rem 0 0 1rem;
}

.data-table td:last-child,
.metrics-table td:last-child {
    border-right: 1px solid rgba(255, 255, 255, 0.035);
    border-radius: 0 1rem 1rem 0;
}

.ticker-link,
.landing-inline-link,
.filter-chip,
.sync-freshness-badge.fresh,
.mode-indicator.filtered {
    color: var(--color-accent-primary) !important;
}

/* Kill mismatched purple/green SaaS gradients in app screens. */
.filter-toggle-btn,
.filter-badge,
.mode-indicator.filtered {
    background: rgba(173, 198, 255, 0.09) !important;
    border: 1px solid rgba(173, 198, 255, 0.16) !important;
    color: #d8e2ff !important;
}

.preset-card--active {
    background: linear-gradient(135deg, rgba(173,198,255,0.16) 0%, rgba(77,142,255,0.08) 100%) !important;
    border-color: rgba(173,198,255,0.5) !important;
}

.preset-card__icon-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.preset-card__icon {
    font-size: 1.25rem;
}

.preset-card__name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.preset-card__desc {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
}

.preset-card:hover,
.km-card:hover,
.company-price-card:hover,
.company-mini-stats:hover {
    border-color: rgba(173, 198, 255, 0.18) !important;
    box-shadow: 0 22px 64px rgba(77, 142, 255, 0.08);
}

.search-input,
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    background: rgba(10, 14, 20, 0.72) !important;
    border: 1px solid rgba(173, 198, 255, 0.10) !important;
    color: var(--color-text-primary) !important;
    border-radius: 1rem !important;
}

.search-input:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(173, 198, 255, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(173, 198, 255, 0.10), 0 0 42px rgba(77, 142, 255, 0.10) !important;
}

/* Homepage bento polish: softer boundaries, stronger editorial type. */
.stitch-home .bento-card {
    border-color: rgba(255, 255, 255, 0.055) !important;
    box-shadow: 0 36px 110px rgba(0, 0, 0, 0.34), 0 0 80px rgba(173, 198, 255, 0.045) !important;
}

.stitch-home h1,
.stitch-home h2,
.stitch-home h3 {
    letter-spacing: -0.065em;
}

.footer-marketing {
    background: linear-gradient(180deg, rgba(10, 14, 20, 0.92), #0a0e14) !important;
    border-top: 1px solid rgba(173, 198, 255, 0.08) !important;
}

@media (max-width: 980px) {
    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-main-content {
        padding: 1rem;
    }

    .app-sidebar {
        position: relative;
        height: auto;
    }

    .company-hero-grid,
    .insights-dashboard {
        grid-template-columns: 1fr;
    }

    .company-name-large {
        font-size: clamp(2.7rem, 14vw, 4.8rem);
    }
}

/* ========================================
   Company page fidelity pass — controls, nav, Deep Dive
   ======================================== */
.company-controls-panel {
    display: grid;
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.9fr);
    gap: clamp(1.25rem, 3vw, 2.25rem);
    align-items: stretch;
    padding: clamp(1.35rem, 2.4vw, 2rem) !important;
    margin-bottom: 1.35rem;
    border-radius: 2rem !important;
    position: relative;
    overflow: hidden;
}

.company-controls-panel::before {
    content: '';
    position: absolute;
    inset: -50% auto auto -18%;
    width: 34rem;
    height: 22rem;
    background: radial-gradient(circle, rgba(173, 198, 255, 0.09), transparent 64%);
    pointer-events: none;
}

.company-controls-copy,
.company-controls-grid {
    position: relative;
    z-index: 1;
}

.company-controls-eyebrow,
.control-label,
.category-nav-copy span {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-weight: 850;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.company-controls-copy h2 {
    margin: 0.45rem 0 0.55rem;
    font-family: var(--font-family-display);
    font-size: clamp(1.85rem, 3vw, 3rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
    color: #f5f7ff;
}

.company-controls-copy p {
    max-width: 27rem;
    color: rgba(194, 198, 214, 0.78);
    line-height: 1.65;
    margin: 0;
}

.company-controls-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.control-cluster {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.85rem;
    border-radius: 1.35rem;
    background: rgba(10, 14, 20, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.premium-segmented,
.premium-range-filter {
    background: rgba(8, 11, 18, 0.7) !important;
    border: 1px solid rgba(173, 198, 255, 0.1) !important;
    border-radius: 1.05rem !important;
    padding: 0.28rem;
    overflow: visible;
}

/* Segmented control: one sliding pill rather than a fill on each button.
   The pill is a ::before layer; the buttons sit above it and only swap
   text colour. Geometry is exact for any 2-segment control (cadence, lens):
   with padding p, each segment spans 50%, so a pill of width (50% - p)
   anchored at left:p lands perfectly on segment 1, and translateX(100%)
   lands it on segment 2. */
.premium-segmented {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    isolation: isolate;
}

.premium-segmented::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 0.28rem;
    bottom: 0.28rem;
    left: 0.28rem;
    width: calc(50% - 0.28rem);
    border-radius: 0.85rem;
    background: linear-gradient(135deg, #eaf0ff 0%, #c4d6ff 100%);
    box-shadow:
        0 6px 18px rgba(77, 142, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
}

.premium-segmented:has(> .toggle-btn:last-child.active)::before {
    transform: translateX(100%);
}

.premium-segmented .toggle-btn {
    position: relative;
    z-index: 1;
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border-radius: 0.85rem;
    padding: 0.6rem 0.85rem;
    color: rgba(198, 205, 224, 0.74);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    background: transparent !important;
    box-shadow: none !important;
    transition: color 0.3s ease;
}

.premium-segmented .toggle-btn:hover {
    color: var(--color-text-primary);
}

.premium-segmented .toggle-btn.active {
    color: #07101d !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Fallback where :has() is unsupported — restore the per-button fill. */
@supports not (selector(:has(*))) {
    .premium-segmented::before { display: none; }
    .premium-segmented .toggle-btn.active {
        background: linear-gradient(135deg, #eaf0ff, #c4d6ff) !important;
        box-shadow: 0 6px 18px rgba(77, 142, 255, 0.28) !important;
    }
}

.premium-range-filter {
    display: grid;
    grid-template-columns: minmax(76px, 1fr) auto minmax(76px, 1fr) auto;
    gap: 0.35rem;
    align-items: center;
}

.premium-range-filter .year-select {
    min-width: 0;
    width: 100%;
    height: 2.7rem;
    padding: 0 2rem 0 0.9rem;
    border-radius: 0.82rem !important;
    background-color: rgba(10, 14, 20, 0.78) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%23adc6ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    border: 1px solid rgba(173, 198, 255, 0.12) !important;
    color: #eef3ff !important;
    font-size: 0.85rem;
    font-weight: 600;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.premium-range-filter .year-select:hover {
    border-color: rgba(173, 198, 255, 0.3) !important;
    background-color: rgba(14, 19, 27, 0.92) !important;
}

.premium-range-filter .year-select:focus-visible {
    outline: none;
    border-color: rgba(173, 198, 255, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(77, 142, 255, 0.18);
}

.premium-range-filter .range-separator {
    color: rgba(173, 198, 255, 0.5);
    font-weight: 700;
    font-size: 0.95rem;
}

.premium-range-filter .apply-btn {
    height: 2.7rem;
    padding: 0 1.2rem;
    border-radius: 0.82rem;
    background: linear-gradient(135deg, #eaf0ff 0%, #c4d6ff 100%);
    border: 1px solid transparent;
    color: #07101d;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(77, 142, 255, 0.22);
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.premium-range-filter .apply-btn:hover {
    filter: brightness(1.05);
    box-shadow: 0 8px 22px rgba(77, 142, 255, 0.32);
}

.premium-range-filter .apply-btn:active {
    transform: translateY(1px);
    box-shadow: 0 4px 12px rgba(77, 142, 255, 0.24);
}

.category-nav-bar {
    position: relative;
    top: auto;
    align-items: center;
    padding: 0.75rem;
    gap: 0.8rem;
    border-radius: 1.55rem;
    background: rgba(10, 14, 20, 0.58);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.18);
}

.category-nav-copy {
    min-width: 10rem;
    padding: 0 0.5rem;
}

.category-nav-copy strong {
    display: block;
    margin-top: 0.25rem;
    color: #f2f5ff;
    font-family: var(--font-family-display);
    font-size: 1.05rem;
    letter-spacing: -0.045em;
}

.category-tabs {
    gap: 0.4rem;
    padding: 0.2rem;
    background: rgba(8, 11, 18, 0.48);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 1.15rem;
}

.category-tab {
    border: 0;
    background: transparent;
    border-radius: 0.92rem;
    padding: 0.62rem 0.8rem;
    color: rgba(194, 198, 214, 0.72);
    font-size: 0.76rem;
}

.category-tab.active {
    background: rgba(173, 198, 255, 0.12);
    color: #eef3ff;
    box-shadow: inset 0 0 0 1px rgba(173, 198, 255, 0.12);
}

.company-deep-dive-section {
    margin: 1.4rem clamp(1rem, 2vw, 1.5rem) 1.8rem;
    padding: clamp(1.35rem, 2.4vw, 2.4rem) !important;
    border-radius: 2rem;
    background: linear-gradient(145deg, rgba(20, 25, 34, 0.9), rgba(9, 13, 20, 0.78)) !important;
    border: 1px solid rgba(173, 198, 255, 0.075);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.28);
}

.company-deep-dive-section .report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.company-deep-dive-section .report-title {
    font-family: var(--font-family-display);
    font-size: clamp(2.1rem, 4vw, 4rem);
    line-height: 0.96;
    letter-spacing: -0.065em;
    margin-bottom: 0.55rem;
}

.company-deep-dive-section .report-subtitle {
    color: rgba(194, 198, 214, 0.74);
    max-width: 34rem;
}

.report-actions-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    justify-content: flex-end;
}

.report-actions-header a,
.report-actions-header button {
    border-radius: 0.9rem !important;
    background: rgba(173, 198, 255, 0.08) !important;
    border: 1px solid rgba(173, 198, 255, 0.14) !important;
    color: #dbe6ff !important;
    box-shadow: none !important;
}

.deep-dive-signals-section,
.percentile-section,
.peer-comparison-section,
.anomalies-section {
    background: rgba(10, 14, 20, 0.46) !important;
    border: 1px solid rgba(255, 255, 255, 0.055) !important;
    border-radius: 1.5rem !important;
    padding: clamp(1rem, 2vw, 1.45rem) !important;
    margin-bottom: 1rem !important;
}

.company-deep-dive-section .section-title {
    font-family: var(--font-family-display);
    font-size: 1.35rem;
    letter-spacing: -0.045em;
}

.company-deep-dive-section .section-subtitle {
    margin-bottom: 1rem;
}

.signals-grid {
    gap: 1rem;
}

.signals-column {
    padding: 0.85rem;
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid rgba(255, 255, 255, 0.045);
}

.signal-item,
.percentile-card,
.peer-card,
.anomaly-item {
    background: rgba(8, 11, 18, 0.46) !important;
    border: 1px solid rgba(255, 255, 255, 0.045) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.045) !important;
    border-radius: 1.05rem !important;
}

.signal-item.strong {
    border-color: rgba(173, 198, 255, 0.16) !important;
    background: rgba(173, 198, 255, 0.045) !important;
}

.percentile-grid,
.peer-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.percentile-fill.excellent,
.percentile-fill.good {
    background: linear-gradient(90deg, #adc6ff, #4d8eff);
}

.percentile-fill.fair {
    background: linear-gradient(90deg, #8c909f, #c2c6d6);
}

.percentile-fill.weak {
    background: linear-gradient(90deg, #ffb4ab, #f3c969);
}

@media (max-width: 1180px) {
    .company-controls-panel,
    .company-controls-grid {
        grid-template-columns: 1fr;
    }

    .category-nav-bar,
    .company-deep-dive-section .report-header {
        flex-direction: column;
        align-items: stretch;
    }

    .report-actions-header {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .premium-range-filter {
        grid-template-columns: 1fr;
    }

    .premium-range-filter .range-separator {
        display: none;
    }

    .signals-grid {
        grid-template-columns: 1fr;
    }
}

/* Company page controls — focused two-control layout (cadence + range). */
.company-controls-grid {
    grid-template-columns: minmax(190px, 230px) minmax(0, 1fr);
    align-items: stretch;
}

.control-cluster-period {
    grid-column: 1;
}

.control-cluster-range {
    grid-column: 2;
}

.premium-range-filter {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100%;
    min-width: 0;
}

.premium-range-filter .year-select {
    flex: 1 1 6.25rem;
    min-width: 5.6rem;
}

.premium-range-filter .range-separator {
    flex: 0 0 auto;
    padding: 0 0.1rem;
}

.premium-range-filter .apply-btn {
    flex: 0 0 auto;
    min-width: 5.25rem;
    white-space: nowrap;
}

.company-controls-panel .metric-search-input,
.company-controls-panel .category-select,
.premium-range-filter .year-select {
    text-overflow: ellipsis;
}

@media (max-width: 1180px) {
    .control-cluster-period,
    .control-cluster-range {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .premium-range-filter {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .premium-range-filter .range-separator {
        display: none;
    }

    .premium-range-filter .apply-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Company page trust hierarchy pass — research brief and honest data surfaces */
.company-data-status-card {
    gap: 1rem;
}

.company-price-display {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.company-price-value {
    font-family: var(--font-family-display);
    font-size: clamp(2.4rem, 4vw, 3.6rem);
    line-height: 0.94;
    letter-spacing: -0.06em;
    font-weight: 800;
    color: #f5f7ff;
}

.company-price-unavailable {
    color: rgba(194, 198, 214, 0.45);
}

.company-price-change {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.company-price-change-note {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.evidence-stats .key-stat-value {
    font-size: 1.15rem;
}

.research-brief-panel {
    padding: clamp(1.35rem, 2.8vw, 2.3rem) !important;
    margin-bottom: 1.35rem;
    border-radius: 2rem !important;
}

.research-brief-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.15rem;
}

.research-brief-header h2 {
    margin: 0.35rem 0 0.45rem;
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 0.95;
    letter-spacing: -0.07em;
    color: #f5f7ff;
}

.research-brief-header p,
.brief-card p {
    margin: 0;
    color: rgba(194, 198, 214, 0.76);
    line-height: 1.6;
}

.analysis-confidence-badge,
.brief-chip,
.benchmark-note,
.valuation-withheld-note {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    padding: 0.45rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.analysis-confidence-badge.reliable,
.brief-chip {
    color: #dbe6ff;
    background: rgba(173, 198, 255, 0.11);
    border: 1px solid rgba(173, 198, 255, 0.16);
}

.analysis-confidence-badge.limited,
.benchmark-note,
.valuation-withheld-note {
    color: #ffe0b3;
    background: rgba(243, 201, 105, 0.1);
    border: 1px solid rgba(243, 201, 105, 0.18);
}

.research-brief-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.brief-card {
    min-width: 0;
    padding: 1rem;
    border-radius: 1.35rem;
    background: rgba(10, 14, 20, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.055);
}

.brief-card-label {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--color-text-muted);
    font-size: 0.64rem;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.brief-card strong {
    display: block;
    color: #f2f5ff;
    margin-bottom: 0.45rem;
}

.brief-list {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.brief-list li {
    display: grid;
    gap: 0.2rem;
}

.brief-list span {
    color: rgba(194, 198, 214, 0.72);
    font-size: 0.88rem;
    line-height: 1.45;
}

.benchmark-unavailable-panel,
.benchmark-unavailable-deep-dive {
    border-color: rgba(243, 201, 105, 0.16) !important;
    background: linear-gradient(145deg, rgba(44, 33, 16, 0.42), rgba(10, 14, 20, 0.58)) !important;
}

.benchmark-note-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.benchmark-unavailable-deep-dive {
    padding: clamp(1rem, 2vw, 1.45rem);
    border-radius: 1.5rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(243, 201, 105, 0.16);
}

.benchmark-unavailable-deep-dive p {
    max-width: 56rem;
    color: rgba(237, 220, 190, 0.82);
}

.valuation-withheld-note {
    margin-bottom: 1rem;
    border-radius: 0.9rem;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.82rem;
}

.research-upsell-card {
    background: rgba(10, 14, 20, 0.58) !important;
    padding: 1.35rem !important;
    border-radius: 1.5rem !important;
    margin: 1.25rem 0 !important;
    text-align: left !important;
    border: 1px solid rgba(173, 198, 255, 0.1) !important;
}

.research-upsell-card .upsell-content {
    margin-bottom: 0 !important;
}

.research-upsell-card p {
    color: rgba(194, 198, 214, 0.74) !important;
}

@media (max-width: 1180px) {
    .research-brief-header {
        flex-direction: column;
    }

    .research-brief-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .research-brief-grid {
        grid-template-columns: 1fr;
    }
}

.quick-veko-panel {
    background:
        radial-gradient(circle at 10% 0%, rgba(173, 198, 255, 0.12), transparent 34%),
        radial-gradient(circle at 90% 10%, rgba(243, 201, 105, 0.08), transparent 30%),
        linear-gradient(145deg, rgba(15, 20, 30, 0.94), rgba(8, 11, 18, 0.86)) !important;
    border: 1px solid rgba(173, 198, 255, 0.09) !important;
}

.quick-veko-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.quick-veko-header h2::before {
    content: 'V';
    display: inline-grid;
    place-items: center;
    width: 2.55rem;
    height: 2.55rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, #adc6ff, #4d8eff);
    color: #07101d;
    font-family: var(--font-family-display);
    font-size: 1.25rem;
    letter-spacing: -0.08em;
    box-shadow: 0 18px 42px rgba(77, 142, 255, 0.22);
}

.quick-veko-card {
    position: relative;
    overflow: hidden;
    min-height: 13rem;
    padding: 1.05rem 1.05rem 1.1rem 1.15rem;
}

.quick-veko-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 0.28rem;
    background: var(--quick-veko-accent, #adc6ff);
}

.quick-veko-card::after {
    content: '';
    position: absolute;
    inset: -4rem -5rem auto auto;
    width: 10rem;
    height: 10rem;
    border-radius: 999px;
    background: var(--quick-veko-glow, rgba(173, 198, 255, 0.08));
    pointer-events: none;
}

.quick-veko-status-card {
    --quick-veko-accent: #adc6ff;
    --quick-veko-glow: rgba(173, 198, 255, 0.1);
    background: linear-gradient(145deg, rgba(20, 31, 54, 0.72), rgba(10, 14, 20, 0.54));
    border-color: rgba(173, 198, 255, 0.14);
}

.quick-veko-positive-card {
    --quick-veko-accent: #7ee7b0;
    --quick-veko-glow: rgba(126, 231, 176, 0.11);
    background: linear-gradient(145deg, rgba(13, 43, 31, 0.62), rgba(10, 14, 20, 0.54));
    border-color: rgba(126, 231, 176, 0.14);
}

.quick-veko-warning-card {
    --quick-veko-accent: #f3c969;
    --quick-veko-glow: rgba(243, 201, 105, 0.12);
    background: linear-gradient(145deg, rgba(52, 39, 16, 0.66), rgba(10, 14, 20, 0.56));
    border-color: rgba(243, 201, 105, 0.16);
}

.quick-veko-confidence-card.reliable {
    --quick-veko-accent: #86d9ff;
    --quick-veko-glow: rgba(134, 217, 255, 0.11);
    background: linear-gradient(145deg, rgba(13, 37, 54, 0.64), rgba(10, 14, 20, 0.56));
    border-color: rgba(134, 217, 255, 0.14);
}

.quick-veko-confidence-card.limited {
    --quick-veko-accent: #ffb4ab;
    --quick-veko-glow: rgba(255, 180, 171, 0.11);
    background: linear-gradient(145deg, rgba(54, 25, 24, 0.62), rgba(10, 14, 20, 0.56));
    border-color: rgba(255, 180, 171, 0.16);
}

.quick-veko-card .brief-card-label {
    color: color-mix(in srgb, var(--quick-veko-accent, #adc6ff) 76%, white 24%);
}

.quick-veko-card .brief-chip {
    color: #dbe6ff;
    background: rgba(173, 198, 255, 0.12);
    border-color: rgba(173, 198, 255, 0.18);
}

/* Compact Quick Veko strip — subtle brand verb before the metrics */
.quick-veko-strip {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem 1rem !important;
    margin-bottom: 1rem;
    border-radius: 1.25rem !important;
    background: linear-gradient(135deg, rgba(10, 14, 20, 0.68), rgba(14, 19, 29, 0.56)) !important;
    border: 1px solid rgba(173, 198, 255, 0.08) !important;
}

.quick-veko-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.46rem 0.62rem;
    border-radius: 0.9rem;
    background: rgba(173, 198, 255, 0.1);
    color: #dbe6ff;
    font-family: var(--font-family-display);
    font-size: 0.92rem;
    letter-spacing: -0.035em;
    white-space: nowrap;
}

.quick-veko-mark::before {
    content: 'V';
    display: inline-grid;
    place-items: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 0.48rem;
    background: linear-gradient(135deg, #adc6ff, #4d8eff);
    color: #07101d;
    font-size: 0.75rem;
}

.quick-veko-strip-main {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.42rem 0.6rem;
}

.quick-veko-strip-label {
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.quick-veko-strip-main strong {
    color: #f5f7ff;
    font-size: 0.95rem;
}

.quick-veko-strip-main span:last-child {
    color: rgba(194, 198, 214, 0.72);
    font-size: 0.86rem;
}

.quick-veko-strip-signals {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
}

.quick-veko-pill {
    display: inline-flex;
    max-width: 18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.36rem 0.58rem;
    font-size: 0.72rem;
    font-weight: 750;
}

.quick-veko-pill.source {
    color: #dbe6ff;
    background: rgba(173, 198, 255, 0.09);
    border: 1px solid rgba(173, 198, 255, 0.12);
}

.quick-veko-pill.positive {
    color: #c9f7dc;
    background: rgba(126, 231, 176, 0.09);
    border: 1px solid rgba(126, 231, 176, 0.13);
}

.quick-veko-pill.warning {
    color: #ffe0b3;
    background: rgba(243, 201, 105, 0.09);
    border: 1px solid rgba(243, 201, 105, 0.14);
}

@media (max-width: 980px) {
    .quick-veko-strip {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .quick-veko-strip-signals {
        justify-content: flex-start;
    }
}

/* Quick Veko widget refinement — cards stay, intro becomes subtle */
.quick-veko-subtle-top {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.quick-veko-mark-small {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #dbe6ff;
    font-family: var(--font-family-display);
    font-size: 0.9rem;
    letter-spacing: -0.035em;
}

.quick-veko-mark-small::before {
    content: 'V';
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 0.45rem;
    background: linear-gradient(135deg, #adc6ff, #4d8eff);
    color: #07101d;
    font-size: 0.72rem;
}

.quick-veko-subtle-label {
    color: var(--color-text-muted);
    font-size: 0.62rem;
    font-weight: 850;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* Research Workspace — evidence first, benchmark lens second */
.research-workspace-section .metrics-container {
    display: flex;
    flex-direction: column;
}

.research-workspace-section .red-flags-banner {
    order: 0;
}

.research-workspace-section .category-nav-bar {
    order: 1;
}

.research-workspace-section .categorized-metrics {
    order: 2;
}

.benchmark-lens-panel {
    order: 3;
    margin-top: 1.1rem !important;
}

.benchmark-lens-panel[open] {
    padding-bottom: clamp(1rem, 2vw, 1.5rem) !important;
}

.benchmark-lens-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    padding: 0.6rem 0.4rem;
    border-radius: 0.85rem;
    transition: background 0.18s ease;
}
.benchmark-lens-summary:hover { background: rgba(173, 198, 255, 0.05); }

.benchmark-lens-summary::-webkit-details-marker { display: none; }
.benchmark-lens-summary::marker { display: none; content: ""; }

/* Lens icon — same chip family as the dashboard cards. */
.benchmark-lens-summary-icon {
    display: grid !important;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.85rem;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    flex-shrink: 0;
}
.benchmark-lens-summary-icon .material-symbols-outlined {
    font-size: 1.55rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}
details:not([open]) > .benchmark-lens-summary .benchmark-lens-summary-icon {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.55);
}

.benchmark-lens-summary .report-header-content {
    flex: 1;
    min-width: 0;
}
.benchmark-lens-summary .report-title {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    margin-bottom: 0.2rem;
}
.benchmark-lens-summary .report-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.benchmark-lens-state {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.benchmark-lens-state.ready {
    color: #dbe6ff;
    background: rgba(173, 198, 255, 0.12);
    border: 1px solid rgba(173, 198, 255, 0.25);
}
.benchmark-lens-state.disabled {
    color: #ffe0b3;
    background: rgba(243, 201, 105, 0.1);
    border: 1px solid rgba(243, 201, 105, 0.22);
}

/* Chevron rotates on open. */
.benchmark-lens-chevron {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.5rem !important;
    line-height: 1 !important;
    transition: transform 0.22s ease, color 0.18s ease;
    flex-shrink: 0;
}
.benchmark-lens-summary:hover .benchmark-lens-chevron { color: #adc6ff; }
details[open] > .benchmark-lens-summary .benchmark-lens-chevron { transform: rotate(180deg); }

.benchmark-lens-body { margin-top: 1.2rem; }

.benchmark-unavailable-deep-dive { margin-bottom: 0; }

/* Action-row pills inside the open lens — give them icons + a real interactive feel. */
.report-actions-header a,
.report-actions-header button {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease !important;
}
.report-actions-header a:hover,
.report-actions-header button:hover {
    background: rgba(173, 198, 255, 0.18) !important;
    border-color: rgba(173, 198, 255, 0.38) !important;
    color: #fff !important;
}
.report-actions-header .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

@media (max-width: 760px) {
    .benchmark-lens-summary { flex-wrap: wrap; }
    .benchmark-lens-summary .report-header-content { flex: 1 0 100%; order: 2; }
    .benchmark-lens-state { order: 3; }
    .benchmark-lens-chevron { order: 1; margin-left: auto; }
}

/* Period content swap loading state */
#company-period-content {
    transition: opacity 0.18s ease;
    position: relative;
}
#company-period-content.period-content-loading {
    opacity: 0.55;
    pointer-events: none;
}
#company-period-content.period-content-loading::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    border: 2px solid rgba(173, 198, 255, 0.2);
    border-top-color: #adc6ff;
    animation: period-spin 0.7s linear infinite;
    z-index: 10;
}
@keyframes period-spin {
    to { transform: rotate(360deg); }
}

/* Price Chart */
.chart-section {
    margin-bottom: 1.5rem;
}
.chart-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.chart-title {
    font-family: 'Manrope', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #8c909f;
    flex: 1;
}
.chart-period-toggle {
    display: inline-flex;
    gap: 0.15rem;
    background: rgba(8, 11, 18, 0.6);
    border: 1px solid rgba(173, 198, 255, 0.1);
    border-radius: 0.7rem;
    padding: 0.22rem;
}
.chart-period-btn {
    background: transparent;
    border: none;
    color: rgba(198, 205, 224, 0.6);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    padding: 0.34rem 0.74rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.chart-period-btn:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.045);
}
.chart-period-btn--active,
.chart-period-btn--active:hover {
    background: linear-gradient(135deg, #eaf0ff, #c4d6ff);
    color: #07101d;
    box-shadow: 0 3px 10px rgba(77, 142, 255, 0.25);
}
.chart-collapse-btn {
    background: transparent;
    border: none;
    color: #8c909f;
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    border-radius: 0.35rem;
    transition: color 0.15s, transform 0.2s;
}
.chart-collapse-btn:hover { color: #adc6ff; }
.chart-collapse-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }
.chart-body { padding: 0 0 0.5rem; }

/* Loading overlay shown while a chart period's bars are fetched (price_chart.js). */
.chart-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.chart-loading.is-active { display: flex; }
.chart-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--color-accent-primary, #4d8eff);
    border-radius: 50%;
    animation: chart-spin 0.7s linear infinite;
}
@keyframes chart-spin { to { transform: rotate(360deg); } }

/* App Dashboard Home */
.dashboard-page {
    padding-top: 0.5rem;
    padding-bottom: 3rem;
}

/* Compact dashboard hero (overrides the giant .app-page-header treatment) */
.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 2rem;
    flex-wrap: wrap;
    padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.5rem);
    margin-bottom: 2rem;
    border-radius: 2rem;
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.dashboard-hero::before {
    content: '';
    position: absolute;
    inset: -40% -20% auto auto;
    width: 36rem;
    height: 22rem;
    background: radial-gradient(circle, rgba(173, 198, 255, 0.13), transparent 65%);
    pointer-events: none;
}
.dashboard-hero-text { position: relative; z-index: 1; }
.dashboard-hero-eyebrow {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(173, 198, 255, 0.75);
    margin-bottom: 0.6rem;
}
.dashboard-hero-title {
    font-family: var(--font-family-display);
    font-size: clamp(1.85rem, 3.4vw, 2.85rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
    color: #f4f7ff;
    margin: 0;
}
.dashboard-hero-subtitle {
    margin-top: 0.65rem;
    font-size: 0.95rem;
    color: rgba(194, 198, 214, 0.78);
    max-width: 32rem;
    line-height: 1.55;
}
.dashboard-hero-actions { position: relative; z-index: 1; display: flex; gap: 0.6rem; flex-wrap: wrap; }
.dashboard-hero-cta-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-primary);
    box-shadow: 0 0 0 1px var(--color-border-light) inset;
}
.dashboard-hero-cta-secondary:hover { background: rgba(255, 255, 255, 0.09); }
.dashboard-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.75rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    color: #06111f;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
    text-decoration: none;
    box-shadow: 0 18px 45px rgba(77,142,255,0.22), 0 0 0 1px rgba(255,255,255,0.12) inset;
    transition: filter 0.15s, transform 0.15s;
}
.dashboard-hero-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.dashboard-hero-cta .material-symbols-outlined { font-size: 1.1rem; }

/* Section heads */
.dash-section { margin-bottom: 2.25rem; }
.dash-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.dash-section-title {
    font-family: 'Manrope', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(140, 144, 159, 0.85);
    margin: 0;
}
.dash-section-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: rgba(173, 198, 255, 0.85);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.dash-section-link:hover { color: #adc6ff; }
.dash-section-link .material-symbols-outlined { font-size: 1rem; }

/* Card base shared by ticker / preset / sector / CTA cards */
.dash-ticker-card,
.dash-preset-card,
.dash-sector-card,
.dash-cta-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.5rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.55) 0%, rgba(10, 14, 20, 0.32) 100%);
    border: 1px solid rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(14px);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    position: relative;
}

/* Unified icon-chip used across preset, sector, CTA cards.
   Single source of truth so chips can't drift visually section-to-section.
   `!important` on display defends against Google's
   `.material-symbols-outlined { display: inline-block }` shipping after us. */
.dash-preset-icon,
.dash-sector-icon,
.dash-cta-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: grid !important;
    place-items: center;
    border-radius: 0.85rem;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    font-size: 1.5rem !important;
    line-height: 1 !important;
    margin-bottom: 0.6rem;
    flex-shrink: 0;
    /* Material Symbols font variation: FILL=1 renders the solid glyph
       (instead of the default thin outline). Requires the FILL axis to be
       present in the loaded font URL (see base.html). */
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.dash-ticker-card:hover,
.dash-preset-card:hover,
.dash-sector-card:hover,
.dash-cta-card:hover {
    transform: translateY(-3px);
    border-color: rgba(173, 198, 255, 0.22);
    box-shadow: 0 22px 46px rgba(0,0,0,0.32), 0 0 0 1px rgba(173,198,255,0.08) inset;
}

/* Recently viewed ticker cards */
.dash-grid-recent {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}
.dash-ticker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}
.dash-ticker-symbol {
    font-family: var(--font-family-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: #f4f7ff;
}
.dash-ticker-change {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.55rem 0.22rem 0.42rem;
    border-radius: 999px;
}
.dash-ticker-change-icon { font-size: 0.95rem !important; }
.dash-ticker-change--up   { color: #4edea3; background: rgba(78,222,163,0.13); }
.dash-ticker-change--down { color: #ffb4ab; background: rgba(255,180,171,0.13); }
.dash-ticker-price {
    font-family: var(--font-family-display);
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #f4f7ff;
}
.dash-ticker-meta {
    font-size: 0.72rem;
    color: rgba(140, 144, 159, 0.85);
    letter-spacing: 0.02em;
}

/* Empty state */
.dash-empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 2.25rem 2rem;
    border-radius: 1.5rem;
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.45) 0%, rgba(10, 14, 20, 0.25) 100%);
    border: 1px dashed rgba(255, 255, 255, 0.07);
}
.dash-empty-icon {
    font-size: 2rem !important;
    color: rgba(173, 198, 255, 0.6);
    margin-bottom: 0.25rem;
}
.dash-empty-title {
    font-family: var(--font-family-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: #f4f7ff;
    margin: 0;
}
.dash-empty-desc {
    font-size: 0.85rem;
    color: rgba(194, 198, 214, 0.75);
    margin: 0;
    max-width: 32rem;
}
.dash-empty-action {
    margin-top: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.dash-empty-action:hover { background: rgba(173, 198, 255, 0.2); }
.dash-empty-action .material-symbols-outlined { font-size: 1rem; }

/* Preset cards */
.dash-grid-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}
.dash-preset-card { gap: 0.5rem; }
.dash-preset-name {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.015em;
    color: #f4f7ff;
}
.dash-preset-desc {
    font-size: 0.82rem;
    color: rgba(194, 198, 214, 0.75);
    line-height: 1.45;
    margin-bottom: 0.5rem;
}
.dash-preset-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: rgba(173, 198, 255, 0.85);
    letter-spacing: 0.04em;
    margin-top: auto;
}
.dash-preset-cta .material-symbols-outlined {
    font-size: 1rem;
    transition: transform 0.18s;
}
.dash-preset-card:hover .dash-preset-cta .material-symbols-outlined {
    transform: translateX(3px);
}

/* Sector cards */
.dash-grid-sectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.dash-sector-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}
.dash-sector-icon { margin-bottom: 0; }
.dash-sector-badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
}
.badge--trending { background: rgba(78,222,163,0.14); color: #4edea3; }
.badge--stable   { background: rgba(173,198,255,0.14); color: #adc6ff; }
.badge--volatile { background: rgba(255,180,171,0.14); color: #ffb4ab; }
.dash-sector-name {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.015em;
    color: #f4f7ff;
}
.dash-sector-desc {
    font-size: 0.82rem;
    color: rgba(194, 198, 214, 0.75);
    line-height: 1.45;
    margin: 0;
}

/* CTA cards */
.dash-cta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.dash-cta-title {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: -0.02em;
    color: #f4f7ff;
}
.dash-cta-desc {
    font-size: 0.85rem;
    color: rgba(194, 198, 214, 0.75);
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 720px) {
    .dashboard-hero { flex-direction: column; align-items: flex-start; }
    .dashboard-hero-actions { width: 100%; }
    .dashboard-hero-cta { width: 100%; justify-content: center; }
}

/* ---------------------------------------------------------------------------
   Watchlist (dashboard widget + dedicated page + company-page toggle)
   --------------------------------------------------------------------------- */
.dash-messages {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.dash-message {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.92rem;
}
.dash-message-success { border-color: rgba(76, 175, 80, 0.4); background: rgba(76, 175, 80, 0.12); }
.dash-message-error   { border-color: rgba(229, 57, 53, 0.4); background: rgba(229, 57, 53, 0.12); }
.dash-message-warning { border-color: rgba(255, 167, 38, 0.4); background: rgba(255, 167, 38, 0.12); }

.dash-watch-card {
    position: relative;
}
.dash-watch-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}
.dash-watch-remove-form {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    margin: 0;
}
.dash-watch-remove {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.dash-watch-remove:hover {
    background: rgba(229, 57, 53, 0.15);
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(229, 57, 53, 0.4);
}
.dash-watch-remove .material-symbols-outlined { font-size: 1rem; }

.dash-watch-add-form {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    max-width: 360px;
}
.dash-watch-add-input {
    flex: 1;
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 0.92rem;
    text-transform: uppercase;
}
.dash-watch-add-input:focus {
    outline: none;
    border-color: rgba(173, 198, 255, 0.5);
    background: rgba(255, 255, 255, 0.06);
}
.dash-watch-add-btn {
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(173, 198, 255, 0.4);
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    transition: background 0.15s ease;
}
.dash-watch-add-btn:hover { background: rgba(173, 198, 255, 0.22); }
.dash-watch-add-btn .material-symbols-outlined { font-size: 1.1rem; }

/* Company-page star toggle */
.company-watchlist-form { display: inline-block; margin: 0 0 0 0.75rem; }
.company-watchlist-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.company-watchlist-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}
.company-watchlist-toggle.is-watched {
    background: rgba(255, 213, 79, 0.12);
    border-color: rgba(255, 213, 79, 0.4);
    color: #ffd54f;
}
.company-watchlist-toggle .material-symbols-outlined { font-size: 1.05rem; }

/* Dedicated watchlist page */
.watchlist-page { max-width: 880px; margin: 2rem auto; padding: 0 1.5rem; }
.watchlist-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.watchlist-header h1 { margin: 0; font-size: 1.5rem; }
.watchlist-meta { color: rgba(255, 255, 255, 0.6); font-size: 0.9rem; }
.watchlist-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.watchlist-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.watchlist-row a { color: inherit; text-decoration: none; }
.watchlist-row .ticker { font-weight: 700; letter-spacing: 0.05em; margin-right: 0.75rem; }
.watchlist-row .name { color: rgba(255, 255, 255, 0.7); }
.watchlist-row form { margin: 0; }

/* ---------------------------------------------------------------------------
   Veko It homepage — search-first, centered, dark-glow personality
   --------------------------------------------------------------------------- */
.veko-it-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
    padding: 2rem 1.5rem 4rem;
    position: relative;
}

.veko-it-welcome-pill {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(173, 198, 255, 0.06);
    border: 1px solid rgba(173, 198, 255, 0.18);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.2s ease;
}
.veko-it-welcome-pill:hover {
    background: rgba(173, 198, 255, 0.12);
    border-color: rgba(173, 198, 255, 0.4);
}
.veko-it-pill-arrow { color: rgba(255, 255, 255, 0.3); }
.veko-it-pill-cta { color: #adc6ff; font-weight: 600; }

.veko-it-stage {
    width: 100%;
    max-width: 640px;
    text-align: center;
}

.veko-it-wordmark {
    font-size: clamp(4.5rem, 12vw, 7rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0 0 2.5rem;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #adc6ff 50%, #6b8acc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 60px rgba(173, 198, 255, 0.2));
}

.veko-it-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1rem;
    margin: 0 0 2.5rem;
    font-weight: 400;
}
.veko-it-tagline-accent {
    color: #adc6ff;
    font-weight: 600;
    margin-left: 0.25rem;
}

.veko-it-form {
    margin: 0 auto;
    max-width: 620px;
}

/* Wrapper that anchors the suggestions panel directly under the input,
   independent of the buttons that come after it in the form. */
.veko-it-search-cell {
    position: relative;
}

.veko-it-input-shell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.5rem 0 1.25rem;
    height: 60px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.3);
    cursor: text;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    /* Suppress the default focus ring browsers add to the <label> when its
       input gains focus — we render our own focus state below. */
    outline: none;
}
.veko-it-input-shell:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 6px 32px rgba(0, 0, 0, 0.36);
}
.veko-it-input-shell:focus-within {
    border-color: rgba(173, 198, 255, 0.55);
    box-shadow: 0 10px 44px rgba(0, 0, 0, 0.45), 0 0 100px rgba(173, 198, 255, 0.08);
}

.veko-it-input-icon {
    color: rgba(255, 255, 255, 0.45);
    font-size: 1.5rem;
    transition: color 0.18s ease;
    user-select: none;
    pointer-events: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    outline: none;
}
.veko-it-input-shell:focus-within .veko-it-input-icon { color: #adc6ff; }

/* The global `input[type="text"] { ... !important }` rule above (line ~9083)
   forces a dark background, border, and border-radius on every text input.
   `!important` alone can't opt back out: `input[type="text"]` (0,1,1) out-scores
   a bare `.veko-it-input` (0,1,0), so the dark fill leaks through as a boxed-in
   field inside the shell. Scoping to `.veko-it-input-shell .veko-it-input`
   (0,2,0) beats the global selector so the input stays transparent and inherits
   only the shell's styling — matching the light-mode rule further down. */
.veko-it-input-shell .veko-it-input {
    flex: 1;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0;
    margin: 0;
    height: 100%;
    font-family: inherit;
    min-width: 0;
}
.veko-it-input::placeholder { color: rgba(255, 255, 255, 0.36); }
.veko-it-input:focus,
.veko-it-input:focus-visible {
    outline: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
}
/* Kill the chrome/safari autofill yellow/blue background and inner shadow that
   browsers apply to text inputs they think are eligible for autofill. */
.veko-it-input:-webkit-autofill,
.veko-it-input:-webkit-autofill:hover,
.veko-it-input:-webkit-autofill:focus,
.veko-it-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
    box-shadow: 0 0 0 1000px transparent inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Clear button only when there's something to clear (CSS-only via :placeholder-shown). */
.veko-it-clear {
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}
.veko-it-input-shell:has(.veko-it-input:not(:placeholder-shown)) .veko-it-clear {
    display: inline-flex;
}
.veko-it-clear:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.veko-it-clear:focus, .veko-it-clear:focus-visible { outline: none; box-shadow: none; }
.veko-it-clear .material-symbols-outlined { font-size: 1.1rem; }

.veko-it-suggestions {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    background: rgba(18, 20, 28, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.55);
    text-align: left;
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 30;
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
}
.veko-it-suggestions.is-open { display: block; }
.veko-it-suggestions li {
    padding: 0.7rem 1.1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: background 0.1s ease;
}
.veko-it-suggestions li:hover,
.veko-it-suggestions li.is-active {
    background: rgba(173, 198, 255, 0.1);
}
.veko-it-sugg-ticker {
    font-weight: 700;
    color: #adc6ff;
    min-width: 4.5rem;
    letter-spacing: 0.02em;
    font-size: 0.95rem;
}
.veko-it-sugg-name { color: rgba(255, 255, 255, 0.78); font-size: 0.93rem; }

.veko-it-error {
    margin: 1rem 0 0;
    padding: 0.7rem 1rem;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.35);
    border-radius: 0.65rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
}

.veko-it-actions {
    margin-top: 2rem;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}
.veko-it-btn {
    border: 1px solid transparent;
    padding: 0.7rem 1.6rem;
    border-radius: 0.6rem;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}
.veko-it-btn-primary {
    background: #adc6ff;
    color: #001a42;
    box-shadow: 0 4px 24px rgba(173, 198, 255, 0.25);
}
.veko-it-btn-primary:hover {
    background: #c2d4ff;
    transform: translateY(-1px);
    box-shadow: 0 6px 30px rgba(173, 198, 255, 0.4);
}
.veko-it-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.85);
}
.veko-it-btn-secondary:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); }

/* Guest-only hint: anonymous visitors can open the NVDA report for free. */
.veko-it-guest-hint {
    margin: 1.35rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}
.veko-it-guest-hint .material-symbols-outlined {
    font-size: 1rem;
    color: rgba(173, 198, 255, 0.7);
}
.veko-it-guest-hint a {
    color: rgba(173, 198, 255, 0.9);
    text-decoration: none;
    font-weight: 600;
}
.veko-it-guest-hint a:hover { text-decoration: underline; color: #c2d4ff; }

.veko-it-trending {
    margin-top: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}
.veko-it-trending-label {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-right: 0.5rem;
}
.veko-it-chip {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.veko-it-chip:hover {
    background: rgba(173, 198, 255, 0.12);
    border-color: rgba(173, 198, 255, 0.4);
    color: #adc6ff;
}

.veko-it-footer {
    position: absolute;
    bottom: 1.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.82rem;
}
.veko-it-footer a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.15s ease;
}
.veko-it-footer a:hover { color: #adc6ff; }

@media (max-width: 640px) {
    .veko-it-welcome-pill { position: static; margin: 0 0 1.5rem; }
    .veko-it-actions { flex-direction: column; }
    .veko-it-btn { width: 100%; }
}

/* ============================================================================
   Compare page v2 — Apple-style edit per #38
   All rules namespaced under .cmp2-* to avoid colliding with the legacy
   compare CSS that lived inside the template's <style> block.
   ============================================================================ */

.cmp2-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 4rem;
}

.cmp2-header {
    margin-bottom: 1.5rem;
}
.cmp2-title {
    font-family: var(--font-family-display);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.045em;
    color: #f4f7ff;
    margin: 0.4rem 0 0.5rem;
    line-height: 1;
}
.cmp2-prompt {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

/* Tag input ----------------------------------------------------------------- */
.cmp2-form { margin: 0; }
.cmp2-tag-input {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-height: 64px;
    padding: 0.55rem 0.9rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.3);
    cursor: text;
    position: relative;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.cmp2-tag-input:focus-within {
    border-color: rgba(173, 198, 255, 0.5);
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.4), 0 0 80px rgba(173, 198, 255, 0.08);
}
.cmp2-chips {
    display: contents;
    list-style: none;
    margin: 0;
    padding: 0;
}
.cmp2-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.3rem 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(173, 198, 255, 0.14);
    color: #adc6ff;
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cmp2-chip-text { line-height: 1; }
.cmp2-chip-remove {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 0;
    background: transparent;
    color: rgba(173, 198, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}
.cmp2-chip-remove:hover { background: rgba(173, 198, 255, 0.2); color: #fff; }
.cmp2-chip-remove .material-symbols-outlined { font-size: 0.95rem; line-height: 1; }
.cmp2-input {
    flex: 1;
    min-width: 180px;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none !important;
    color: inherit;
    font-size: 0.98rem;
    line-height: 1;
    padding: 0.45rem 0.25rem !important;
    margin: 0;
    font-family: inherit;
}
.cmp2-input::placeholder { color: rgba(255, 255, 255, 0.36); }
.cmp2-input:disabled { color: rgba(255, 255, 255, 0.4); }
.cmp2-counter {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    align-self: center;
    margin-left: auto;
}

/* Suggestions dropdown */
.cmp2-suggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    list-style: none;
    margin: 0;
    padding: 0.45rem 0;
    background: rgba(18, 20, 28, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, 0.55);
    z-index: 30;
    max-height: 320px;
    overflow-y: auto;
}
.cmp2-form { position: relative; }
.cmp2-suggestions[hidden] { display: none; }
.cmp2-suggestions li {
    padding: 0.6rem 1rem;
    display: flex;
    gap: 0.85rem;
    cursor: pointer;
    align-items: center;
}
.cmp2-suggestions li:hover, .cmp2-suggestions li.is-active {
    background: rgba(173, 198, 255, 0.1);
}
.cmp2-sugg-ticker { font-weight: 700; color: #adc6ff; min-width: 4.5rem; letter-spacing: 0.02em; }
.cmp2-sugg-name { color: rgba(255, 255, 255, 0.78); font-size: 0.9rem; }

/* Presets ------------------------------------------------------------------- */
.cmp2-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}
.cmp2-preset {
    display: inline-block;
    padding: 0.45rem 0.95rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.cmp2-preset:hover {
    border-color: rgba(173, 198, 255, 0.4);
    color: #adc6ff;
    background: rgba(173, 198, 255, 0.1);
}
.cmp2-preset-watchlist {
    color: #adc6ff;
    border-color: rgba(173, 198, 255, 0.3);
    background: rgba(173, 198, 255, 0.06);
}

/* Actions row --------------------------------------------------------------- */
.cmp2-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin: 1.25rem 0 0.75rem;
}
.cmp2-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.6rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cmp2-action:hover {
    background: rgba(173, 198, 255, 0.1);
    border-color: rgba(173, 198, 255, 0.35);
    color: #adc6ff;
}
.cmp2-action .material-symbols-outlined {
    font-size: 1.05rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

/* Hint / error / loading ---------------------------------------------------- */
.cmp2-hint {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 1rem;
    background: rgba(173, 198, 255, 0.06);
    border: 1px dashed rgba(173, 198, 255, 0.18);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    text-align: center;
}
.cmp2-error {
    margin-top: 1.5rem;
    padding: 0.85rem 1.1rem;
    background: rgba(229, 57, 53, 0.1);
    border: 1px solid rgba(229, 57, 53, 0.4);
    border-radius: 0.65rem;
    color: rgba(255, 255, 255, 0.92);
}
#cmp2-results {
    margin-top: 1rem;
    transition: opacity 0.18s ease;
}
#cmp2-results.is-loading { opacity: 0.45; pointer-events: none; }

/* Scoreboard — verdict-first leaderboard above the table -------------------- */
.cmp2-scoreboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin: 0.5rem 0 1.25rem;
}
.cmp2-scorecard {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.3rem 1.35rem;
    border-radius: 1.4rem;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.012) 100%);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    animation: cmp2-card-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cmp2-scorecard:hover {
    transform: translateY(-3px);
    border-color: rgba(173, 198, 255, 0.22);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.26);
}
.cmp2-scorecard.is-leader {
    border-color: rgba(78, 222, 163, 0.4);
    background: linear-gradient(155deg, rgba(78, 222, 163, 0.12) 0%, rgba(78, 222, 163, 0.02) 55%, rgba(255, 255, 255, 0.012) 100%);
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.22), inset 0 0 0 1px rgba(78, 222, 163, 0.18);
}
@keyframes cmp2-card-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.cmp2-score-crown {
    position: absolute;
    top: 0.9rem;
    right: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.24rem 0.6rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.cmp2-score-crown .material-symbols-outlined { font-size: 0.9rem; line-height: 1; font-variation-settings: 'FILL' 1; }
.cmp2-score-id { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.cmp2-score-ticker {
    font-family: var(--font-family-display);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.05;
    color: var(--color-accent-secondary);
    text-decoration: none;
}
.cmp2-score-ticker:hover { color: var(--color-accent-primary); }
.cmp2-score-name {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmp2-score-sector {
    align-self: flex-start;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border-light);
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmp2-score-wins { display: flex; align-items: baseline; gap: 0.45rem; margin-top: auto; }
.cmp2-score-wins-value {
    font-family: var(--font-family-display);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--color-text-primary);
    font-variant-numeric: tabular-nums;
}
.cmp2-scorecard.is-leader .cmp2-score-wins-value { color: var(--color-positive); }
.cmp2-score-wins-label { font-size: 0.72rem; color: var(--color-text-muted); font-weight: 600; }
.cmp2-score-bar-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); overflow: hidden; }
.cmp2-score-bar {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    transform-origin: left;
    animation: pf-bar-grow 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.cmp2-scorecard.is-leader .cmp2-score-bar { background: linear-gradient(90deg, #10b981, #4edea3); }

/* Summary strip — quick context, mirrors the portfolio strip ---------------- */
.cmp2-summary-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.7rem;
}
.cmp2-summary-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.95rem 1.15rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--color-border-light);
}
.cmp2-summary-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.cmp2-summary-value { font-size: 1.3rem; font-weight: 700; color: var(--color-text-primary); }
.cmp2-summary-leader { color: var(--color-accent-secondary); font-family: var(--font-family-display); letter-spacing: 0.02em; }

/* Section heading above the breakdown table */
.cmp2-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.7rem;
}
.cmp2-section-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); margin: 0; }
.cmp2-section-sub { font-size: 0.78rem; color: var(--color-text-muted); }
.cmp2-legend-dot { font-size: 0.6rem; vertical-align: middle; }
.cmp2-legend-dot.best { color: #4edea3; }
.cmp2-legend-dot.worst { color: #ff8a80; }

/* Results table ------------------------------------------------------------- */
.cmp2-table-wrap {
    margin-top: 0.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.45) 0%, rgba(10, 14, 20, 0.28) 100%);
    overflow-x: auto;
}
.cmp2-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.cmp2-th-metric, .cmp2-th-company {
    text-align: left;
    font-weight: 600;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(10, 14, 20, 0.35);
    position: sticky;
    top: 0;
    z-index: 1;
}
.cmp2-th-metric {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    min-width: 220px;
}
.cmp2-th-company { min-width: 160px; }
.cmp2-th-link {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}
.cmp2-th-link:hover .cmp2-th-ticker { color: #adc6ff; }
.cmp2-th-ticker {
    font-family: var(--font-family-display);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #f4f7ff;
}
.cmp2-th-name {
    font-size: 0.82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
}
.cmp2-th-sector {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.4);
}

/* Section row (category divider) */
.cmp2-section-row td {
    padding: 1.5rem 1rem 0.4rem;
    border-bottom: 0;
}
.cmp2-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #adc6ff;
}

/* Metric rows */
.cmp2-row td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}
.cmp2-row:hover td { background: rgba(255, 255, 255, 0.02); }
.cmp2-row.is-expanded td { border-bottom-color: transparent; }
.cmp2-cell-metric { color: rgba(255, 255, 255, 0.85); }
.cmp2-metric-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.1rem 0.2rem;
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: left;
}
.cmp2-toggle-chevron {
    color: rgba(255, 255, 255, 0.35);
    font-size: 1.05rem !important;
    line-height: 1 !important;
    transition: transform 0.18s ease, color 0.18s ease;
}
.cmp2-metric-toggle[aria-expanded="true"] .cmp2-toggle-chevron {
    transform: rotate(90deg);
    color: #adc6ff;
}
.cmp2-metric-toggle:hover .cmp2-toggle-chevron { color: #adc6ff; }
.cmp2-metric-name { font-weight: 500; }
.cmp2-direction-hint {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    margin-left: 0.2rem;
}

/* Cells: value + single dot marker */
.cmp2-cell {
    position: relative;
    color: rgba(255, 255, 255, 0.92);
    font-variant-numeric: tabular-nums;
}
.cmp2-value { font-weight: 600; }
.cmp2-marker {
    display: inline-block;
    margin-left: 0.4rem;
    font-size: 0.6rem;
    line-height: 1;
    vertical-align: middle;
    opacity: 0.95;
}
.cmp2-marker-best { color: #4edea3; }
.cmp2-marker-worst { color: #ff8a80; }
.cmp2-cell.is-best .cmp2-value { color: #6ee7b7; font-weight: 700; }
.cmp2-cell.is-leader-col { background: rgba(78, 222, 163, 0.045); }
.cmp2-th-company.is-leader { background: linear-gradient(180deg, rgba(78, 222, 163, 0.14), rgba(10, 14, 20, 0.35)); }
.cmp2-th-company.is-leader .cmp2-th-ticker { color: #6ee7b7; }

/* Tooltip on hover (sector percentile) */
.cmp2-cell .cmp2-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(10, 14, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    padding: 0.35rem 0.6rem;
    border-radius: 0.5rem;
    font-size: 0.72rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 4;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}
.cmp2-cell:hover .cmp2-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Trend (sparkline) row — hidden by default, revealed on toggle */
.cmp2-trend-row td {
    padding: 0.4rem 1rem 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(173, 198, 255, 0.025);
}
.cmp2-trend-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.cmp2-trend-cell {
    display: table-cell;
    vertical-align: middle;
}
.cmp2-sparkline {
    width: 100px;
    height: 28px;
    display: inline-block;
    vertical-align: middle;
}
.cmp2-trend-direction {
    margin-left: 0.45rem;
    font-size: 0.85rem;
    font-weight: 700;
    vertical-align: middle;
}
.cmp2-trend-direction.trend-up { color: #4edea3; }
.cmp2-trend-direction.trend-down { color: #ff8a80; }
.cmp2-trend-direction.trend-stable { color: rgba(255, 255, 255, 0.4); }
.cmp2-trend-na { color: rgba(255, 255, 255, 0.3); font-size: 0.85rem; }

/* Footer */
.cmp2-footer {
    margin-top: 1rem;
    text-align: center;
}
.cmp2-data-note {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* Mobile -------------------------------------------------------------------- */
@media (max-width: 760px) {
    .cmp2-page { padding: 1rem 1rem 3rem; }
    .cmp2-summary-strip { grid-template-columns: repeat(2, 1fr); }
    .cmp2-table-wrap {
        background: transparent;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }
    .cmp2-table thead { display: none; }
    .cmp2-table, .cmp2-table tbody, .cmp2-table tr, .cmp2-table td { display: block; width: 100%; }
    .cmp2-section-row td { padding: 1.5rem 0 0.5rem; }
    .cmp2-row { margin-bottom: 0.75rem; border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 1rem; padding: 0.75rem 1rem; background: rgba(255, 255, 255, 0.03); }
    .cmp2-row td { border-bottom: 1px dashed rgba(255, 255, 255, 0.05); padding: 0.55rem 0; display: flex; justify-content: space-between; align-items: center; }
    .cmp2-row td:last-child { border-bottom: 0; }
    .cmp2-cell-metric { font-weight: 700; }
    .cmp2-cell::before {
        content: attr(data-ticker);
        color: rgba(255, 255, 255, 0.4);
        font-size: 0.72rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .cmp2-trend-row { padding: 0; }
    .cmp2-actions { justify-content: stretch; }
    .cmp2-action { flex: 1; justify-content: center; }
}

/* ============================================================================
   Per-company notes — drawer + Research Log + company-page header toggle
   ============================================================================ */

/* Notes toggle in company-page header (sits next to the watchlist star) */
.company-notes-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}
.company-notes-toggle:hover {
    background: rgba(173, 198, 255, 0.1);
    border-color: rgba(173, 198, 255, 0.4);
    color: #adc6ff;
}
.company-notes-toggle[aria-expanded="true"] {
    background: rgba(173, 198, 255, 0.15);
    border-color: rgba(173, 198, 255, 0.45);
    color: #adc6ff;
}
.company-notes-toggle .material-symbols-outlined {
    font-size: 1.1rem;
    line-height: 1;
    font-variation-settings: 'FILL' 1, 'wght' 500;
}

/* Drawer ----------------------------------------------------------------- */
.notes-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    animation: notes-scrim-in 0.18s ease forwards;
}
@keyframes notes-scrim-in { to { opacity: 1; } }

.notes-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(420px, 100%);
    background: rgba(14, 16, 22, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.22s cubic-bezier(0.32, 0.72, 0.24, 1);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(20px);
}
.notes-drawer.is-open { transform: translateX(0); }
.notes-drawer[aria-hidden="true"] { pointer-events: none; }
.notes-drawer.is-open[aria-hidden="false"] { pointer-events: auto; }

.notes-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.notes-drawer-title {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.notes-drawer-eyebrow {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.4);
}
.notes-drawer-ticker {
    font-family: var(--font-family-display);
    font-size: 1.25rem;
    font-weight: 800;
    color: #adc6ff;
    letter-spacing: 0.04em;
}
.notes-drawer-close {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.notes-drawer-close:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.notes-drawer-close .material-symbols-outlined { font-size: 1.1rem !important; line-height: 1 !important; }

.notes-drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.notes-drawer-loading {
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 2rem 0;
    font-size: 0.92rem;
}

/* Drawer body -- list of notes + compose */
.notes-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}
.notes-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}
.notes-item {
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.025);
    border-radius: 0.75rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.notes-item:hover { border-color: rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); }
.notes-item-body {
    margin: 0 0 0.45rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.notes-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.notes-item-time {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.02em;
}
.notes-item-delete-form { margin: 0; }
.notes-item-delete {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}
.notes-item:hover .notes-item-delete { opacity: 1; }
.notes-item-delete:hover { background: rgba(229, 57, 53, 0.15); color: #ff8a80; }
.notes-item-delete .material-symbols-outlined { font-size: 0.95rem !important; line-height: 1 !important; }

.notes-empty {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.92rem;
    text-align: center;
    padding: 1.5rem 0;
}

.notes-error {
    color: var(--color-negative);
    background: rgba(255, 180, 171, 0.08);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.88rem;
    padding: 0.6rem 0.75rem;
    margin-bottom: 0.75rem;
}

/* Compose */
.notes-compose {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.notes-compose-input {
    background: rgba(255, 255, 255, 0.04) !important;
    background-color: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0.75rem !important;
    color: #f4f7ff !important;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.75rem 0.85rem !important;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.notes-compose-input:focus {
    outline: none !important;
    border-color: rgba(173, 198, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
}
.notes-compose-input::placeholder { color: rgba(255, 255, 255, 0.36); }
.notes-compose-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.notes-compose-hint {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.notes-compose-hint kbd {
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.notes-compose-save {
    padding: 0.5rem 1.1rem;
    border-radius: 0.6rem;
    border: 0;
    background: #adc6ff;
    color: #001a42;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease;
}
.notes-compose-save:hover { background: #c2d4ff; }

/* Research Log section on dashboard ------------------------------------- */
.research-log-section { margin-top: 0.5rem; }
.research-log-search-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.15s ease;
}
.research-log-search-wrap:focus-within { border-color: rgba(173, 198, 255, 0.4); }
.research-log-search-icon { color: rgba(255, 255, 255, 0.4); font-size: 1.05rem !important; line-height: 1 !important; }
.research-log-search {
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    color: inherit;
    font-family: inherit;
    font-size: 0.88rem;
    padding: 0.15rem 0.25rem !important;
    width: 200px;
}
.research-log-search::placeholder { color: rgba(255, 255, 255, 0.35); }

.research-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.research-log-row {
    border: 1px solid rgba(255, 255, 255, 0.055);
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.45) 0%, rgba(10, 14, 20, 0.28) 100%);
    border-radius: 1rem;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.research-log-row:hover {
    transform: translateY(-1px);
    border-color: rgba(173, 198, 255, 0.25);
}
.research-log-link {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 1rem;
    align-items: baseline;
    padding: 0.85rem 1.1rem;
    color: inherit;
    text-decoration: none;
}
.research-log-ticker {
    font-family: var(--font-family-display);
    font-weight: 800;
    color: #adc6ff;
    letter-spacing: 0.04em;
    font-size: 0.95rem;
}
.research-log-preview {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.research-log-meta {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.75rem;
    white-space: nowrap;
}
.research-log-empty { color: rgba(255, 255, 255, 0.5); padding: 1rem 0; }

@media (max-width: 720px) {
    .research-log-link {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
    .research-log-meta { justify-self: start; }
    .research-log-search { width: 100%; }
    .research-log-search-wrap { width: 100%; }
}

@media (max-width: 480px) {
    .notes-drawer { width: 100%; }
}

/* ========================================
   Market Discovery (Screener) — clean Apple-style
   ======================================== */

.screener-page { padding-bottom: 4rem; }

.screener-mode {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.4rem 0.85rem;
    background: rgba(173, 198, 255, 0.06);
    border: 1px solid rgba(173, 198, 255, 0.12);
    border-radius: 999px;
    font-size: 0.8rem;
    color: rgba(216, 226, 255, 0.85);
}
.screener-mode-label {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.68rem;
    color: rgba(173, 198, 255, 0.95);
}
.screener-mode-value { font-weight: 600; color: #f4f7ff; }
.screener-mode-meta { color: rgba(140, 144, 159, 0.85); }

.screener-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
}
.screener-stat-value {
    font-family: var(--font-family-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #f4f7ff;
}
.screener-stat-label {
    margin-top: 0.2rem;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(140, 144, 159, 0.85);
}

.screener-section { margin-bottom: 2rem; }
.screener-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.screener-section-title {
    font-family: var(--font-family-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: #f4f7ff;
    margin: 0;
}

.screener-clear-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: rgba(173, 198, 255, 0.9);
    text-decoration: none;
    transition: color 0.15s;
}
.screener-clear-link:hover { color: #f4f7ff; }
.screener-clear-link .material-symbols-outlined { font-size: 1rem; }

/* Quick screen preset cards */
.screener-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
}
.screener-preset-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.15rem;
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.55) 0%, rgba(10, 14, 20, 0.32) 100%);
    border: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 1.15rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.screener-preset-card:hover {
    transform: translateY(-2px);
    border-color: rgba(173, 198, 255, 0.22);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}
.screener-preset-card--active {
    border-color: rgba(173, 198, 255, 0.45);
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.14) 0%, rgba(77, 142, 255, 0.06) 100%);
}
.screener-preset-icon {
    width: 2.4rem;
    height: 2.4rem;
    display: grid !important;
    place-items: center;
    border-radius: 0.7rem;
    background: rgba(173, 198, 255, 0.12);
    color: #adc6ff;
    font-size: 1.35rem !important;
    line-height: 1 !important;
    margin-bottom: 0.4rem;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}
.screener-preset-name {
    font-family: var(--font-family-display);
    font-weight: 700;
    font-size: 0.98rem;
    letter-spacing: -0.012em;
    color: #f4f7ff;
}
.screener-preset-desc {
    font-size: 0.78rem;
    color: rgba(194, 198, 214, 0.75);
    line-height: 1.4;
}

/* Filter card */
.screener-filter-card {
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
    overflow: hidden;
}
.screener-filter-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
}

.screener-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.95rem;
    background: rgba(173, 198, 255, 0.08) !important;
    border: 1px solid rgba(173, 198, 255, 0.16) !important;
    border-radius: 0.75rem;
    color: #d8e2ff !important;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.screener-filter-toggle:hover {
    background: rgba(173, 198, 255, 0.14) !important;
    border-color: rgba(173, 198, 255, 0.28) !important;
}
.screener-filter-toggle .material-symbols-outlined { font-size: 1.1rem; }
.screener-filter-chevron { transition: transform 0.2s ease; }
.screener-filter-toggle.is-open .screener-filter-chevron { transform: rotate(180deg); }
.screener-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.45rem;
    background: rgba(173, 198, 255, 0.22);
    color: #f4f7ff;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.screener-filter-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0 1.25rem;
    border-top: 1px solid transparent;
}
.screener-filter-panel.is-open {
    max-height: 720px;
    padding: 1.25rem;
    border-top-color: rgba(255, 255, 255, 0.05);
}

.screener-filter-form { display: flex; flex-direction: column; gap: 1.25rem; }

.screener-field-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.screener-field-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(140, 144, 159, 0.95);
    min-width: 5.5rem;
}

.screener-input {
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.7rem;
    color: #f4f7ff;
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
    flex: 1;
    min-width: 0;
}
.screener-input:focus {
    outline: none;
    border-color: rgba(173, 198, 255, 0.4);
    background: rgba(10, 14, 20, 0.8);
}
.screener-input--compact { padding: 0.4rem 0.65rem; font-size: 0.85rem; flex: 0 0 auto; }
select.screener-input { cursor: pointer; }

.screener-rules-block { display: flex; flex-direction: column; gap: 0.75rem; }
.screener-rules-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.screener-add-rule {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.45rem 0.85rem;
    background: rgba(173, 198, 255, 0.08);
    border: 1px solid rgba(173, 198, 255, 0.18);
    border-radius: 0.65rem;
    color: #d8e2ff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.screener-add-rule:hover {
    background: rgba(173, 198, 255, 0.14);
    border-color: rgba(173, 198, 255, 0.3);
}
.screener-add-rule .material-symbols-outlined { font-size: 1rem; }

.screener-rules { display: flex; flex-direction: column; gap: 0.6rem; }
.screener-rule {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
}
.screener-rule-remove {
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.6rem;
    color: rgba(194, 198, 214, 0.7);
    cursor: pointer;
    transition: all 0.15s;
}
.screener-rule-remove:hover {
    background: rgba(255, 180, 171, 0.08);
    border-color: rgba(255, 180, 171, 0.28);
    color: #ffb4ab;
}
.screener-rule-remove .material-symbols-outlined { font-size: 1.05rem; }

.screener-filter-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.screener-apply-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.25rem;
    background: linear-gradient(135deg, #6c93ff 0%, #4d8eff 100%);
    border: none;
    border-radius: 0.8rem;
    color: white;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.screener-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(77, 142, 255, 0.3);
}
.screener-apply-btn .material-symbols-outlined { font-size: 1.1rem; }

.screener-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.25rem;
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.8rem;
    color: rgba(194, 198, 214, 0.85);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}
.screener-reset-btn:hover {
    border-color: rgba(173, 198, 255, 0.22);
    color: #f4f7ff;
}

/* Active filter chips */
.screener-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.screener-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.4rem 0.35rem 0.85rem;
    background: rgba(173, 198, 255, 0.08);
    border: 1px solid rgba(173, 198, 255, 0.18);
    border-radius: 999px;
    font-size: 0.8rem;
    color: #d8e2ff;
}
.screener-chip-label { letter-spacing: 0.01em; }
.screener-chip-remove {
    display: grid;
    place-items: center;
    width: 1.4rem;
    height: 1.4rem;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: rgba(216, 226, 255, 0.7);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.screener-chip-remove:hover {
    background: rgba(255, 180, 171, 0.18);
    color: #ffb4ab;
}
.screener-chip-remove .material-symbols-outlined { font-size: 0.95rem; }

/* Results card */
.screener-results-card {
    background: linear-gradient(180deg, rgba(28, 32, 38, 0.5) 0%, rgba(10, 14, 20, 0.28) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.25rem;
    overflow: hidden;
}
.screener-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.screener-results-title {
    font-family: var(--font-family-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #f4f7ff;
    margin: 0;
}
.screener-results-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.screener-results-count {
    font-size: 0.78rem;
    color: rgba(140, 144, 159, 0.9);
    margin-right: 0.25rem;
}
.screener-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.75rem;
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.6rem;
    color: rgba(194, 198, 214, 0.9);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.screener-icon-btn:hover {
    border-color: rgba(173, 198, 255, 0.28);
    color: #f4f7ff;
}
.screener-icon-btn .material-symbols-outlined { font-size: 1rem; }

.screener-cell-name { color: var(--color-text-primary); }

.screener-row-action {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(173, 198, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
}
.screener-row-action:hover { color: #f4f7ff; }
.screener-row-action .material-symbols-outlined { font-size: 1rem; transition: transform 0.15s; }
.screener-row-action:hover .material-symbols-outlined { transform: translateX(2px); }

.screener-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.screener-page-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.95rem;
    background: rgba(10, 14, 20, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.6rem;
    color: rgba(216, 226, 255, 0.9);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.screener-page-btn:hover {
    border-color: rgba(173, 198, 255, 0.28);
    color: #f4f7ff;
}
.screener-page-btn .material-symbols-outlined { font-size: 1rem; }
.screener-page-info {
    font-size: 0.82rem;
    color: rgba(140, 144, 159, 0.9);
}

.screener-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: rgba(194, 198, 214, 0.85);
}
.screener-empty--full { padding: 4rem 1.5rem; }
.screener-empty h3 {
    font-family: var(--font-family-display);
    font-size: 1.05rem;
    color: #f4f7ff;
    margin: 0.6rem 0 0.35rem;
}
.screener-empty p { color: rgba(140, 144, 159, 0.85); margin: 0; }
.screener-empty-icon {
    font-size: 2.2rem !important;
    color: rgba(173, 198, 255, 0.6);
}

.screener-error {
    padding: 2rem;
    color: #ffb4ab;
    text-align: center;
}

@media (max-width: 720px) {
    .screener-rule {
        grid-template-columns: 1fr 1fr auto;
    }
    .screener-rule .screener-rule-metric { grid-column: 1 / -1; }
    .screener-field-row { align-items: stretch; }
    .screener-field-row .screener-input { width: 100%; }
}

/* ============================================================
   Visual Lens — second reading of the company metrics
   ============================================================ */

.visual-lens {
    padding: 0.5rem 0.25rem 1.5rem;
}

.vl-empty {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--color-text-secondary);
}

/* Entrance choreography */
.vl-in {
    opacity: 0;
    transform: translateY(10px);
    animation: vl-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: var(--vl-delay, 0ms);
}

@keyframes vl-rise {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- masthead ---------- */

.vl-masthead {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1.25rem;
}

.vl-eyebrow {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8c909f;
    margin-bottom: 0.35rem;
}

.vl-period-title {
    margin: 0;
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text-primary);
}

.vl-period-end {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    letter-spacing: 0;
}

.vl-period-picker {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.vl-period-picker select {
    background: rgba(10, 14, 20, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.6rem;
    color: var(--color-text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.45rem 0.7rem;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.vl-period-picker select:focus {
    outline: none;
    border-color: var(--color-accent-secondary, #adc6ff);
    box-shadow: 0 0 0 3px rgba(173, 198, 255, 0.12);
}

/* ---------- headline cards ---------- */

.vl-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.75rem;
}

.vl-card {
    position: relative;
    padding: 1.1rem 1.2rem 1rem;
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)) padding-box,
        linear-gradient(135deg, rgba(173, 198, 255, 0.35), rgba(255, 255, 255, 0.06) 45%) border-box;
    border: 1px solid transparent;
    overflow: hidden;
}

.vl-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 85% -10%, rgba(77, 142, 255, 0.12), transparent 55%);
    pointer-events: none;
}

.vl-card-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.45rem;
}

.vl-card-value {
    display: block;
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.vl-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.vl-badge-pos { color: #4edea3; }
.vl-badge-neg { color: #ffb4ab; }
.vl-badge-flat { color: #b9bdc9; }
.vl-badge-none { color: var(--color-text-muted); font-weight: 500; }

/* ---------- shared section chrome ---------- */

.vl-section {
    margin-bottom: 1.9rem;
}

.vl-section-title {
    margin: 0 0 1rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8c909f;
}

.vl-row-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.vl-row-delta {
    justify-self: end;
    text-align: right;
    white-space: nowrap;
}

/* ---------- comparison bars ---------- */

.vl-compare-row,
.vl-margin-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 130px;
    gap: 1rem;
    align-items: center;
    padding: 0.65rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.vl-compare-row:last-child,
.vl-margin-row:last-child {
    border-bottom: none;
}

.vl-bar-pair {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.vl-bar-track {
    position: relative;
    height: 1.7rem;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

.vl-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    border-radius: 0.45rem;
    transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.vl-live .vl-bar { width: var(--vl-w); }

.vl-bar-curr {
    background: linear-gradient(90deg, #4d8eff 0%, #adc6ff 100%);
    box-shadow: 0 0 18px rgba(77, 142, 255, 0.35);
}

.vl-bar-prior {
    background: rgba(173, 198, 255, 0.22);
}

.vl-bar-margin {
    background: linear-gradient(90deg, rgba(78, 222, 163, 0.85), rgba(78, 222, 163, 0.45));
    box-shadow: 0 0 14px rgba(78, 222, 163, 0.22);
}

.vl-bar-neg {
    background: linear-gradient(90deg, rgba(229, 57, 53, 0.8), rgba(255, 180, 171, 0.5)) !important;
    box-shadow: 0 0 14px rgba(229, 57, 53, 0.25) !important;
}

.vl-bar-value {
    padding-left: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #06111f;
    white-space: nowrap;
}

.vl-bar-prior .vl-bar-value,
.vl-bar-neg .vl-bar-value {
    color: var(--color-text-primary);
}

.vl-bar-tag {
    font-weight: 500;
    opacity: 0.75;
    font-size: 0.72rem;
}

.vl-bar-missing {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding-left: 0.6rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* ---------- margin structure ---------- */

.vl-margin-row .vl-bar-track {
    height: 1.55rem;
}

.vl-margin-was {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.vl-margin-was.down { color: #ffb4ab; }

/* ---------- trend explorer ---------- */

.vl-trend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.vl-trend-head .vl-section-title { margin: 0; }

.vl-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.vl-chip {
    padding: 0.38rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vl-chip:hover {
    border-color: rgba(173, 198, 255, 0.4);
    color: var(--color-text-primary);
}

.vl-chip.active {
    background: linear-gradient(135deg, #adc6ff 0%, #4d8eff 100%);
    border-color: transparent;
    color: #06111f;
}

.vl-trend {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 0.45rem;
    height: 230px;
    padding: 0.25rem 0.25rem 0;
}

/* zero baseline */
.vl-trend::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: var(--vl-baseline, 100%);
    border-top: 1px dashed rgba(255, 255, 255, 0.14);
    pointer-events: none;
}

.vl-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    cursor: default;
}

.vl-col-space {
    position: relative;
    flex: 1;
}

.vl-col-bar {
    position: absolute;
    left: 12%;
    right: 12%;
    height: 0;
    border-radius: 0.35rem 0.35rem 0 0;
    background: linear-gradient(180deg, rgba(173, 198, 255, 0.75), rgba(77, 142, 255, 0.45));
    transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.vl-live .vl-col-bar { height: var(--vl-h); }

.vl-col:hover .vl-col-bar {
    background: linear-gradient(180deg, #adc6ff, #4d8eff);
    box-shadow: 0 0 16px rgba(77, 142, 255, 0.4);
}

.vl-col-latest {
    background: linear-gradient(180deg, #adc6ff, #4d8eff);
    box-shadow: 0 0 18px rgba(77, 142, 255, 0.45);
}

.vl-col-neg {
    border-radius: 0 0 0.35rem 0.35rem;
    background: linear-gradient(180deg, rgba(229, 57, 53, 0.6), rgba(255, 180, 171, 0.45));
}

.vl-col:hover .vl-col-neg,
.vl-col-neg.vl-col-latest {
    background: linear-gradient(180deg, rgba(229, 57, 53, 0.9), rgba(255, 180, 171, 0.6));
    box-shadow: 0 0 16px rgba(229, 57, 53, 0.35);
}

.vl-col-value {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-secondary);
    transform: translateY(-0.25rem);
    white-space: nowrap;
}

.vl-col-value-neg {
    transform: translateY(0.35rem);
}

.vl-col-label {
    padding-top: 0.5rem;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vl-col-label.latest {
    color: var(--color-text-primary);
}

.vl-footnote {
    margin: 0.5rem 0 0;
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* ---------- responsive + motion ---------- */

@media (max-width: 760px) {
    .vl-compare-row,
    .vl-margin-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }
    .vl-row-delta { justify-self: start; text-align: left; }
    .vl-trend { height: 180px; }
    .vl-col-label { font-size: 0.62rem; }
    .vl-card-value { font-size: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    .vl-in { animation: none; opacity: 1; transform: none; }
    .vl-bar, .vl-col-bar { transition: none; }
    .vl-bar { width: var(--vl-w); }
    .vl-col-bar { height: var(--vl-h); }
}

/* ============================================================
   Lens swap + page performance refactor
   ============================================================ */


/* Off-screen category sections skip layout + paint entirely. The intrinsic
   size keeps the scrollbar honest while they are skipped. */
.category-section {
    content-visibility: auto;
    contain-intrinsic-size: auto 540px;
}

/* The metric tables animate nothing worth the style-recalc cost: hovering a
   25k-node table with `transition: all` rules melts the main thread. */
.categorized-metrics .metrics-table,
.categorized-metrics .metrics-table * {
    transition: none !important;
}

/* Cheaper sticky toolbar: blur over a scrolling table repaints constantly —
   a more opaque solid background reads the same on the dark theme. */
.category-nav-bar-slim {
    backdrop-filter: none;
    background: rgba(12, 16, 23, 0.97);
}

/* Shared metric tooltip — single floating element replacing the per-cell
   tooltip subtree (same visual language as the old .tooltip-content). */
#metric-tooltip {
    position: fixed;
    z-index: 1000;
    min-width: 280px;
    max-width: 320px;
    padding: var(--spacing-md);
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: left;
    pointer-events: none;
}

/* Trend axis: long quarterly histories label every nth column */
.vl-col-label-empty {
    min-height: 1.35rem;
}

/* ============================================================
   Company page — Stitch redesign (header, hero, tabs, trajectory)
   ============================================================ */

/* ---- Header ---- */
.company-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 1.6rem;
}
.header-filing-chips {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}
.filing-freshness-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.7rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
}
.filing-freshness-badge.stale { color: #fbbf24; background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.28); }
.filing-freshness-badge .sync-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.filing-chip-group { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.filing-chip {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    padding: 0.3rem 0.55rem;
    border-radius: 0.5rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--color-border-light);
}
.company-header-actions { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; justify-content: flex-end; }
.company-header-actions .company-watchlist-form { margin: 0; }
.header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--color-border-light);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.header-action-btn:hover { background: rgba(255,255,255,0.06); border-color: var(--color-border); color: var(--color-text-primary); }
.header-action-btn .material-symbols-outlined { font-size: 1.1rem; }
/* Back sits at the far left of the header, ahead of the filing chips */
.header-back-btn { margin-right: 0.5rem; }
.header-action-btn.watchlist-action.is-watched { color: #fbbf24; border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.08); }
.header-action-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--color-accent-primary), #6aa3ff);
    border-color: transparent;
}
.header-action-primary:hover { color: #fff; filter: brightness(1.06); }

.company-header-identity {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.company-headline { display: flex; align-items: baseline; gap: 0.9rem; flex-wrap: wrap; flex: 0 1 40%; max-width: 40%; min-width: 0; }
.company-header-identity .company-name-large { max-width: 100%; margin-bottom: 0; overflow-wrap: anywhere; }
.company-ticker-chip {
    font-family: var(--font-family-display);
    font-size: clamp(1rem, 1.6vw, 1.4rem);
    font-weight: 700;
    color: var(--color-accent-secondary);
    letter-spacing: 0.02em;
}
.company-header-identity .company-price-display { align-items: flex-end; text-align: right; }

.company-header-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--color-border-light);
}
.company-breadcrumb { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; color: var(--color-text-muted); font-size: 0.82rem; }
.company-breadcrumb .breadcrumb-item { color: var(--color-text-secondary); }
.company-breadcrumb .country-flag { width: 18px; height: auto; border-radius: 2px; }
.company-header-foot .company-mini-stats { margin: 0; background: transparent; border: 0; padding: 0; gap: 1.4rem; }

/* ---- Hero card ---- */
.company-hero-card {
    margin-bottom: 1rem;
    padding: clamp(1.25rem, 2.5vw, 1.75rem) clamp(1.5rem, 3vw, 2rem);
}
.hero-card-grid {
    display: grid;
    grid-template-columns: minmax(140px, 0.6fr) minmax(0, 1.8fr) minmax(220px, 1fr);
    column-gap: clamp(1.5rem, 3vw, 2.5rem);
    row-gap: clamp(1rem, 2vw, 1.25rem);
    align-items: center;
}
.hero-health {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.55rem;
    padding-right: clamp(1rem, 2vw, 1.75rem);
    border-right: 1px solid var(--color-border-light);
    align-self: center;
}
.hero-score-ring { width: 120px; height: 120px; }
.hero-score-ring .score-caption {
    font-size: 0.58rem; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-text-muted); margin-top: 0.1rem;
}
.hero-health-status { font-weight: 700; font-size: 0.95rem; }
.hero-health-status.grade-a-text { color: #10b981; }
.hero-health-status.grade-b-text { color: #34d399; }
.hero-health-status.grade-c-text { color: #fbbf24; }
.hero-health-status.grade-d-text { color: #f97316; }
.hero-health-status.grade-f-text { color: #ef4444; }
.hero-health-muted { gap: 0.4rem; padding-right: clamp(1rem, 2vw, 1.75rem); border-right: 1px solid var(--color-border-light); }
.hero-health-muted .hero-health-lock { font-size: 2rem; color: var(--color-text-muted); }
.hero-health-note { font-size: 0.78rem; color: var(--color-text-muted); margin: 0; line-height: 1.45; }
.hero-health-basis {
    margin-top: 0.35rem;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-pill, 999px);
    padding: 0.18rem 0.55rem;
    cursor: help;
}
.signals-basis-note {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0 0 1rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
    background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md, 10px);
}
.signals-basis-note .material-symbols-outlined { font-size: 1.05rem; color: var(--color-text-muted); flex-shrink: 0; }

.hero-summary { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.hero-summary-head { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-summary-spark { color: var(--color-text-muted); font-size: 1rem; }
.hero-summary-title { font-size: 0.88rem; font-weight: 700; margin: 0; color: var(--color-text-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.hero-summary-text { margin: 0; color: var(--color-text-secondary); line-height: 1.65; font-size: 0.93rem; }
.hero-summary-stats {
    display: flex; gap: 2.25rem; margin-top: 0.1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}
.hero-stat { display: flex; flex-direction: column; gap: 0.15rem; }
.hero-stat-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-text-muted); }
.hero-stat-value { font-size: 1rem; font-weight: 700; color: var(--color-text-primary); }

.hero-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
.hero-metric-tile {
    display: flex; flex-direction: column; gap: 0.4rem;
    padding: 0.9rem 1rem;
    border-radius: 0.85rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    transition: border-color 0.15s ease;
}
.hero-metric-label { font-size: 0.6rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-text-muted); }
.hero-metric-value { font-size: 1.2rem; font-weight: 700; color: var(--color-text-primary); display: inline-flex; align-items: baseline; gap: 0.3rem; }
.hero-metric-trend { font-size: 0.82rem; }
.hero-metric-trend.trend-up { color: #10b981; }
.hero-metric-trend.trend-down { color: #ef4444; }
.hero-metric-trend.trend-stable { color: var(--color-text-muted); }

/* ---- Valuation strip ---- */
.hero-valuation-row {
    grid-column: 1 / -1;
    display: flex; align-items: center; gap: 0; flex-wrap: wrap;
    padding-top: clamp(0.85rem, 1.5vw, 1.1rem);
    border-top: 1px solid var(--color-border-light);
}
.hero-val-tile {
    display: flex; flex-direction: column; gap: 0.25rem;
    flex: 1; min-width: 6.5rem;
    padding: 0 1.25rem 0 0;
    border-right: 1px solid var(--color-border-light);
    margin-right: 1.25rem;
}
.hero-val-tile:last-of-type { border-right: 0; }
.hero-val-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-text-muted); }
.hero-val-num { font-family: var(--font-family-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.03em; color: var(--color-text-primary); }
.hero-val-note {
    display: inline-flex; align-items: center; gap: 0.4rem;
    margin-left: auto; padding-left: 1rem;
    font-size: 0.7rem; color: var(--color-text-muted); max-width: 13rem; line-height: 1.4;
}
.hero-val-note .material-symbols-outlined { font-size: 0.9rem; flex-shrink: 0; }

/* ---- Tab bar ---- */
.company-tab-bar {
    display: flex; gap: 0.4rem; align-items: stretch;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 1.4rem;
}
.company-tab {
    appearance: none; background: none; border: 0; cursor: pointer;
    padding: 0.7rem 1.05rem;
    font-size: 0.92rem; font-weight: 600; color: var(--color-text-muted);
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.company-tab:hover { color: var(--color-text-secondary); }
.company-tab.is-active { color: var(--color-text-primary); border-bottom-color: var(--color-accent-primary); }

.company-tab-panel { display: none; }
.company-tab-panel.is-active { display: block; }

/* ---- Guest tab lock (anonymous sign-up wall on the deeper tabs) ---- */
.company-tab.is-guest-locked { display: inline-flex; align-items: center; gap: 0.32rem; }
.company-tab-lock { font-size: 0.95rem; opacity: 0.55; transition: opacity 0.15s ease; }
.company-tab.is-guest-locked:hover .company-tab-lock,
.company-tab.is-guest-locked.is-active .company-tab-lock { opacity: 1; }

.guest-lock { position: relative; padding: clamp(1.5rem, 4vw, 3rem) 1rem; display: flex; justify-content: center; }
.guest-lock-glow {
    position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(60% 60% at 50% 0%, var(--color-accent-glow), transparent 70%);
}
.guest-lock-card {
    position: relative; z-index: 1; width: min(560px, 100%); text-align: center;
    padding: clamp(1.6rem, 3.5vw, 2.6rem);
    background: linear-gradient(160deg, rgba(77, 142, 255, 0.10), rgba(28, 32, 38, 0.66));
    border: 1px solid var(--color-border-light); border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(4px);
}
.guest-lock-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--color-accent-secondary); padding: 0.32rem 0.7rem;
    border: 1px solid var(--color-accent-glow); border-radius: var(--radius-full);
    background: rgba(77, 142, 255, 0.10); margin-bottom: 1.1rem;
}
.guest-lock-badge .material-symbols-outlined { font-size: 0.95rem; }
.guest-lock-icon {
    width: 3.4rem; height: 3.4rem; margin: 0 auto 1rem; display: grid; place-items: center;
    border-radius: var(--radius-lg); background: var(--gradient-primary); color: #0a0e14;
    box-shadow: var(--shadow-glow);
}
.guest-lock-icon .material-symbols-outlined { font-size: 1.9rem; }
.guest-lock-title {
    font-family: var(--font-family-display); font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 800; margin: 0 0 0.5rem; color: var(--color-text-primary);
}
.guest-lock-desc {
    font-size: 0.98rem; line-height: 1.5; color: var(--color-text-secondary);
    max-width: 42ch; margin: 0 auto 1.4rem;
}
.guest-lock-perks {
    list-style: none; margin: 0 auto 1.6rem; padding: 0;
    display: inline-flex; flex-direction: column; gap: 0.55rem; text-align: left;
}
.guest-lock-perks li { display: flex; align-items: center; gap: 0.6rem; font-size: 0.92rem; color: var(--color-text-secondary); }
.guest-lock-perks .material-symbols-outlined { font-size: 1.15rem; color: var(--color-accent-secondary); }
.guest-lock-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; justify-content: center; align-items: center; }
.guest-lock-btn-primary {
    display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.8rem 1.5rem;
    border-radius: var(--radius-full); font-weight: 700; font-size: 0.98rem; text-decoration: none;
    color: #0a0e14; background: var(--gradient-primary); box-shadow: var(--shadow-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.guest-lock-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 55px var(--color-accent-glow); }
.guest-lock-btn-primary .material-symbols-outlined { font-size: 1.15rem; }
.guest-lock-btn-secondary {
    display: inline-flex; align-items: center; padding: 0.8rem 1.2rem;
    border-radius: var(--radius-full); font-weight: 600; font-size: 0.95rem; text-decoration: none;
    color: var(--color-text-secondary); border: 1px solid var(--color-border);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.guest-lock-btn-secondary:hover { color: var(--color-text-primary); border-color: var(--color-accent-primary); }
.guest-lock-fineprint { margin: 1rem 0 0; font-size: 0.78rem; color: var(--color-text-muted); }

/* ---- Trajectory table ---- */
.trajectory-card { padding: clamp(1.1rem, 2.4vw, 1.8rem) !important; margin-bottom: 1.25rem; }
.trajectory-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.trajectory-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: var(--color-text-primary); }
.trajectory-cadence { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-muted); padding: 0.3rem 0.6rem; border: 1px solid var(--color-border-light); border-radius: 0.5rem; }
.trajectory-table { display: flex; flex-direction: column; }
.trajectory-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.7fr);
    align-items: center; gap: 1rem;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px solid var(--color-border-light);
}
.trajectory-row:last-child { border-bottom: 0; }
.trajectory-row-head { padding: 0.4rem 0.25rem; }
.trajectory-row-head span { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--color-text-muted); }
.trajectory-row-head .traj-col-value, .traj-value { text-align: right; }
.trajectory-row-head .traj-col-pct, .traj-percentile { text-align: right; }
.traj-metric { display: flex; flex-direction: column; gap: 0.15rem; }
.traj-name { font-weight: 600; color: var(--color-text-primary); font-size: 0.92rem; }
.traj-sub { font-size: 0.74rem; color: var(--color-text-muted); }
.traj-value { font-weight: 700; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.traj-spark { display: flex; align-items: flex-end; gap: 4px; height: 38px; }
.traj-bar { width: 9px; border-radius: 2px 2px 0 0; background: var(--color-accent-primary); opacity: 0.55; min-height: 4px; }
.traj-spark.tone-positive .traj-bar { background: linear-gradient(180deg, #34d399, #10b981); }
.traj-spark.tone-info .traj-bar { background: linear-gradient(180deg, #6aa3ff, #4d8eff); }
.traj-spark.tone-warning .traj-bar { background: linear-gradient(180deg, #fb9b6a, #ef6b4b); }
.traj-spark .traj-bar:last-child { opacity: 1; }
/* Current (latest) trajectory bar — full opacity + a distinct, non-layout
   treatment (brightness lift + a crisp white top accent line) so it reads as
   the "you are here" bar against the recessive history bars. Scoped per tone
   to (0,3,0) so it beats the tone gradient overrides above. */
.traj-bar--current { opacity: 1; }
.traj-spark.tone-positive .traj-bar--current,
.traj-spark.tone-info .traj-bar--current,
.traj-spark.tone-warning .traj-bar--current {
    filter: brightness(1.25);
    box-shadow: inset 0 2px 0 0 rgba(255, 255, 255, 0.8);
}
.traj-yoy { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 700; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.traj-yoy.is-good { color: #10b981; }
.traj-yoy.is-bad { color: #ef4444; }
.traj-yoy.is-flat { color: var(--color-text-muted); }
.traj-percentile { font-weight: 700; color: var(--color-text-secondary); font-variant-numeric: tabular-nums; }

/* ---- Bullish / Bearish summary cards ---- */
.signals-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; margin-bottom: 1.25rem; }
.signals-summary-card {
    padding: 1.2rem 1.35rem;
    border-radius: 1rem;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-light);
    border-left: 3px solid transparent;
}
.signals-summary-card.bullish { border-left-color: #10b981; }
.signals-summary-card.bearish { border-left-color: #ef4444; }
.signals-summary-head { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.signals-summary-head h3 { font-size: 1rem; font-weight: 700; margin: 0; color: var(--color-text-primary); }
.signals-summary-card.bullish .signals-summary-head .material-symbols-outlined { color: #10b981; }
.signals-summary-card.bearish .signals-summary-head .material-symbols-outlined { color: #ef4444; }
.signals-summary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.signals-summary-list li { display: flex; flex-direction: column; gap: 0.2rem; }
.signals-summary-list li strong { font-size: 0.88rem; color: var(--color-text-primary); font-weight: 600; }
.signals-summary-list li span { font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.45; }

/* ---- Health breakdown ---- */
.health-breakdown-card { padding: clamp(1.1rem, 2.4vw, 1.8rem) !important; margin-bottom: 1.25rem; }
.health-breakdown-card .trajectory-title { margin-bottom: 1rem; }

/* ---- Dividend history (company page, SEC dividend_per_share) ---- */
.div-history-card { padding: clamp(1.1rem, 2.4vw, 1.8rem) !important; margin-bottom: 1.25rem; }
.div-history-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.3rem; }
.div-history-sub { display: block; margin-top: 0.25rem; font-size: 0.76rem; color: var(--color-text-muted); }
.div-history-toggle { display: inline-flex; gap: 0.25rem; padding: 0.25rem; border-radius: 0.7rem; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--color-border-light); }
.div-cadence-btn { border: none; background: transparent; color: var(--color-text-muted); font-size: 0.78rem; font-weight: 700; padding: 0.4rem 0.85rem; border-radius: 0.5rem; cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.div-cadence-btn:hover:not(:disabled) { color: var(--color-text-secondary); }
.div-cadence-btn.is-active { background: var(--color-accent-primary); color: #fff; }
.div-cadence-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.div-history-pane[hidden] { display: none; }
.div-history-statsrow { display: flex; gap: 1.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.div-history-stats { display: flex; gap: 1.4rem; }
.div-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; }
.div-stat-value { font-size: 1.15rem; font-weight: 800; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.div-stat-value.positive { color: var(--color-positive); }
.div-stat-value.negative { color: var(--color-negative); }
.div-stat-label { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-text-muted); }
.div-adj { color: var(--color-accent-secondary); font-weight: 700; margin-left: 1px; }

.div-history-chart { display: flex; align-items: flex-end; gap: 0.5rem; min-height: 168px; padding-top: 0.5rem; overflow-x: auto; }
.div-bar-col { flex: 1 1 0; min-width: 34px; display: flex; flex-direction: column; align-items: center; gap: 0.45rem; }
.div-bar-value { font-size: 0.7rem; font-weight: 700; color: var(--color-text-secondary); white-space: nowrap; font-variant-numeric: tabular-nums; min-height: 0.9rem; }
.div-bar-track { width: 100%; max-width: 46px; height: 120px; display: flex; align-items: flex-end; }
.div-bar-fill {
    width: 100%;
    border-radius: 0.45rem 0.45rem 0 0;
    background: linear-gradient(180deg, #6ee7b7 0%, #10b981 100%);
    min-height: 3px;
    transform-origin: bottom;
    animation: pf-bar-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.div-bar-fill.is-zero { background: rgba(255, 255, 255, 0.08); min-height: 2px; }
.div-bar-col:hover .div-bar-fill { filter: brightness(1.12); }
.div-bar-label { font-size: 0.66rem; font-weight: 600; color: var(--color-text-muted); white-space: nowrap; }
.div-history-foot { margin: 0.9rem 0 0; font-size: 0.72rem; color: var(--color-text-muted); }
.div-history-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; padding: 1.5rem 0; color: var(--color-text-muted); }
.div-history-empty .material-symbols-outlined { font-size: 2rem; opacity: 0.6; }
.div-history-empty p { margin: 0; font-size: 0.86rem; }
@keyframes pf-bar-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .div-bar-fill { animation: none; transform: none; } }
[data-theme="light"] .div-bar-fill.is-zero { background: rgba(15, 23, 42, 0.08); }

/* ---- Compare CTA ---- */
.compare-cta-card { padding: 2.5rem !important; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.compare-cta-icon { font-size: 2.6rem; color: var(--color-accent-secondary); }
.compare-cta-card h3 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--color-text-primary); }
.compare-cta-card p { margin: 0; color: var(--color-text-muted); max-width: 34rem; line-height: 1.55; }
.compare-cta-btn {
    margin-top: 0.6rem; display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.7rem 1.3rem; border-radius: 0.7rem; font-weight: 600; text-decoration: none;
    color: #fff; background: linear-gradient(135deg, var(--color-accent-primary), #6aa3ff);
}
.compare-cta-btn:hover { filter: brightness(1.06); color: #fff; }
.compare-cta-btn .material-symbols-outlined { font-size: 1.1rem; }
.deepdive-container { display: block; }

/* Visual tab — frames the lens in the same dark card the metrics container
   used to give it, so the translucent .vl-card surfaces read correctly. */
.visual-container {
    background: linear-gradient(145deg, rgba(28, 32, 38, 0.46) 0%, rgba(10, 14, 20, 0.24) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: clamp(0.75rem, 2vw, 1.5rem) clamp(0.9rem, 2.5vw, 1.75rem);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .hero-card-grid { grid-template-columns: 1fr; }
    .hero-health { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--color-border-light); padding-bottom: 1rem; }
    .hero-health-muted { border-right: 0; padding-right: 0; }
    .hero-metric-grid { grid-template-columns: repeat(2, 1fr); }
    .signals-summary-grid { grid-template-columns: 1fr; }
    .company-header-identity { align-items: flex-start; }
    .company-headline { flex-basis: auto; max-width: 100%; }
    .company-header-identity .company-price-display { align-items: flex-start; text-align: left; }
}
@media (max-width: 720px) {
    .trajectory-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); row-gap: 0.4rem; }
    .trajectory-row .traj-spark, .trajectory-row-head .traj-col-trend,
    .trajectory-row .traj-percentile, .trajectory-row-head .traj-col-pct { display: none; }
    .company-tab-bar { overflow-x: auto; }
}

/* === Screener results table — premium redesign === */

/* Compact row height — higher specificity than .data-table td (0,1,1) */
#screener-table td {
    padding: 0.6rem 1rem;
    vertical-align: middle;
}

/* Row hover */
#screener-table tbody tr { transition: background 0.1s; }
#screener-table tbody tr:hover td { background: rgba(77,142,255,0.06); }

/* Merged company column */
.screener-company-col { white-space: nowrap; }
.screener-company-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
}
.screener-company-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.screener-company-name {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: capitalize;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 28ch;
}
.screener-company-link:hover .screener-company-name { color: #f0f4ff; }

/* Ticker chip */
.screener-ticker-chip {
    display: inline-block;
    padding: 0.05rem 0.35rem;
    border-radius: var(--radius-sm, 4px);
    background: rgba(77,142,255,0.15);
    color: #adc6ff;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* Price cell */
#screener-table .screener-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* Sector badge */
.screener-sector-badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: 99px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--color-text-secondary, #9ca3af);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* View button */
.screener-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-md, 6px);
    background: rgba(77,142,255,0.1);
    border: 1px solid rgba(77,142,255,0.25);
    color: #adc6ff;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    white-space: nowrap;
}
.screener-view-btn:hover {
    background: var(--color-accent-primary, #4d8eff);
    border-color: var(--color-accent-primary, #4d8eff);
    color: #fff;
}

/* Letter avatar — base */
.screener-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0;
    line-height: 1;
}

/* Avatar palette — 26 letters, 12 on-brand gradient colors */
/* Blues */
.avatar--A, .avatar--N { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
/* Violets */
.avatar--B, .avatar--O { background: linear-gradient(135deg, #7c3aed, #a78bfa); }
/* Teals */
.avatar--C, .avatar--P { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
/* Cyan */
.avatar--D, .avatar--Q { background: linear-gradient(135deg, #0891b2, #22d3ee); }
/* Orange */
.avatar--E, .avatar--R { background: linear-gradient(135deg, #ea580c, #fb923c); }
/* Pink */
.avatar--F, .avatar--S { background: linear-gradient(135deg, #db2777, #f472b6); }
/* Indigo */
.avatar--G, .avatar--T { background: linear-gradient(135deg, #4338ca, #818cf8); }
/* Amber — dark text for contrast */
.avatar--H, .avatar--U { background: linear-gradient(135deg, #d97706, #fcd34d); color: #1a1200; }
/* Emerald */
.avatar--I, .avatar--V { background: linear-gradient(135deg, #059669, #34d399); }
/* Purple */
.avatar--J, .avatar--W { background: linear-gradient(135deg, #6d28d9, #c084fc); }
/* Sky blue */
.avatar--K, .avatar--X { background: linear-gradient(135deg, #0284c7, #7dd3fc); }
/* Crimson */
.avatar--L, .avatar--Y { background: linear-gradient(135deg, #dc2626, #f87171); }
/* Accent primary — for M and Z */
.avatar--M, .avatar--Z { background: linear-gradient(135deg, #4d8eff, #adc6ff); }

/* Sort glyph on the Company column header (mirrors .sort-arrow). */
.sort-indicator {
    margin-left: 0.25rem;
    font-size: 0.65em;
    opacity: 0.75;
}

/* Ticker as separate column */
.screener-ticker-col {
    white-space: nowrap;
    width: 1%;
}
.screener-ticker-col a.screener-ticker-chip {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm, 4px);
    background: rgba(77,142,255,0.15);
    color: #adc6ff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.screener-ticker-col a.screener-ticker-chip:hover {
    background: rgba(77,142,255,0.3);
    color: #fff;
}
.screener-company-col a.screener-company-name {
    color: var(--color-text-primary);
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: capitalize;
    text-decoration: none;
}
.screener-company-col a.screener-company-name:hover {
    color: #f0f4ff;
}

/* ============================================================
   Light mode — [data-theme="light"]
   Token overrides + key structural surfaces (body, sidebar, cards, nav).
   Intentionally narrow scope per approved story; full rgba sweep is a follow-up.
   ============================================================ */
:root[data-theme="light"],
[data-theme="light"] {
    color-scheme: light;
    --color-bg-primary:      #f5f7fa;
    --color-bg-secondary:    #ffffff;
    --color-bg-card:         #ffffff;
    --color-bg-card-hover:   #eef1f6;
    --color-bg-elevated:     #ffffff;

    --color-text-primary:    #1a1f2b;
    --color-text-secondary:  #3a4150;
    --color-text-muted:      #5f6675;

    --color-accent-primary:  #2f6fed;
    --color-accent-secondary:#4d8eff;
    --color-accent-glow:     rgba(47, 111, 237, 0.16);

    --color-positive:        #0f9d6a;
    --color-negative:        #d6453a;
    --color-warning:         #b6841f;

    --color-border:          rgba(20, 28, 44, 0.14);
    --color-border-light:    rgba(20, 28, 44, 0.08);

    --gradient-bg:      linear-gradient(180deg, #f5f7fa 0%, #eef1f6 100%);
    --gradient-card:    linear-gradient(145deg, #ffffff 0%, #f7f9fc 100%);
    --gradient-primary: linear-gradient(135deg, #1a2a4a 0%, #2f6fed 55%, #4d8eff 100%);

    --shadow-sm:  0 1px 2px rgba(20, 28, 44, 0.06);
    --shadow-md:  0 4px 12px rgba(20, 28, 44, 0.08);
    --shadow-lg:  0 18px 50px rgba(20, 28, 44, 0.12);
    --shadow-glow: 0 0 40px rgba(47, 111, 237, 0.10);
}

/* Soften the grid overlay on light backgrounds */
[data-theme="light"] .app-body::before {
    background-image:
        linear-gradient(rgba(20,28,44,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20,28,44,0.02) 1px, transparent 1px);
}

/* AC 7: sidebar */
[data-theme="light"] .app-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
    border-right: 1px solid rgba(20, 28, 44, 0.08);
}
[data-theme="light"] .app-sidebar-frame {
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fa 100%);
    border: 1px solid rgba(20, 28, 44, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 24px 60px rgba(20,28,44,0.08);
}
[data-theme="light"] .app-sidebar-frame::before {
    background: none;
}

/* AC 7: cards */
[data-theme="light"] .app-surface-card {
    background: var(--gradient-card);
    border: 1px solid rgba(20, 28, 44, 0.08);
    box-shadow: 0 18px 50px rgba(20, 28, 44, 0.08);
}

/* Sidebar nav icons */
[data-theme="light"] .app-nav-icon {
    color: #5f6675;
}
[data-theme="light"] .app-nav-icon:hover,
[data-theme="light"] .app-nav-icon.active {
    color: #1a1f2b;
    background: linear-gradient(180deg, rgba(47,111,237,0.10) 0%, rgba(47,111,237,0.04) 100%);
    border-color: rgba(47,111,237,0.20);
    box-shadow: none;
}

/* Hero card text */
[data-theme="light"] .dashboard-hero-eyebrow { color: var(--color-accent-primary); }
[data-theme="light"] .dashboard-hero-title { color: var(--color-text-primary); }
[data-theme="light"] .dashboard-hero-subtitle { color: var(--color-text-secondary); }

/* Dashboard ticker + preset + sector + cta cards */
[data-theme="light"] .dash-ticker-card,
[data-theme="light"] .dash-preset-card,
[data-theme="light"] .dash-sector-card,
[data-theme="light"] .dash-cta-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="light"] .dash-ticker-card:hover,
[data-theme="light"] .dash-preset-card:hover,
[data-theme="light"] .dash-sector-card:hover,
[data-theme="light"] .dash-cta-card:hover {
    border-color: rgba(47, 111, 237, 0.25);
    box-shadow: 0 12px 32px rgba(20, 28, 44, 0.10);
}
[data-theme="light"] .dash-ticker-symbol,
[data-theme="light"] .dash-ticker-price { color: var(--color-text-primary); }
[data-theme="light"] .dash-ticker-meta { color: var(--color-text-muted); }
[data-theme="light"] .dash-ticker-change--up   { color: var(--color-positive); background: rgba(15, 157, 106, 0.12); }
[data-theme="light"] .dash-ticker-change--down { color: var(--color-negative); background: rgba(214, 69, 58, 0.12); }

/* Preset card text */
[data-theme="light"] .dash-preset-name { color: var(--color-text-primary); }
[data-theme="light"] .dash-preset-desc { color: var(--color-text-secondary); }
[data-theme="light"] .dash-preset-cta { color: var(--color-accent-primary); }

/* Empty state */
[data-theme="light"] .dash-empty-state {
    background: rgba(20, 28, 44, 0.03);
    border-color: var(--color-border);
}
[data-theme="light"] .dash-empty-title { color: var(--color-text-primary); }
[data-theme="light"] .dash-empty-desc { color: var(--color-text-secondary); }
[data-theme="light"] .dash-empty-icon { color: var(--color-accent-primary); }

/* Section headings */
[data-theme="light"] .dash-section-title { color: var(--color-text-muted); }
[data-theme="light"] .dash-section-link { color: var(--color-accent-primary); }
[data-theme="light"] .dash-section-link:hover { color: var(--color-accent-secondary); }

/* Watchlist add form */
[data-theme="light"] .dash-watch-add-input {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    color: var(--color-text-primary);
}
[data-theme="light"] .dash-watch-add-input:focus {
    border-color: var(--color-accent-primary);
    background: var(--color-bg-secondary);
}
[data-theme="light"] .dash-watch-add-btn {
    background: rgba(47, 111, 237, 0.10);
    border-color: rgba(47, 111, 237, 0.30);
    color: var(--color-accent-primary);
}
[data-theme="light"] .dash-watch-add-btn:hover { background: rgba(47, 111, 237, 0.18); }

/* Research log */
[data-theme="light"] .research-log-search-wrap {
    background: rgba(20, 28, 44, 0.04);
    border-color: var(--color-border);
}
[data-theme="light"] .research-log-search-icon { color: var(--color-text-muted); }
[data-theme="light"] .research-log-search { color: var(--color-text-primary); }
[data-theme="light"] .research-log-search::placeholder { color: var(--color-text-muted); }
[data-theme="light"] .research-log-row {
    background: var(--color-bg-card);
    border-color: var(--color-border-light);
}
[data-theme="light"] .research-log-row:hover { border-color: rgba(47, 111, 237, 0.25); }
[data-theme="light"] .research-log-ticker { color: var(--color-accent-primary); }
[data-theme="light"] .research-log-preview { color: var(--color-text-secondary); }
[data-theme="light"] .research-log-meta { color: var(--color-text-muted); }

/* ── App page header / title ────────────────────────────────────────────── */
[data-theme="light"] .app-page-eyebrow { color: var(--color-accent-primary); }
[data-theme="light"] .app-page-title { color: var(--color-text-primary); }
[data-theme="light"] .app-page-subtitle,
[data-theme="light"] .panel-narrative,
[data-theme="light"] .sub-text { color: var(--color-text-secondary) !important; }

/* ── Global surface border fix (the Stitch block sets !important) ──────── */
[data-theme="light"] .app-page-header,
[data-theme="light"] .company-header-redesign,
[data-theme="light"] .app-surface-card,
[data-theme="light"] .table-card,
[data-theme="light"] .insights-panel,
[data-theme="light"] .chart-collapsible,
[data-theme="light"] .collapsible-section {
    border: 1px solid rgba(20, 28, 44, 0.08) !important;
    backdrop-filter: none;
}

/* ── Veko-It home page ──────────────────────────────────────────────────── */
[data-theme="light"] .veko-it-wordmark {
    background: linear-gradient(135deg, #1a1f2b 0%, #2f6fed 60%, #4d8eff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: none;
}
[data-theme="light"] .veko-it-welcome-pill {
    background: rgba(47, 111, 237, 0.06);
    border-color: rgba(47, 111, 237, 0.20);
    color: var(--color-text-secondary);
}
[data-theme="light"] .veko-it-pill-arrow { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-pill-cta { color: var(--color-accent-primary); }
[data-theme="light"] .veko-it-tagline { color: var(--color-text-secondary); }
[data-theme="light"] .veko-it-tagline-accent { color: var(--color-accent-primary); }
[data-theme="light"] .veko-it-input-shell {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    box-shadow: 0 4px 16px rgba(20, 28, 44, 0.08);
}
[data-theme="light"] .veko-it-input-shell:hover {
    border-color: rgba(47, 111, 237, 0.30);
    box-shadow: 0 6px 20px rgba(20, 28, 44, 0.12);
}
[data-theme="light"] .veko-it-input-shell:focus-within {
    border-color: var(--color-accent-primary);
    box-shadow: 0 10px 32px rgba(47, 111, 237, 0.12);
}
[data-theme="light"] .veko-it-input-icon { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-input { color: var(--color-text-primary); }
[data-theme="light"] .veko-it-input::placeholder { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-btn-primary {
    background: var(--color-accent-primary);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(47, 111, 237, 0.30);
}
[data-theme="light"] .veko-it-btn-secondary {
    background: rgba(20, 28, 44, 0.04);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
[data-theme="light"] .veko-it-btn-secondary:hover {
    background: rgba(20, 28, 44, 0.08);
    border-color: rgba(47, 111, 237, 0.25);
}
[data-theme="light"] .veko-it-trending-label { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-chip {
    background: rgba(20, 28, 44, 0.04);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
[data-theme="light"] .veko-it-chip:hover {
    background: rgba(47, 111, 237, 0.08);
    border-color: rgba(47, 111, 237, 0.30);
    color: var(--color-accent-primary);
}
[data-theme="light"] .veko-it-footer { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-footer a { color: var(--color-text-muted); }
[data-theme="light"] .veko-it-footer a:hover { color: var(--color-accent-primary); }

/* ── Screener page ─────────────────────────────────────────────────────── */
[data-theme="light"] .screener-stats {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="light"] .screener-stat-value { color: var(--color-text-primary); }
[data-theme="light"] .screener-stat-label { color: var(--color-text-muted); }
[data-theme="light"] .screener-section-title { color: var(--color-text-primary); }
[data-theme="light"] .screener-clear-link { color: var(--color-accent-primary); }
[data-theme="light"] .screener-clear-link:hover { color: var(--color-accent-secondary); }
[data-theme="light"] .screener-preset-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="light"] .screener-preset-card:hover {
    border-color: rgba(47, 111, 237, 0.25);
    box-shadow: 0 12px 32px rgba(20, 28, 44, 0.10);
}
[data-theme="light"] .screener-preset-card--active {
    background: rgba(47, 111, 237, 0.06);
    border-color: rgba(47, 111, 237, 0.30);
}
[data-theme="light"] .screener-preset-icon {
    background: rgba(47, 111, 237, 0.10);
    color: var(--color-accent-primary);
}
[data-theme="light"] .screener-preset-name { color: var(--color-text-primary); }
[data-theme="light"] .screener-preset-desc { color: var(--color-text-secondary); }
[data-theme="light"] .screener-filter-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="light"] .screener-filter-toggle {
    background: rgba(47, 111, 237, 0.06) !important;
    border-color: rgba(47, 111, 237, 0.20) !important;
    color: var(--color-accent-primary) !important;
}
[data-theme="light"] .screener-filter-toggle:hover {
    background: rgba(47, 111, 237, 0.12) !important;
    border-color: rgba(47, 111, 237, 0.35) !important;
}
[data-theme="light"] .screener-filter-count {
    background: rgba(47, 111, 237, 0.12);
    color: var(--color-accent-primary);
}
[data-theme="light"] .screener-filter-panel.is-open {
    border-top-color: var(--color-border);
}

/* Fix autofill override for veko-it search in light mode */
[data-theme="light"] .veko-it-input:-webkit-autofill,
[data-theme="light"] .veko-it-input:-webkit-autofill:hover,
[data-theme="light"] .veko-it-input:-webkit-autofill:focus,
[data-theme="light"] .veko-it-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
    box-shadow: 0 0 0 1000px #ffffff inset !important;
    -webkit-text-fill-color: var(--color-text-primary) !important;
    caret-color: var(--color-text-primary) !important;
}
[data-theme="light"] .veko-it-input::placeholder { color: var(--color-text-muted); }

/* Self-service sync: spinner + transient toast feedback */
@keyframes veko-spin { to { transform: rotate(360deg); } }
.material-symbols-outlined.spin { animation: veko-spin 0.9s linear infinite; transform-origin: center; }
[data-sync-trigger].is-syncing { opacity: 0.85; cursor: progress; }

.veko-toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translate(-50%, 1.5rem);
    z-index: 1000;
    max-width: min(90vw, 30rem);
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-md, 10px);
    font-size: 0.86rem;
    line-height: 1.4;
    color: var(--color-text-primary);
    background: var(--color-bg-elevated, #1c2026);
    border: 1px solid var(--color-border-light);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.veko-toast.show { opacity: 1; transform: translate(-50%, 0); }
.veko-toast.error { border-color: #ef4444; }
.veko-toast.info { border-color: var(--color-accent-primary, #4d8eff); }

/* ============================================================
   Light mode — round 2: components that were built dark-only.
   Appended last so these win over the hardcoded dark rules.
   ============================================================ */

/* --- Form inputs (a global rule hardcodes near-black bg !important) --- */
[data-theme="light"] .search-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="search"],
[data-theme="light"] select,
[data-theme="light"] textarea {
    background-color: #ffffff !important;   /* color only — preserves any select arrow image */
    border-color: var(--color-border) !important;
    color: var(--color-text-primary) !important;
}
/* Inputs that sit inside an already-white shell stay transparent + borderless. */
[data-theme="light"] .veko-it-input-shell .veko-it-input,
[data-theme="light"] .cmp2-tag-input .cmp2-input,
[data-theme="light"] .stock-search-container .stock-search {
    background-color: transparent !important;
    border-color: transparent !important;
}
[data-theme="light"] .cmp2-input::placeholder { color: var(--color-text-muted); }

/* --- Sidebar: read as a distinct panel against the off-white page --- */
[data-theme="light"] .app-sidebar { background: transparent; border-right: 0; }
[data-theme="light"] .app-sidebar-frame {
    background: #ffffff;
    border: 1px solid rgba(20, 28, 44, 0.12);
    box-shadow: 0 10px 34px rgba(20, 28, 44, 0.10);
}
[data-theme="light"] .app-rail-logo { color: var(--color-accent-primary); background: rgba(47, 111, 237, 0.10); }

/* --- Dashboard sector + CTA cards (titles were #f4f7ff = invisible) --- */
[data-theme="light"] .dash-sector-name,
[data-theme="light"] .dash-cta-title { color: var(--color-text-primary); }
[data-theme="light"] .dash-sector-desc,
[data-theme="light"] .dash-cta-desc { color: var(--color-text-secondary); }
[data-theme="light"] .dash-sector-icon,
[data-theme="light"] .dash-cta-icon { background: rgba(47, 111, 237, 0.10); color: var(--color-accent-primary); }
[data-theme="light"] .badge--stable { background: rgba(47, 111, 237, 0.12); color: var(--color-accent-primary); }

/* --- Compare table (.cmp2-*) was built dark-only --- */
[data-theme="light"] .cmp2-title { color: var(--color-text-primary); }
[data-theme="light"] .cmp2-prompt { color: var(--color-text-secondary); }
[data-theme="light"] .cmp2-table-wrap { background: var(--color-bg-card); border-color: var(--color-border); }
[data-theme="light"] .cmp2-th-metric,
[data-theme="light"] .cmp2-th-company { background: #eef1f6; border-bottom-color: var(--color-border); }
[data-theme="light"] .cmp2-th-metric,
[data-theme="light"] .cmp2-th-sector,
[data-theme="light"] .cmp2-section-sub,
[data-theme="light"] .cmp2-data-note,
[data-theme="light"] .cmp2-score-wins-label,
[data-theme="light"] .cmp2-trend-label,
[data-theme="light"] .cmp2-direction-hint,
[data-theme="light"] .cmp2-toggle-chevron,
[data-theme="light"] .cmp2-counter { color: var(--color-text-muted); }
[data-theme="light"] .cmp2-th-ticker { color: var(--color-text-primary); }
[data-theme="light"] .cmp2-th-name { color: var(--color-text-secondary); }
[data-theme="light"] .cmp2-section-label { color: var(--color-accent-primary); }
[data-theme="light"] .cmp2-cell,
[data-theme="light"] .cmp2-cell-metric,
[data-theme="light"] .cmp2-metric-name { color: var(--color-text-primary); }
[data-theme="light"] .cmp2-row td { border-bottom-color: var(--color-border-light); }
[data-theme="light"] .cmp2-row:hover td { background: rgba(20, 28, 44, 0.03); }
[data-theme="light"] .cmp2-trend-row td { background: rgba(47, 111, 237, 0.05); border-bottom-color: var(--color-border-light); }
[data-theme="light"] .cmp2-th-company.is-leader { background: linear-gradient(180deg, rgba(15, 157, 106, 0.14), #eef1f6); }
[data-theme="light"] .cmp2-th-company.is-leader .cmp2-th-ticker { color: #0f9d6a; }
[data-theme="light"] .cmp2-cell.is-leader-col { background: rgba(15, 157, 106, 0.05); }
[data-theme="light"] .cmp2-cell.is-best .cmp2-value { color: #0f9d6a; }
[data-theme="light"] .cmp2-scorecard,
[data-theme="light"] .cmp2-summary-item { background: var(--color-bg-card); border-color: var(--color-border); }
[data-theme="light"] .cmp2-score-bar-track { background: rgba(20, 28, 44, 0.07); }
[data-theme="light"] .cmp2-tag-input { background: #ffffff; border-color: var(--color-border); box-shadow: 0 4px 18px rgba(20, 28, 44, 0.06); }
[data-theme="light"] .cmp2-chip { background: rgba(47, 111, 237, 0.10); color: var(--color-accent-primary); }
[data-theme="light"] .cmp2-chip-remove { color: rgba(47, 111, 237, 0.7); }
[data-theme="light"] .cmp2-chip-remove:hover { background: rgba(47, 111, 237, 0.18); color: var(--color-accent-primary); }
[data-theme="light"] .cmp2-suggestions { background: #ffffff; border-color: var(--color-border); box-shadow: 0 12px 40px rgba(20, 28, 44, 0.15); }
[data-theme="light"] .cmp2-suggestions li:hover,
[data-theme="light"] .cmp2-suggestions li.is-active { background: rgba(47, 111, 237, 0.08); }
[data-theme="light"] .cmp2-sugg-ticker { color: var(--color-accent-primary); }
[data-theme="light"] .cmp2-sugg-name { color: var(--color-text-secondary); }
[data-theme="light"] .cmp2-hint { background: rgba(47, 111, 237, 0.06); border-color: rgba(47, 111, 237, 0.20); color: var(--color-text-secondary); }
[data-theme="light"] .cmp2-preset,
[data-theme="light"] .cmp2-action { background: #ffffff; border-color: var(--color-border); color: var(--color-text-secondary); }
[data-theme="light"] .cmp2-preset:hover,
[data-theme="light"] .cmp2-action:hover { color: var(--color-accent-primary); border-color: rgba(47, 111, 237, 0.3); background: rgba(47, 111, 237, 0.06); }

/* --- Screener results table (.screener-results-card dark gradient) --- */
[data-theme="light"] .screener-results-card { background: var(--color-bg-card); border-color: var(--color-border); }
[data-theme="light"] .screener-results-head { border-bottom-color: var(--color-border); }
[data-theme="light"] .screener-results-title { color: var(--color-text-primary); }
[data-theme="light"] .screener-icon-btn { background: #ffffff; border-color: var(--color-border); color: var(--color-text-secondary); }
[data-theme="light"] .screener-icon-btn:hover { color: var(--color-accent-primary); border-color: rgba(47, 111, 237, 0.3); }
[data-theme="light"] #screener-table tbody tr:hover td { background: rgba(47, 111, 237, 0.06); }
[data-theme="light"] .screener-sector-badge { background: rgba(20, 28, 44, 0.04); border-color: var(--color-border); color: var(--color-text-secondary); }
[data-theme="light"] .screener-ticker-chip { background: rgba(47, 111, 237, 0.12); color: var(--color-accent-primary); }
[data-theme="light"] .screener-row-action { color: var(--color-accent-primary); }
[data-theme="light"] .screener-row-action:hover { color: var(--color-accent-secondary); }

/* --- Data-table rows (.data-table/.metrics-table td had hardcoded dark bg) --- */
[data-theme="light"] .data-table td,
[data-theme="light"] .metrics-table td {
    background: #ffffff;
    border-top-color: var(--color-border-light) !important;
    border-bottom-color: var(--color-border-light) !important;
}
[data-theme="light"] .data-table td:first-child,
[data-theme="light"] .metrics-table td:first-child { border-left-color: var(--color-border-light) !important; }
[data-theme="light"] .data-table td:last-child,
[data-theme="light"] .metrics-table td:last-child { border-right-color: var(--color-border-light) !important; }
[data-theme="light"] .data-table tbody tr:hover td,
[data-theme="light"] .metrics-table tbody tr:hover td { background: rgba(47, 111, 237, 0.06) !important; }
[data-theme="light"] .data-table th,
[data-theme="light"] .metrics-table th { color: var(--color-text-muted) !important; }

/* --- Portfolio empty state ("Your portfolio starts here") --- */
[data-theme="light"] .empty-portfolio {
    background: linear-gradient(145deg, #ffffff 0%, #eef1f6 100%);
    border-color: rgba(47, 111, 237, 0.25);
}
[data-theme="light"] .pf-empty-list .material-symbols-outlined {
    background: rgba(47, 111, 237, 0.10);
    color: var(--color-accent-primary);
}
/* Ghost preview placeholders were white-translucent → invisible on white. */
[data-theme="light"] .pf-ghost-price,
[data-theme="light"] .pf-ghost-big,
[data-theme="light"] .pf-ghost-grid span { background: rgba(20, 28, 44, 0.08); }

/* ===================================================================== */
/* Portfolio — transaction ledger (per-holding buy/sell history)         */
/* Uses design tokens so both dark and light themes adapt automatically. */
/* ===================================================================== */
.holding-tx {
    margin-top: 0.75rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
}
.holding-tx-summary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    list-style: none;
    font-size: var(--font-size-sm, 0.85rem);
    color: var(--color-text-secondary);
    user-select: none;
}
.holding-tx-summary::-webkit-details-marker { display: none; }
.holding-tx-summary:hover { color: var(--color-text-primary); }
.holding-tx-summary .material-symbols-outlined { font-size: 1.05rem; }
.holding-tx-count {
    margin-left: auto;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--color-bg-tertiary, rgba(127, 127, 127, 0.14));
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}
.holding-tx-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.holding-tx-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-bg-tertiary, rgba(127, 127, 127, 0.08));
    font-size: var(--font-size-sm, 0.82rem);
}
.tx-badge {
    flex-shrink: 0;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.tx-badge-buy { background: rgba(16, 185, 129, 0.16); color: #10b981; }
.tx-badge-sell { background: rgba(239, 68, 68, 0.16); color: #ef4444; }
.tx-detail { color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
.tx-date { color: var(--color-text-secondary); font-size: 0.75rem; }
.tx-row-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
.tx-row-actions .tx-delete-form { margin: 0; display: inline-flex; }
.tx-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.7rem;
    height: 1.7rem;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tx-icon-btn:hover { background: var(--color-bg-secondary, rgba(127, 127, 127, 0.16)); color: var(--color-text-primary); }
.tx-icon-btn .material-symbols-outlined { font-size: 1.05rem; }
.tx-icon-danger:hover { color: #ef4444; background: rgba(239, 68, 68, 0.12); }
.tx-add-btn {
    margin-top: 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.7rem;
    border: 1px dashed var(--color-border);
    background: transparent;
    border-radius: var(--radius-sm, 6px);
    color: var(--color-accent-primary);
    font-size: var(--font-size-sm, 0.82rem);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.tx-add-btn:hover { background: rgba(77, 142, 255, 0.10); border-color: var(--color-accent-primary); }
.tx-add-btn .material-symbols-outlined { font-size: 1.05rem; }

/* ============================================================
   Mobile app shell — issue #107
   Bottom tab bar (primary nav) + slim top bar (secondary actions).
   Additive & desktop-safe: the new chrome is display:none until the
   tablet/phone breakpoint, where it replaces the left icon rail.
   ============================================================ */
.app-mobile-topbar,
.app-tabbar { display: none; }

@media (max-width: 1023px) {
    /* Replace the desktop icon rail with mobile chrome. */
    .app-body .app-sidebar { display: none; }
    .app-body .app-layout { grid-template-columns: minmax(0, 1fr); }

    /* Make room for the fixed top bar (56px) and bottom tab bar (58px),
       respecting iOS safe-area insets on notched devices. */
    .app-body .app-main-content {
        padding: calc(56px + env(safe-area-inset-top, 0px) + 0.5rem) 0
                 calc(58px + env(safe-area-inset-bottom, 0px) + 1rem);
    }

    /* --- Slim top bar --- */
    .app-mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 120;
        height: calc(56px + env(safe-area-inset-top, 0px));
        padding: env(safe-area-inset-top, 0px) 0.9rem 0;
        background: rgba(8, 11, 18, 0.92);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(173, 198, 255, 0.08);
    }

    .app-mobile-brand {
        font-family: var(--font-family-display);
        font-size: 1.3rem;
        font-weight: 800;
        letter-spacing: -0.04em;
        color: #eef4ff;
        text-decoration: none;
    }

    .app-mobile-topbar-actions {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }

    .app-mobile-iconbtn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.85rem;
        border: 1px solid transparent;
        background: transparent;
        color: #90a0bd;
        cursor: pointer;
        text-decoration: none;
        transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
    }

    .app-mobile-iconbtn:hover,
    .app-mobile-iconbtn:active {
        color: #dce8ff;
        background: rgba(173, 198, 255, 0.08);
        border-color: rgba(173, 198, 255, 0.14);
    }

    .app-mobile-iconbtn .material-symbols-outlined { font-size: 1.3rem; }

    .app-mobile-iconbtn-accent {
        color: #eaf2ff;
        background: linear-gradient(180deg, rgba(77, 142, 255, 0.22) 0%, rgba(173, 198, 255, 0.08) 100%);
        border-color: rgba(173, 198, 255, 0.2);
    }

    /* --- Bottom tab bar --- */
    .app-tabbar {
        display: flex;
        align-items: stretch;
        justify-content: space-around;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 120;
        padding: 0.3rem 0.25rem calc(0.3rem + env(safe-area-inset-bottom, 0px));
        background: rgba(8, 11, 18, 0.94);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(173, 198, 255, 0.08);
    }

    .app-tab {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        min-width: 0;
        padding: 0.35rem 0.2rem;
        border-radius: 0.85rem;
        color: #8c97ad;
        text-decoration: none;
        transition: color var(--transition-fast), background var(--transition-fast);
    }

    .app-tab .material-symbols-outlined { font-size: 1.45rem; }

    .app-tab-label {
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        line-height: 1;
        white-space: nowrap;
    }

    .app-tab:hover { color: #c2cad9; }

    .app-tab.active {
        color: #eaf2ff;
    }

    .app-tab.active .material-symbols-outlined {
        font-variation-settings: 'FILL' 1;
    }
}

/* Light-theme variants for the mobile chrome. */
[data-theme="light"] .app-mobile-topbar {
    background: rgba(248, 250, 253, 0.92);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .app-mobile-brand { color: #0f1b2d; }
[data-theme="light"] .app-mobile-iconbtn { color: #51607a; }
[data-theme="light"] .app-mobile-iconbtn:hover,
[data-theme="light"] .app-mobile-iconbtn:active {
    color: #0f1b2d;
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.1);
}
[data-theme="light"] .app-tabbar {
    background: rgba(248, 250, 253, 0.95);
    border-top-color: rgba(15, 23, 42, 0.08);
}
[data-theme="light"] .app-tab { color: #64718a; }
[data-theme="light"] .app-tab:hover { color: #334155; }
[data-theme="light"] .app-tab.active { color: #0f1b2d; }

/* ============================================================
   Mobile data tables — company + screener (issue #107)
   Denser cells + a pinned first column so dense financial tables
   stay legible while scrolling sideways on a phone.
   ============================================================ */
@media (max-width: 1023px) {
    /* The metrics-table header is position:sticky/top:0; offset it so it
       pins just below the fixed mobile top bar instead of behind it. */
    .app-body .metrics-table th {
        top: calc(56px + env(safe-area-inset-top, 0px));
    }
}

@media (max-width: 640px) {
    /* --- Company metrics table: denser cells, momentum scroll --- */
    .table-wrapper { -webkit-overflow-scrolling: touch; }
    .metrics-table th,
    .metrics-table td { padding: 0.6rem 0.7rem; }
    .metric-name-header,
    .metric-name-cell {
        min-width: 132px;
        padding-left: 0.85rem;
    }
    .period-header { min-width: 78px; }

    /* Compact the company header action buttons so fewer rows wrap. */
    .header-action-btn { padding: 0.45rem 0.6rem; font-size: 0.76rem; }

    /* --- Screener results: pin the ticker column while scrolling --- */
    .screener-results-card .table-responsive { -webkit-overflow-scrolling: touch; }
    #screener-table th,
    #screener-table td { padding: 0.7rem 0.6rem; font-size: 0.8rem; }
    #screener-table thead th:first-child,
    #screener-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: var(--color-bg-card);
    }
    #screener-table thead th:first-child {
        z-index: 2;
        background: var(--color-bg-secondary);
    }
    .screener-results-head { padding: 0.9rem 1rem; }
    .screener-results-actions { width: 100%; }
    .screener-pagination { padding: 1rem; gap: 0.6rem; flex-wrap: wrap; }
}


/* ============================================================
   Light mode — round 3: company page (issue #111)
   Hero, Statement-lens controls, Metrics toolbar, Visual lens,
   and Deep Dive were built dark-only before the theme toggle and
   never got a light pass — hardcoded dark glass backgrounds (some
   !important) + near-white text. Appended last so these win over
   the source rules. Dark mode is untouched.
   ============================================================ */

/* ── Hero header ─────────────────────────────────────────────── */
[data-theme="light"] .company-name-large,
[data-theme="light"] .company-price-value { color: var(--color-text-primary); }
[data-theme="light"] .company-meta { color: var(--color-text-secondary); }
[data-theme="light"] .company-price-unavailable { color: var(--color-text-muted); }

[data-theme="light"] .company-price-card,
[data-theme="light"] .company-mini-stats,
[data-theme="light"] .km-card,
[data-theme="light"] .landing-score-card,
[data-theme="light"] .landing-mini-metric,
[data-theme="light"] .preset-card {
    background: var(--gradient-card) !important;
    border-color: rgba(20, 28, 44, 0.10) !important;
}
[data-theme="light"] .company-price-card:hover,
[data-theme="light"] .company-mini-stats:hover,
[data-theme="light"] .km-card:hover,
[data-theme="light"] .preset-card:hover {
    border-color: rgba(47, 111, 237, 0.25) !important;
    box-shadow: 0 12px 32px rgba(20, 28, 44, 0.10);
}

/* Header pill toggles (watchlist / notes) were white-on-dark. */
[data-theme="light"] .company-watchlist-toggle,
[data-theme="light"] .company-notes-toggle {
    background: rgba(20, 28, 44, 0.04);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
[data-theme="light"] .company-watchlist-toggle:hover,
[data-theme="light"] .company-notes-toggle:hover {
    background: rgba(47, 111, 237, 0.08);
    border-color: rgba(47, 111, 237, 0.30);
    color: var(--color-accent-primary);
}

/* ── Statement-lens controls (cadence + range) ───────────────── */
[data-theme="light"] .company-controls-copy h2 { color: var(--color-text-primary); }
[data-theme="light"] .company-controls-copy p { color: var(--color-text-secondary); }
[data-theme="light"] .control-cluster,
[data-theme="light"] .period-toggle {
    background: rgba(20, 28, 44, 0.03);
    border-color: var(--color-border);
}
[data-theme="light"] .premium-segmented,
[data-theme="light"] .premium-range-filter {
    background: #ffffff !important;
    border-color: var(--color-border) !important;
}
[data-theme="light"] .premium-segmented .toggle-btn { color: var(--color-text-muted); }
[data-theme="light"] .premium-segmented .toggle-btn:hover { color: var(--color-text-primary); }
[data-theme="light"] .premium-range-filter .range-separator { color: var(--color-text-muted); }
[data-theme="light"] .year-select,
[data-theme="light"] .category-select { color: var(--color-text-primary); }
[data-theme="light"] .premium-range-filter .year-select {
    background-color: #ffffff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' stroke='%235f6675' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    border-color: var(--color-border) !important;
    color: var(--color-text-primary) !important;
}
[data-theme="light"] .premium-range-filter .year-select:hover {
    background-color: #f5f7fa !important;
    border-color: rgba(47, 111, 237, 0.30) !important;
}

/* ── Metrics tab: container, toolbar, cards ──────────────────── */
[data-theme="light"] .metrics-container,
[data-theme="light"] .insights-panel,
[data-theme="light"] .metric-card-large,
[data-theme="light"] .visual-container {
    background: var(--gradient-card);
    border-color: var(--color-border);
    box-shadow: 0 18px 50px rgba(20, 28, 44, 0.08);
}
/* Category cards are nested inside .metrics-container — border only, no
   second drop shadow. */
[data-theme="light"] .category-section {
    background: var(--gradient-card);
    border-color: var(--color-border);
}
[data-theme="light"] .metric-card-large.primary {
    background: linear-gradient(145deg, rgba(47, 111, 237, 0.10) 0%, #ffffff 70%);
    border-color: rgba(47, 111, 237, 0.20);
}
[data-theme="light"] .metric-search-input {
    background: #ffffff;
    border-color: var(--color-border);
    color: var(--color-text-primary);
}
[data-theme="light"] .category-nav-bar,
[data-theme="light"] .category-nav-bar-slim {
    background: var(--color-bg-card);
    border-color: var(--color-border);
}
[data-theme="light"] .category-nav-copy strong { color: var(--color-text-primary); }
[data-theme="light"] .insights-toggle,
[data-theme="light"] .nav-bar-actions .toolbar-btn,
[data-theme="light"] .chart-period-toggle {
    background: rgba(20, 28, 44, 0.03);
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}
[data-theme="light"] .insights-toggle:hover,
[data-theme="light"] .nav-bar-actions .toolbar-btn:hover {
    border-color: rgba(47, 111, 237, 0.30);
    color: var(--color-accent-primary);
    background: rgba(47, 111, 237, 0.06);
}
[data-theme="light"] .insights-toggle.active {
    background: rgba(47, 111, 237, 0.10);
    border-color: rgba(47, 111, 237, 0.28);
    color: var(--color-accent-primary);
}
[data-theme="light"] .quick-veko-strip {
    background: linear-gradient(135deg, rgba(47, 111, 237, 0.06), rgba(47, 111, 237, 0.02)) !important;
    border-color: rgba(47, 111, 237, 0.18) !important;
}
[data-theme="light"] .quick-veko-mark { color: var(--color-accent-primary); }

/* Upsell cards. */
[data-theme="light"] .premium-upsell {
    background: linear-gradient(180deg, #ffffff 0%, #eef1f6 100%);
    border-color: var(--color-border);
}
[data-theme="light"] .research-upsell-card {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}

/* Collapsible chart / section headers + content. */
[data-theme="light"] .collapsible-header,
[data-theme="light"] .chart-collapsible .collapsible-content {
    background: var(--gradient-card);
    border-color: var(--color-border);
}
[data-theme="light"] .collapsible-header:hover {
    background: var(--color-bg-card-hover);
    border-color: rgba(47, 111, 237, 0.25);
}

/* ── Visual tab (lens cards + bars) ──────────────────────────── */
[data-theme="light"] .vl-card {
    background: #ffffff;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}
[data-theme="light"] .vl-bar-track { background: rgba(20, 28, 44, 0.06); }
[data-theme="light"] .vl-bar-prior { background: rgba(47, 111, 237, 0.20); }
[data-theme="light"] .vl-chip {
    background: rgba(20, 28, 44, 0.03);
    border-color: var(--color-border);
}
[data-theme="light"] .vl-chip:hover { border-color: rgba(47, 111, 237, 0.40); }

/* ── Deep Dive tab ───────────────────────────────────────────── */
[data-theme="light"] .company-deep-dive-section {
    background: var(--gradient-card) !important;
    border-color: rgba(20, 28, 44, 0.10);
    box-shadow: 0 18px 50px rgba(20, 28, 44, 0.10);
}
[data-theme="light"] .company-deep-dive-section .report-header { border-bottom-color: var(--color-border-light); }
[data-theme="light"] .company-deep-dive-section .report-title { color: var(--color-text-primary); }
[data-theme="light"] .company-deep-dive-section .report-subtitle { color: var(--color-text-secondary); }
[data-theme="light"] .report-actions-header a,
[data-theme="light"] .report-actions-header button {
    background: rgba(47, 111, 237, 0.08) !important;
    border-color: rgba(47, 111, 237, 0.20) !important;
    color: var(--color-accent-primary) !important;
}
[data-theme="light"] .deep-dive-signals-section,
[data-theme="light"] .percentile-section,
[data-theme="light"] .peer-comparison-section,
[data-theme="light"] .anomalies-section {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
}
[data-theme="light"] .signals-column {
    background: rgba(20, 28, 44, 0.025);
    border-color: var(--color-border-light);
}
[data-theme="light"] .signal-item,
[data-theme="light"] .percentile-card,
[data-theme="light"] .peer-card,
[data-theme="light"] .anomaly-item {
    background: #ffffff !important;
    border-color: var(--color-border) !important;
    border-left-color: var(--color-border) !important;
}
[data-theme="light"] .signal-item.strong {
    background: rgba(47, 111, 237, 0.06) !important;
    border-color: rgba(47, 111, 237, 0.20) !important;
}
[data-theme="light"] .benchmark-unavailable-panel,
[data-theme="light"] .benchmark-unavailable-deep-dive {
    background: linear-gradient(145deg, rgba(182, 132, 31, 0.10), rgba(182, 132, 31, 0.03)) !important;
    border-color: rgba(182, 132, 31, 0.30) !important;
}

/* ── Research-log drawer ─────────────────────────────────────── */
[data-theme="light"] .notes-drawer {
    background: #ffffff;
    border-left-color: var(--color-border);
}
[data-theme="light"] .notes-drawer-eyebrow { color: var(--color-text-muted); }
[data-theme="light"] .notes-drawer-ticker { color: var(--color-accent-primary); }
[data-theme="light"] .notes-drawer-close {
    background: rgba(20, 28, 44, 0.04);
    color: var(--color-text-secondary);
}
[data-theme="light"] .notes-drawer-close:hover {
    background: rgba(20, 28, 44, 0.08);
    color: var(--color-text-primary);
}

/* ============================================================
   Light-mode overrides — logged-out surfaces
   Auth (login/signup/reset), pricing cards, and the shared
   marketing footer were dark-only. Without these they stay dark
   when a visitor has light mode on and then logs out, leaving
   dark widgets on light pages (/, /about, /terms, /privacy,
   login, upgrade). Text already uses --color-* tokens (which
   flip); these cover the hardcoded dark backgrounds/borders.
   ============================================================ */

/* Auth pages */
[data-theme="light"] .auth-container {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    box-shadow: 0 30px 80px rgba(20, 28, 44, 0.12);
}
[data-theme="light"] .auth-page::before {
    background: rgba(47, 111, 237, 0.10);
}
[data-theme="light"] .auth-form input {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
}

/* Pricing / upgrade cards */
[data-theme="light"] .pricing-card {
    background: var(--color-bg-card);
    border-color: var(--color-border);
    box-shadow: 0 8px 32px rgba(20, 28, 44, 0.08);
}
[data-theme="light"] .pricing-card:hover {
    border-color: var(--color-accent-secondary);
}
[data-theme="light"] .pricing-card--featured,
[data-theme="light"] .pricing-card.pro {
    background: linear-gradient(180deg, rgba(47, 111, 237, 0.06) 0%, var(--color-bg-card) 100%);
    border-color: rgba(47, 111, 237, 0.28);
    box-shadow: 0 8px 32px rgba(47, 111, 237, 0.10), 0 0 0 1px rgba(47, 111, 237, 0.12) inset;
}

/* Marketing footer (shared chrome). The base rule is forced dark with
   !important in two places, so the light override must be !important too. */
[data-theme="light"] .footer-marketing {
    background: var(--color-bg-secondary) !important;
    border-top: 1px solid var(--color-border) !important;
}
[data-theme="light"] .footer-marketing-wordmark,
[data-theme="light"] .footer-marketing-heading {
    color: var(--color-text-primary);
}
[data-theme="light"] .footer-marketing-copy {
    color: var(--color-text-secondary);
}
[data-theme="light"] .footer-marketing-meta,
[data-theme="light"] .footer-marketing-item,
[data-theme="light"] .footer-marketing-grid a {
    color: var(--color-text-muted);
}
[data-theme="light"] .footer-marketing-grid a:hover {
    color: var(--color-accent-primary);
}

/* Marketing top nav (Companies / Screener / Compare / About / Pricing).
   The base bar is dark (rgba(10,14,20,.6)) and its links are light-gray,
   both hardcoded — so they stay dark/low-contrast in light mode. */
[data-theme="light"] .navbar-marketing {
    background: rgba(245, 247, 250, 0.72);
    border-bottom: 1px solid var(--color-border);
}
[data-theme="light"] .navbar-marketing .nav-link {
    color: var(--color-text-secondary);
}
[data-theme="light"] .navbar-marketing .nav-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
}

/* Mobile hamburger drawer — the base panel is dark and its bars/links are
   hardcoded light, so give light mode a matching surface + contrast. */
[data-theme="light"] .nav-mobile-toggle-bar {
    background: var(--color-text-primary);
}
[data-theme="light"] .nav-mobile-panel {
    background: var(--color-bg-card, #ffffff);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.18);
}
[data-theme="light"] .nav-mobile-link {
    color: var(--color-text-secondary);
}
[data-theme="light"] .nav-mobile-link:hover {
    color: var(--color-text-primary);
    background: var(--color-bg-secondary);
}
[data-theme="light"] .nav-mobile-divider {
    background: var(--color-border);
}

/* ============================================================
   Pro member badge (nav)
   A gilded status symbol shown in the sidebar rail and the mobile
   top bar to anyone with an active Pro entitlement. It reuses the
   icon-button footprint (.app-nav-icon / .app-mobile-iconbtn) so it
   slots into the existing 92px rail without layout surgery, then
   overrides the palette to gold and adds a slow shimmer sweep.
   Colours are self-contained (own gold fill + dark glyph) so it reads
   correctly in both dark and light themes with no [data-theme] override.
   Appended at end so its equal-specificity overrides win by source order.
   ============================================================ */
.app-nav-icon.pro-member-badge,
.app-mobile-iconbtn.pro-member-badge {
    position: relative;
    overflow: hidden;
    color: #4a3608;
    background: linear-gradient(135deg, #fbe9b0 0%, #e9bd54 46%, #cf9a2f 100%);
    border: 1px solid rgba(255, 240, 194, 0.55);
    box-shadow: 0 2px 12px rgba(207, 154, 47, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.pro-member-badge .material-symbols-outlined {
    position: relative;
    z-index: 1;
    color: #4a3608;
}

/* Diagonal light sweep that crosses the badge every few seconds. */
.pro-member-badge::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(115deg, transparent 25%, rgba(255, 255, 255, 0.85) 50%, transparent 75%);
    transform: translateX(-130%);
    animation: pro-member-badge-shimmer 5s ease-in-out infinite;
    pointer-events: none;
}

.app-nav-icon.pro-member-badge:hover,
.app-nav-icon.pro-member-badge.active,
.app-mobile-iconbtn.pro-member-badge:hover,
.app-mobile-iconbtn.pro-member-badge:active {
    color: #3a2a05;
    background: linear-gradient(135deg, #ffefb8 0%, #f0c65f 46%, #d9a437 100%);
    border-color: rgba(255, 240, 194, 0.78);
    box-shadow: 0 4px 18px rgba(207, 154, 47, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

@keyframes pro-member-badge-shimmer {
    0%, 55% { transform: translateX(-130%); }
    100% { transform: translateX(130%); }
}

@media (prefers-reduced-motion: reduce) {
    .pro-member-badge::after { animation: none; opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Ad slots — free-tier monetization (hidden for Supporters via `show_ads`).
   Desktop shows a right-hand side-rail; narrow screens show inline slots
   between widgets. CSS guarantees only one variant is visible per width.
   ═══════════════════════════════════════════════════════════════════════════ */

/* App main becomes a 2-column grid (content | rail) only when a rail is present
   (i.e. show_ads added `.has-ad-rail`) and the viewport is wide enough to spare
   the gutter. Supporters keep the normal single-column flow. */
.app-content-col { min-width: 0; }

@media (min-width: 1400px) {
    .app-main-content.has-ad-rail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 1.75rem;
        align-items: start;
    }
    .ad-rail {
        position: sticky;
        top: 1.5rem;
        align-self: start;
    }
    /* The rail covers desktop, so inline slots collapse there. */
    .ad-slot--inline { display: none; }
}

@media (max-width: 1399px) {
    .ad-rail { display: none; }
}

.ad-slot { display: block; }
.ad-slot--inline { margin: 1.5rem 0; }

.ad-slot-tag {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.35rem;
}

/* House ad — the default filler until a real network is wired. Reads as a calm
   Supporter CTA, not a flashy banner. */
.ad-house {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1.15rem 1.25rem;
    border: 1px solid rgba(173, 198, 255, 0.12);
    border-radius: 1rem;
    background: linear-gradient(155deg, rgba(47, 111, 237, 0.10) 0%, rgba(28, 32, 38, 0.35) 100%);
    text-decoration: none;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}
.ad-house:hover {
    border-color: rgba(91, 155, 255, 0.4);
    transform: translateY(-1px);
}
.ad-house-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-accent, #5b9bff);
}
.ad-house-badge .material-symbols-outlined { font-size: 0.95rem; }
.ad-house-title {
    font-family: var(--font-display, inherit);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text-primary);
}
.ad-house-desc {
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--color-text-secondary);
}
.ad-house-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-accent, #5b9bff);
}
.ad-house-cta .material-symbols-outlined { font-size: 1rem; }

/* Light-mode overrides — the base theme is dark-only, so widgets must opt in. */
:root[data-theme="light"] .ad-house {
    border-color: rgba(47, 111, 237, 0.18);
    background: linear-gradient(155deg, rgba(47, 111, 237, 0.08) 0%, rgba(255, 255, 255, 0.6) 100%);
}
:root[data-theme="light"] .ad-slot-tag { color: rgba(15, 23, 42, 0.5); }
