:root[data-theme="light"] {
    color-scheme: light;
    --bs-body-bg: #f3f7ff;
    --bs-body-color: #0f172a;
    --bs-body-color-rgb: 15, 23, 42;
    --bs-secondary-color: #334155;
    --bs-secondary-color-rgb: 51, 65, 85;
    --bs-tertiary-color: #475569;
    --bs-tertiary-color-rgb: 71, 85, 105;
    --bs-emphasis-color: #0b1324;
    --bs-emphasis-color-rgb: 11, 18, 36;
    --bs-heading-color: #0b1324;
    --bs-link-color: #1d4ed8;
    --bs-link-hover-color: #0f3fb3;
    --bs-border-color: rgba(15, 23, 42, 0.14);
    --bs-light-text-emphasis: #334155;
    --bg-1: #f3f7ff;
    --bg-2: #deebff;
    --bg-glow-1: rgba(37, 99, 235, 0.12);
    --bg-glow-2: rgba(14, 165, 233, 0.1);
    --surface: rgba(255, 255, 255, 0.84);
    --surface-strong: rgba(255, 255, 255, 0.96);
    --text-main: #0f172a;
    --text-muted: #334155;
    --text-muted-strong: #1e293b;
    --accent: #1d4ed8;
    --accent-2: #0284c7;
    --lt-bg: #eef4ff;
    --lt-surface: #ffffff;
    --lt-surface-soft: #f8fbff;
    --lt-border: rgba(15, 23, 42, 0.14);
    --lt-text: #0f172a;
    --lt-muted: #475569;
    --lt-heading: #0b1324;

    /* Global theme contract tokens - light */
    --ui-page-bg: linear-gradient(165deg, #eff6ff, #dbeafe);
    --ui-card-bg: linear-gradient(165deg, #ffffff, #f8fbff);
    --ui-card-border: rgba(15, 23, 42, 0.14);
    --ui-card-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    --ui-title-color: #0b1324;
    --ui-subtitle-color: #334155;
    --ui-table-head-bg: rgba(15, 23, 42, 0.94);
    --ui-table-head-text: #0e7490;
    --ui-table-row-odd: #f8fafc;
    --ui-table-row-even: #f1f5f9;
    --ui-table-row-hover: #dbeafe;
    --ui-table-cell-text: #0f172a;
    --ui-table-cell-border: rgba(100, 116, 139, 0.28);

    /* Global topbar token contract - light */
    --topbar-bg: rgba(255, 255, 255, 0.9);
    --topbar-border: rgba(15, 23, 42, 0.14);
    --topbar-link-text: #0f172a;
    --topbar-link-border: rgba(15, 23, 42, 0.24);
    --topbar-link-bg: rgba(255, 255, 255, 0.72);
    --topbar-link-hover-text: #020617;
    --topbar-link-hover-border: rgba(29, 78, 216, 0.52);
    --topbar-link-hover-bg: rgba(219, 234, 254, 0.82);
    --topbar-link-active-text: #0b1324;
    --topbar-link-active-border: rgba(29, 78, 216, 0.56);
    --topbar-link-active-bg: linear-gradient(135deg, rgba(191, 219, 254, 0.9), rgba(224, 242, 254, 0.92));
    --ui-label-color: #0f172a;
    --ui-label-muted-color: #334155;
    --ui-chip-text: #0f172a;
    --ui-chip-bg: rgba(255, 255, 255, 0.9);
    --ui-chip-border: rgba(100, 116, 139, 0.36);
    --ui-badge-text: #0f172a;
    --ui-badge-bg: rgba(226, 232, 240, 0.8);
    --ui-badge-border: rgba(100, 116, 139, 0.4);
    --blog-editor-shell-bg: linear-gradient(165deg, #ffffff, #f8fbff);
    --blog-editor-shell-border: rgba(15, 23, 42, 0.14);
    --blog-editor-shell-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
    --blog-editor-toolbar-bg: rgba(241, 245, 249, 0.96);
    --blog-editor-toolbar-border: rgba(100, 116, 139, 0.18);
    --blog-editor-toolbar-text: #0f172a;
    --blog-editor-surface-bg: #f8fafc;
    --blog-editor-surface-bg-focus: #ffffff;
    --blog-editor-surface-text: #0f172a;
    --blog-editor-surface-border: rgba(100, 116, 139, 0.18);
}

:root[data-theme="light"] body,
:root[data-theme="light"] .app-shell {
    color: var(--lt-text) !important;
}

:root[data-theme="light"] body {
    background-color: var(--lt-bg);
}

:root[data-theme="light"] .topbar {
    background: rgba(255, 255, 255, 0.9) !important;
    border-bottom-color: var(--lt-border) !important;
}

:root[data-theme="light"] .topbar :is(.brand, .nav-link, .topbar-link, .profile-chip-name) {
    color: var(--lt-text) !important;
}

:root[data-theme="light"] .topbar .topbar-link {
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.24) !important;
    background: rgba(255, 255, 255, 0.72) !important;
    font-weight: 600;
}

:root[data-theme="light"] .topbar .topbar-link:hover,
:root[data-theme="light"] .topbar .topbar-link:focus-visible {
    color: #020617 !important;
    border-color: rgba(29, 78, 216, 0.52) !important;
    background: rgba(219, 234, 254, 0.82) !important;
}

:root[data-theme="light"] .topbar .topbar-link-active {
    color: #0b1324 !important;
    border-color: rgba(29, 78, 216, 0.56) !important;
    background: linear-gradient(135deg, rgba(191, 219, 254, 0.9), rgba(224, 242, 254, 0.92)) !important;
}

:root[data-theme="light"] .topbar .topbar-link-secondary,
:root[data-theme="light"] .topbar .topbar-link-highlight,
:root[data-theme="light"] .topbar .topbar-link-admin {
    color: #0f172a !important;
}

:root[data-theme="light"] .topbar .dropdown-toggle::after {
    color: #1e293b !important;
    opacity: 0.9;
}

:root[data-theme="light"] .topbar .profile-chip-name {
    color: #0f172a !important;
    font-weight: 700;
}

:root[data-theme="light"] .topbar .navbar-toggler {
    border-color: rgba(15, 23, 42, 0.28) !important;
    background: rgba(255, 255, 255, 0.82) !important;
}

:root[data-theme="light"] .topbar .navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18) !important;
}

:root[data-theme="light"] .topbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2815,23,42,0.92%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.25' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

:root[data-theme="light"] .topbar .topbar-state-badge {
    font-weight: 800;
    border-width: 1px;
}

:root[data-theme="light"] .topbar .topbar-state-badge.is-good {
    color: #14532d !important;
    background: rgba(187, 247, 208, 0.92) !important;
    border-color: rgba(34, 197, 94, 0.52) !important;
}

:root[data-theme="light"] .topbar .topbar-state-badge.is-low {
    color: #7c2d12 !important;
    background: rgba(254, 215, 170, 0.92) !important;
    border-color: rgba(249, 115, 22, 0.56) !important;
}

:root[data-theme="light"] .topbar .topbar-state-badge.is-empty {
    color: #7f1d1d !important;
    background: rgba(254, 202, 202, 0.94) !important;
    border-color: rgba(239, 68, 68, 0.56) !important;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark {
    background: linear-gradient(180deg, #ffffff, #f8fafc) !important;
    border-color: var(--lt-border) !important;
    min-width: 16.5rem;
    max-width: min(92vw, 21rem);
    overflow: hidden;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark :is(.dropdown-item, .dropdown-header) {
    color: var(--lt-text) !important;
    box-sizing: border-box;
    max-width: calc(100% - 0.9rem);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item {
    margin-inline: 0.45rem !important;
    padding-inline: 0.65rem !important;
}

:root[data-theme="light"] .topbar :is(.topbar-credit-meta, .topbar-dropdown-meta) {
    color: #334155 !important;
    opacity: 1 !important;
    font-weight: 500;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item :is(small, .small, .text-muted, .muted) {
    color: #475569 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item:hover :is(small, .small, .text-muted, .muted),
:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item:focus-visible :is(small, .small, .text-muted, .muted) {
    color: #1e293b !important;
}

:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item:hover,
:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item:focus-visible,
:root[data-theme="light"] .topbar .dropdown-menu.dropdown-menu-dark .dropdown-item.active {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #0b1324 !important;
}

:root[data-theme="light"] :is(
    .content-card, .support-card, .ticket-item, .theme-card, .feature-card,
    .account-manage-nav-panel, .account-manage-subcard, .admin-section, .panel-topbar,
    .modal-content, .theme-builder-section, .theme-builder-layout-advanced .theme-builder-tabs-wrap,
    .theme-builder-layout-advanced .theme-builder-tab-content, .theme-builder-layout-advanced .accordion-item,
    .admin-users-section .user-manage-card, .admin-users-section .user-manage-panel, .admin-user-manage-modal .modal-content,
    .blog-post-card, .blog-content, .home-pricing-shortcut, .hero-copy-panel, .hero-preview-panel, .pricing-section-surface
) {
    background: linear-gradient(165deg, var(--lt-surface), var(--lt-surface-soft)) !important;
    border-color: var(--lt-border) !important;
    color: var(--lt-text) !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] :is(h1, h2, h3, h4, h5, h6) {
    color: var(--lt-heading) !important;
}

:root[data-theme="light"] :is(.text-muted, .text-secondary, .text-body-secondary, .text-body-tertiary, .muted, .small.text-muted, .form-text, .panel-topbar p) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.small, small) {
    color: #475569 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.blog-page, .dashboard-page, .admin-dashboard-page, .account-manage-content, .support-card, .ticket-item, .auth-card, .auth-brand-panel, .content-card, .panel-shell, .preview-panel, .home-pricing-shortcut, .blog-post-card, .blog-content) :is(.text-white, .text-white-50, .text-light, .text-light-emphasis) {
    color: #0f172a !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .public-page-content .card.border-0.shadow-sm {
    background: linear-gradient(165deg, #ffffff, #f8fbff) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
    color: #0f172a !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] .public-page-content .card.border-0.shadow-sm :is(h1, h2, h3, h4, h5, h6, p, li, .text-muted, .text-secondary, .text-white-50, .lead) {
    color: #0f172a !important;
}

:root[data-theme="light"] :is(
    .content-card,
    .support-card,
    .ticket-item,
    .theme-card,
    .feature-card,
    .account-manage-nav-panel,
    .account-manage-subcard,
    .admin-section,
    .panel-topbar,
    .modal-content,
    .theme-builder-section,
    .theme-builder-layout-advanced .theme-builder-tabs-wrap,
    .theme-builder-layout-advanced .theme-builder-tab-content,
    .theme-builder-layout-advanced .accordion-item,
    .admin-users-section .user-manage-card,
    .admin-users-section .user-manage-panel,
    .admin-user-manage-modal .modal-content,
    .blog-post-card,
    .blog-content,
    .home-pricing-shortcut,
    .hero-copy-panel,
    .hero-preview-panel,
    .pricing-section-surface
) :is(.text-muted, .text-secondary, .text-body-secondary, .text-body-tertiary, .form-text, .muted, .small, small, p, li, span) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .account-manage-nav-panel {
    background: linear-gradient(180deg, #ffffff, #f8fbff) !important;
    border-color: rgba(148, 163, 184, 0.36) !important;
    color: #0f172a !important;
}

:root[data-theme="light"] .account-manage-link {
    background: #f8fafc !important;
    border-color: rgba(148, 163, 184, 0.46) !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7) !important;
}

:root[data-theme="light"] .account-manage-link:hover,
:root[data-theme="light"] .account-manage-link:focus-visible {
    background: #e2e8f0 !important;
    border-color: rgba(100, 116, 139, 0.62) !important;
    color: #020617 !important;
}

:root[data-theme="light"] .account-manage-link.active {
    background: linear-gradient(135deg, #1d4ed8, #0ea5e9) !important;
    border-color: rgba(29, 78, 216, 0.7) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.22) !important;
}

:root[data-theme="light"] .account-manage-link :is(.text-muted, .text-secondary, .small, small) {
    color: inherit !important;
}

/* Global light contrast guard: labels/chips/badges/buttons on pale surfaces */
:root[data-theme="light"] :is(.badge, .topbar-state-badge, .table-uniform-chip, .chip, .visual-effect-chip, .style-combo-chip) {
    color: var(--ui-badge-text) !important;
    border-color: var(--ui-badge-border) !important;
}

:root[data-theme="light"] :is(.btn, .btn-action):disabled,
:root[data-theme="light"] :is(.btn, .btn-action).disabled {
    color: #475569 !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
    background: rgba(248, 250, 252, 0.98) !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.stat-label, .dashboard-summary-label, .table-uniform-title, .section-subtitle-wide) {
    color: #334155 !important;
    opacity: 1 !important;
}

/* Global light-theme label contrast baseline */
:root[data-theme="light"] :is(
    label,
    .form-label,
    .col-form-label,
    .form-check-label,
    legend,
    .form-floating > label
) {
    color: #0f172a !important;
    opacity: 1 !important;
    font-weight: 600;
}

:root[data-theme="light"] :is(
    label.text-muted,
    .form-label.text-muted,
    .col-form-label.text-muted,
    .form-check-label.text-muted,
    legend.text-muted,
    .form-floating > label.text-muted
) {
    color: #334155 !important;
}

:root[data-theme="light"] :is(
    .content-card .form-text,
    .panel-shell .form-text,
    .auth-card .form-text,
    .auth-brand-panel .form-text,
    .admin-dashboard-page .form-text,
    .account-manage-content .form-text,
    .support-card .form-text,
    .ticket-item .form-text,
    .response-form .form-text,
    .content-card .text-light-emphasis,
    .panel-shell .text-light-emphasis,
    .auth-card .text-light-emphasis,
    .auth-brand-panel .text-light-emphasis,
    .admin-dashboard-page .text-light-emphasis,
    .account-manage-content .text-light-emphasis,
    .support-card .text-light-emphasis,
    .ticket-item .text-light-emphasis,
    .response-form .text-light-emphasis,
    .content-card .text-secondary,
    .panel-shell .text-secondary,
    .auth-card .text-secondary,
    .auth-brand-panel .text-secondary,
    .admin-dashboard-page .text-secondary,
    .account-manage-content .text-secondary,
    .support-card .text-secondary,
    .ticket-item .text-secondary,
    .response-form .text-secondary
) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.kpi-card span, .admin-kpi-card span, .dashboard-summary-label, .section-subtitle-wide, .pricing-page-subtitle) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.kpi-card strong, .admin-kpi-card strong) {
    color: #0f172a !important;
}

:root[data-theme="light"] :is(.auth-card, .auth-brand-panel) {
    background: linear-gradient(165deg, #ffffff, #f8fbff) !important;
    border-color: rgba(100, 116, 139, 0.3) !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

:root[data-theme="light"] .auth-brand-panel :is(h1, h2, h3, p, li, .text-muted, .text-secondary, .text-white-50, .small) {
    color: #1e293b !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .blog-page .panel-topbar,
:root[data-theme="light"] .blog-page .blog-post-card,
:root[data-theme="light"] .blog-page .blog-content {
    color: #0f172a !important;
}

:root[data-theme="light"] .blog-page .blog-post-card {
    overflow: hidden;
}

:root[data-theme="light"] .blog-page .blog-post-card :is(.card-body, .card-footer) {
    background: transparent !important;
}

:root[data-theme="light"] .blog-page .blog-post-card :is(h2, p, .small, .text-muted, .text-secondary) {
    color: #0f172a !important;
}

:root[data-theme="light"] .blog-page .blog-post-card .badge.text-bg-light {
    color: #0f172a !important;
    background: #e2e8f0 !important;
    border: 1px solid rgba(100, 116, 139, 0.28) !important;
}

:root[data-theme="light"] .blog-page .blog-content {
    background: linear-gradient(165deg, #ffffff, #f8fbff) !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    border-radius: 1rem;
    padding: 1.25rem 1.15rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] .blog-page .blog-content :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, figcaption) {
    color: #0f172a !important;
}

:root[data-theme="light"] .blog-page .blog-content :is(p, li, blockquote) {
    line-height: 2;
}

:root[data-theme="light"] .blog-page .blog-content a {
    color: #1d4ed8 !important;
}

:root[data-theme="light"] .blog-page .blog-content :is(code, pre) {
    color: #dbeafe !important;
    background: #0b1731 !important;
    border-color: rgba(56, 189, 248, 0.18) !important;
}

:root[data-theme="light"] .home-pricing-shortcut {
    background:
        radial-gradient(circle at 12% 14%, rgba(37, 99, 235, 0.08), transparent 44%),
        linear-gradient(165deg, #ffffff, #f8fbff) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
}

:root[data-theme="light"] .home-pricing-shortcut :is(h2, p, .text-white, .text-white-50) {
    color: #0f172a !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .home-pricing-shortcut .badge {
    color: #0f172a !important;
}

:root[data-theme="light"] .hero-copy-panel,
:root[data-theme="light"] .hero-preview-panel {
    color: #0f172a !important;
}

:root[data-theme="light"] .hero-copy-panel :is(h1, p, .chip, .text-white, .text-white-50) {
    color: #0f172a !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .hero-preview-panel {
    background: linear-gradient(165deg, #ffffff, #f8fbff) !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

:root[data-theme="light"] .hero-preview-panel :is(h3, p, code, pre) {
    color: #0f172a !important;
}

:root[data-theme="light"] .hero-preview-panel pre {
    background: #0b1731 !important;
    border-color: rgba(56, 189, 248, 0.18) !important;
}

:root[data-theme="light"] .hero-preview-panel p {
    color: #334155 !important;
}

:root[data-theme="light"] .auth-card .auth-method-tab {
    background: #eef2ff !important;
    color: #1e3a8a !important;
    border-color: rgba(37, 99, 235, 0.36) !important;
}

:root[data-theme="light"] .auth-card .auth-method-tab.active {
    background: linear-gradient(135deg, #1d4ed8, #06b6d4) !important;
    color: #ffffff !important;
}

:root[data-theme="light"] .auth-card .auth-alt-login-btn,
:root[data-theme="light"] .auth-links a {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: rgba(100, 116, 139, 0.34) !important;
}

:root[data-theme="light"] .auth-provider-mark {
    background: linear-gradient(135deg, #ffffff, #f8fafc) !important;
    border-color: rgba(100, 116, 139, 0.26) !important;
}

:root[data-theme="light"] .auth-provider-mark-github {
    background: linear-gradient(135deg, #111827, #334155) !important;
}

:root[data-theme="light"] .auth-provider-name {
    color: #0f172a !important;
}

:root[data-theme="light"] .auth-provider-subtitle {
    color: #475569 !important;
}

:root[data-theme="light"] .auth-card .auth-alt-login-btn:hover,
:root[data-theme="light"] .auth-card .auth-alt-login-btn:focus-visible,
:root[data-theme="light"] .auth-links a:hover,
:root[data-theme="light"] .auth-links a:focus-visible {
    background: #e2e8f0 !important;
    color: #0b1324 !important;
}

:root[data-theme="light"] .release-notes-page .release-note-item {
    background: #f8fbff !important;
    border-color: rgba(100, 116, 139, 0.3) !important;
}

:root[data-theme="light"] .release-notes-page .release-note-item p {
    color: #1e293b !important;
}

:root[data-theme="light"] :is(
    .dashboard-collapsible-summary h2, .dashboard-collapsible-summary h3,
    .admin-collapsible-summary h2, .admin-collapsible-summary h3,
    .dashboard-summary-label, .table-uniform-title
) {
    color: #0b1324 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(
    .admin-collapsible-summary::after,
    .dashboard-collapsible-summary::after,
    .wheel-card-details-block > summary::after,
    .wheel-card-subdetails > summary::after,
    .wheel-preview-block > summary::after,
    .editor-note-group > summary::after,
    .editor-live-preview > summary::after,
    .editor-form-group > summary::after,
    .editor-picker-card > summary::after,
    .admin-user-mobile-more > summary::after
) {
    color: #0f172a !important;
    background: #dbeafe !important;
    border-color: rgba(37, 99, 235, 0.58) !important;
}

:root[data-theme="light"] :is(
    details[open] > .admin-collapsible-summary::after,
    details[open] > .dashboard-collapsible-summary::after
) {
    color: #ffffff !important;
    background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
    border-color: rgba(29, 78, 216, 0.82) !important;
    box-shadow: 0 0 0 2px rgba(191, 219, 254, 0.8) !important;
}

:root[data-theme="light"] :is(.dashboard-page .report-filter-grid > div, .admin-dashboard-page .report-filter-grid > div, .admin-users-section .admin-user-filters > div) {
    background: linear-gradient(165deg, #e2e8f0, #cbd5e1) !important;
    border-color: rgba(100, 116, 139, 0.48) !important;
}

:root[data-theme="light"] :is(.dashboard-page .report-filter-grid .form-label, .admin-dashboard-page .report-filter-grid .form-label, .admin-users-section .admin-user-filters .form-label) {
    color: #0f172a !important;
    font-weight: 700 !important;
}

:root[data-theme="light"] :is(.dashboard-page .report-filter-grid .form-control, .dashboard-page .report-filter-grid .form-select, .admin-dashboard-page .report-filter-grid .form-control, .admin-dashboard-page .report-filter-grid .form-select, .admin-users-section .admin-user-filters .form-control, .admin-users-section .admin-user-filters .form-select) {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: rgba(71, 85, 105, 0.44) !important;
}

:root[data-theme="light"] .theme-note {
    background: linear-gradient(165deg, #e2e8f0, #cbd5e1) !important;
    border-color: rgba(100, 116, 139, 0.48) !important;
}

:root[data-theme="light"] .editor-side-note-head h3,
:root[data-theme="light"] .editor-side-note-head p,
:root[data-theme="light"] .theme-note li,
:root[data-theme="light"] .theme-note li strong {
    color: #0f172a !important;
}

:root[data-theme="light"] .editor-note-group {
    background: #f8fafc !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
}

:root[data-theme="light"] .editor-note-group > summary {
    color: #1e293b !important;
    background: #e2e8f0 !important;
}

:root[data-theme="light"] :is(
    .content-card,
    .panel-shell,
    .support-card,
    .ticket-item,
    .response-form,
    .editor-form-group,
    .editor-picker-card,
    .editor-note-group,
    .editor-live-preview,
    .theme-note,
    .theme-builder-layout-advanced .accordion-item,
    .theme-builder-layout-advanced .theme-builder-tabs-wrap,
    .theme-builder-layout-advanced .theme-builder-tab-content
) {
    color: #0f172a !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
}

:root[data-theme="light"] :is(
    .content-card,
    .panel-shell,
    .support-card,
    .ticket-item,
    .response-form,
    .editor-form-group,
    .editor-picker-card,
    .editor-note-group,
    .editor-live-preview,
    .theme-note
) :is(.form-text, .text-muted, .muted, .text-secondary, .text-light-emphasis, small) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(
    .editor-form-group > summary,
    .editor-picker-card > summary,
    .editor-note-group > summary,
    .editor-live-preview > summary,
    .theme-builder-layout-advanced .accordion-button
) {
    color: #0f172a !important;
    background: #e2e8f0 !important;
}

/* Keep theme-builder section/accordion headings readable in light mode */
:root[data-theme="light"] .theme-builder-layout-advanced .accordion {
    --bs-accordion-btn-color: #0f172a;
    --bs-accordion-active-color: #0b1324;
    --bs-accordion-color: #0f172a;
}

:root[data-theme="light"] .theme-builder-layout-advanced :is(.accordion-button, .accordion-button:not(.collapsed), .accordion-button span) {
    color: #0f172a !important;
    opacity: 1 !important;
    font-weight: 700;
}

:root[data-theme="light"] .theme-builder-layout-advanced .accordion-button::after {
    opacity: 0.9;
}

:root[data-theme="light"] :is(.theme-builder-section-head h3, .theme-builder-section-head p) {
    color: #1e293b !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.chip, .visual-effect-chip, .style-combo-chip, .theme-builder-badge, .theme-builder-value-note) {
    color: #334155 !important;
    background: #e2e8f0 !important;
    border-color: rgba(100, 116, 139, 0.4) !important;
}

:root[data-theme="light"] :is(
    .chip:has(input:checked),
    .visual-effect-chip:has(input:checked),
    .style-combo-chip:has(input:checked),
    .theme-palette-preset.is-active
) {
    color: #082f49 !important;
    background: #bae6fd !important;
    border-color: rgba(14, 116, 144, 0.58) !important;
}

:root[data-theme="light"] :is(
    .form-control, .form-select,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
    textarea, select
) {
    background: #ffffff !important;
    color: var(--lt-text) !important;
    border-color: rgba(15, 23, 42, 0.2) !important;
}

:root[data-theme="light"] :is(.form-control::placeholder, input::placeholder, textarea::placeholder) {
    color: #475569 !important;
    opacity: 1 !important;
    font-style: normal;
    text-overflow: ellipsis;
}

:root[data-theme="light"] :is(.form-control, .form-select, textarea, input)::placeholder {
    color: #475569 !important;
    opacity: 1 !important;
    font-style: normal;
    text-overflow: ellipsis;
}

:root[data-theme="light"] :is(.form-control, .form-select, textarea, input):-ms-input-placeholder {
    color: #64748b !important;
}

:root[data-theme="light"] :is(.form-control, .form-select, textarea, input)::-ms-input-placeholder {
    color: #475569 !important;
}

:root[data-theme="light"] :is(
    .form-control,
    .form-select,
    textarea,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"])
) {
    line-height: 1.5;
    background-clip: padding-box;
}

:root[data-theme="light"] :is(
    .form-control.form-control-sm,
    .form-select.form-select-sm,
    textarea.form-control-sm,
    input.form-control-sm:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"])
) {
    min-height: calc(1.5em + 0.75rem + 2px);
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
}

/* Final readable form contrast for all admin/dashboard surfaces in light theme */
:root[data-theme="light"] :is(.admin-dashboard-page, .dashboard-page, .account-manage-content, .editor-form) :is(
    .form-control::placeholder,
    input::placeholder,
    textarea::placeholder
) {
    color: #475569 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.admin-dashboard-page, .dashboard-page, .account-manage-content, .editor-form) :is(
    .form-text,
    .small,
    .small.text-muted,
    .text-muted,
    .text-secondary,
    .text-light-emphasis
) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.admin-dashboard-page, .dashboard-page, .account-manage-content, .editor-form) :is(h5, h6) {
    color: #0f172a !important;
}

:root[data-theme="light"] :is(.form-control, .form-select, textarea, input):focus {
    border-color: rgba(37, 99, 235, 0.55) !important;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.14) !important;
}

:root[data-theme="light"] .table.table-admin-unified thead th,
:root[data-theme="light"] .table thead th {
    background: rgba(15, 23, 42, 0.94) !important;
    color: #67e8f9 !important;
    border-bottom-color: rgba(37, 99, 235, 0.28) !important;
}

:root[data-theme="light"] .table.table-admin-unified tbody td,
:root[data-theme="light"] .table tbody td {
    color: var(--lt-text) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
}

:root[data-theme="light"] .table.table-admin-unified tbody tr:nth-child(odd) td,
:root[data-theme="light"] .table tbody tr:nth-child(odd) td {
    background: rgba(248, 250, 252, 0.98) !important;
}

:root[data-theme="light"] .table.table-admin-unified tbody tr:nth-child(even) td,
:root[data-theme="light"] .table tbody tr:nth-child(even) td {
    background: rgba(241, 245, 249, 0.96) !important;
}

:root[data-theme="light"] .table tbody tr:hover td {
    background: rgba(219, 234, 254, 0.9) !important;
}

:root[data-theme="light"] .table-uniform-meta {
    background: linear-gradient(165deg, #f8fbff, #eaf2ff) !important;
    border-color: rgba(100, 116, 139, 0.38) !important;
}

:root[data-theme="light"] .table-uniform-title {
    color: #334155 !important;
}

:root[data-theme="light"] .table-uniform-chip {
    color: #0f172a !important;
    background: #dbeafe !important;
    border-color: rgba(59, 130, 246, 0.44) !important;
}

:root[data-theme="light"] .footer-shell {
    background: rgba(255, 255, 255, 0.82) !important;
    border-top-color: var(--lt-border) !important;
}

:root[data-theme="light"] .footer-shell :is(a, span, strong, small) {
    color: var(--lt-text) !important;
}

:root[data-theme="light"] :is(.btn-outline-light, .btn-close-white) {
    color: #0f172a !important;
    border-color: rgba(30, 41, 59, 0.28) !important;
}

:root[data-theme="light"] .btn-outline-light:hover,
:root[data-theme="light"] .btn-outline-light:focus-visible {
    color: #0b1324 !important;
    background: rgba(30, 64, 175, 0.12) !important;
    border-color: rgba(37, 99, 235, 0.5) !important;
}

:root[data-theme="light"] .btn-close-white {
    filter: none !important;
    opacity: 0.75 !important;
}

:root[data-theme="light"] .btn-close-white:hover,
:root[data-theme="light"] .btn-close-white:focus-visible {
    opacity: 1 !important;
}

:root[data-theme="light"] .btn-outline-info {
    color: #0c4a6e !important;
    border-color: rgba(8, 145, 178, 0.52) !important;
    background: #f0f9ff !important;
}

:root[data-theme="light"] .btn-outline-info:hover,
:root[data-theme="light"] .btn-outline-info:focus-visible,
:root[data-theme="light"] .btn-outline-info.active {
    color: #082f49 !important;
    border-color: rgba(3, 105, 161, 0.62) !important;
    background: #bae6fd !important;
}

:root[data-theme="light"] .btn-outline-warning {
    color: #854d0e !important;
    border-color: rgba(202, 138, 4, 0.56) !important;
    background: #fffbeb !important;
}

:root[data-theme="light"] .btn-outline-warning:hover,
:root[data-theme="light"] .btn-outline-warning:focus-visible,
:root[data-theme="light"] .btn-outline-warning.active {
    color: #713f12 !important;
    border-color: rgba(161, 98, 7, 0.66) !important;
    background: #fef08a !important;
}

:root[data-theme="light"] .btn-outline-secondary {
    color: #334155 !important;
    border-color: rgba(100, 116, 139, 0.48) !important;
    background: #f8fafc !important;
}

:root[data-theme="light"] .btn-outline-secondary:hover,
:root[data-theme="light"] .btn-outline-secondary:focus-visible,
:root[data-theme="light"] .btn-outline-secondary.active {
    color: #0f172a !important;
    border-color: rgba(71, 85, 105, 0.56) !important;
    background: #e2e8f0 !important;
}

:root[data-theme="light"] .btn-outline-primary {
    color: #1e3a8a !important;
    border-color: rgba(37, 99, 235, 0.52) !important;
    background: #eff6ff !important;
}

:root[data-theme="light"] .btn-outline-primary:hover,
:root[data-theme="light"] .btn-outline-primary:focus-visible,
:root[data-theme="light"] .btn-outline-primary.active {
    color: #172554 !important;
    border-color: rgba(29, 78, 216, 0.62) !important;
    background: #bfdbfe !important;
}

:root[data-theme="light"] .btn-outline-success {
    color: #166534 !important;
    border-color: rgba(22, 163, 74, 0.52) !important;
    background: #f0fdf4 !important;
}

:root[data-theme="light"] .btn-outline-success:hover,
:root[data-theme="light"] .btn-outline-success:focus-visible,
:root[data-theme="light"] .btn-outline-success.active {
    color: #14532d !important;
    border-color: rgba(21, 128, 61, 0.62) !important;
    background: #bbf7d0 !important;
}

:root[data-theme="light"] .btn-outline-danger {
    color: #991b1b !important;
    border-color: rgba(220, 38, 38, 0.52) !important;
    background: #fef2f2 !important;
}

:root[data-theme="light"] .btn-outline-danger:hover,
:root[data-theme="light"] .btn-outline-danger:focus-visible,
:root[data-theme="light"] .btn-outline-danger.active {
    color: #7f1d1d !important;
    border-color: rgba(185, 28, 28, 0.62) !important;
    background: #fecaca !important;
}

/* Global topbar-action contrast on light surfaces */
:root[data-theme="light"] .panel-topbar :is(.btn-outline-light, .btn-outline-info) {
    font-weight: 700;
}

:root[data-theme="light"] .panel-topbar .btn-outline-light {
    color: #0f172a !important;
    background: #f8fafc !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
}

:root[data-theme="light"] .panel-topbar .btn-outline-light:hover,
:root[data-theme="light"] .panel-topbar .btn-outline-light:focus-visible {
    color: #020617 !important;
    background: #e2e8f0 !important;
    border-color: rgba(71, 85, 105, 0.58) !important;
}

:root[data-theme="light"] .panel-topbar .btn-outline-info {
    color: #0c4a6e !important;
    background: #f0f9ff !important;
    border-color: rgba(8, 145, 178, 0.46) !important;
}

:root[data-theme="light"] .panel-topbar :is(.text-white, .text-white-50, .text-light, .text-light-emphasis) {
    color: #0f172a !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .panel-topbar .btn-outline-info:hover,
:root[data-theme="light"] .panel-topbar .btn-outline-info:focus-visible {
    color: #082f49 !important;
    background: #bae6fd !important;
    border-color: rgba(3, 105, 161, 0.58) !important;
}

:root[data-theme="light"] :is(.btn-outline-info, .btn-outline-warning, .btn-outline-secondary, .btn-outline-primary, .btn-outline-success, .btn-outline-danger):disabled,
:root[data-theme="light"] :is(.btn-outline-info, .btn-outline-warning, .btn-outline-secondary, .btn-outline-primary, .btn-outline-success, .btn-outline-danger).disabled {
    color: #475569 !important;
    border-color: rgba(100, 116, 139, 0.34) !important;
    background: #e2e8f0 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.text-light, .text-light-emphasis) {
    color: #334155 !important;
}

:root[data-theme="light"] :is(.preview-panel, .embed-box, .snippet-panel) {
    background: linear-gradient(165deg, #f8fbff, #e8f1ff) !important;
    border-color: rgba(30, 41, 59, 0.16) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1) !important;
}

:root[data-theme="light"] :is(.preview-panel h3, .snippet-panel h2, .embed-label) {
    color: #0f172a !important;
}

:root[data-theme="light"] :is(.preview-panel p, .snippet-panel p, .embed-box .small, .embed-box .text-muted) {
    color: #334155 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.preview-panel pre, .embed-box pre, .snippet-box, .preview-panel code, .embed-box code) {
    background: #0b1731 !important;
    border: 1px solid rgba(56, 189, 248, 0.22) !important;
    color: #a5f3fc !important;
}

:root[data-theme="light"] :is(.bg-dark, .dropdown-menu-dark) {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
}

:root[data-theme="light"] .dropdown-menu-dark :is(.dropdown-item, .dropdown-header, .dropdown-divider) {
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
}

:root[data-theme="light"] .dropdown-menu-dark .dropdown-item:hover,
:root[data-theme="light"] .dropdown-menu-dark .dropdown-item:focus-visible,
:root[data-theme="light"] .dropdown-menu-dark .dropdown-item.active {
    background: rgba(37, 99, 235, 0.1) !important;
    color: #0b1324 !important;
}

:root[data-theme="light"] .notifications-page .notification-item {
    background: linear-gradient(165deg, #ffffff, #f5f9ff) !important;
    border-color: rgba(30, 41, 59, 0.16) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .notifications-page .notification-item.is-unread {
    border-color: rgba(14, 165, 233, 0.45) !important;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.1),
        0 0 0 1px rgba(14, 165, 233, 0.2) inset !important;
}

:root[data-theme="light"] .notifications-page .notification-item.is-read {
    opacity: 1 !important;
}

:root[data-theme="light"] .notifications-page :is(.text-muted, .notification-meta, small) {
    color: #475569 !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .notifications-page :is(.text-light, .notification-title, .notification-body) {
    color: #0f172a !important;
}

:root[data-theme="light"] .notifications-page :is(.btn-outline-info, .btn-info) {
    border-color: rgba(14, 116, 144, 0.4) !important;
}

:root[data-theme="light"] .notifications-page .btn-outline-info {
    color: #0c4a6e !important;
    background: #f0f9ff !important;
}

:root[data-theme="light"] .notifications-page .btn-outline-info.active,
:root[data-theme="light"] .notifications-page .btn-outline-info:hover,
:root[data-theme="light"] .notifications-page .btn-outline-info:focus-visible {
    color: #082f49 !important;
    background: #bae6fd !important;
    border-color: rgba(2, 132, 199, 0.52) !important;
}

:root[data-theme="light"] .notifications-page .btn-info {
    color: #083344 !important;
    background: #67e8f9 !important;
}

:root[data-theme="light"] .notifications-page .btn-info:disabled {
    color: #334155 !important;
    background: #cbd5e1 !important;
    border-color: rgba(71, 85, 105, 0.42) !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn {
    font-weight: 700;
}

:root[data-theme="light"] .notifications-page .notification-item .btn.btn-outline-info {
    color: #0c4a6e !important;
    background: #e0f2fe !important;
    border-color: rgba(8, 145, 178, 0.48) !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn.btn-outline-info:hover,
:root[data-theme="light"] .notifications-page .notification-item .btn.btn-outline-info:focus-visible {
    color: #082f49 !important;
    background: #bae6fd !important;
    border-color: rgba(3, 105, 161, 0.58) !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn.btn-outline-info:disabled {
    color: #475569 !important;
    background: #dbeafe !important;
    border-color: rgba(100, 116, 139, 0.36) !important;
    opacity: 1 !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn-action {
    color: #0f172a !important;
    background: #e2e8f0 !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
    text-decoration: none;
}

:root[data-theme="light"] .notifications-page .notification-item .btn-action:hover,
:root[data-theme="light"] .notifications-page .notification-item .btn-action:focus-visible {
    color: #020617 !important;
    background: #cbd5e1 !important;
    border-color: rgba(71, 85, 105, 0.52) !important;
    transform: none !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn-action.primary {
    color: #0b3b5a !important;
    background: linear-gradient(135deg, #bae6fd, #bfdbfe) !important;
    border-color: rgba(14, 116, 144, 0.42) !important;
}

:root[data-theme="light"] .notifications-page .notification-item .btn-action.primary:hover,
:root[data-theme="light"] .notifications-page .notification-item .btn-action.primary:focus-visible {
    color: #082f49 !important;
    background: linear-gradient(135deg, #7dd3fc, #93c5fd) !important;
    border-color: rgba(3, 105, 161, 0.58) !important;
}

/* Pricing pages (light theme only) */
:root[data-theme="light"] .pricing-hero-section {
    background:
        radial-gradient(circle at 12% 14%, rgba(37, 99, 235, 0.12), transparent 44%),
        radial-gradient(circle at 88% 18%, rgba(14, 165, 233, 0.12), transparent 42%),
        linear-gradient(165deg, #eff6ff, #dbeafe) !important;
}

:root[data-theme="light"] .pricing-hero-section :is(h1, p, .lead) {
    color: #0f172a !important;
}

:root[data-theme="light"] .pricing-section-surface {
    background:
        radial-gradient(circle at 10% 10%, rgba(37, 99, 235, 0.08), transparent 42%),
        linear-gradient(170deg, #eef4ff, #dbeafe) !important;
}

:root[data-theme="light"] :is(.home-pricing-card, .pricing-card):not(.promo-special):not(.promo-discount):not(.free-plan) {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

:root[data-theme="light"] :is(.home-pricing-card, .pricing-card) :is(.text-dark, .text-secondary, .text-muted, .fw-medium) {
    color: #1e293b !important;
    opacity: 1 !important;
}

:root[data-theme="light"] :is(.home-pricing-card, .pricing-card).promo-discount {
    background: linear-gradient(165deg, #eff6ff, #dbeafe) !important;
    border-color: rgba(37, 99, 235, 0.28) !important;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14) !important;
}

:root[data-theme="light"] :is(.home-pricing-card, .pricing-card).promo-special {
    background: linear-gradient(165deg, #fef3c7, #fde68a) !important;
    border-color: rgba(245, 158, 11, 0.34) !important;
    box-shadow: 0 14px 28px rgba(245, 158, 11, 0.17) !important;
}

:root[data-theme="light"] :is(.home-pricing-card, .pricing-card).free-plan {
    background: linear-gradient(165deg, #ecfdf5, #d1fae5) !important;
    border-color: rgba(16, 185, 129, 0.32) !important;
    box-shadow: 0 14px 28px rgba(5, 150, 105, 0.14) !important;
}

/* Theme preset cards should follow light surfaces too */
:root[data-theme="light"] :is(.dashboard-page, .admin-dashboard-page) .theme-preset-card {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34%),
        linear-gradient(165deg, #ffffff, #f1f5f9) !important;
    border-color: rgba(100, 116, 139, 0.32) !important;
    color: #0f172a !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1) !important;
}

:root[data-theme="light"] :is(.dashboard-page, .admin-dashboard-page) .theme-preset-card::after {
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.55), transparent) !important;
    opacity: 0.85;
}

:root[data-theme="light"] :is(.dashboard-page, .admin-dashboard-page) .theme-preset-card :is(h3, p, strong, span, small) {
    color: #0f172a !important;
}

:root[data-theme="light"] :is(.dashboard-page, .admin-dashboard-page) .theme-preset-card :is(.tag, .theme-swatch) {
    color: #1e293b !important;
    background: #e2e8f0 !important;
    border-color: rgba(100, 116, 139, 0.42) !important;
}

:root[data-theme="light"] :is(.dashboard-page, .admin-dashboard-page) .theme-preset-mini-preview {
    background: #eaf2ff !important;
    border-color: rgba(100, 116, 139, 0.3) !important;
}
