/* Appearance changes palette, not the publication's structure or motion. */
.rm-reading-controls { display:flex; align-items:center; gap:6px; margin:0; flex-shrink:0; }
.rm-reading-controls button { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; min-width:44px; padding:10px; border:1px solid var(--rm-line); border-radius:6px; background:var(--rm-paper); color:var(--rm-forest); cursor:pointer; transition:background-color 160ms ease-out,border-color 160ms ease-out; }
.rm-reading-controls button svg { display:block; width:20px; height:20px; flex-shrink:0; }
.rm-reading-controls button:hover { background:#e7dfcc; border-color:var(--rm-forest); }
.rm-reading-controls button:focus-visible { outline:3px solid var(--rm-gold); outline-offset:3px; }
.rm-reading-controls button:active { background:#d9d0bd; }
.rm-reading-controls button:disabled { cursor:default; opacity:.6; }
.rm-header-motion[aria-pressed="true"] { border-color:var(--rm-gold); }

html[data-rm-theme="dark"] {
  color-scheme:dark;
  --rm-paper:#20362a; --rm-card:#1b2c23; --rm-line:#496454;
  --rm-body:#eee9df; --rm-support:#d5dbd0;
  --rm-dark-surface:#111e18; --rm-dark-link:#c7dfc5;
  scrollbar-color:#739180 #111e18;
}
html[data-rm-theme="dark"] body { background:var(--rm-dark-surface); color:var(--rm-body); }
html[data-rm-theme="dark"] :is(a,button,input,select,summary):focus-visible { outline-color:var(--rm-light-gold); }
html[data-rm-theme="dark"] input { caret-color:var(--rm-dark-link); }
html[data-rm-theme="dark"] :is(header.wp-block-template-part,.rm-site-header) { background:var(--rm-dark-surface); border-color:var(--rm-line); }
html[data-rm-theme="dark"] .rm-site-header .rm-brand { color:var(--rm-ivory); }
html[data-rm-theme="dark"] .rm-brand-accent { color:var(--rm-light-gold); }
html[data-rm-theme="dark"] .rm-site-header .rm-nav { color:var(--rm-ivory); }
html[data-rm-theme="dark"] .rm-site-header .rm-nav .wp-block-navigation-item__content { color:var(--rm-ivory); }
html[data-rm-theme="dark"] .rm-nav .wp-block-navigation-item__content:hover,
html[data-rm-theme="dark"] .rm-nav .current-menu-item:not(.rm-supplier-link)>.wp-block-navigation-item__content,
html[data-rm-theme="dark"] .rm-nav a[aria-current="page"] { background:var(--rm-paper); }
html[data-rm-theme="dark"] .rm-nav .rm-supplier-link>.wp-block-navigation-item__content { background:#28543f; border-color:#739180; }
html[data-rm-theme="dark"] .rm-nav .rm-supplier-link>.wp-block-navigation-item__content:hover { background:#346349; }
html[data-rm-theme="dark"] .rm-site-header .rm-nav .wp-block-navigation__responsive-container.is-menu-open { background:var(--rm-dark-surface)!important; color:var(--rm-ivory)!important; }
html[data-rm-theme="dark"] .rm-nav .wp-block-navigation__submenu-container { background:var(--rm-card); border-color:var(--rm-line); color:var(--rm-ivory); }
html[data-rm-theme="dark"] .rm-site-header .rm-nav :is(.wp-block-navigation__responsive-container-open,.wp-block-navigation__responsive-container-close),
html[data-rm-theme="dark"] .rm-reading-controls button { background:var(--rm-paper); color:var(--rm-ivory); border-color:var(--rm-line); }
html[data-rm-theme="dark"] .rm-reading-controls button:hover { background:#294532; border-color:#91b39d; }
html[data-rm-theme="dark"] .rm-reading-controls button:active { background:#36543e; }
html[data-rm-theme="dark"] .rm-header-motion[aria-pressed="true"] { border-color:var(--rm-light-gold); }
html[data-rm-theme="dark"] .rm-site-header .rm-nav .rm-supplier-link { border-color:var(--rm-line); }

html[data-rm-theme="dark"] :is(.rm-discovery-band,.rm-guide-shelf) { background:#192b20; border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-publication-section,.rm-reader-paths>div,.rm-source-panel>div:last-child,.rm-profile-next,.rm-contents,.rm-area-list>div,.rm-section) { border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-reading,.rm-profile-reading,.rm-hub-body,.rm-publication-section,.rm-discovery-band,.rm-source-panel,.rm-profile-next,.rm-tool-content,.rm-contents,.rm-guide-next) :is(h1,h2,h3,h4,dt) { color:var(--rm-body); }
html[data-rm-theme="dark"] :is(.rm-reading,.rm-profile-reading,.rm-hub-body,.rm-profile-next,.rm-source-panel,.rm-profile-card,.rm-guide-details,.rm-reader-paths,.rm-featured-reading,.rm-reading-tools,.rm-guide-next) a { color:var(--rm-dark-link); }
html[data-rm-theme="dark"] :is(.rm-reader-paths p,.rm-publication-section>p,.rm-profile-card>p,.rm-guide-details p,.rm-guide-includes,.rm-source-panel p,.rm-directory-count,.rm-reading-note,.rm-contents a,.rm-hub-body p,.rm-profile-facts dd,.rm-related-peptide small) { color:var(--rm-support); }
html[data-rm-theme="dark"] :is(.rm-reading .wp-block-post-content>p:first-child,.rm-note,.rm-query .wp-block-post-date,.rm-table figcaption) { color:var(--rm-support); }
html[data-rm-theme="dark"] :is(.rm-profile-card,.rm-topic-card,.rm-study-card) { background:var(--rm-card); border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-profile-card,.rm-topic-card):is(:hover,:focus-within) { background:#233e2e; border-color:#91b39d; }
html[data-rm-theme="dark"] .rm-profile-tags span { background:#294532; color:#d1e4cd; }
html[data-rm-theme="dark"] :is(.rm-directory-controls,.rm-directory-empty,.rm-content-status,.rm-evidence-card,.rm-profile-summary,.rm-mobile-summary>p,.rm-profile-reading .wp-block-post-content>p:first-child,.rm-comparison,.rm-hero-note,.rm-study-meta span) { background:var(--rm-paper); color:var(--rm-body); border-color:var(--rm-line); }
html[data-rm-theme="dark"] .rm-evidence-card .rm-evidence-scope { color:var(--rm-support); }
html[data-rm-theme="dark"] :is(.rm-guide-next,.rm-coverage-note,.rm-area-paths a,.rm-topic-examples a,.rm-profile-next .rm-related-peptide) { background:var(--rm-paper); color:var(--rm-dark-link); border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-area-paths a,.rm-topic-examples a,.rm-profile-next .rm-related-peptide):hover { background:#294532; border-color:#91b39d; }
html[data-rm-theme="dark"] .rm-area-list>div:is(:hover,:focus-within) { background:var(--rm-paper); }
html[data-rm-theme="dark"] :is(.rm-coverage-note strong,.rm-study-details summary,.rm-profile-faq summary),
html[data-rm-theme="dark"] .rm-learning-step::marker { color:var(--rm-dark-link); }
html[data-rm-theme="dark"] .rm-study-details summary:hover,
html[data-rm-theme="dark"] .rm-profile-faq summary:hover { color:var(--rm-ivory); }
html[data-rm-theme="dark"] :is(.rm-study-details,.rm-profile-faq details,.rm-profile-facts dt,.rm-profile-facts dd,.rm-learning-step,.rm-about-columns>section,.rm-about-columns>.wp-block-group) { border-color:var(--rm-line); }
html[data-rm-theme="dark"] .rm-study-meta { color:var(--rm-support); }
html[data-rm-theme="dark"] .rm-availability { background:#4b4122; color:#ead89d; }

html[data-rm-theme="dark"] :is(.rm-directory-search label,.wp-block-search__label,.rm-study-controls label) { color:var(--rm-dark-link); }
html[data-rm-theme="dark"] :is(.rm-directory-search input,.wp-block-search__input) { background:#14251b; color:var(--rm-body); border-color:#739180; }
html[data-rm-theme="dark"] :is(.rm-directory-search input,.wp-block-search__input)::placeholder { color:#b8cbbd; opacity:1; }
html[data-rm-theme="dark"] .rm-topic-filters button { background:var(--rm-card); color:var(--rm-dark-link); border-color:#739180; }
html[data-rm-theme="dark"] .rm-topic-filters button:hover { background:#294532; border-color:#91b39d; }
html[data-rm-theme="dark"] .rm-topic-filters button[aria-pressed="true"] { background:#365c42; color:var(--rm-ivory); border-color:#a4c5a9; }
html[data-rm-theme="dark"] .rm-directory-empty button { background:#28543f; color:var(--rm-ivory); border-color:#91b39d; }
html[data-rm-theme="dark"] .wp-block-button.rm-secondary .wp-block-button__link { color:var(--rm-dark-link); border-color:#91b39d; }
html[data-rm-theme="dark"] .wp-block-button.rm-secondary .wp-block-button__link:hover { background:#294532; }
html[data-rm-theme="dark"] :is(.rm-reading,.rm-profile-reading) :is(th,td) { border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-reading,.rm-profile-reading) th,
html[data-rm-theme="dark"] .rm-table th { background:var(--rm-paper); color:var(--rm-body); }
html[data-rm-theme="dark"] .rm-table :is(th,td) { border-color:var(--rm-line)!important; }
html[data-rm-theme="dark"] .rm-query .wp-block-post-template>li { border-color:var(--rm-line); }
html[data-rm-theme="dark"] :is(.rm-query>p,.rm-query .wp-block-query-no-results) { background:var(--rm-paper); }

html[data-rm-theme="dark"] .rm-calculator { --calc-forest:#c7dfc5; --calc-ink:#eee9df; --calc-paper:#20362a; --calc-border:#496454; }
html[data-rm-theme="dark"] .rm-calc-tabs button:is(:hover,[aria-selected="true"]) { background:#294532; }
html[data-rm-theme="dark"] .rm-calculator :is(input,select) { background:#14251b; border-color:#739180; color:var(--calc-ink); }
html[data-rm-theme="dark"] .rm-calculator :is(input,select)::placeholder { color:#b8cbbd; }
html[data-rm-theme="dark"] .rm-calculator :is(.rm-calc-help,.rm-calc-result-label,.rm-calc-privacy,.rm-calc-sources) { color:var(--rm-support); }
html[data-rm-theme="dark"] .rm-calc-actions button { background:#28543f; border-color:#91b39d; color:var(--rm-ivory); }
html[data-rm-theme="dark"] .rm-calc-actions button:hover { background:#346349; }
html[data-rm-theme="dark"] .rm-calc-actions button[type="reset"] { background:transparent; color:var(--rm-dark-link); }
html[data-rm-theme="dark"] .rm-calc-actions button[type="reset"]:hover { background:#294532; }
html[data-rm-theme="dark"] .rm-calculator [aria-invalid="true"] { border-color:#edaa94; }
html[data-rm-theme="dark"] .rm-calculator .rm-calc-error { background:#492b24; color:#ffd2bf; }
html[data-rm-theme="dark"] .rm-calc-output .rm-calc-formula { border-color:var(--rm-line); }

/* The header's three 44px controls retain targets on narrow screens. */
@media(max-width:520px) {
  .rm-site-header .rm-header { gap:8px; }
  .rm-brand { min-width:0; flex-shrink:1; }
  .rm-brand-name { display:block; max-width:112px; font-size:20px; white-space:normal; line-height:1.17; }
  .rm-reading-controls { margin-left:auto; gap:4px; }
}
@media(max-width:360px) {
  .rm-brand-name { max-width:98px; font-size:18px; }
  .rm-reading-controls { gap:2px; }
}
@media(prefers-reduced-motion:reduce) {
  .rm-reading-controls button { transition:none; }
}
