
/* RESDS shared dark / light palette */
html[data-theme="dark"]{--theme-canvas:#111614;--theme-paper:#19211d;--theme-raised:#202b25;--theme-soft:#25342b;--theme-header:#121b16;--theme-ink:#eaf0ec;--theme-muted:#aabbb0;--theme-line:#41554a;--theme-accent:#76cba0;--theme-tint:#243e30;--theme-input:#131c17;--theme-label:#293e31;--theme-primary:#167348;--theme-primary-hover:#1c8455;--theme-warning-bg:#373325;--theme-warning-text:#e5d6a9}
html[data-theme="light"]{--theme-canvas:#edf1ed;--theme-paper:#fbfcf9;--theme-raised:#f2f6f1;--theme-soft:#e5ece5;--theme-header:#f5f8f3;--theme-ink:#24332a;--theme-muted:#54665a;--theme-line:#bccabe;--theme-accent:#216b49;--theme-tint:#dae9df;--theme-input:#ffffff;--theme-label:#dce9df;--theme-primary:#167348;--theme-primary-hover:#105d39;--theme-warning-bg:#f2eddd;--theme-warning-text:#756025}
html[data-theme],html[data-theme] body{--ink:var(--theme-ink)!important;--muted:var(--theme-muted)!important;--line:var(--theme-line)!important;--paper:var(--theme-paper)!important;--soft:var(--theme-soft)!important;--green:var(--theme-accent)!important;--darkgreen:var(--theme-primary-hover)!important;--tint:var(--theme-tint)!important;background:var(--theme-canvas)!important;color:var(--theme-ink)!important}
html[data-theme] :is(.site-chrome,.header){background:var(--theme-header)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] .site-breadcrumbs{background:var(--theme-raised)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.library-content,.directory-layout,.upload-layout){background:transparent!important;color:var(--theme-ink)!important}
html[data-theme] :is(.library-nav,.filter-sidebar,.doc-info,.related-panel){background:var(--theme-paper)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.detail-section,.official-references,.official-directory,.document-transcript,.document-provenance,.supplier-section,.correction-section,.source-methods,.catalog-grid>a,.doc-card,.collection-note,.batch-permission,.dropzone,.empty){background:var(--theme-paper)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] .doc-card{border-radius:7px}
html[data-theme] :is(.reader-heading,.reader-toolbar,.reader-controls,.reader-search,.supplier-current,.supplier-main,.supplier-main-card,.supplier-card,.supplier-fields>div,.company-about,.advanced-filters,.filterbar,.filter-panel,.filter-controls,.filter-summary,.directory-summary,.extraction-status){background:var(--theme-raised)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.reader-main,.reader-body,.pdf-stage,#readerViewport){background:var(--theme-canvas)!important}
html[data-theme] :is(.transcript-page,.transcript-page-body,.official-property-grid>div,.composition-evidence blockquote){background:var(--theme-input)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.official-property-grid,.detail-specs,.specifications-panel){border-color:var(--theme-line)!important}
html[data-theme] #centeredDocument .specifications-panel .detail-specs>div{background:var(--theme-paper)!important}
html[data-theme] #centeredDocument .specifications-panel dt{background:var(--theme-label)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] #centeredDocument .specifications-panel dd{background:var(--theme-input)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.source-table,.directory-table,.suppliers-table,.official-source-table){background:var(--theme-paper)!important;color:var(--theme-ink)!important}
html[data-theme] :is(.source-table,.directory-table,.suppliers-table,.official-source-table) :is(td,th){border-color:var(--theme-line)!important}
html[data-theme] :is(.source-table,.directory-table,.suppliers-table,.official-source-table) th{background:var(--theme-label)!important;color:var(--theme-ink)!important}
html[data-theme] :is(.source-table,.directory-table,.suppliers-table,.official-source-table) tbody tr:nth-child(even){background:var(--theme-raised)!important}
html[data-theme] :is(.source-table,.directory-table,.suppliers-table,.official-source-table) tbody tr:hover{background:var(--theme-tint)!important}
html[data-theme] :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){background:var(--theme-input)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important;color-scheme:inherit!important}
html[data-theme] .global-search input{border-color:var(--theme-primary)!important}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--theme-muted)!important;opacity:1}
html[data-theme] :is(.button,.icon-button,.action-tile,.catalog-chips a){background:var(--theme-raised)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.button,.icon-button,.action-tile,.catalog-chips a):hover{background:var(--theme-tint)!important;border-color:var(--theme-accent)!important}
html[data-theme] :is(.button.green,.top-action,.global-search button,.upload-submit,.correction-form>button){background:var(--theme-primary)!important;border-color:var(--theme-primary)!important;color:#fff!important}
html[data-theme] :is(.button.green,.top-action,.global-search button,.upload-submit,.correction-form>button):hover{background:var(--theme-primary-hover)!important;border-color:var(--theme-primary-hover)!important}
html[data-theme] :is(.nav-item,.nav-sub,.type-tab){color:var(--theme-muted)!important}
html[data-theme] :is(.nav-item:hover,.nav-item.active,.nav-sub:hover,.type-tab.active){background:var(--theme-tint)!important;color:var(--theme-ink)!important}
html[data-theme] .element-grid .element-tile{background:var(--theme-raised)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important;box-shadow:none!important}
html[data-theme] .element-grid .element-tile:hover{background:var(--theme-tint)!important;border-color:var(--theme-accent)!important}
html[data-theme] .element-grid .element-tile.selected{background:var(--theme-primary)!important;border-color:var(--theme-accent)!important;color:#fff!important}
html[data-theme] .element-grid .element-tile.selected :is(strong,b,span){color:#fff!important}
html[data-theme] .element-grid .element-tile.missing:not(.selected){background:var(--theme-canvas)!important;color:var(--theme-muted)!important}
html[data-theme] :is(.element-count,.catalog-small,.publisher,.card-meta,.source-indicator,.doc-description,.supplier-row,.stats,.doc-disclaimer,.batch-help,.form-footer,.filter-status,.toolbar-file,.result-count,.transcript-note,.supplier-note,.supplier-empty,.detail-muted,.official-reference-note,.official-reference-status){color:var(--theme-muted)!important}
html[data-theme] :is(.doc-card h2,.supplier-row b,.collection-note b,.catalog-grid strong,.placeholder-cover b){color:var(--theme-ink)!important}
html[data-theme] :is(.catalog-nav a,.catalog-chips a,.doc-type,.composition-evidence summary,.source-link,.pdf-free-access-note,.section-number,.filter-status){color:var(--theme-accent)!important}
html[data-theme] :is(.label-chip,.material-chip,.technical-tag,.element-chip,.filter-chip){background:var(--theme-tint)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important}
html[data-theme] .uncertain-chip{background:var(--theme-warning-bg)!important;border-color:var(--theme-line)!important;color:var(--theme-warning-text)!important}
html[data-theme] :is(.match-mode,.match-mode label,.filter-hint-popover,.hint-popover,.filter-help,.supplier-about){background:var(--theme-raised)!important;color:var(--theme-ink)!important;border-color:var(--theme-line)!important}
html[data-theme] :is(.type-tabs,.catalog-nav,.nav-divider,.footer,.official-frameworks,.official-compound,.supplier-fields>div,.source-table-wrap){border-color:var(--theme-line)!important}
html[data-theme] .footer{color:var(--theme-muted)!important}
html[data-theme] .toast{background:var(--theme-primary)!important;color:#fff!important}
html[data-theme] .header-nav .theme-toggle{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;flex:none;height:46px;min-height:46px;min-width:44px;width:auto;padding:9px 12px;font-size:13px!important;font-weight:600;line-height:1;white-space:nowrap;border:1px solid var(--theme-line);border-radius:6px;cursor:pointer}
html[data-theme] .theme-toggle svg{width:20px;height:20px;flex:none}
html[data-theme] .theme-toggle:focus-visible{outline:2px solid var(--theme-accent);outline-offset:3px}
html[data-theme] .theme-toggle:disabled{opacity:.6;cursor:wait}
@media(max-width:1350px){html[data-theme] .theme-toggle-label{display:none}html[data-theme] .header-nav .theme-toggle{width:42px;min-width:42px;padding:9px}}
@media(max-width:760px){html[data-theme] .header-nav .theme-toggle{height:34px;min-height:34px;width:36px;min-width:36px;padding:6px;order:0;margin-left:3px}}
@media(prefers-reduced-motion:no-preference){html[data-theme] .theme-toggle{transition:background-color .15s,border-color .15s}}
/* Original PDF pages retain their native colors in either theme. */
html[data-theme] :is(.pdf-page,.pdf-page canvas,.native-pdf iframe,#readerViewport canvas){color-scheme:only light;forced-color-adjust:none}

html[data-theme="light"] .header-nav .theme-toggle{background:#1c2d23!important;color:#f3f8f4!important;border:2px solid #557961!important;box-shadow:0 1px 3px #13291c20}
html[data-theme="light"] .header-nav .theme-toggle:hover{background:#294535!important;border-color:#1d6b43!important}
html[data-theme="dark"] .header-nav .theme-toggle{background:#edf4ed!important;color:#20372a!important;border:2px solid #93bea1!important;box-shadow:0 1px 3px #0003}
html[data-theme="dark"] .header-nav .theme-toggle:hover{background:#dbeadb!important;border-color:#c7e6cf!important}
html[data-theme] .header-nav .theme-toggle :is(svg,span){color:inherit!important}

/* Specifications readability */
html[data-theme] #centeredDocument .specifications-panel dt{font-size:12px;font-weight:600;line-height:1.4;padding:6px 8px;letter-spacing:.02em}
html[data-theme] #centeredDocument .specifications-panel dd{font-size:16px;font-weight:500;line-height:1.4;padding:6px 10px}
html[data-theme="light"] #centeredDocument .specifications-panel dt{background:#c7dace!important;color:#263f30!important;border-color:#9eb6a6!important}
html[data-theme="light"] #centeredDocument .specifications-panel dd{background:#f0f5ef!important;color:#1e3327!important;border-color:#9eb6a6!important}
html[data-theme="light"] #centeredDocument .specifications-panel{border-color:#9eb6a6!important}
html[data-theme="light"] #centeredDocument .specifications-panel .detail-specs{background:#afc3b5!important}
html[data-theme="dark"] #centeredDocument .specifications-panel dt{background:#20362a!important;color:#e0eee4!important;border-color:#4d6857!important}
html[data-theme="dark"] #centeredDocument .specifications-panel dd{background:#111b15!important;color:#edf4ef!important;border-color:#4d6857!important}
@media(max-width:560px){html[data-theme] #centeredDocument .specifications-panel dt{font-size:11px;padding:5px 7px}html[data-theme] #centeredDocument .specifications-panel dd{font-size:15px;padding:5px 8px}}
