:root {
    color-scheme: dark;
    --ak-page-bg: #030b18;
    --ak-page-bg-layer:
        radial-gradient(circle at 18% 8%, rgba(57, 194, 255, 0.1), transparent 32rem),
        linear-gradient(180deg, #030b18 0%, #020617 100%);
    --ak-surface: linear-gradient(180deg, rgba(11, 19, 32, 0.98), rgba(8, 14, 25, 0.98));
    --ak-surface-solid: #0b1322;
    --ak-surface-muted: rgba(12, 22, 40, 0.78);
    --ak-surface-soft: rgba(15, 23, 42, 0.62);
    --ak-control-bg: rgba(8, 15, 26, 0.96);
    --ak-text: #f8fafc;
    --ak-text-soft: #b8c8dd;
    --ak-text-muted: #7f94b1;
    --ak-border: rgba(86, 124, 168, 0.26);
    --ak-border-strong: rgba(86, 124, 168, 0.42);
    --ak-brand: #39c2ff;
    --ak-brand-strong: #7dd3fc;
    --ak-focus: rgba(57, 194, 255, 0.32);
    --ak-shadow: 0 16px 38px rgba(2, 8, 23, 0.24);
    --ak-shadow-soft: 0 10px 26px rgba(2, 8, 23, 0.18);
    --ak-positive: #34d399;
    --ak-negative: #f87171;
    --ak-warning: #fbbf24;
    --shadow-soft: var(--ak-shadow);
    --accent: var(--ak-brand);
    --accent-soft: var(--ak-brand-strong);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-root: #f6f8fb;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #0b1728;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-subtle: #d9e2ec;
    --border-active: #94a3b8;
    --accent-brand: #0369a1;
    --focus-ring: rgba(3, 105, 161, 0.32);
    --ak-page-bg: #f6f8fb;
    --ak-page-bg-layer:
        linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 48%, #eef3f7 100%);
    --ak-surface: #ffffff;
    --ak-surface-solid: #ffffff;
    --ak-surface-muted: #f8fafc;
    --ak-surface-soft: #eef3f7;
    --ak-control-bg: #ffffff;
    --ak-text: #0b1728;
    --ak-text-soft: #334155;
    --ak-text-muted: #64748b;
    --ak-border: rgba(148, 163, 184, 0.28);
    --ak-border-strong: rgba(100, 116, 139, 0.42);
    --ak-brand: #0369a1;
    --ak-brand-strong: #0f4c81;
    --ak-focus: rgba(3, 105, 161, 0.16);
    --ak-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
    --ak-shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.06);
    --ak-positive: #047857;
    --ak-negative: #be123c;
    --ak-warning: #b45309;
    --shadow-soft: var(--ak-shadow);
    --accent: var(--ak-brand);
    --accent-soft: var(--ak-brand-strong);
}

.nav-theme-group {
    display: flex;
    align-items: center;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-width: 42px;
    min-height: 42px;
    padding: 0.2rem 0.58rem;
    border: 1px solid var(--ak-border);
    border-radius: 999px;
    background: var(--ak-control-bg);
    color: var(--ak-text);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    box-shadow: var(--ak-shadow-soft);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(3, 105, 161, 0.34);
    color: var(--ak-brand-strong);
    outline: none;
    transform: translateY(-1px);
}

.theme-toggle-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.theme-toggle-text {
    font-size: 0.76rem;
    white-space: nowrap;
}

:root[data-theme="dark"] .theme-toggle-icon-moon,
:root[data-theme="light"] .theme-toggle-icon-sun {
    display: none;
}

.theme-toggle-mobile {
    min-width: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
}

.theme-toggle-mobile .theme-toggle-text {
    display: none;
}

@media (max-width: 900px) {
    .theme-toggle-mobile,
    .mobile-menu-toggle,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut {
        min-width: 44px !important;
        min-height: 44px !important;
        touch-action: manipulation;
    }

    .nav-theme-group {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .nav-theme-group .theme-toggle {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
}

:root[data-theme="light"] body {
    background-color: var(--ak-page-bg) !important;
    background-image: var(--ak-page-bg-layer) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] body.index-page-bg {
    background-image: var(--ak-page-bg-layer) !important;
}

:root[data-theme="light"] a {
    color: var(--ak-brand);
}

:root[data-theme="light"] header {
    background: rgba(255, 255, 255, 0.94) !important;
    border-bottom-color: var(--ak-border) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] header::after {
    background: linear-gradient(90deg, transparent 0%, rgba(3, 105, 161, 0.16) 20%, rgba(3, 105, 161, 0.06) 82%, transparent 100%) !important;
}

:root[data-theme="light"] :where(
    .logo,
    .logo-wordmark,
    .nav-link,
    .nav-link-text,
    .market-status,
    .lang-switcher a,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut,
    .mobile-menu-toggle
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: initial !important;
}

:root[data-theme="light"] :where(.nav-links, .nav-utils) {
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: var(--ak-border) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] :where(.nav-link:hover, .nav-link:focus-visible, .nav-link.active, .nav-link.nav-link-primary) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .nav-link-icon {
    color: var(--ak-brand) !important;
}

:root[data-theme="light"] .beta-tag {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.28) !important;
    color: var(--ak-brand-strong) !important;
    -webkit-text-fill-color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .header-stock-search input,
    .market-status,
    .lang-switcher a,
    .theme-toggle,
    .nav-auth .nav-btn,
    .mobile-auth-shortcut,
    .mobile-lang-shortcut,
    .mobile-menu-toggle
) {
    background: var(--ak-control-bg) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] :where(.header-stock-search input::placeholder, input::placeholder, textarea::placeholder) {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] :where(.header-search-icon, .nav-link-icon) {
    color: var(--ak-brand) !important;
}

:root[data-theme="light"] .header-search-suggestions {
    background: var(--ak-surface) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14) !important;
}

:root[data-theme="light"] .mobile-nav-overlay {
    background: rgba(15, 23, 42, 0.24) !important;
}

:root[data-theme="light"] :where(.mobile-dock, .mobile-dock.is-authenticated, .mobile-dock.is-guest) {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .mobile-dock-link {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .mobile-dock-link.active {
    background: rgba(3, 105, 161, 0.11) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .mobile-dock-link.is-auth {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .mobile-dock-link.is-logout {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.18) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .mobile-dock-icon,
:root[data-theme="light"] .mobile-dock-text {
    color: inherit !important;
}

:root[data-theme="light"] .mobile-dock-text {
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
}

:root[data-theme="light"] .mobile-cta-bar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    box-shadow: 0 -12px 28px rgba(15, 23, 42, 0.14) !important;
}

:root[data-theme="light"] .main-nav.active {
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%) !important;
    border-left-color: var(--ak-border-strong) !important;
    box-shadow: -26px 0 52px rgba(15, 23, 42, 0.18) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(.nav-mobile-title, .nav-mobile-section-label) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .nav-mobile-close {
    background: #e2e8f0 !important;
    border-color: var(--ak-border-strong) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(
    .card,
    .panel,
    .content-card,
    .dashboard-card,
    .form-card,
    .modal-content,
    .directory-header,
    .entry-conversion,
    .table-container,
    .market-table-container,
    .market-table-wrapper,
    .legal-card,
    .profile-container,
    .profile-card,
    .profile-section,
    .credit-card,
    .stock-insight-card,
    .stock-facts-card,
    .stock-analysis-card,
    .stock-chart-card,
    .stock-news-card,
    .stock-ai-entry-card,
    .ai-stock-report__hero,
    .ai-stock-report__section,
    .ai-stock-report__side-card,
    .ai-stock-report__summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .home-page.home-v2-premium .home-v2-hero,
    .home-page.home-v2-premium .home-v2-preview,
    .home-page.home-v2-premium .home-v2-resume,
    .home-page.home-v2-premium .home-v2-conversion,
    .home-page.home-v2-premium .home-v2-workflow,
    .home-page.home-v2-premium .home-v2-block,
    .home-page.home-v2-premium .home-v2-preview-row,
    .home-page.home-v2-premium .home-v2-list-item,
    .home-page.home-v2-premium .home-v2-step,
    .home-page.home-v2-premium .home-v2-resume-side-card,
    .home-page.home-v2-premium .home-v2-resume-row,
    .home-page.home-v2-premium .home-v2-resume-primary,
    .home-page.home-v2-premium .home-v2-conversion-metric,
    .home-page.home-v2-premium .home-v2-search
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar,
    .portfolio-page .sidebar,
    .portfolio-page .portfolio-switcher-mobile,
    .portfolio-page .portfolio-sticky-nav,
    .portfolio-page .portfolio-section-nav,
    .portfolio-page .portfolio-subnav-shell,
    .portfolio-page .portfolio-toolbar-summary-item,
    .portfolio-page .p-nav-item,
    .portfolio-page .top-stats,
    .portfolio-page .eval-panel,
    .portfolio-page .value-panel,
    .portfolio-page .summary-card,
    .portfolio-page .detail-card,
    .portfolio-page .evaluator-step-card,
    .portfolio-page .audit-holding-card,
    .portfolio-page .accounting-entry-panel,
    .portfolio-page .accounting-detail-card,
    .portfolio-page .accounting-allocation-card,
    .portfolio-page .portfolio-settings-page-card,
    .portfolio-page .portfolio-settings-modal-shell,
    .portfolio-page .estimate-section,
    .portfolio-page .estimate-card,
    .portfolio-page .optimizer-section,
    .portfolio-page .optimizer-suggestions,
    .portfolio-page .chart-container,
    .portfolio-page .charts-grid,
    .portfolio-page .holdings-container,
    .portfolio-page .portfolio-secondary-details,
    .portfolio-page .portfolio-workflow-guide,
    .portfolio-page .portfolio-workflow-step,
    .portfolio-page .stock-decision-next-steps,
    .portfolio-page .market-board-context-note,
    .portfolio-page .portfolio-priority-banner,
    .portfolio-page .portfolio-overview-focus-card,
    .portfolio-page .portfolio-current-holdings-panel,
    .portfolio-page .portfolio-current-holding-card,
    .portfolio-page .portfolio-current-holdings-stat,
    .portfolio-page .portfolio-overview-context-details,
    .portfolio-page .portfolio-empty-state,
    .portfolio-page .portfolio-empty-card,
    .portfolio-page .portfolio-post-import-card,
    .portfolio-page .portfolio-post-import-panel,
    .portfolio-page .dividend-summary-card,
    .portfolio-page .portfolio-export-panel,
    .portfolio-page .broker-drop-zone,
    .portfolio-page .broker-guide-card,
    .portfolio-page .assignment-status-card,
    .portfolio-page .sidebar-agent-card,
    .portfolio-page .sidebar-agent-btn,
    .portfolio-page .sidebar-agent-nocredits,
    .portfolio-page .sidebar-agents-balance-pill
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar,
    .portfolio-page .sidebar,
    .portfolio-page .portfolio-sticky-nav,
    .portfolio-page .top-stats,
    .portfolio-page .charts-grid,
    .portfolio-page .portfolio-income-section
) {
    background: var(--ak-surface) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .p-nav-item:hover,
    .portfolio-page .p-nav-item.active,
    .portfolio-section-link.active,
    .portfolio-subnav-link.active,
    .portfolio-page .portfolio-toolbar-eyebrow
) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.28) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .portfolio-toolbar-summary-item,
    .portfolio-page .holding-quick-fact,
    .portfolio-page .holding-mobile-metric,
    .portfolio-page .portfolio-current-holdings-summary,
    .portfolio-page .portfolio-current-holdings-preview,
    .portfolio-page .portfolio-secondary-details > .optimizer-section,
    .portfolio-page .portfolio-secondary-details > .estimate-section,
    .portfolio-page .portfolio-secondary-details > .portfolio-dividend-overview-strip
) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
}

:root[data-theme="light"] :where(
    .model-portfolio-page .directory-header,
    .model-portfolio-page .model-portfolio-hero-main,
    .model-portfolio-page .model-portfolio-hero-side,
    .model-portfolio-page .model-portfolio-panel,
    .model-portfolio-page .model-portfolio-action-card,
    .model-portfolio-page .model-portfolio-card,
    .model-portfolio-page .model-portfolio-spotlight,
    .model-portfolio-page .model-portfolio-dashboard,
    .model-portfolio-page .model-portfolio-dashboard-item,
    .model-portfolio-page .model-portfolio-filter-panel,
    .model-portfolio-page .model-portfolio-mini-chart-panel,
    .model-portfolio-page .model-portfolio-card-performance-main,
    .model-portfolio-page .model-portfolio-card-summary > *,
    .model-portfolio-page .model-portfolio-snapshot-card,
    .model-portfolio-page .model-portfolio-status-card,
    .model-portfolio-page .model-portfolio-run-context,
    .model-portfolio-page .model-portfolio-run-context-card,
    .model-portfolio-page .model-portfolio-follow-suggestions > *,
    .model-portfolio-page .model-portfolio-holdings-card,
    .model-portfolio-page .model-portfolio-detail-card,
    .model-portfolio-page .model-portfolio-summary-card,
    .model-portfolio-page .top-stat-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .social-page .social-hero-premium,
    .social-page .social-directory-shell,
    .social-page .social-overview-card,
    .social-page .social-empty-state,
    .social-page .social-table tr.social-row-card,
    .social-page .social-hero-spotlight,
    .social-page .social-hero-spotlight-surface,
    .social-page .social-board-control input,
    .social-page .social-board-control select,
    .public-portfolio-page .directory-header,
    .public-portfolio-page .top-stats,
    .public-portfolio-page .eval-panel,
    .public-portfolio-page .value-panel,
    .public-portfolio-page .chart-container,
    .public-portfolio-page .public-holdings-container,
    .public-portfolio-page .public-social-rail,
    .public-portfolio-page .public-social-rail-stat,
    .public-portfolio-page .public-social-peer-card,
    .public-portfolio-page .dividend-summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .docs-page,
    .docs-admin-page
) {
    background: var(--ak-page-bg-layer) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(
    .docs-side-nav,
    .docs-hero,
    .docs-guide-hero,
    .docs-tutorial-hero,
    .docs-section,
    .docs-card,
    .docs-step-card,
    .docs-checklist-card,
    .docs-warning-card,
    .docs-tutorial-final,
    .docs-hero-panel,
    .docs-section-highlight,
    .docs-metric,
    .docs-feature-card,
    .docs-tutorial-summary-card
) {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] :where(
    .market-table,
    .holdings-table,
    .public-holdings-table,
    .social-table,
    .model-portfolio-holdings-table,
    .model-portfolio-ledger-table,
    .accounting-history-table
) {
    background: var(--ak-surface) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(th, td) {
    border-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] :where(
    .market-table thead,
    .market-table th,
    .holdings-table tr.holding-row,
    .social-table tr.social-row-card,
    .public-holdings-table tr,
    .model-portfolio-holdings-table tr,
    .model-portfolio-ledger-table tr
) {
    background: var(--ak-surface-muted) !important;
}

:root[data-theme="light"] :where(
    input,
    select,
    textarea,
    .currency-form,
    .portfolio-page .currency-form,
    .portfolio-page .currency-form select,
    .portfolio-page .portfolio-settings input,
    .portfolio-page .portfolio-settings select,
    .accounting-filter-form input,
    .accounting-filter-form select,
    .accounting-entry-form input,
    .accounting-entry-form select,
    .social-board-control input,
    .social-board-control select
) {
    background: var(--ak-control-bg) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] :where(input:focus, select:focus, textarea:focus) {
    border-color: rgba(3, 105, 161, 0.62) !important;
    box-shadow: 0 0 0 3px var(--ak-focus) !important;
}

:root[data-theme="light"] :where(
    .btn-secondary,
    .settings-open-btn,
    .filter-chip,
    .detail-chip,
    .tag,
    .badge,
    .pill,
    .portfolio-chip,
    .p-risk-badge,
    .p-tax-badge,
    .social-rank-badge,
    .docs-secondary-action
) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] :where(.btn-primary, .docs-action) {
    background: var(--ak-brand-strong) !important;
    border-color: var(--ak-brand-strong) !important;
    color: #ffffff !important;
}

:root[data-theme="light"] :where(
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    .portfolio-title,
    .portfolio-toolbar-summary-value,
    .p-nav-name,
    .sidebar-agent-name,
    .eval-score,
    .value-amount,
    .summary-card .value,
    .detail-card strong,
    .top-stat-card strong,
    .model-portfolio-page strong,
    .social-overview-value,
    .social-card-title-group strong,
    .public-social-rail-stat-value,
    .docs-side-nav-title,
    .docs-page strong,
    .ai-stock-report__title,
    .ai-stock-report__summary-card strong
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: initial !important;
}

:root[data-theme="light"] :where(
    p,
    li,
    small,
    label,
    .subtitle,
    .section-subtitle,
    .directory-meta,
    .text-muted,
    .text-secondary,
    .muted,
    .helper-text,
    .portfolio-page-subtitle,
    .portfolio-toolbar-summary-label,
    .sidebar-label,
    .sidebar-count,
    .p-nav-meta,
    .sidebar-agents-intro,
    .sidebar-agent-role,
    .sidebar-agent-cost,
    .eval-status,
    .value-meta-note,
    .summary-card .label,
    .summary-card .meta,
    .detail-card p,
    .table-note,
    .field-help,
    .holding-company-name,
    .holding-subline,
    .social-board-control,
    .social-overview-label,
    .social-hero-note,
    .model-portfolio-card-text,
    .model-portfolio-card-meta,
    .model-portfolio-card-performance-note,
    .docs-breadcrumbs,
    .docs-side-nav-link small,
    .docs-card p,
    .docs-section p,
    .docs-section li,
    .ai-stock-report__subtitle,
    .ai-stock-report__summary-card p
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] :where(
    .docs-eyebrow,
    .docs-side-nav-group-label,
    .docs-breadcrumbs a,
    .docs-side-nav-home.active,
    .docs-side-nav-link.active,
    .portfolio-toolbar-eyebrow,
    .portfolio-section-group-label,
    .model-portfolio-action-eyebrow,
    .social-hero-kicker
) {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] :where(
    .portfolio-page .sidebar-agent-btn:not([disabled]),
    .portfolio-page .sidebar-agents-link,
    .portfolio-page .sidebar-agent-buycredits
) {
    color: var(--ak-brand-strong) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    background: rgba(3, 105, 161, 0.08) !important;
}

:root[data-theme="light"] :where(
    .docs-side-nav-home:hover,
    .docs-side-nav-home:focus-visible,
    .docs-side-nav-link:hover,
    .docs-side-nav-link:focus-visible,
    .docs-side-nav-home.active,
    .docs-side-nav-link.active
) {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-card-meta,
    .docs-hero-panel span,
    .docs-step-number,
    .docs-mini-icon,
    .docs-step-icon
) {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-tutorial-summary strong,
    .docs-step-card h3,
    .docs-guide-step h2
) {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .docs-page :where(
    .docs-tutorial-summary p,
    .docs-step-card p,
    .docs-guide-step p,
    .docs-hero-panel p,
    .docs-note,
    .docs-tip
) {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-tip, .docs-note) {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
}

:root[data-theme="light"] .docs-page .docs-step-number {
    background: rgba(3, 105, 161, 0.1) !important;
    border: 1px solid rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] .docs-page :where(.docs-mini-icon, .docs-step-icon) {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] :where(
    .buy,
    .positive,
    .gain,
    .score-positive,
    .value-amount.buy,
    .eval-score.tone-good,
    .kv-value.tone-good
) {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] :where(
    .sell,
    .negative,
    .loss,
    .score-negative,
    .value-amount.sell,
    .eval-score.tone-risk,
    .kv-value.tone-risk
) {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] :where(
    .hold,
    .warning,
    .tone-warn,
    .eval-score.tone-warn
) {
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] :where(.tone-good, .portfolio-chip.tone-good, .detail-chip.tone-good) {
    border-color: rgba(4, 120, 87, 0.24) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}

:root[data-theme="light"] :where(.tone-warn, .portfolio-chip.tone-warn, .detail-chip.tone-warn) {
    border-color: rgba(180, 83, 9, 0.24) !important;
    background: rgba(245, 158, 11, 0.1) !important;
}

:root[data-theme="light"] :where(.tone-risk, .detail-chip.tone-risk) {
    border-color: rgba(190, 18, 60, 0.22) !important;
    background: rgba(244, 63, 94, 0.08) !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .portfolio-page .holdings-table tr.holding-row {
        background: var(--ak-surface) !important;
        border-color: var(--ak-border) !important;
        box-shadow: var(--ak-shadow-soft) !important;
    }
}

/* High-specificity portfolio light-mode fixes for legacy dark rules that use !important. */
:root[data-theme="light"] .portfolio-page .portfolio-toolbar,
:root[data-theme="light"] .portfolio-page .sidebar,
:root[data-theme="light"] .portfolio-page .portfolio-sticky-nav,
:root[data-theme="light"] .portfolio-page .portfolio-section-nav,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-shell,
:root[data-theme="light"] .portfolio-page .portfolio-switcher-mobile {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-sticky-nav {
    top: 92px;
    z-index: 58;
    margin-bottom: 1.1rem;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-section-link.active,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link.active,
:root[data-theme="light"] .portfolio-page .portfolio-section-link:hover,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link:hover,
:root[data-theme="light"] .portfolio-page .portfolio-section-link:focus-visible,
:root[data-theme="light"] .portfolio-page .portfolio-subnav-link:focus-visible {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-item,
:root[data-theme="light"] .portfolio-page .p-nav-item,
:root[data-theme="light"] .portfolio-page .sidebar-agent-card,
:root[data-theme="light"] .portfolio-page .sidebar-agent-btn,
:root[data-theme="light"] .portfolio-page .sidebar-agents-balance-pill,
:root[data-theme="light"] .portfolio-page .currency-form,
:root[data-theme="light"] .portfolio-page .toolbar-actions .currency-form {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item.active,
:root[data-theme="light"] .portfolio-page .p-nav-item:hover {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.24) !important;
    border-left-color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .p-nav-item.active .p-nav-name,
:root[data-theme="light"] .portfolio-page .p-nav-item:hover .p-nav-name {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .top-stats,
:root[data-theme="light"] .portfolio-page .top-stats-primary,
:root[data-theme="light"] .portfolio-page .top-stats-secondary {
    background: transparent !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel,
:root[data-theme="light"] .portfolio-page .value-panel,
:root[data-theme="light"] .portfolio-page .is-secondary-stat,
:root[data-theme="light"] .public-portfolio-page .eval-panel,
:root[data-theme="light"] .public-portfolio-page .value-panel,
:root[data-theme="light"] .public-portfolio-page .is-secondary-stat {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-good,
:root[data-theme="light"] .portfolio-page .value-panel.tone-good,
:root[data-theme="light"] .portfolio-page .summary-card.tone-good,
:root[data-theme="light"] .portfolio-page .detail-card.tone-good,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-good,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-good,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-good {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(4, 120, 87, 0.24) !important;
    border-top-color: rgba(4, 120, 87, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-warn,
:root[data-theme="light"] .portfolio-page .value-panel.tone-warn,
:root[data-theme="light"] .portfolio-page .summary-card.tone-warn,
:root[data-theme="light"] .portfolio-page .detail-card.tone-warn,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-warn,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-warn,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-warn {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(180, 83, 9, 0.24) !important;
    border-top-color: rgba(180, 83, 9, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-risk,
:root[data-theme="light"] .portfolio-page .value-panel.tone-risk,
:root[data-theme="light"] .portfolio-page .summary-card.tone-risk,
:root[data-theme="light"] .portfolio-page .detail-card.tone-risk,
:root[data-theme="light"] .portfolio-page .evaluator-step-card.tone-risk,
:root[data-theme="light"] .portfolio-page .audit-holding-card.tone-risk,
:root[data-theme="light"] .portfolio-page .accounting-allocation-card.tone-risk {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border-color: rgba(190, 18, 60, 0.22) !important;
    border-top-color: rgba(190, 18, 60, 0.42) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-good .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-good .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-good strong {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-warn .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-warn .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-warn strong {
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] .portfolio-page .eval-panel.tone-risk .eval-score,
:root[data-theme="light"] .portfolio-page .summary-card.tone-risk .value,
:root[data-theme="light"] .portfolio-page .detail-card.tone-risk strong {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount,
:root[data-theme="light"] .portfolio-page .eval-score,
:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-value {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount.buy,
:root[data-theme="light"] .portfolio-page .eval-score.buy,
:root[data-theme="light"] .portfolio-page .eval-score-delta.is-up {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .value-amount.sell,
:root[data-theme="light"] .portfolio-page .eval-score.sell,
:root[data-theme="light"] .portfolio-page .eval-score-delta.is-down {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-up {
    background: rgba(4, 120, 87, 0.1) !important;
    border-color: rgba(4, 120, 87, 0.22) !important;
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-down {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.18) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .eval-score-delta.is-flat {
    background: rgba(180, 83, 9, 0.1) !important;
    border-color: rgba(180, 83, 9, 0.2) !important;
    color: var(--ak-warning) !important;
}

:root[data-theme="light"] .portfolio-page .eval-status,
:root[data-theme="light"] .portfolio-page .value-meta-note,
:root[data-theme="light"] .portfolio-page .eval-score-delta-meta,
:root[data-theme="light"] .portfolio-page .portfolio-page-subtitle,
:root[data-theme="light"] .portfolio-page .portfolio-toolbar-summary-label,
:root[data-theme="light"] .portfolio-page .holdings-header-note,
:root[data-theme="light"] .portfolio-page .holdings-header-guide,
:root[data-theme="light"] .portfolio-transactions-page .active-holdings-scan-hint,
:root[data-theme="light"] .portfolio-page .sidebar-label,
:root[data-theme="light"] .portfolio-page .sidebar-count,
:root[data-theme="light"] .portfolio-page .sidebar-agents-intro,
:root[data-theme="light"] .portfolio-page .sidebar-agent-role,
:root[data-theme="light"] .portfolio-page .summary-card .label,
:root[data-theme="light"] .portfolio-page .summary-card .meta {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-stats-controls {
    display: flex;
    justify-content: flex-end;
    margin: 0 0 0.55rem;
}

:root[data-theme="light"] .portfolio-page .totals-mode-toggle {
    background: var(--ak-surface-muted) !important;
    border: 1px solid var(--ak-border) !important;
    border-radius: 12px !important;
    box-shadow: var(--ak-shadow-soft) !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-label {
    color: var(--ak-text-muted) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-btn {
    background: transparent !important;
    border-color: transparent !important;
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .totals-mode-btn.is-active {
    background: rgba(3, 105, 161, 0.14) !important;
    border-color: rgba(3, 105, 161, 0.2) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-good,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-good {
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%) !important;
    border-color: rgba(4, 120, 87, 0.24) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-warn,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-warn {
    background: linear-gradient(180deg, #ffffff 0%, #fffbeb 100%) !important;
    border-color: rgba(180, 83, 9, 0.24) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-priority-banner.tone-risk,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-panel.tone-risk {
    background: linear-gradient(180deg, #ffffff 0%, #fff1f2 100%) !important;
    border-color: rgba(190, 18, 60, 0.22) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card h3,
:root[data-theme="light"] .portfolio-page .portfolio-priority-copy h3,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-copy h3 {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-overview-focus-card p,
:root[data-theme="light"] .portfolio-page .portfolio-priority-copy p,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-copy p {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-container,
:root[data-theme="light"] .portfolio-page .holdings-header,
:root[data-theme="light"] .portfolio-page .portfolio-workflow-guide,
:root[data-theme="light"] .portfolio-page .portfolio-workflow-step,
:root[data-theme="light"] .portfolio-page .portfolio-current-holding-card,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-stat,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-summary,
:root[data-theme="light"] .portfolio-page .portfolio-current-holdings-preview {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .holdings-table thead th {
    background: var(--ak-surface-muted) !important;
    border-bottom-color: var(--ak-border) !important;
    color: var(--ak-text-muted) !important;
}

/* Portfolio subpage light-mode overrides for late legacy dark sections. */
:root[data-theme="light"] .portfolio-page .portfolio-title {
    background: none !important;
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .add-stock-grid,
:root[data-theme="light"] .portfolio-page .export-section,
:root[data-theme="light"] .portfolio-page .import-section,
:root[data-theme="light"] .portfolio-page .portfolio-dividend-overview-strip,
:root[data-theme="light"] .portfolio-page .optimizer-section,
:root[data-theme="light"] .portfolio-page .optimizer-suggestions,
:root[data-theme="light"] .portfolio-page .optimizer-card,
:root[data-theme="light"] .portfolio-page .estimate-section,
:root[data-theme="light"] .portfolio-page .estimate-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-panel,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel,
:root[data-theme="light"] .portfolio-page .evaluator-steps-section,
:root[data-theme="light"] .portfolio-page .evaluator-tax-section,
:root[data-theme="light"] .portfolio-page .evaluator-holdings-section,
:root[data-theme="light"] .portfolio-page .evaluator-history-section,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid,
:root[data-theme="light"] .portfolio-page .accounting-history-section,
:root[data-theme="light"] .portfolio-page .accounting-controls,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .accounting-detail-card {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: var(--ak-shadow) !important;
}

:root[data-theme="light"] .portfolio-page .optimizer-card,
:root[data-theme="light"] .portfolio-page .estimate-card,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item,
:root[data-theme="light"] .portfolio-page .accounting-controls,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .accounting-detail-card {
    background: var(--ak-surface-muted) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .portfolio-page .add-stock-grid,
:root[data-theme="light"] .portfolio-page .export-section,
:root[data-theme="light"] .portfolio-page .import-section,
:root[data-theme="light"] .portfolio-page .portfolio-dividend-overview-strip,
:root[data-theme="light"] .portfolio-page .optimizer-section,
:root[data-theme="light"] .portfolio-page .estimate-section,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-card,
:root[data-theme="light"] .portfolio-page .evaluator-steps-section,
:root[data-theme="light"] .portfolio-page .evaluator-tax-section,
:root[data-theme="light"] .portfolio-page .evaluator-holdings-section,
:root[data-theme="light"] .portfolio-page .evaluator-history-section,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid,
:root[data-theme="light"] .portfolio-page .accounting-history-section {
    border-top-color: rgba(3, 105, 161, 0.18) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-alert.is-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(4, 120, 87, 0.28) !important;
    border-left-color: rgba(4, 120, 87, 0.66) !important;
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-alert.is-error {
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(190, 18, 60, 0.24) !important;
    border-left-color: rgba(190, 18, 60, 0.66) !important;
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-kicker,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-source,
:root[data-theme="light"] .portfolio-page .holding-quick-fact,
:root[data-theme="light"] .portfolio-page .holding-mobile-metric,
:root[data-theme="light"] .portfolio-page .accounting-source-chip,
:root[data-theme="light"] .portfolio-page .portfolio-priority-chip,
:root[data-theme="light"] .portfolio-page .holdings-header-chip {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-head h2,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel strong,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy h3,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item strong,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary strong,
:root[data-theme="light"] .portfolio-page .split-header h3,
:root[data-theme="light"] .portfolio-page .evaluator-detail-grid .detail-card h3,
:root[data-theme="light"] .portfolio-page .accounting-detail-card > summary {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-post-import-head p,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-panel p,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-meta,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy p,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item small,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary small,
:root[data-theme="light"] .portfolio-page .evaluator-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-history-table th,
:root[data-theme="light"] .portfolio-page .estimate-card .label,
:root[data-theme="light"] .portfolio-page .estimate-card .cov,
:root[data-theme="light"] .portfolio-page .optimizer-card .label,
:root[data-theme="light"] .portfolio-page .optimizer-card .detail,
:root[data-theme="light"] .portfolio-page .portfolio-mobile-summary {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-copy span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-start-item span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary span,
:root[data-theme="light"] .portfolio-page .portfolio-evaluator-evidence-panel > summary::after,
:root[data-theme="light"] .portfolio-page .portfolio-post-import-stat-label {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .portfolio-page .evaluator-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-history-table th,
:root[data-theme="light"] .portfolio-page .accounting-secondary-grid .market-table tr,
:root[data-theme="light"] .portfolio-page .holdings-table tr.holding-row:hover td {
    background: var(--ak-surface-muted) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.buy,
:root[data-theme="light"] .portfolio-page .optimizer-card.good {
    border-left-color: rgba(4, 120, 87, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.sell,
:root[data-theme="light"] .portfolio-page .optimizer-card.risk {
    border-left-color: rgba(190, 18, 60, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.hold,
:root[data-theme="light"] .portfolio-page .optimizer-card.warn {
    border-left-color: rgba(180, 83, 9, 0.52) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.buy .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.good .value {
    color: var(--ak-positive) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.sell .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.risk .value {
    color: var(--ak-negative) !important;
}

:root[data-theme="light"] .portfolio-page .estimate-card.hold .pct,
:root[data-theme="light"] .portfolio-page .optimizer-card.warn .value {
    color: var(--ak-warning) !important;
}

/* Professional light footer: avoid dark-mode leftovers and stretched empty cards. */
:root[data-theme="light"] .main-footer {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(238, 243, 247, 0.92) 100%) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.32) !important;
    color: var(--ak-text-soft) !important;
    margin-top: clamp(2rem, 4vw, 3.2rem) !important;
    padding: clamp(2.2rem, 4vw, 3.2rem) 0 1.4rem !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
}

:root[data-theme="light"] .main-footer .container {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .footer-grid {
    align-items: start !important;
    gap: 1rem !important;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) !important;
    margin-bottom: 1rem !important;
}

:root[data-theme="light"] .f-col {
    align-self: start !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 1.15rem 1.2rem !important;
    border: 1px solid var(--ak-border) !important;
    border-radius: 18px !important;
    background: rgba(255, 255, 255, 0.92) !important;
    color: var(--ak-text-soft) !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .f-col .logo,
:root[data-theme="light"] .f-col h4 {
    color: var(--ak-text) !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .f-col .logo {
    margin-bottom: 0.8rem !important;
}

:root[data-theme="light"] .f-col h4 {
    margin-bottom: 0.65rem !important;
}

:root[data-theme="light"] .f-col p,
:root[data-theme="light"] .contact-info,
:root[data-theme="light"] .disclaimer-box,
:root[data-theme="light"] .footer-bottom {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .footer-links {
    gap: 0.35rem !important;
}

:root[data-theme="light"] .footer-links a,
:root[data-theme="light"] .contact-info a {
    color: var(--ak-brand-strong) !important;
    border-bottom-color: rgba(15, 76, 129, 0.34) !important;
    text-decoration: none !important;
}

:root[data-theme="light"] .footer-links a:hover,
:root[data-theme="light"] .footer-links a:focus-visible,
:root[data-theme="light"] .contact-info a:hover,
:root[data-theme="light"] .contact-info a:focus-visible {
    color: #08375f !important;
    border-bottom-color: #08375f !important;
    outline: none !important;
}

:root[data-theme="light"] .disclaimer-box {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: var(--ak-border) !important;
    border-radius: 16px !important;
    margin: 1rem 0 1.2rem !important;
    box-shadow: var(--ak-shadow-soft) !important;
}

:root[data-theme="light"] .disclaimer-box strong {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .footer-bottom {
    border-top-color: rgba(148, 163, 184, 0.34) !important;
    padding-top: 1.1rem !important;
}

@media (max-width: 900px) {
    :root[data-theme="light"] .footer-grid {
        grid-template-columns: 1fr !important;
    }

    :root[data-theme="light"] .f-col,
    :root[data-theme="light"] .disclaimer-box {
        padding: 1rem !important;
    }
}

/* Social/public light-mode contrast stabilization. */
:root[data-theme="light"] .social-page .social-hero-kicker,
:root[data-theme="light"] .social-page .social-hero-spotlight-kicker,
:root[data-theme="light"] .social-page .social-rank-badge,
:root[data-theme="light"] .social-page .portfolio-risk-label,
:root[data-theme="light"] .social-page .action-link,
:root[data-theme="light"] .social-page .social-follow-form .social-follow-btn {
    background: var(--ak-surface-muted) !important;
    border-color: rgba(3, 105, 161, 0.22) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .social-page .social-overview-label,
:root[data-theme="light"] .social-page .social-card-owner-inline,
:root[data-theme="light"] .social-page .listing-quick-fact-label,
:root[data-theme="light"] .social-page .social-hero-spotlight-owner,
:root[data-theme="light"] .social-page .social-hero-spotlight-copy,
:root[data-theme="light"] .social-page .social-hero-spotlight-return-label,
:root[data-theme="light"] .public-portfolio-page .public-social-rail small {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .social-page .social-overview-value,
:root[data-theme="light"] .social-page .social-card-title-group,
:root[data-theme="light"] .social-page .social-card-title-group strong,
:root[data-theme="light"] .social-page strong.social-card-title-group,
:root[data-theme="light"] .social-page .listing-quick-fact-value,
:root[data-theme="light"] .social-page .social-cell-holdings,
:root[data-theme="light"] .social-page .social-cell-followers,
:root[data-theme="light"] .social-page .social-cell-return,
:root[data-theme="light"] .social-page .social-hero-spotlight h2,
:root[data-theme="light"] .social-page .social-hero-spotlight-return strong {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .social-page .listing-quick-fact,
:root[data-theme="light"] .social-page .social-hero-spotlight-return,
:root[data-theme="light"] .social-page .social-hero-spotlight-stats .detail-chip {
    background: var(--ak-surface-muted) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .social-page .social-table td,
:root[data-theme="light"] .social-page .social-table tbody tr:hover td {
    background: var(--ak-surface) !important;
    border-color: var(--ak-border) !important;
    color: var(--ak-text) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .social-page .action-link:hover,
:root[data-theme="light"] .social-page .social-follow-form .social-follow-btn:hover {
    background: rgba(3, 105, 161, 0.1) !important;
    border-color: rgba(3, 105, 161, 0.3) !important;
    color: var(--ak-brand-strong) !important;
}

/* Professional light-mode homepage palette. */
:root[data-theme="light"] body.index-page-bg {
    background-color: var(--ak-page-bg) !important;
    background-image:
        linear-gradient(180deg, #fbfcfe 0%, #f6f8fb 48%, #eef3f7 100%) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium::before {
    background:
        radial-gradient(circle at 18% 18%, rgba(15, 76, 129, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(15, 23, 42, 0.05), transparent 72%) !important;
    filter: none !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium::after {
    background:
        repeating-linear-gradient(90deg, rgba(100, 116, 139, 0.025) 0 1px, transparent 1px 96px),
        repeating-linear-gradient(0deg, rgba(100, 116, 139, 0.02) 0 1px, transparent 1px 96px) !important;
    opacity: 0.28 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-workflow,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator {
    background:
        linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 26px 58px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-workflow::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo::before,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator::before {
    background: radial-gradient(circle, rgba(15, 76, 129, 0.08), transparent 72%) !important;
    filter: blur(6px) !important;
    opacity: 0.5 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-hero-visual {
    opacity: 0.055 !important;
    mix-blend-mode: multiply !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1::first-line,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-copy h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-head h2,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-copy h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary h3,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-ticker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-value {
    color: var(--ak-text) !important;
    text-shadow: none !important;
    -webkit-text-fill-color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-copy h1 {
    background: none !important;
    background-clip: border-box !important;
    -webkit-background-clip: border-box !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-subtitle {
    color: #26364d !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-note,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-block-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-copy p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-head p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-copy p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-prompt p,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card em,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-list-head em,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-name,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-rank,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-row-score,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-label {
    color: var(--ak-text-soft) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-chip,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-links a,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-start-path,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-trust-item,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-primary,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-side-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-prompt,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-conversion-metric,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-manifesto,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-audit,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-signal,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare-card,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-chip,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-links a {
    background: #f8fafc !important;
    color: var(--ak-text-soft) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-proofline strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card-index,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-section-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-label {
    background: rgba(3, 105, 161, 0.08) !important;
    border-color: rgba(3, 105, 161, 0.2) !important;
    color: var(--ak-brand-strong) !important;
    box-shadow: none !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.32) !important;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search::after {
    background: linear-gradient(90deg, rgba(3, 105, 161, 0.045), transparent 32%, transparent 68%, rgba(20, 184, 166, 0.045)) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search input {
    color: var(--ak-text) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-search input::placeholder {
    color: #94a3b8 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-primary {
    background: linear-gradient(135deg, #0f4c81, #0369a1) !important;
    background-color: #0f4c81 !important;
    border-color: rgba(3, 105, 161, 0.34) !important;
    color: #ffffff !important;
    box-shadow: 0 14px 28px rgba(3, 105, 161, 0.18) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-primary:hover {
    box-shadow: 0 18px 34px rgba(3, 105, 161, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-actions .btn-secondary,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-footer .btn-secondary {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    color: var(--ak-text) !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    box-shadow: 0 24px 52px rgba(15, 23, 42, 0.09) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview::after {
    background: radial-gradient(circle, rgba(15, 76, 129, 0.08), transparent 70%) !important;
    opacity: 0.55 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-head {
    border-bottom-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-panel-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-demo-compare-kicker {
    color: var(--ak-brand-strong) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator {
    background: linear-gradient(145deg, #112338 0%, #17243a 100%) !important;
    background-color: #112338 !important;
    border-color: rgba(15, 76, 129, 0.34) !important;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.16) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score {
    background: rgba(2, 10, 22, 0.5) !important;
    border-color: rgba(125, 211, 252, 0.18) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score strong,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator p {
    color: #e8f4ff !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-score span,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-evaluator-kicker {
    color: #9cc7e8 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart {
    background: linear-gradient(135deg, #eef2f7 0%, #dfe7ef 100%) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart-line,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-chart-point {
    opacity: 0.68 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row::after {
    background: linear-gradient(180deg, rgba(3, 105, 161, 0.42), rgba(20, 184, 166, 0.16)) !important;
    opacity: 0.62 !important;
}

:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-preview-row:focus-visible,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-list-item:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-step:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-focus-card:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-resume-row:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-positioning-card:hover,
:root[data-theme="light"] .home-page.home-v2-premium .home-v2-evaluator-card:hover {
    background: #ffffff !important;
    border-color: rgba(3, 105, 161, 0.26) !important;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.09) !important;
}
