:root{color-scheme:light;--theme-bg:#fff;--theme-surface:#fff;--theme-soft:#f3f7fb;--theme-text:#1e293b;--theme-muted:#64748b;--theme-line:#dbe4ee}
html[data-theme=dark]{color-scheme:dark;--theme-bg:#08131f;--theme-surface:#102235;--theme-soft:#0c1b2a;--theme-text:#eaf3f8;--theme-muted:#a9bdca;--theme-line:#29445a}
html[data-theme=dark] body{background:var(--theme-bg)!important;color:var(--theme-text)!important}
html[data-theme=dark] .site-header,html[data-theme=dark] .workspace-header,html[data-theme=dark] .workspace-footer,html[data-theme=dark] .settings-header{background:#0d1d2c!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme=dark] .section,html[data-theme=dark] .settings-workspace,html[data-theme=dark] .cloud-main,html[data-theme=dark] .account-workspace{background:var(--theme-bg)!important;color:var(--theme-text)!important}
html[data-theme=dark] .section.soft,html[data-theme=dark] .hero,html[data-theme=dark] .notice{background:var(--theme-soft)!important}
html[data-theme=dark] .card,html[data-theme=dark] .form-card,html[data-theme=dark] .settings-panel,html[data-theme=dark] .setting-card,html[data-theme=dark] .payment-box,html[data-theme=dark] .auth-box{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme=dark] h1,html[data-theme=dark] h2,html[data-theme=dark] h3,html[data-theme=dark] strong,html[data-theme=dark] .main-nav a{color:var(--theme-text)!important}
html[data-theme=dark] p,html[data-theme=dark] .muted,html[data-theme=dark] small,html[data-theme=dark] .lead{color:var(--theme-muted)}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:#091724!important;color:var(--theme-text)!important;border-color:#38556c!important}
html[data-theme=dark] table{background:var(--theme-surface)!important;color:var(--theme-text)!important}html[data-theme=dark] th,html[data-theme=dark] td{border-color:var(--theme-line)!important}
html[data-theme=dark] .btn.secondary{background:#132a3d!important;color:#eaf3f8!important;border-color:#38556c!important}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:42px;padding:8px 12px;border:1px solid var(--line,#dbe4ee);border-radius:12px;background:var(--theme-surface);color:var(--theme-text);font:inherit;font-weight:800;cursor:pointer;white-space:nowrap}.theme-toggle:hover{border-color:#4e9bbb}.theme-toggle-icon{font-size:1.05rem}.main-nav{gap:clamp(10px,1.4vw,22px)}.main-nav .theme-toggle span:last-child{display:none}
.header-theme-toggle{position:static!important;right:auto!important;bottom:auto!important;z-index:auto!important;margin-left:auto;flex:0 0 auto}.workspace-header .header-theme-toggle span:last-child,.settings-header .header-theme-toggle span:last-child,.account-header .header-theme-toggle span:last-child{display:none}
@media(prefers-color-scheme:dark){html:not([data-theme=light]){color-scheme:dark}html:not([data-theme=light]) body{background:#08131f;color:#eaf3f8}html:not([data-theme=light]) .site-header,html:not([data-theme=light]) .workspace-header,html:not([data-theme=light]) .workspace-footer,html:not([data-theme=light]) .settings-header{background:#0d1d2c;border-color:#29445a;color:#eaf3f8}html:not([data-theme=light]) .card,html:not([data-theme=light]) .settings-panel,html:not([data-theme=light]) .setting-card,html:not([data-theme=light]) .payment-box{background:#102235;border-color:#29445a;color:#eaf3f8}html:not([data-theme=light]) h1,html:not([data-theme=light]) h2,html:not([data-theme=light]) h3,html:not([data-theme=light]) .main-nav a{color:#eaf3f8}html:not([data-theme=light]) input,html:not([data-theme=light]) select,html:not([data-theme=light]) textarea{background:#091724;color:#eaf3f8;border-color:#38556c}}
@media(max-width:900px){.main-nav .theme-toggle{width:100%}.main-nav .theme-toggle span:last-child{display:inline}}

/* Contrast and branding fixes. Keep this section last so page-level styles cannot override it. */
.footer-grid{grid-template-columns:1.5fr repeat(2,minmax(0,1fr))}
html[data-theme=dark] .brand img{filter:brightness(0) invert(1);opacity:1}
html[data-theme=dark] .package-hero,html[data-theme=dark] .knowledge-hero{background:var(--theme-soft)!important;color:var(--theme-text)!important}
html[data-theme=dark] .package-card,html[data-theme=dark] .comparison table,html[data-theme=dark] .knowledge-card,html[data-theme=dark] .article-card{background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-text)!important}
html[data-theme=dark] .package-card h2,html[data-theme=dark] .package-card h3,html[data-theme=dark] .package-card li,html[data-theme=dark] .package-price strong,html[data-theme=dark] .package-hero h1,html[data-theme=dark] .knowledge-hero h1,html[data-theme=dark] .knowledge-hero h2{color:var(--theme-text)!important}
html[data-theme=dark] .package-card p,html[data-theme=dark] .package-price,html[data-theme=dark] .package-hero p,html[data-theme=dark] .knowledge-hero p{color:var(--theme-muted)!important}
html[data-theme=dark] .billing-tabs button{background:var(--theme-surface)!important;color:var(--theme-text)!important;border-color:var(--theme-line)!important}
html[data-theme=dark] .billing-tabs button.active{background:#4e9bbb!important;color:#fff!important}
html[data-theme=dark] .comparison th,html[data-theme=dark] .comparison td{color:var(--theme-text)!important;border-color:var(--theme-line)!important}
html[data-theme=dark] .knowledge-filter,html[data-theme=dark] .knowledge-tools{color:var(--theme-text)!important}
@media(prefers-color-scheme:dark){
 html:not([data-theme=light]) .brand img{filter:brightness(0) invert(1);opacity:1}
 html:not([data-theme=light]) .package-hero,html:not([data-theme=light]) .knowledge-hero{background:#0c1b2a!important;color:#eaf3f8!important}
 html:not([data-theme=light]) .package-card,html:not([data-theme=light]) .comparison table,html:not([data-theme=light]) .knowledge-card,html:not([data-theme=light]) .article-card{background:#102235!important;border-color:#29445a!important;color:#eaf3f8!important}
 html:not([data-theme=light]) .package-card h2,html:not([data-theme=light]) .package-card h3,html:not([data-theme=light]) .package-card li,html:not([data-theme=light]) .package-price strong,html:not([data-theme=light]) .package-hero h1,html:not([data-theme=light]) .knowledge-hero h1,html:not([data-theme=light]) .knowledge-hero h2{color:#eaf3f8!important}
 html:not([data-theme=light]) .package-card p,html:not([data-theme=light]) .package-price,html:not([data-theme=light]) .package-hero p,html:not([data-theme=light]) .knowledge-hero p{color:#a9bdca!important}
 html:not([data-theme=light]) .billing-tabs button{background:#102235!important;color:#eaf3f8!important;border-color:#29445a!important}
 html:not([data-theme=light]) .billing-tabs button.active{background:#4e9bbb!important;color:#fff!important}
}
@media(max-width:900px){.footer-grid{grid-template-columns:1fr 1fr}}
@media(max-width:640px){.footer-grid{grid-template-columns:1fr}}

/* Cloud workspace contrast: component styles must not leave white panels with pale text. */
html[data-theme=dark] .cloud-main .form-grid,html[data-theme=dark] .cloud-main .import-panel,html[data-theme=dark] .cloud-main #imageForm,html[data-theme=dark] .cloud-main .table-wrap,html[data-theme=dark] .cloud-main .image-card,html[data-theme=dark] .cloud-main .image-preview{background:#102235!important;border-color:#35536b!important;color:#f4f9fc!important}
html[data-theme=dark] .cloud-main .form-grid h1,html[data-theme=dark] .cloud-main .form-grid h2,html[data-theme=dark] .cloud-main .form-grid h3,html[data-theme=dark] .cloud-main .form-grid label,html[data-theme=dark] .cloud-main .import-panel h3{color:#f4f9fc!important}
html[data-theme=dark] .cloud-main .form-grid p,html[data-theme=dark] .cloud-main .form-grid .muted,html[data-theme=dark] .cloud-main .import-panel p{color:#b8cad6!important}
html[data-theme=dark] .cloud-main th{background:#19364a!important;color:#f4f9fc!important}
html[data-theme=dark] .cloud-main td{color:#eaf3f8!important}
html[data-theme=dark] .settings-panel .help,html[data-theme=dark] .settings-title p,html[data-theme=dark] .settings-intro p{color:#bfd0dc!important}
@media(prefers-color-scheme:dark){html:not([data-theme=light]) .cloud-main .form-grid,html:not([data-theme=light]) .cloud-main .import-panel,html:not([data-theme=light]) .cloud-main #imageForm,html:not([data-theme=light]) .cloud-main .table-wrap,html:not([data-theme=light]) .cloud-main .image-card,html:not([data-theme=light]) .cloud-main .image-preview{background:#102235!important;border-color:#35536b!important;color:#f4f9fc!important}html:not([data-theme=light]) .cloud-main .form-grid h1,html:not([data-theme=light]) .cloud-main .form-grid h2,html:not([data-theme=light]) .cloud-main .form-grid h3,html:not([data-theme=light]) .cloud-main .form-grid label{color:#f4f9fc!important}html:not([data-theme=light]) .cloud-main .form-grid p,html:not([data-theme=light]) .cloud-main .form-grid .muted{color:#b8cad6!important}html:not([data-theme=light]) .cloud-main th{background:#19364a!important;color:#f4f9fc!important}html:not([data-theme=light]) .cloud-main td{color:#eaf3f8!important}}
@media(max-width:680px){.header-theme-toggle{min-width:44px;padding:8px}.header-theme-toggle span:last-child{display:none!important}}
