/* ========================================
   SY Holdings Intelligence Repository
   ======================================== */

:root {
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --sidebar-width: 360px;
    --header-height: 56px;
    --radius: 8px;
    --radius-sm: 4px;
    --transition: 0.2s ease;
}

/* Dark Theme (default) */
[data-theme="dark"] {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a26;
    --bg-card: #16161f;
    --bg-hover: #1e1e2a;
    --bg-input: #1a1a26;
    --border: #2a2a3a;
    --border-light: #222233;
    --text-primary: #e8e8f0;
    --text-secondary: #8888a0;
    --text-muted: #555570;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-dim: rgba(99, 102, 241, 0.15);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --tag-regulatory: #8b5cf6;
    --tag-pricing: #06b6d4;
    --tag-competitor: #f59e0b;
    --tag-macro: #10b981;
    --tag-deal: #ec4899;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #f0f1f3;
    --bg-card: #ffffff;
    --bg-hover: #f0f1f5;
    --bg-input: #f0f1f3;
    --border: #e0e0e8;
    --border-light: #eaeaf0;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --accent-dim: rgba(79, 70, 229, 0.1);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --tag-regulatory: #7c3aed;
    --tag-pricing: #0891b2;
    --tag-competitor: #d97706;
    --tag-macro: #059669;
    --tag-deal: #db2777;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

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

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

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========= Auth Gate ========= */
.auth-gate {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 1000;
}

.auth-gate.hidden { display: none; }

.auth-box {
    text-align: center;
    padding: 3rem 2.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 380px;
    max-width: 90vw;
    box-shadow: var(--shadow);
}

.auth-logo .logo-icon {
    font-size: 2.5rem;
    color: var(--accent);
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

#auth-form {
    margin-top: 2rem;
}

#auth-password {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    text-align: center;
    letter-spacing: 0.1em;
    transition: border var(--transition);
}

#auth-password:focus {
    outline: none;
    border-color: var(--accent);
}

#auth-form button {
    width: 100%;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

#auth-form button:hover {
    background: var(--accent-hover);
}

.auth-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.75rem;
    min-height: 1.2em;
}

/* ========= App Layout ========= */
.app {
    display: flex;
    min-height: 100vh;
}

.app.hidden { display: none; }

/* ========= Sidebar ========= */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header .logo-icon {
    font-size: 1.5rem;
    color: var(--accent);
}

.sidebar-header h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-search {
    padding: 0.75rem 1.25rem;
}

.sidebar-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: border var(--transition);
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--accent);
}

.sidebar-filters {
    padding: 0 1.25rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-filters h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    margin-top: 0.75rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chip {
    padding: 0.25rem 0.6rem;
    font-size: 0.72rem;
    font-family: var(--font-sans);
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.chip.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.chip.small {
    padding: 0.15rem 0.45rem;
    font-size: 0.62rem;
    border-radius: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-item {
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.04));
    transition: background 0.12s;
}

.sidebar-item:hover {
    background: var(--bg-hover, rgba(255,255,255,0.04));
}

.sidebar-item.active {
    background: var(--accent-dim);
    border-left: 3px solid var(--accent);
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.nav-date-group {
    padding: 0.15rem 0;
}

.nav-date-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--transition);
    -webkit-tap-highlight-color: rgba(99,102,241,0.1);
    touch-action: manipulation;
}

.nav-date-header:hover {
    background: var(--bg-hover);
}

.nav-date-header.has-active {
    color: var(--accent);
}

.nav-date-arrow {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.nav-date-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    text-align: left;
}

.nav-date-header:hover .nav-date-label {
    color: var(--accent);
}

.nav-date-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    flex-shrink: 0;
}

.nav-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.6rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    touch-action: pan-y;
    border-left: 3px solid transparent;
}

.nav-cat-label {
    padding: 0.5rem 1.25rem 0.2rem 2rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    opacity: 0.7;
}

.nav-date-group + .nav-cat-label,
.nav-cat-label ~ .nav-item {
    padding-left: 2.5rem;
}

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

.nav-item.active {
    background: var(--bg-hover);
    color: var(--accent);
    border-left-color: var(--accent);
}

.nav-item .nav-item-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.82rem;
}

.nav-tag {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-tag.regulatory { background: rgba(139,92,246,0.15); color: var(--tag-regulatory); }
.nav-tag.pricing { background: rgba(6,182,212,0.15); color: var(--tag-pricing); }
.nav-tag.competitor { background: rgba(245,158,11,0.15); color: var(--tag-competitor); }
.nav-tag.macro { background: rgba(16,185,129,0.15); color: var(--tag-macro); }
.nav-tag.deal-flow { background: rgba(236,72,153,0.15); color: var(--tag-deal); }

.footer-powered {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-left: auto;
    margin-right: auto;
}

.footer-powered strong {
    color: var(--accent);
}

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
}

.theme-toggle, .logout-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition);
}

.theme-toggle:hover, .logout-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========= Mobile Header ========= */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    z-index: 90;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
}

.mobile-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
}

.mobile-title .logo-icon {
    color: var(--accent);
}

/* ========= Content ========= */
.content {
    flex: 1;
    min-width: 0;
    padding: 2rem 3rem;
}

/* Landing */
.landing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.landing.hidden { display: none; }

.landing-inner {
    text-align: center;
    max-width: 500px;
}

.landing-icon {
    font-size: 3rem;
    color: var(--accent);
    display: block;
    margin-bottom: 1rem;
}

.landing h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.landing p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ========= Report View ========= */
.report-view { }
.report-view.hidden { display: none; }

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 1rem;
}

#report-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.report-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.report-tag {
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-tag.regulatory { background: rgba(139,92,246,0.15); color: var(--tag-regulatory); }
.report-tag.pricing { background: rgba(6,182,212,0.15); color: var(--tag-pricing); }
.report-tag.competitor { background: rgba(245,158,11,0.15); color: var(--tag-competitor); }
.report-tag.macro { background: rgba(16,185,129,0.15); color: var(--tag-macro); }
.report-tag.deal-flow { background: rgba(236,72,153,0.15); color: var(--tag-deal); }

.report-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.report-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

/* Report Body */
.report-body {
    max-width: 800px;
    line-height: 1.75;
}

.report-body h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.report-body h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--accent);
}

.report-body h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.25rem 0 0.5rem;
}

.report-body p {
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.report-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.report-body th {
    background: var(--bg-tertiary);
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.report-body td {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.report-body tr:hover td {
    background: var(--bg-hover);
}

.report-body ul, .report-body ol {
    margin: 0.5rem 0 1rem 1.5rem;
}

.report-body li {
    margin-bottom: 0.3rem;
}

.report-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.report-body code {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}

.report-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    background: var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

/* Impact badges */
.impact-high { 
    display: inline-block;
    background: rgba(239,68,68,0.15); 
    color: var(--danger); 
    padding: 0.15rem 0.5rem; 
    border-radius: 3px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

.impact-medium { 
    display: inline-block;
    background: rgba(245,158,11,0.15); 
    color: var(--warning); 
    padding: 0.15rem 0.5rem; 
    border-radius: 3px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

.impact-low { 
    display: inline-block;
    background: rgba(16,185,129,0.15); 
    color: var(--success); 
    padding: 0.15rem 0.5rem; 
    border-radius: 3px; 
    font-size: 0.75rem; 
    font-weight: 600; 
}

/* ========= Search Results ========= */
.search-results.hidden { display: none; }
.data-view.hidden { display: none; }
.news-view.hidden { display: none; }
.news-feed.hidden { display: none !important; }
.news-article.hidden { display: none; }
.file-preview.hidden { display: none; }
[class].hidden { display: none !important; }

.search-results h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

#search-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.search-result-item {
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
}

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

.search-result-item h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.search-result-item .result-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.search-result-item .result-snippet {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
    line-height: 1.5;
}

.search-result-item .result-snippet mark {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.05rem 0.2rem;
    border-radius: 2px;
}

/* ========= Mobile Responsive ========= */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 95;
}

.sidebar-overlay.active {
    display: block;
}

/* Mobile-friendly tables in reports */
.report-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.report-body table th,
.report-body table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
}

.report-body table th {
    background: var(--bg-hover);
    font-weight: 600;
    white-space: nowrap;
}

.report-body table tr:nth-child(even) {
    background: var(--bg-hover);
}

@media (max-width: 768px) {
    .report-body table {
        font-size: 0.72rem;
    }

    .report-body table th,
    .report-body table td {
        padding: 6px 8px;
    }

    .report-body table td {
        white-space: normal;
        word-break: break-word;
    }

    /* Sticky first column on mobile */
    .report-body table th:first-child,
    .report-body table td:first-child {
        position: sticky;
        left: 0;
        background: var(--bg-primary);
        z-index: 1;
        border-right: 2px solid var(--accent);
    }

    .report-body table tr:nth-child(even) td:first-child {
        background: var(--bg-hover);
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
        z-index: 100;
        width: 100vw;
        min-width: 100vw;
    }

    .sidebar.open {
        left: 0;
    }

    /* Better spacing for sidebar panels on mobile full-width */
    .sidebar-panel {
        padding-bottom: 2rem;
    }

    .sidebar-search {
        padding: 0.75rem 1rem;
    }

    .sidebar-search input {
        font-size: 0.85rem;
        padding: 0.6rem 0.75rem;
    }

    .sidebar-filters {
        padding: 0.5rem 1rem 0.75rem;
    }

    .chip.small {
        padding: 0.25rem 0.6rem;
        font-size: 0.68rem;
    }

    .sidebar-nav .sidebar-item {
        padding: 0.75rem 1rem;
    }

    .mobile-header {
        display: flex;
    }

    .content {
        padding: 1.25rem;
        padding-top: calc(var(--header-height) + 1.25rem);
    }

    .report-header {
        flex-direction: column;
    }

    .report-actions {
        width: 100%;
    }

    .report-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .stats {
        flex-direction: column;
        gap: 1rem;
    }

    #report-title {
        font-size: 1.3rem;
    }

    .report-body {
        font-size: 0.92rem;
    }

    .report-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* ========= Sidebar Tabs ========= */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

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

.sidebar-tab {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 0.25rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    white-space: nowrap;
}

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

.tab-label {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sidebar-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-hover);
}

.sidebar-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.sidebar-panel {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

.sidebar-panel::-webkit-scrollbar {
    width: 4px;
}

.sidebar-panel::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.sidebar-panel::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.sidebar-panel.hidden {
    display: none;
}

.project-actions-bar {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
    align-items: center;
}

.view-toggle {
    display: flex;
    gap: 2px;
    margin-left: auto;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.view-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 0.25rem 0.45rem;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 3px;
    transition: all var(--transition);
    line-height: 1;
}

.view-btn:hover {
    color: var(--text-secondary);
}

.view-btn.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.btn-small {
    padding: 0.35rem 0.65rem;
    font-size: 0.72rem;
}

.btn-accent {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}

/* ========= Projects View ========= */
.projects-view.hidden { display: none; }

.project-landing-header {
    margin-bottom: 1.5rem;
}

.project-landing-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.15rem;
}

.bc-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    font-family: var(--font-sans);
    touch-action: manipulation;
}
.bc-btn:hover { text-decoration: underline; }

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

.bc-back-btn {
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    font-family: var(--font-sans);
    touch-action: manipulation;
    white-space: nowrap;
}
.bc-back-btn:hover { border-color: var(--accent); color: var(--accent); }

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    -webkit-tap-highlight-color: rgba(99,102,241,0.15);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    /* button reset */
    font-family: var(--font-sans);
    font-size: inherit;
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}

.project-card:hover {
    border-color: var(--accent);
    background: var(--bg-hover);
}

.project-card-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

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

.project-card-info h4 {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-card .file-download-link {
    font-size: 1rem;
    text-decoration: none;
    color: var(--text-muted);
    padding: 0.3rem;
    border-radius: 4px;
    transition: all var(--transition);
}

.file-card .file-download-link:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

.file-status {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.file-status-new { background: rgba(99,102,241,0.15); color: var(--accent); }
.file-status-draft { background: rgba(245,158,11,0.15); color: var(--warning); }
.file-status-final { background: rgba(16,185,129,0.15); color: var(--success); }

.project-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.project-empty h3 {
    margin: 0.75rem 0 0.5rem;
    color: var(--text-secondary);
}

/* ========= List View ========= */
.project-list-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.list-header {
    display: grid;
    grid-template-columns: 1fr 80px 120px 80px 40px;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-tertiary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.list-row {
    display: grid;
    grid-template-columns: 1fr 80px 120px 40px;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background var(--transition);
    border-bottom: 1px solid var(--border-light);
    align-items: center;
    -webkit-tap-highlight-color: rgba(99,102,241,0.15);
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    /* button reset */
    background: none;
    font-family: var(--font-sans);
    color: var(--text-primary);
    text-align: left;
    width: 100%;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row:hover {
    background: var(--bg-hover);
}

.list-col-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.list-col-size, .list-col-count, .list-col-date, .list-col-status {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.list-col-action a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.2rem;
    border-radius: 3px;
    transition: all var(--transition);
}

.list-col-action a:hover {
    color: var(--accent);
    background: var(--accent-dim);
}

@media (max-width: 768px) {
    .list-header, .list-row {
        grid-template-columns: 1fr 60px 40px;
    }
    .list-col-date, .list-col-status {
        display: none;
    }
}

.file-text-preview {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.file-text-preview pre {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* ========= Modal ========= */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.modal-box {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 520px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: fadeIn 0.2s ease;
}

.modal-small {
    width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color var(--transition);
}

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

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

.modal-input {
    width: 100%;
    padding: 0.6rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
}

.modal-input:focus {
    outline: none;
    border-color: var(--accent);
}

.upload-target-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.upload-target-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.upload-target-row select {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

.upload-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-dropzone:hover, .upload-dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.dropzone-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.dropzone-text a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.dropzone-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.upload-queue {
    margin-top: 0.75rem;
}

.upload-queue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
}

.upload-queue-item span:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-queue-size {
    color: var(--text-muted);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.upload-queue-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}

.upload-queue-remove:hover {
    color: var(--danger);
    background: rgba(239,68,68,0.1);
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-box {
        margin: 1rem;
    }
}

/* ========= Animations ========= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== Markdown Rendered in Projects ===== */
.md-rendered h1 { font-size: 1.5rem; font-weight: 700; margin: 1.5rem 0 0.75rem; border-bottom: 2px solid var(--accent); padding-bottom: 0.5rem; }
.md-rendered h2 { font-size: 1.25rem; font-weight: 600; margin: 1.25rem 0 0.5rem; color: var(--accent); }
.md-rendered h3 { font-size: 1.1rem; font-weight: 600; margin: 1rem 0 0.4rem; }
.md-rendered h4, .md-rendered h5, .md-rendered h6 { font-size: 0.95rem; font-weight: 600; margin: 0.75rem 0 0.3rem; }
.md-rendered p { margin-bottom: 0.75rem; line-height: 1.7; }
.md-rendered ul, .md-rendered ol { margin: 0.5rem 0 0.75rem; padding-left: 1.75rem; }
.md-rendered li { margin-bottom: 0.3rem; line-height: 1.6; }
.md-rendered li > ul, .md-rendered li > ol { margin: 0.25rem 0; }
.md-rendered blockquote { border-left: 3px solid var(--accent); padding: 0.5rem 1rem; margin: 0.75rem 0; background: var(--bg-hover); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-secondary); }
.md-rendered code { background: var(--bg-tertiary); padding: 0.15rem 0.4rem; border-radius: 3px; font-family: var(--font-mono); font-size: 0.85em; }
.md-rendered pre { background: var(--bg-tertiary); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 0.75rem; }
.md-rendered pre code { background: none; padding: 0; font-size: 0.82rem; }
.md-rendered hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
.md-rendered a { color: var(--accent); text-decoration: underline; }
.md-rendered img { max-width: 100%; border-radius: var(--radius-sm); }
/* Tables in rendered markdown */
.md-rendered table, .md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    display: block;
}
.md-rendered table th, .md-table th {
    background: var(--bg-hover);
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.md-rendered table td, .md-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}
.md-rendered table tr:hover, .md-table tr:hover { background: var(--bg-hover); }

.file-text-preview {
    padding: 1.5rem;
    overflow-x: auto;
}

.file-text-preview pre {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Analyst consensus card */
.analyst-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.analyst-card-left { text-align: center; min-width: 80px; }
.analyst-rating { font-size: 1rem; font-weight: 800; }
.analyst-meta { font-size: 0.65rem; color: var(--text-muted); margin-top: 0.2rem; }
.analyst-card-center { flex: 1; text-align: center; }
.analyst-target-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.2rem; }
.analyst-target-mean { font-size: 1.4rem; font-weight: 800; font-family: var(--font-mono); }
.analyst-target-range { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }
.analyst-card-right { text-align: center; min-width: 70px; }
.analyst-upside { font-size: 1rem; font-weight: 700; font-family: var(--font-mono); }
.analyst-upside.up { color: #22c55e; }
.analyst-upside.dn { color: #ef4444; }
.fin-rows-cat-label { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); padding: 0.4rem 0.75rem 0.2rem; background: var(--bg-secondary); border-top: 1px solid var(--border-light); border-left: 3px solid var(--accent); }
.news-card-relevance { font-size: 0.65rem; letter-spacing: -0.05em; }

.news-card-stars {
    display: inline-flex;
    gap: 1px;
    align-items: center;
    user-select: none;
}
.news-card-stars.user-rated .rel-star.filled { color: #a78bfa; }
.rel-star {
    font-size: 0.75rem;
    color: var(--border);
    transition: color 0.12s;
    touch-action: manipulation;
    line-height: 1;
    cursor: pointer;
}
.rel-star.filled { color: #facc15; }
.rel-star.hover-fill { color: #facc15 !important; opacity: 0.75; }
.news-region-label { font-size: 0.6rem; font-weight: 600; color: var(--text-muted); padding: 0.25rem 1.25rem 0.1rem; text-transform: uppercase; letter-spacing: 0.04em; border-top: 1px solid var(--border-light); margin-top: 0.25rem; }

/* SCF / Credit Analysis Grid */
.scf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
}
.scf-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.scf-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    padding: 0.5rem 0.75rem 0.4rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}
.scf-hint {
    display: block;
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}
.scf-val-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
    min-width: 72px;
}
.scf-val-main {
    font-size: 0.9rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
    white-space: nowrap;
}
.scf-val-wrap .deltaBadge, .scf-val-wrap span[style*="font-size:0.65rem"] {
    margin-top: 1px;
    white-space: nowrap;
}
@media (max-width: 768px) {
    .scf-grid { grid-template-columns: 1fr; }
}

/* Statement period toggle */
.stmt-period-toggle {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: var(--radius);
    width: fit-content;
}
.stmt-period-btn {
    background: none;
    border: none;
    padding: 0.3rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: calc(var(--radius) - 2px);
    transition: all var(--transition);
    white-space: nowrap;
}
.stmt-period-btn.active {
    background: var(--accent);
    color: #fff;
}
.stmt-period-btn:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* ===== Financial Statement Cards ===== */
.fin-stmt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0 0.5rem;
    border-bottom: 2px solid var(--accent);
    margin-bottom: 0.25rem;
    min-width: max-content;
}
.fin-stmt-header h3 { font-size: 0.9rem; font-weight: 700; margin: 0; }
.fin-period-labels { display: flex; }
.fin-period-labels span { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); width: 72px; text-align: right; padding-right: 0.5rem; }
.fin-stmt-body { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 0.5rem; }
.fin-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border-light); transition: background var(--transition); flex-wrap: nowrap; min-width: max-content; }
.fin-row:last-child { border-bottom: none; }
.fin-row:hover { background: var(--bg-hover); }
.fin-row-key { background: rgba(99, 102, 241, 0.1); border-left: 3px solid var(--accent); }
.fin-row-key .fin-row-label { font-weight: 800; color: var(--text-primary); font-size: 0.84rem; }
.fin-row-key .fin-row-vals span { font-weight: 800; color: var(--text-primary); }
.fin-row-subtotal { background: rgba(99, 102, 241, 0.04); border-left: 2px solid rgba(99,102,241,0.35); }
.fin-row-subtotal .fin-row-label { font-weight: 600; color: var(--text-primary); font-size: 0.8rem; }
.fin-row-subtotal .fin-row-vals span { font-weight: 600; color: var(--text-secondary); }
.fin-row-minor .fin-row-label { color: var(--text-muted); }
.fin-row-minor .fin-row-vals span { color: var(--text-muted); }
.fin-row-label { font-size: 0.72rem; color: var(--text-secondary); flex-shrink: 0; min-width: 130px; max-width: 140px; white-space: normal; word-wrap: break-word; padding-right: 0.5rem; }
.fin-row-vals { display: flex; flex-shrink: 0; }
.fin-row-vals span { font-size: 0.78rem; font-family: var(--font-mono); width: 72px; text-align: right; padding-right: 0.5rem; color: var(--text-primary); white-space: nowrap; flex-shrink: 0; }
.fin-cagr-col { border-left: 1px solid var(--border-light); margin-left: 2px; padding-left: 4px !important; }
.fin-positive { color: #22c55e; }
.fin-negative { color: #ef4444; }
.fin-show-more { width: 100%; background: none; border: none; border-top: 1px solid var(--border-light); padding: 0.5rem; font-size: 0.72rem; color: var(--accent); cursor: pointer; text-align: center; transition: background var(--transition); }
.fin-show-more:hover { background: var(--bg-hover); }
@media (max-width: 768px) {
    .fin-period-labels span { width: 58px; font-size: 0.6rem; }
    .fin-row-vals span { width: 58px; font-size: 0.7rem; }
    .fin-row-label { font-size: 0.7rem; }
}
@media (max-width: 600px) {
    .fin-row-label { min-width: 100px; font-size: 0.67rem; }
    .fin-row-vals span { width: 60px; font-size: 0.67rem; }
}

/* ===== Screener Tab ===== */
.screener-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.screener-price-box {
    text-align: right;
}

.screener-price {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.screener-currency {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.screener-summary {
    padding: 0 1.5rem;
    margin-top: 1rem;
}

.screener-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem;
}

.metric-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    text-align: center;
}

.metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

.metric-sub {
    font-size: 0.6rem;
    color: var(--accent);
    margin-top: 0.15rem;
}

.screener-ratios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.ratio-group {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.ratio-group h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-light);
}

.ratio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.2rem 0;
    font-size: 0.78rem;
}

.ratio-label {
    color: var(--text-secondary);
}

.ratio-value {
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

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

@media (max-width: 768px) {
    .screener-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
    }

    .screener-price-box {
        text-align: left;
    }

    .screener-metrics {
        grid-template-columns: repeat(3, 1fr);
        padding: 1rem;
        gap: 0.5rem;
    }

    .metric-card { padding: 0.5rem; }
    .metric-value { font-size: 0.9rem; }
}

.sidebar-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.data-date-range {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.25rem;
}

.data-date-input {
    flex: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-primary);
    width: 100%;
    min-width: 0;
}

.data-date-input:focus {
    border-color: var(--accent);
    outline: none;
}

.data-date-reset {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all var(--transition);
}

.data-date-reset:hover {
    color: var(--danger);
    background: var(--bg-hover);
}

/* Nav item with remove button */
.nav-item-wrap {
    display: flex;
    align-items: stretch;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
    touch-action: pan-y;
}

.nav-item-wrap:hover {
    background: var(--bg-hover);
}

.nav-item-wrap.active {
    background: rgba(99, 102, 241, 0.12);
}

.nav-item-wrap.drag-over {
    border-top: 2px solid var(--accent);
    background: rgba(99, 102, 241, 0.08);
}

.nav-item-wrap[draggable="true"] {
    cursor: grab;
}

.nav-item-wrap[draggable="true"]:active {
    cursor: grabbing;
}

.nav-item-body {
    flex: 1;
    background: none;
    border: none;
    padding: 0.5rem 0.75rem;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    min-width: 0;
}

.nav-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity var(--transition), color var(--transition);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    flex-shrink: 0;
}

.nav-item-wrap:hover .nav-item-remove {
    opacity: 1;
}

.nav-item-remove:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ===== Data Tab ===== */
.data-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.data-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
}

.data-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.data-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.data-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    position: relative;
}

.data-chart-card h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.data-chart-card canvas {
    max-height: 250px;
}

/* Fullscreen chart */
.data-chart-card:fullscreen,
.data-chart-card:-webkit-full-screen {
    background: var(--bg-card) !important;
    padding: 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    box-sizing: border-box;
}
.data-chart-card:fullscreen canvas,
.data-chart-card:-webkit-full-screen canvas {
    max-height: none !important;
    height: auto !important;
    flex: 1 1 0 !important;
    min-height: 0 !important;
    width: 100% !important;
}

.data-chart-source {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: right;
    margin-top: 0.5rem;
    font-style: italic;
}

.data-sources-footer {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 1rem 0;
    border-top: 1px solid var(--border-light);
    margin-top: 0.5rem;
}

.data-table-wrap {
    padding: 0 1.5rem 2rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.data-table th {
    background: var(--bg-hover);
    padding: 8px 12px;
    text-align: right;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.data-table th:first-child {
    text-align: left;
}

.data-table td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border-light);
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.data-table td:first-child {
    text-align: left;
    font-family: var(--font-sans);
    font-weight: 500;
}

.data-table tr:hover {
    background: var(--bg-hover);
}

@media (max-width: 768px) {
    .data-charts {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .data-table-wrap {
        padding: 0 1rem 1rem;
    }
}

/* ===== News Tab ===== */
.news-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
    touch-action: pan-y;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(99,102,241,0.2);
}

.news-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.news-card-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
}

.news-card-content {
    padding: 1rem;
}

.news-card-region {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.news-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.news-tag.fintech {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.news-share-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 50%;
    transition: background var(--transition);
}

.news-share-btn:hover {
    background: var(--bg-hover);
}

/* News Article View */
.news-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem;
}

.news-back-btn {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.news-article-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.news-article-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.news-article-body {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.news-article-body p {
    margin-bottom: 1rem;
}

.news-article-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.news-feed-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 0.3rem;
}

.fintech-badge {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.global-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
}

.live-badge-news {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red { 0%,100%{opacity:1} 50%{opacity:0.55} }

.news-read-more {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    margin-left: auto;
}

.news-summary-box {
    background: var(--bg-hover);
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.9rem;
    line-height: 1.6;
}

.news-no-full-text {
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.news-no-full-text p {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .news-feed {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 0.75rem;
    }

    .news-card {
        -webkit-tap-highlight-color: transparent;
    }

    .news-article {
        padding: 1rem;
    }

    .news-article-header h2 {
        font-size: 1.2rem;
    }
}

.report-view, .search-results {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse-green { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ========= Print ========= */
@media print {
    .sidebar, .mobile-header, .auth-gate, .report-actions, .sidebar-overlay {
        display: none !important;
    }

    .content {
        padding: 0;
    }

    .report-body {
        max-width: 100%;
    }
}

/* ========= Research Tab ========= */

/* Header */
.research-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 2rem;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.research-header-left {
    flex: 1;
    min-width: 0;
}

.research-company-name {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.4rem 0;
    line-height: 1.2;
}

.research-header-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.research-ticker-badge {
    background: var(--accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    letter-spacing: 0.04em;
}

.research-meta-pill {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.research-header-right {
    text-align: right;
    flex-shrink: 0;
}

.research-price {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
    line-height: 1;
}

.research-currency {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-family: var(--font-mono);
}

/* Body wrapper */
.research-body {
    padding: 0 0 3rem 0;
}

/* Section */
.research-section {
    padding: 1.5rem 2rem;
    border-top: 3px solid var(--section-color, var(--accent));
    margin-top: 0;
}

.research-section + .research-section {
    border-top: 3px solid var(--section-color, var(--accent));
}

.research-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Card */
.research-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
    break-inside: avoid;
}

.research-card-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    line-height: 1.3;
}

.research-card-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Grid */
.research-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.research-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

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

/* Snapshot */
.research-snapshot-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.research-snapshot-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.research-snapshot-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6366f1;
    margin-bottom: 0.2rem;
}

.research-snapshot-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.research-snapshot-para {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0 0 0.5rem 0;
}

/* Score / numbered insight cards */
.research-score-card {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--section-color, #10b981);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.research-score-card:last-child {
    margin-bottom: 0;
}

.research-score-num {
    flex-shrink: 0;
    width: 1.6rem;
    height: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-size: 0.7rem;
    font-weight: 800;
    border-radius: 50%;
    font-family: var(--font-mono);
}

.research-score-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 0.25rem;
}

.research-score-body {
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Segment pills */
.research-segment-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.research-segment-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    font-size: 0.72rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-weight: 500;
}
.seg-pct {
    font-size: 0.85rem;
    font-weight: 800;
    color: #c4b5fd;
    letter-spacing: -0.01em;
}
.seg-name {
    color: #a78bfa;
}
.seg-rev {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
}
.seg-card-pct {
    display: inline-block;
    font-size: 1rem;
    font-weight: 800;
    color: #c4b5fd;
    margin-right: 0.35rem;
    vertical-align: middle;
}

/* Supply chain list */
.research-chain-list {
    margin: 0;
    padding: 0 0 0 1.2rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.research-chain-list li {
    margin-bottom: 0.3rem;
}

/* Table */
.research-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.research-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--border);
}

.research-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.5;
}

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

.research-table-name {
    font-weight: 600;
    color: var(--text-primary) !important;
    white-space: nowrap;
    min-width: 140px;
}

.research-table tr:hover td {
    background: var(--bg-hover);
}

/* Customer geography coverage badges */
.cov-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 0.72rem;
}
.cov-summary-label {
    color: var(--text-muted);
    font-weight: 600;
}
.cov-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.18rem 0.55rem;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}
.cov-green  { background: rgba(34,197,94,0.15);  color: #16a34a; border: 1px solid rgba(34,197,94,0.3); }
.cov-amber  { background: rgba(245,158,11,0.15); color: #b45309; border: 1px solid rgba(245,158,11,0.3); }
.cov-red    { background: rgba(239,68,68,0.15);  color: #dc2626; border: 1px solid rgba(239,68,68,0.3); }
.cov-unknown{ background: var(--bg-hover);       color: var(--text-muted); border: 1px solid var(--border); }
[data-theme="dark"] .cov-green  { background: rgba(34,197,94,0.12);  color: #4ade80; }
[data-theme="dark"] .cov-amber  { background: rgba(245,158,11,0.12); color: #fbbf24; }
[data-theme="dark"] .cov-red    { background: rgba(239,68,68,0.12);  color: #f87171; }

/* Badges */
.research-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
}

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

.research-badge-medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

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

/* Touchpoint cards */
.research-touchpoint-card {
    display: flex;
    flex-direction: column;
}

/* Footer */
.research-footer {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid var(--border-light);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Mobile: tighten research header */
@media (max-width: 600px) {
    .research-header {
        padding: 1rem 1rem;
    }
    .research-section {
        padding: 1.25rem 1rem;
    }
    .research-company-name {
        font-size: 1.25rem;
    }
    .research-price {
        font-size: 1.3rem;
    }
}

/* ===== Screener Inner Tabs ===== */
.screener-inner-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    margin-bottom: 0;
    background: var(--bg-card);
    position: sticky;
    top: 0;
    z-index: 10;
}
.screener-inner-tab {
    padding: 0.65rem 1.1rem;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    letter-spacing: 0.01em;
}
.screener-inner-tab:hover { color: var(--text); }
.screener-inner-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ===== Notes Tab ===== */
/* ===== Notes Tab ===== */
.notes-panel { padding: 1.5rem; }
.notes-list { margin-bottom: 1.5rem; }
.notes-empty { color: var(--text-muted); font-size: 0.82rem; padding: 1.5rem 0; text-align: center; }

/* Topic filter pills */
.note-topic-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.note-topic-chip {
    font-size: 0.7rem !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 12px !important;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.note-topic-chip.active {
    background: var(--chip-color, var(--accent)) !important;
    color: #fff !important;
    border-color: var(--chip-color, var(--accent)) !important;
}
.chip-count {
    font-size: 0.6rem;
    opacity: 0.7;
    font-weight: 400;
}

/* Note cards */
.note-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.15s;
}
.note-card:hover { border-color: var(--accent); }
.note-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    user-select: none;
    flex-wrap: wrap;
}
.note-topic-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.note-date {
    font-size: 0.72rem;
    color: var(--accent);
    font-weight: 600;
    white-space: nowrap;
}
.note-title-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.note-expand-icon {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}
.note-card-body {
    padding: 0.75rem 1rem 0.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
}
.note-body-meta {
    margin-bottom: 0.6rem;
}
.note-body-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}
.note-body-info {
    font-size: 0.65rem;
    color: var(--text-muted);
}
.note-full-text {
    font-size: 0.82rem;
    color: var(--text);
    word-break: break-word;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.note-full-text ul, .note-full-text ol {
    margin: 0.3rem 0;
    padding-left: 1.5rem;
}
.note-full-text blockquote {
    border-left: 3px solid var(--accent);
    margin: 0.4rem 0;
    padding: 0.2rem 0.75rem;
    color: var(--text-muted);
}
.note-actions { display: flex; gap: 0.5rem; }

/* Notes editor */
.notes-editor {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    margin-top: 0.5rem;
}
.note-editor-fields {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}
.note-field-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.note-field-row-half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.note-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.note-input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.45rem 0.7rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.note-input:focus { outline: none; border-color: var(--accent); }

/* Custom styled select (dark-mode friendly) */
.note-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 2rem;
}
.note-select option {
    background: var(--bg-card);
    color: var(--text);
    padding: 0.4rem 0.6rem;
}
/* Force dark background on select dropdown in dark mode */
[data-theme="dark"] .note-select {
    background-color: var(--bg);
    color: var(--text);
}
[data-theme="dark"] .note-select option {
    background-color: #1e1e2e;
    color: #e0e0e0;
    padding: 6px 10px;
}
[data-theme="dark"] .note-input[type="date"] {
    color-scheme: dark;
}

/* Rich text toolbar */
.note-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0.35rem 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    align-items: center;
}
.note-toolbar-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 0.3rem;
    flex-shrink: 0;
}
.note-tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.12s;
    padding: 0;
    font-family: inherit;
    line-height: 1;
}
.note-tb-btn:hover {
    background: var(--bg-hover, rgba(128,128,128,0.15));
    color: var(--text);
}
.note-tb-btn.active {
    background: var(--accent);
    color: #fff;
}
.note-tb-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 0.2rem 1.4rem 0.2rem 0.4rem;
    cursor: pointer;
    height: 28px;
    font-family: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
}
.note-tb-select:hover { border-color: var(--accent); color: var(--text); }
[data-theme="dark"] .note-tb-select option {
    background-color: #1e1e2e;
    color: #e0e0e0;
}

/* Rich text editable area */
.note-richtext {
    width: 100%;
    min-height: 300px;
    max-height: 600px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0 0 6px 6px;
    color: var(--text);
    font-size: 0.82rem;
    padding: 0.6rem 0.8rem;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.6;
    outline: none;
    word-break: break-word;
}
.note-richtext:focus { border-color: var(--accent); }
.note-richtext:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.6;
}
.note-richtext ul, .note-richtext ol {
    margin: 0.3rem 0;
    padding-left: 1.5rem;
}
.note-richtext blockquote {
    border-left: 3px solid var(--accent);
    margin: 0.3rem 0;
    padding: 0.15rem 0.6rem;
    color: var(--text-muted);
}
.note-richtext h3 {
    font-size: 1rem;
    margin: 0.5rem 0 0.25rem;
}

/* Hide old textarea when richtext is active */
.note-textarea-hidden { display: none; }

@media (max-width: 600px) {
    .note-field-row-half {
        grid-template-columns: 1fr;
    }
    .note-card-header {
        gap: 0.4rem;
    }
    .note-date { min-width: auto; }
    .note-toolbar { gap: 1px; padding: 0.25rem 0.35rem; }
    .note-tb-btn { width: 26px; height: 26px; font-size: 0.72rem; }
}
.btn-danger {
    color: #ef4444;
    border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* ===== Files Tab ===== */
.files-panel { padding: 1.5rem; }
.files-empty { color: var(--text-muted); font-size: 0.82rem; padding: 1rem 0; text-align: center; }
.files-list { margin-bottom: 1.5rem; }
.files-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
.files-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.files-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.files-table tr:hover td { background: var(--bg-card); }
.files-name { color: var(--text); font-weight: 500; }
.files-size { color: var(--text-muted); white-space: nowrap; }
.files-date { color: var(--text-muted); white-space: nowrap; }
.files-actions { display: flex; gap: 0.4rem; }
.files-upload-area { margin-top: 1rem; }
.files-drop-inner {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.82rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.15s, background 0.15s;
}
.files-drop-inner:hover, .files-drop-inner.drag-over {
    border-color: var(--accent);
    background: rgba(99,102,241,0.06);
}
.files-loading { color: var(--text-muted); }

/* ===== iOS / Mobile Responsiveness ===== */
@media (max-width: 768px) {
    /* Screener inner tabs — horizontal scroll */
    .screener-inner-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.75rem;
        gap: 0;
    }
    .screener-inner-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.72rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Financial statement tables — horizontal scroll with sticky first col */
    .stmt-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Charts — reduce height on mobile */
    .data-chart-card {
        margin: 0.75rem !important;
        padding: 1rem;
    }
    .data-chart-card h3 {
        font-size: 0.9rem;
    }
    .data-chart-card canvas {
        max-height: 200px;
    }

    /* Chip buttons — tighter on mobile */
    .chip {
        font-size: 0.68rem;
        padding: 0.25rem 0.55rem;
    }
    .chart-range-btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }

    /* Valuation multiples — stack range + metric buttons */
    .data-chart-card > div[style*="justify-content:space-between"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    /* Summary cards — stack on mobile */
    .screener-summary {
        padding: 1rem 0.75rem;
    }

    /* Notes panel */
    .notes-panel {
        padding: 0.75rem;
    }
    .notes-editor {
        padding-top: 0.75rem;
    }
    .note-richtext {
        min-height: 200px;
        max-height: 400px;
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
    .note-input, .note-select {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }

    /* Files panel */
    .files-panel {
        padding: 0.75rem;
    }
    .files-table {
        font-size: 0.72rem;
    }
    .files-table th,
    .files-table td {
        padding: 0.4rem 0.5rem;
    }
    /* Hide modified date column on mobile — too cramped */
    .files-table th:nth-child(3),
    .files-table td.files-date {
        display: none;
    }

    /* Whale Tracker — Board cards single column */
    div[style*="grid-template-columns:repeat(auto-fill, minmax(220px"] {
        grid-template-columns: 1fr 1fr;
    }

    /* News cards */
    .news-feed {
        padding: 0.75rem;
        gap: 0.75rem;
        grid-template-columns: 1fr;
    }
    .news-card-img {
        height: 120px;
    }

    /* Research sections */
    .research-section {
        padding: 1rem 0.75rem;
    }
    .research-card {
        padding: 0.75rem;
    }
    .research-score-card {
        padding: 0.65rem 0.75rem;
    }
    .research-score-body {
        font-size: 0.72rem;
    }

    /* Segment pills — scroll */
    .research-segment-pills {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 0.3rem;
    }
}

@media (max-width: 480px) {
    /* Very small screens */
    .content {
        padding: 0.75rem;
        padding-top: calc(var(--header-height) + 0.75rem);
    }

    /* Note card header — tighter */
    .note-card-header {
        padding: 0.5rem 0.65rem;
        gap: 0.35rem;
    }
    .note-topic-badge {
        font-size: 0.58rem;
        padding: 0.1rem 0.35rem;
    }
    .note-preview {
        display: none; /* hide preview on very small screens */
    }

    /* Files — even more compact */
    .files-table th:nth-child(2),
    .files-table td.files-size {
        display: none;
    }

    /* Board cards — single column */
    div[style*="grid-template-columns:repeat(auto-fill, minmax(220px"] {
        grid-template-columns: 1fr;
    }

    /* Ownership bar labels */
    div[style*="Insiders"] {
        flex-wrap: wrap;
    }
}

/* iOS safe area support */
@supports (padding: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Prevent iOS text size adjustment */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Smooth scrolling on iOS */
.content, .sidebar, .notes-list, .files-list {
    -webkit-overflow-scrolling: touch;
}

/* iOS tap highlight */
button, a, .note-card-header, .screener-inner-tab {
    -webkit-tap-highlight-color: rgba(99,102,241,0.15);
}

/* ========= iPad / Tablet (768-1024px) ========= */
@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 260px;
    }
    .sidebar-tab .tab-label {
        font-size: 0.6rem;
    }
    .content {
        padding: 1.25rem;
    }
    .news-top-grid {
        grid-template-columns: 1fr !important;
    }
    .news-signal-card {
        padding: 0.85rem !important;
    }
}

/* ========= Mobile News Hybrid Layout ========= */
@media (max-width: 768px) {
    .news-top-grid {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }
    .news-signal-card {
        padding: 0.75rem !important;
    }
    .news-signal-card h3 {
        font-size: 0.82rem !important;
    }
    .news-list-row {
        padding: 0.4rem 0.3rem !important;
        gap: 0.3rem !important;
    }
    .news-list-row span:nth-child(3) {
        font-size: 0.72rem !important;
    }
    /* Partners/Pricing grid on mobile */
    #partners-content > div {
        grid-template-columns: 1fr !important;
    }
    #pricing-content table {
        font-size: 0.7rem !important;
    }
    #pricing-content th,
    #pricing-content td {
        padding: 0.35rem !important;
    }
    /* Base rates cards wrap on mobile */
    #pricing-base-rates > div > div {
        gap: 0.4rem !important;
    }
    #pricing-base-rates > div > div > div {
        min-width: 90px !important;
        padding: 0.4rem 0.5rem !important;
    }
}

/* ========= News List Row hover on touch devices ========= */
@media (hover: none) {
    .news-list-row:active {
        background: var(--surface) !important;
    }
}

/* ========= Safe area padding for iOS notch/home indicator ========= */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .news-list-view {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========= 8 tabs — two-row grid layout ========= */
.sidebar-tabs {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    overflow-x: visible;
    gap: 0;
    padding: 0.25rem 0.35rem;
}
.sidebar-tab {
    min-width: 0;
    padding: 0.4rem 0.2rem;
    border-bottom: 2px solid transparent;
    border-radius: 6px 6px 0 0;
}
.sidebar-tab .tab-icon {
    font-size: 1rem;
}
.sidebar-tab .tab-label {
    font-size: 0.58rem;
    letter-spacing: 0.01em;
}
.sidebar-tab.active {
    background: var(--accent-dim);
    border-bottom-color: var(--accent);
}
@media (max-width: 768px) {
    .sidebar-tabs {
        grid-template-columns: repeat(4, 1fr);
        padding: 0.2rem 0.25rem;
    }
    .sidebar-tab {
        padding: 0.35rem 0.15rem;
    }
    .sidebar-tab .tab-label {
        font-size: 0.52rem;
    }
    .sidebar-tab .tab-icon {
        font-size: 0.9rem;
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar-tabs {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* =========================================================
   Bloomberg 3-Column News Layout
   ========================================================= */

/* Override the old grid-based .news-feed for our new layout */
.news-feed.bloomberg-layout {
    display: block;
    padding: 0;
    grid-template-columns: none;
    gap: 0;
}

/* Three-column wrapper */
.news-3col {
    display: grid;
    grid-template-columns: 35fr 35fr 30fr;
    gap: 0;
    height: calc(100vh - var(--header-height) - 160px);
    min-height: 400px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg);
}

/* Each column */
.ncol {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border);
}
.ncol:last-child {
    border-right: none;
}

/* Column header */
.ncol-header {
    flex-shrink: 0;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.ncol-header-title {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.ncol-header-count {
    font-size: 0.55rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Scrollable body */
.ncol-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.ncol-body::-webkit-scrollbar {
    width: 4px;
}
.ncol-body::-webkit-scrollbar-track {
    background: transparent;
}
.ncol-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

/* ---- Column 1: Featured / Outreach ---- */

.nc-featured-card {
    margin: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-left: 4px solid #ef4444;
    cursor: pointer;
    transition: background var(--transition), transform 0.15s;
}
.nc-featured-card:hover {
    background: rgba(239, 68, 68, 0.11);
    transform: translateY(-1px);
}

.nc-featured-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    color: #ef4444;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.nc-featured-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.nc-featured-flag {
    font-size: 1.1rem;
    line-height: 1;
}
.nc-featured-size {
    font-size: 0.78rem;
    font-weight: 700;
    color: #22c55e;
}

.nc-featured-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.nc-featured-hint {
    font-size: 0.7rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.nc-featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
}
.nc-featured-source {
    font-size: 0.6rem;
    color: var(--text-muted);
}
.nc-featured-read {
    font-size: 0.62rem;
    font-weight: 700;
    color: #ef4444;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    cursor: pointer;
    transition: background var(--transition);
}
.nc-featured-read:hover {
    background: rgba(239,68,68,0.2);
}

/* Additional outreach list below featured */
.nc-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.nc-list-header-label {
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.nc-list-header-count {
    font-size: 0.55rem;
    color: var(--text-muted);
}

/* A compact item row in col1 additional list */
.nc-list-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.04));
    cursor: pointer;
    transition: background var(--transition);
}
.nc-list-item:hover {
    background: var(--surface);
}
.nc-list-item-flag {
    font-size: 0.8rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}
.nc-list-item-body {
    flex: 1;
    min-width: 0;
}
.nc-list-item-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.15rem;
}
.nc-list-item-meta {
    font-size: 0.58rem;
    color: var(--text-muted);
}
.nc-list-item-date {
    font-size: 0.57rem;
    color: var(--text-muted);
    flex-shrink: 0;
    margin-top: 0.15rem;
}

/* ---- Column 2: Prospects ---- */

.nc-prospect-card {
    margin: 0.5rem 0.6rem;
    padding: 0.7rem 0.85rem;
    border-radius: 7px;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition), transform 0.12s;
    position: relative;
    border-left-width: 3px;
}
.nc-prospect-card:hover {
    background: var(--bg-hover, var(--bg));
    transform: translateY(-1px);
}

.nc-prospect-top {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
}

.nc-prospect-country-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.15rem;
}

.nc-prospect-title {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nc-prospect-hint {
    font-size: 0.63rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.nc-prospect-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nc-prospect-source {
    font-size: 0.58rem;
    color: var(--text-muted);
}
.nc-prospect-size {
    font-size: 0.65rem;
    font-weight: 700;
    color: #22c55e;
}

/* ---- Column 3: Monitor ---- */

.nc-monitor-row {
    display: grid;
    grid-template-columns: 1.4rem 1fr auto;
    gap: 0.4rem;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid var(--border-light, rgba(255,255,255,0.04));
    cursor: pointer;
    transition: background var(--transition);
}
.nc-monitor-row:hover {
    background: var(--surface);
}
.nc-monitor-flag {
    font-size: 0.75rem;
    text-align: center;
}
.nc-monitor-body {
    min-width: 0;
}
.nc-monitor-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.nc-monitor-source {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-top: 0.08rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nc-monitor-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    flex-shrink: 0;
}
.nc-monitor-date {
    font-size: 0.53rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.nc-cn-badge {
    font-size: 0.45rem;
    font-weight: 700;
    background: rgba(99,102,241,0.18);
    color: #818cf8;
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    letter-spacing: 0.03em;
}

/* Empty state */
.nc-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Stats bar above the columns */
.news-3col-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.1rem;
    margin-bottom: 0.5rem;
    font-size: 0.62rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.news-3col-stats-chips {
    display: flex;
    gap: 0.6rem;
}

/* ---- Responsive: stack to single column on small screens ---- */
@media (max-width: 900px) {
    .news-3col {
        grid-template-columns: 1fr;
        height: auto;
        min-height: unset;
    }
    .ncol {
        border-right: none;
        border-bottom: 1px solid var(--border);
        max-height: 60vh;
    }
    .ncol:last-child {
        border-bottom: none;
    }
}

@media (max-width: 600px) {
    .ncol {
        max-height: 50vh;
    }
    .nc-featured-card {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    .nc-featured-title {
        font-size: 0.85rem;
    }
}

/* Calculator selects & inputs — dark-mode friendly */
#calculator-view select {
    background-color: var(--surface) !important;
    color: var(--text) !important;
    color-scheme: dark;
}
[data-theme="dark"] #calculator-view select option {
    background-color: #1e1e2e !important;
    color: #e0e0e0 !important;
}
[data-theme="light"] #calculator-view select option {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
}
#calculator-view select:focus {
    outline: 1px solid var(--accent, #3b82f6);
}
