:root {
    --bg-color: #030712;
    --panel-bg: rgba(15, 23, 42, 0.45);
    --panel-border: rgba(30, 41, 59, 0.5);
    --card-glow: rgba(59, 130, 246, 0.05);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --text-dark: #334155;
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.2);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    padding: 2.5rem 0;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 95%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glassmorphism Common Style */
.glass {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
}

/* Header styling */
.main-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #f1f5f9;
}

.logo-area .subtitle {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.05em;
}

.meta-indicators {
    text-align: right;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.5;
}

/* Controls styling */
.controls-bar {
    padding: 1.25rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group.search-group {
    flex-grow: 1;
}

.control-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

.form-input {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--panel-border);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

select.form-input {
    min-width: 320px;
    cursor: pointer;
}

/* Summary Cards */
.summary-matrix {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.stat-card {
    padding: 1.5rem;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--card-glow);
}

.stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
}

#leader-name {
    font-size: 1.05rem;
}

.stat-delta {
    font-size: 0.85rem;
    color: var(--success);
    font-weight: 600;
}

#card-mean1y .stat-delta, #card-mean3y .stat-delta {
    color: var(--text-muted);
}

/* Methodology styling */
.methodology-box {
    padding: 0;
    overflow: hidden;
}

.methodology-header {
    padding: 1.25rem 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.methodology-header:hover {
    background-color: rgba(30, 41, 59, 0.15);
}

.methodology-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.methodology-icon {
    font-size: 1rem;
}

.methodology-main-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.methodology-header:hover .methodology-main-title {
    color: #f1f5f9;
}

.methodology-toggle-badge {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.methodology-header:hover .methodology-toggle-badge {
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.3);
    background: rgba(30, 41, 59, 0.7);
}

.methodology-content {
    display: none;
    padding: 0 1.75rem 1.5rem 1.75rem;
    border-top: 1px solid var(--panel-border);
    margin-top: 0;
    flex-direction: column;
    gap: 1rem;
}

.methodology-box.expanded .methodology-content {
    display: flex;
}

.methodology-intro {
    font-size: 0.85rem;
    color: #94a3b8;
    line-height: 1.5;
}

.methodology-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin: 0.5rem 0;
}

.methodology-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 0.85rem 1rem;
}

.methodology-term {
    font-size: 0.825rem;
    font-weight: 600;
    color: #3b82f6;
    letter-spacing: 0.02em;
}

.methodology-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.methodology-note {
    font-size: 0.775rem;
    color: var(--text-muted);
    background: rgba(59, 130, 246, 0.05);
    border-left: 3px solid var(--primary);
    padding: 0.6rem 1rem;
    border-radius: 0 4px 4px 0;
    line-height: 1.4;
}

.methodology-comparison-box {
    background: rgba(99, 102, 241, 0.06);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-left: 4px solid #6366f1;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin: 0.5rem 0;
}

.methodology-comparison-box h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: #e2e8f0;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.methodology-comparison-box p {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
    margin: 0 0 0.5rem 0;
}

.methodology-comparison-box p:last-child {
    margin-bottom: 0;
}

.methodology-desc-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.methodology-desc-block p {
    font-size: 0.775rem;
    color: #94a3b8;
    line-height: 1.45;
    margin: 0;
}

.methodology-desc-block p strong {
    color: #f1f5f9;
}

.methodology-desc-block code {
    background: rgba(148, 163, 184, 0.15);
    color: #f1f5f9;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.75rem;
}

/* Category Selector Styling */
.category-selector-section {
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.category-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}

.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.category-pill {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid var(--panel-border);
    color: #94a3b8;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.2s ease;
    outline: none;
}

.category-pill:hover {
    background: rgba(30, 41, 59, 0.8);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.3);
}

.category-pill.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

/* Column formatting adjustments */
.aum-col {
    min-width: 120px !important;
    white-space: nowrap !important;
}

.manager-col {
    max-width: 240px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: left;
    white-space: normal;
}

.manager-linkedin-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed rgba(96, 165, 250, 0.4);
    transition: color 0.15s, border-color 0.15s;
    display: inline-block;
}

.manager-linkedin-link:hover {
    color: #93c5fd;
    border-bottom-color: #93c5fd;
}

.manager-more-tag {
    color: var(--text-muted);
    font-size: 0.7rem;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--panel-border);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 600;
    cursor: help;
    display: inline-block;
    margin-left: 0.2rem;
    transition: all 0.2s;
}

.manager-more-tag:hover {
    color: var(--text-main);
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

/* Data grid styling */
.grid-section {
    padding: 1.5rem 0 0 0;
    overflow: hidden;
}

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

.table-title-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.table-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
}

.search-box-small {
    min-width: 250px;
    height: 36px;
    padding: 0.4rem 0.8rem;
    font-size: 0.825rem;
}

.count-badge {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.table-wrapper {
    overflow-x: auto;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.quant-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    text-align: right;
}

.quant-table th, .quant-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.3);
}

.quant-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.quant-table th {
    background: #0f172a;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
}

.quant-table th.text-left, .quant-table td.text-left {
    text-align: left;
}

.quant-table th[data-sort="rating"] {
    text-align: center;
}

.quant-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.quant-table th.sortable:hover {
    color: var(--text-main);
}

.sort-icon {
    font-size: 0.65rem;
    margin-left: 3px;
    display: inline-block;
    vertical-align: middle;
}

.quant-table tbody tr {
    cursor: pointer;
    transition: background-color 0.15s;
}

.quant-table tbody tr:hover {
    background-color: rgba(30, 41, 59, 0.25);
}

.quant-table td.scheme-name {
    font-weight: 500;
    color: #f1f5f9;
}

.rating-stars {
    color: #f59e0b;
    font-weight: 500;
    letter-spacing: 1px;
}

.rating-score-subtext {
    font-size: 0.7rem;
    color: #94a3b8;
    font-weight: 500;
    margin-top: 2px;
    display: block;
}

.rating-cell {
    text-align: center;
}

.score-val {
    color: var(--success);
    font-weight: 600;
}

.percentage-val.positive {
    color: var(--success);
}

.percentage-val.negative {
    color: var(--danger);
}

/* Modal Drawer Overlay */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Slide-out details drawer */
.drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    height: 100vh;
    z-index: 101;
    padding: 2.5rem 2rem;
    overflow-y: auto;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 0;
    border-left: 1px solid var(--panel-border);
}

.drawer.active {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    outline: none;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

/* Drawer Content Styling */
.drawer-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #f1f5f9;
    line-height: 1.4;
}

.drawer-section {
    margin-bottom: 2rem;
}

.drawer-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.modal-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.modal-item-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.modal-item-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mcap-badge {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.manager-change-badge {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #f59e0b;
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.4rem;
    white-space: nowrap;
    vertical-align: middle;
}

body:not(.dark-theme) .manager-change-badge {
    background: rgba(217, 119, 6, 0.08);
    border-color: rgba(217, 119, 6, 0.25);
    color: #b45309;
}

/* Holdings list */
.holdings-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.holding-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.825rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.2);
}

.holding-name {
    font-weight: 500;
    color: #e2e8f0;
}

.holding-sector {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.holding-weight {
    font-weight: 600;
    color: #cbd5e1;
}

/* Warnings and highlights */
.alert-value {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.alert-value.warning {
    color: var(--warning);
    background: var(--warning-bg);
}

.alert-value.success {
    color: var(--success);
    background: var(--success-bg);
}

/* Ratings grid detail */
.rating-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.825rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.15);
}

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

.rating-detail-label {
    color: var(--text-muted);
}

.rating-detail-stars {
    color: #f59e0b;
    font-weight: 600;
}

/* Rating Breakdown Tooltip */
.rating-tooltip-trigger {
    cursor: help;
}

.rating-tooltip {
    position: absolute;
    display: none;
    z-index: 10000;
    width: 290px;
    padding: 12px 14px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(99, 102, 241, 0.1);
    pointer-events: none;
    font-size: 0.785rem;
    color: #e2e8f0;
    text-align: left;
}

.rating-tooltip.glass {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tooltip-header {
    margin-bottom: 8px;
}

.tooltip-fund-name {
    font-weight: 600;
    color: #f8fafc;
    font-size: 0.85rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooltip-overall {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

.tooltip-overall .stars {
    color: #f59e0b;
    font-weight: 600;
}

.tooltip-overall .score {
    color: #94a3b8;
    font-weight: 500;
}

.tooltip-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 8px 0;
}

.tooltip-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-row span:first-child {
    color: #94a3b8;
}

.tooltip-row span:last-child {
    font-weight: 600;
    color: #f1f5f9;
}

/* Adjustments style in tooltip */
.tooltip-row.overlay-row span:first-child {
    color: #cbd5e1;
    font-style: italic;
    font-size: 0.75rem;
}

.tooltip-row.overlay-row span.text-danger {
    color: #ef4444;
}

.tooltip-row.overlay-row span.text-success {
    color: #10b981;
}

/* Column Header Description Tooltip */
.quant-table th[data-col-desc] {
    position: relative;
}

.quant-table th[data-col-desc]::after {
    content: 'ⓘ';
    font-size: 0.6rem;
    color: rgba(148, 163, 184, 0.4);
    margin-left: 4px;
    vertical-align: super;
    transition: color 0.2s;
}

.quant-table th[data-col-desc]:hover::after {
    color: rgba(148, 163, 184, 0.8);
}

.column-tooltip {
    position: absolute;
    display: none;
    z-index: 10001;
    width: 280px;
    padding: 14px 16px;
    border-radius: 10px;
    border-left: 3px solid #6366f1;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 12px rgba(99, 102, 241, 0.12);
    pointer-events: none;
    font-size: 0.785rem;
    color: #cbd5e1;
    line-height: 1.5;
    text-align: left;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.column-tooltip.glass {
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.column-tooltip .col-tooltip-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: #e2e8f0;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.column-tooltip .col-tooltip-title .col-tooltip-icon {
    color: #6366f1;
    font-size: 0.85rem;
}

.column-tooltip .col-tooltip-desc {
    color: #94a3b8;
    font-size: 0.775rem;
    line-height: 1.55;
}

/* SEO FAQ Section */
.faq-section {
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.faq-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
}

body:not(.dark-theme) .faq-item {
    border-bottom: 1px solid rgba(186, 230, 253, 0.5);
}

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

.faq-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    list-style: none;
    position: relative;
    padding-right: 1.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    transition: color 0.2s;
}

/* Custom dropdown arrow for summary */
.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.faq-item[open] .faq-question::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.faq-item[open] .faq-question {
    color: var(--text-main);
}

.faq-answer-content {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.faq-answer {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.stars, .rating-stars, .rating-detail-stars {
    color: #fbbf24; /* Amber-400 for dark mode */
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (MAX-WIDTH: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Global Layout & Header */
    .app-container {
        max-width: 100%;
        width: 100%;
        padding: 0 10px;
        gap: 1rem;
    }
    
    .header-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .logo-area h1 {
        font-size: 1.5rem;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    /* Methodology Section */
    .methodology-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Category Selector & Summary Matrix */
    .category-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }
    
    .summary-matrix {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Data Table */
    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-box-small {
        width: 100%;
    }
    
    .table-title-area h3 {
        font-size: 1.1rem;
    }
    
    .table-wrapper {
        max-height: calc(100vh - 200px);
    }

    .quant-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .quant-table th {
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Sticky First Column for Mobile */
    .quant-table th:nth-child(2),
    .quant-table td:nth-child(2) {
        position: sticky;
        left: 0;
    }
    
    .quant-table th:nth-child(2) {
        background: #1e293b; 
        z-index: 12;
    }
    body:not(.dark-theme) .quant-table th:nth-child(2) {
        background: #e0f2fe !important; 
    }
    
    .quant-table td:nth-child(2) {
        background: #0f172a; 
        z-index: 2;
    }
    body:not(.dark-theme) .quant-table td:nth-child(2) {
        background: #f8fafc !important; 
    }
    
    /* Shadow on the sticky column */
    .quant-table th:nth-child(2)::after,
    .quant-table td:nth-child(2)::after {
        content: '';
        position: absolute;
        top: 0;
        right: -6px;
        bottom: 0;
        width: 6px;
        background: linear-gradient(to right, rgba(0,0,0,0.15), transparent);
        pointer-events: none;
    }

    /* Modals, Drawers & Tooltips */
    .drawer {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }
    .drawer.active, .drawer.open {
        right: 0;
    }
    
    .column-tooltip.glass {
        max-width: 280px;
    }
    
    /* Adjust FAQ padding for mobile */
    .faq-section {
        padding: 1.5rem 1rem;
    }
}

/* LIGHT THEME OVERRIDES */
body:not(.dark-theme) {
    --bg-color: #f0f7ff;
    --panel-bg: rgba(255, 255, 255, 0.75);
    --panel-border: rgba(186, 230, 253, 0.8);
    --card-glow: rgba(59, 130, 246, 0.15);
    --text-main: #1e3a8a;
    --text-muted: #3b82f6;
    --text-dark: #f8fafc;
    
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.2);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
}

body:not(.dark-theme) .logo-area h1,
body:not(.dark-theme) .methodology-header:hover .methodology-main-title,
body:not(.dark-theme) .methodology-desc-block p strong,
body:not(.dark-theme) .category-pill:hover,
body:not(.dark-theme) .quant-table td.scheme-name,
body:not(.dark-theme) .drawer-title,
body:not(.dark-theme) .tooltip-fund-name,
body:not(.dark-theme) .tooltip-row span:last-child,
body:not(.dark-theme) .holding-name,
body:not(.dark-theme) .column-tooltip .col-tooltip-title {
    color: #1e3a8a !important;
}

body:not(.dark-theme) .methodology-main-title,
body:not(.dark-theme) .methodology-intro,
body:not(.dark-theme) .methodology-comparison-box p,
body:not(.dark-theme) .methodology-desc-block p,
body:not(.dark-theme) .category-pill,
body:not(.dark-theme) .rating-score-subtext,
body:not(.dark-theme) .tooltip-overall .score,
body:not(.dark-theme) .tooltip-row span:first-child,
body:not(.dark-theme) .holding-sector,
body:not(.dark-theme) .column-tooltip .col-tooltip-desc,
body:not(.dark-theme) .manager-col {
    color: #475569 !important;
}

body:not(.dark-theme) .form-input,
body:not(.dark-theme) .methodology-item,
body:not(.dark-theme) .methodology-comparison-box {
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(186, 230, 253, 0.7) !important;
}

body:not(.dark-theme) .methodology-comparison-box h4 {
    color: #1d4ed8 !important;
}

body:not(.dark-theme) .category-pill {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(186, 230, 253, 0.9) !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .category-pill:hover {
    background: rgba(224, 242, 254, 0.95) !important;
    border-color: #7dd3fc !important;
}

body:not(.dark-theme) .category-pill.active {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    color: #ffffff !important;
}

body:not(.dark-theme) .quant-table th {
    background: #e0f2fe !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .methodology-note {
    background: rgba(219, 234, 254, 0.6) !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .drawer-overlay {
    background: rgba(224, 242, 254, 0.6) !important;
}

body:not(.dark-theme) .drawer,
body:not(.dark-theme) .rating-tooltip.glass,
body:not(.dark-theme) .column-tooltip.glass {
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(186, 230, 253, 0.9) !important;
}

body:not(.dark-theme) .close-btn {
    color: #3b82f6 !important;
}
body:not(.dark-theme) .close-btn:hover {
    color: #1e3a8a !important;
}

body:not(.dark-theme) .stars,
body:not(.dark-theme) .rating-stars,
body:not(.dark-theme) .rating-detail-stars {
    color: #ea580c !important; /* Orange-600 for sharp visibility in light mode */
}

body:not(.dark-theme) .holding-weight,
body:not(.dark-theme) .tooltip-row.overlay-row span:first-child {
    color: #334155 !important;
}

body:not(.dark-theme) .quant-table tbody tr:hover {
    background-color: rgba(224, 242, 254, 0.6) !important;
}

body:not(.dark-theme) .quant-table td {
    border-bottom: 1px solid rgba(186, 230, 253, 0.7) !important;
}

body:not(.dark-theme) .holding-row {
    border-bottom: 1px solid rgba(186, 230, 253, 0.5) !important;
}

body:not(.dark-theme) .rating-detail-item {
    border-bottom: 1px solid rgba(186, 230, 253, 0.5) !important;
}

body:not(.dark-theme) .manager-more-tag {
    background: rgba(224, 242, 254, 0.9) !important;
    border-color: rgba(186, 230, 253, 0.9) !important;
    color: #1d4ed8 !important;
}
body:not(.dark-theme) .manager-more-tag:hover {
    background: #ffffff !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .count-badge,
body:not(.dark-theme) .mcap-badge,
body:not(.dark-theme) .methodology-toggle-badge {
    background: rgba(224, 242, 254, 0.9) !important;
    border-color: rgba(186, 230, 253, 0.9) !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .methodology-toggle-badge {
    color: #1e3a8a !important;
}

body:not(.dark-theme) .methodology-header:hover .methodology-toggle-badge {
    background: rgba(186, 230, 253, 0.95) !important;
    color: #1e3a8a !important;
}

body:not(.dark-theme) .methodology-desc-block code {
    background: rgba(219, 234, 254, 0.8) !important;
    color: #1d4ed8 !important;
}

body:not(.dark-theme) .tooltip-divider {
    background: rgba(186, 230, 253, 0.7) !important;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    width: auto;
    height: 36px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
    outline: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.theme-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--primary);
    transform: scale(1.05);
}

body.dark-theme .theme-toggle-btn .sun-icon {
    display: none !important;
}
body.dark-theme .theme-toggle-btn .moon-icon {
    display: inline-block !important;
}
body:not(.dark-theme) .theme-toggle-btn .sun-icon {
    display: inline-block !important;
}
body:not(.dark-theme) .theme-toggle-btn .moon-icon {
    display: none !important;
}
