.theme-toggle{display:inline-grid;place-items:center;width:32px;min-height:32px;padding:5px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--muted)}
.theme-toggle svg{width:19px;height:19px;display:block}
html[data-theme="dark"]{color-scheme:dark;--accent:#8eb8ff;--accent-dark:#6495ec;--accent-soft:#223754;--line:#39465b;--muted:#b4c0d2;--surface:#1b2433;--danger:#ffb2b8;--warning:#f4cc84;color:#e7edf6;background:#101722}
html[data-theme="dark"] body{background:#101722;color:#e7edf6}
html[data-theme="dark"] button{background:#356dbb;color:#fff}
html[data-theme="dark"] .text-button{background:transparent}
html[data-theme="dark"] :is(h1,h2,h3,h4,label,strong,summary,.brand-title h1,.user-account-details strong,.current-plan-title-block strong,.meta-box-value,.usage-bar-labels,.plan-price,.plan-features,.meta-val){color:#e7edf6}
html[data-theme="dark"] :is(p,small,.note,.workflow-hint,.hero-tagline,.plans-user-email,.meta-label,.meta-box-label,.header-plan-name,.header-quota-label,.splash-text,.ai-credit-help summary,.section-heading p){color:var(--muted)}
html[data-theme="dark"] :is(a,.text-button,.eyebrow){color:#9dc1ff}
html[data-theme="dark"] :is(input,textarea,select){background:#141d2b;color:#e7edf6;border-color:var(--line)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#929fb2}
html[data-theme="dark"] label{color:#e7edf6!important}
html[data-theme="dark"] :is(#searchFilters,#writingOptions) summary{color:#c9d5e6}
html[data-theme="dark"] :is(.view-screen,.app-splash-loader){background:#101722}
html[data-theme="dark"] :is(dialog,.app-dialog,.app-dialog-card,.welcome-feature-card,.plans-user-account-card,.current-plan-card,.plan-card,.source-card,.tool-panel,.result-card,.source-strip,.progress-panel,details,#research,#argumentSection){background:var(--surface);color:#e7edf6;border-color:var(--line)}
html[data-theme="dark"] dialog::backdrop{background:rgba(0,0,0,.65)}
html[data-theme="dark"] :is(.status-bar,#sharedAiSelector,#searchFilters,#writingOptions,.tabs,.auth-tabs,.meta-box,.clean-refs-check,.case-tools,.output){background:#202c3e;color:#c9d5e6;border-color:var(--line)}
html[data-theme="dark"] .ai-credit-help{background:transparent}
html[data-theme="dark"] :is(.secondary,.icon-button,.help-button,.user-profile-button,.google-sign-in-btn,.toolbar-btn,.theme-toggle,#argCopyBtn,#copyAnswerArg,#copyAnswerDraft){background:#25344b;color:#d5e4ff;border-color:#455c7a}
html[data-theme="dark"] :is(.secondary,.icon-button,.help-button,.user-profile-button,.toolbar-btn,.theme-toggle):hover{background:#304360;color:#fff}
html[data-theme="dark"] .source-card-toolbar .pdf-action{background:#356dbb!important;color:#fff!important;border-color:#356dbb!important}
html[data-theme="dark"] .source-card-toolbar .pdf-action:hover{background:#447fd1!important;border-color:#447fd1!important}
html[data-theme="dark"] :is(.primary-action,.tabs button[aria-pressed="true"],.workspace-tabs button[aria-selected="true"]){background:#356dbb;color:#fff}
html[data-theme="dark"] :is(.primary-action):hover{background:#447fd1}
html[data-theme="dark"] :is(.tabs button[aria-pressed="false"],.workspace-tabs button,.auth-tab){color:#bdcadc}
html[data-theme="dark"] .tabs button[aria-pressed="false"]{background:transparent}
html[data-theme="dark"] :is(.plan-badge,.user-avatar-circle){background:#356dbb;color:#fff}
html[data-theme="dark"] #planAccountState{color:#a3ebca!important}
html[data-theme="dark"] :is(.mini-credit-badge,.usage-pill,.plan-pill,.stat-pill){background:#233951;color:#c5ddff;border-color:#416082}
html[data-theme="dark"] .web-document-panel{background:#172131;border-color:var(--line)}
html[data-theme="dark"] :is(.web-document-paper,.document-empty){background:#202938;color:#e3e9f2;border-color:#435169;box-shadow:0 3px 12px rgba(0,0,0,.2)}
html[data-theme="dark"] .document-page-content :is(p,h1,h2,h3,h4){color:inherit}
html[data-theme="dark"] .document-page-number{color:#aab8cc}
html[data-theme="dark"] :is(.card-title,.card-sintesis,.doctrina-text){color:#e3e9f2}
html[data-theme="dark"] :is(.card-sintesis-box,.doctrina-row,.doctrinas-list,.inline-ai-box,#answer){background:#202c3e;color:#e3e9f2;border-color:var(--line)}
html[data-theme="dark"] :is(.card-meta-bar,.current-plan-top-row,.plans-footer-actions,.dialog-actions-footer){border-color:var(--line)}
html[data-theme="dark"] :is(.card-sintesis-label,.doctrinas-summary){color:#a7caff}
html[data-theme="dark"] .card-sintesis-box{scrollbar-color:#586b85 #202c3e}
html[data-theme="dark"] .card-sintesis-box::-webkit-scrollbar-track{background:#202c3e}
html[data-theme="dark"] .card-sintesis-box::-webkit-scrollbar-thumb{background:#586b85}
html[data-theme="dark"] .card-pending-notice{background:#493924!important;color:#f4d69e!important;border-color:#8b7148!important}
html[data-theme="dark"] :is(.markdown-body blockquote,.privacy,.summary-box,.sumario-box,.thinking-box){background:#21344b;color:#d0e2f7;border-color:#5376a5}
html[data-theme="dark"] .markdown-body code{background:#2d3b50;color:#e3e9f2}
html[data-theme="dark"] :is(.markdown-body,.chat-turn.user .markdown-body){color:#e3e9f2}
html[data-theme="dark"] :is(.custom-progress-track,progress){background:#344359}
html[data-theme="dark"] progress::-webkit-progress-bar{background:#344359}
html[data-theme="dark"] .status-bar.error{background:#41202b;border-color:#a75868;color:#ffbcc2}
html[data-theme="dark"] .status-bar.error .status-dot{background:#ff9fa8}
html[data-theme="dark"] .danger-text{color:#ffb2b8!important}
html[data-theme="dark"] .plan-card button.plan-active-btn{background:#163b32!important;color:#a3ebca!important;border-color:#39775f!important}
html[data-theme="dark"] .user-status-pill{background:#163b32!important;color:#a3ebca!important;border-color:#39775f!important}
html[data-theme="dark"] :is(.review-chip,.plan-trial-badge){background:#493924;color:#f4d69e}
html[data-theme="dark"] .load-more-btn{background:#25344b!important;color:#d5e4ff!important;border-color:#455c7a!important}
html[data-theme="dark"] footer{color:var(--muted)}
@media(max-width:600px){.brand-row{flex-wrap:wrap}.header-actions{flex-wrap:wrap;margin-left:auto}}
