/* Museum theme layer (plan 10; Bundle 2 SPEC 2.2). Loads after preview.css and gallery-polish.css, so its aliases win.
   Colour values live in /site/tokens.css. The museum no longer defines --ink or --surface: those names are the site tokens.
   Night is the shared warm graphite (review decision 5 A). Every colour below is a token, except the Light ink #1c1d1f
   and the Light rule grey #d9d7d1 on the fixed light plate (sections 5c and 7). */

/* 0. The one stage color of every molecule and mechanism panel (Bundle E item 2, owner answer 2a): Night uses the site surface. */
:root{--exhibit-stage:var(--surface)}
html[data-theme=dark]{--exhibit-stage:var(--surface)}

/* 0b. Room still above an exhibit (Bundle E items 5 and 6): a tour still with its caption and a link to the tour stop. The aspect ratio reserves the space. */
.room-still{margin:0 0 22px;max-width:960px}
.room-still img{display:block;width:100%;height:auto;aspect-ratio:1600/833;background:var(--soft);border:1px solid var(--edge)}
.room-still figcaption{margin-top:8px;font-size:var(--step--1);line-height:1.6;color:var(--ink-muted)}
.room-still .room-still-link{display:flex;align-items:center;width:fit-content;min-height:2.75rem;margin-top:2px;color:var(--ink)}

/* 1. Token aliases, both themes (plan 10). */
:root{--page:var(--paper);--soft:var(--plaque);--muted:var(--ink-muted);--edge:var(--rule-strong);--line:var(--rule);--accent:var(--ink);--blue:var(--ink);--green:var(--ink);--selected:var(--ink);--selected-ink:var(--paper);--positive:var(--ink);color:var(--ink);background:var(--paper)}

/* 2. Georgia only in content (review decision 2 A): exhibit titles and text, "My contribution", "Evidence boundary".
   site.css sets the page in Source Sans 3, so the gallery, the learning rooms, the upper floor and the app plan are sans.
   Georgia returns inside an open exhibit (#detail), on the three exhibit titles of the gallery list, and on the sign copy
   drawn over the gallery render on phones (it repeats the serif sign of the render). Inside an exhibit, controls,
   labels, captions, tables and data stay sans. */
:is(#detail,.exhibit-list h2,.gallery-sign-copy){font-family:var(--font-serif)}
#detail :is(button,input,select,textarea,summary,label,output,legend,figcaption,small,th,td,caption,.eyebrow,.detail-number,.small,.toolbar,.back,.bottom-nav,.molecule-tabs,.structure-badge,.peptide-switch,.contribution-jump){font-family:var(--font-sans)}
/* <small> without a museum size rule would fall to the browser's "smaller" (11.67px under 14px text); site minimum is step -1. */
main small{font-size:var(--step--1)}
/* The same for <sub> and <sup> in exhibit text ("smaller" gives 11.67px); line-height 0 keeps the line spacing. */
main :is(sub,sup){font-size:var(--step--1);line-height:0}

/* 3. Museum sub-row under the shared header (plan 3): title left, field guide right. */
.museum-subrow{border-bottom:1px solid var(--rule);background:var(--paper)}
.museum-subrow-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;column-gap:1rem;min-height:3.5rem}
.museum-subrow-title{margin:0;font-family:var(--font-sans);font-size:var(--step-0);font-weight:400;color:var(--ink-muted)}
.field-guide{position:relative}
.field-guide-menu{position:absolute;z-index:30;right:0;top:calc(100% + .25rem);width:20.625rem;max-width:calc(100vw - 2rem);max-height:70svh;overflow:auto;padding:.5rem;background:var(--paper);border:1px solid var(--rule-strong);border-radius:var(--radius-control)}
.field-guide-menu p{margin:.5rem .625rem .75rem;font-size:var(--step--1);color:var(--ink-muted)}
.field-guide-menu a{display:flex;align-items:center;min-height:2.75rem;padding:.5rem .625rem;line-height:1.4;color:var(--ink);text-decoration-line:none}
.field-guide-menu a:hover,.field-guide-menu a:focus-visible{text-decoration-line:underline}
.field-guide-menu a[aria-current=page]{text-decoration-line:underline;text-decoration-thickness:2px}
.field-guide-menu hr{border:0;border-top:1px solid var(--rule);margin:.5rem}
@media(max-width:47.99rem){.field-guide{position:static}.museum-subrow-bar{position:relative}.field-guide-menu{left:0;right:0;width:auto;max-width:none}}

/* 4. Hotspot plaques on the renders (review 6.3.9 "Plaque"): paper fill, 1px rule-strong, 0.25rem radius, numeral in sans 600, flat. */
:is(.gallery-view,.room-scene) .spot{display:inline-flex;align-items:center;justify-content:center;gap:.375rem;width:auto;min-width:2.75rem;height:auto;min-height:2.75rem;padding:0 .75rem;border:1px solid var(--rule-strong);border-radius:var(--radius-control);background:var(--paper);color:var(--ink);font-family:var(--font-sans);font-size:var(--step-0);font-weight:400;line-height:1.2;text-decoration-line:none;white-space:nowrap}
:is(.gallery-view,.room-scene) .spot strong{font-size:inherit;font-weight:600}
:is(.gallery-view,.room-scene) .spot:hover{background:var(--plaque)}
@media(max-width:47.99rem){:is(.gallery-view,.room-scene) .spot{padding:0 .5rem;font-size:var(--step--1)}}
.evidence-hotspot span{width:2.75rem;height:2.75rem;border:1px solid var(--rule-strong);border-radius:var(--radius-control);background:var(--paper);color:var(--ink);font-family:var(--font-sans);font-size:var(--step-0);font-weight:600}
.evidence-hotspot:hover,.evidence-hotspot[aria-pressed=true]{background:transparent;border-color:var(--ink)}
.evidence-hotspot[aria-pressed=true] span{background:var(--ink);border-color:var(--ink);color:var(--paper)}
.dag-exhibit-stage .dag-exhibit-panel:hover,.dag-exhibit-stage .dag-exhibit-panel[aria-pressed=true]{background:transparent;border:2px solid var(--ink)}

/* 5. One pressed style for every tab group (review 6.3.9 "Button"): ink fill, paper text. Hotspots over renders keep
   their own state; the controls inside the 3D and chemical viewers have their own rule (5a).
   :not(#_) adds one id level so this rule beats the exhibit rules that name an id. */
:is(button[aria-pressed=true],.ob-country-tabs a[aria-current=page],.room-links a[aria-current=page]):not(.evidence-hotspot):not(.dag-exhibit-panel):not(.dag-mini):not(:is(.g6sv__controls,.incsv__tools,.molview__toolbar,.drx-structure-toolbar,.ghrp2-structure__tabs,.af-structure-toolbar,.membrane-timeline,.aped-mech-timeline,.chemical-tools) *):not(#_){background:var(--ink);border-color:var(--ink);color:var(--paper)}
.peptide-switch-options button[aria-pressed=true] :is(strong,small){color:var(--paper)}
/* 5a. The 3D and chemical viewer toolbars (owner item O-4, option 3). They take the site tokens like the rest of the museum:
   the ink and the greys of /site/tokens.css in Light and Night, no colour names of their own. Their pressed or current
   button shows one state, the ink fill with paper text. The section 5 rule leaves the toolbars out, so this rule is theirs;
   it also covers the aped timeline, which marks its current step with aria-current. :not(#_) adds one id level so it beats
   the pressed rules in the viewer stylesheets. */
:is(.g6sv__controls,.incsv__tools,.molview__toolbar,.drx-structure-toolbar,.ghrp2-structure__tabs,.af-structure-toolbar,.membrane-timeline,.aped-mech-timeline,.chemical-tools) button[aria-pressed=true]:not(#_),:is(.g6sv__controls,.incsv__tools,.molview__toolbar,.drx-structure-toolbar,.ghrp2-structure__tabs,.af-structure-toolbar,.membrane-timeline,.aped-mech-timeline,.chemical-tools) button[aria-current=true]:not(#_){background:var(--ink);border-color:var(--ink);color:var(--paper)}

/* 5a-1. A pressed or current button changes state at once. gallery-polish.css fades the background over 120ms, but the text
   colour flips on the first frame, so for those frames the new text sits on the old fill (Night: paper on surface, or ink on
   ink, contrast 1.0 to 1.3). The aped Play stage, Replay stage and Stationary 3D buttons were caught by the contrast check in
   that window. aria-pressed and aria-current are set to true and to false, so both states match. */
button:is([aria-pressed],[aria-current]){transition:none}

/* 5b. Targets (plan 7, P 258): buttons, summaries, selects and the museum's navigation links are at least 2.75rem (44px)
   tall, text centred. Links inside running text and source lines keep the line height of their text. The hotspots
   over renders and the controls inside the 3D and chemical viewers keep their own size (owner item O-4). Revision 6:
   the two links that stand alone after a paragraph (the gallery scope strip, the exhibit 03 boundary) become flex. */
main :is(button,summary,select,.back,.bottom-nav a,.room-links a,.room-action,.ob-country-tabs a):not(.evidence-hotspot):not(.dag-exhibit-panel):not(:is(.g6sv__controls,.incsv__tools,.molview__toolbar,.drx-structure-toolbar,.ghrp2-structure__tabs,.af-structure-toolbar,.membrane-timeline,.aped-mech-timeline,.chemical-tools) *){min-height:2.75rem;align-content:center;align-items:center}
main :is(.scope-strip,.evidence-boundary)>a{display:inline-flex;align-items:center;min-height:2.75rem}

/* 5c. Methods Studio diagrams (revision 3; Bundle E item 7, owner answer 7a). methods-studio.js line 11 (.ms-graph) and dag-model.js
   line 42 (the DAG editor) draw their arrows, rings, fills and labels in blue and green through SVG presentation attributes, and
   dag.css colours the editor labels navy and sets them in Georgia (a learning room: sans, revision 4). Any CSS rule beats a
   presentation attribute, so neither script changes. Both diagrams now follow the theme like Exhibit 02: ink, exposure nodes
   --soft, outcome nodes --rule, other nodes --surface, on the --surface canvas. In Light these tokens are the values the
   diagrams had before (#1c1d1f, #efeeea, #d9d7d1, #ffffff). Selection keeps its thicker ring, unmeasured nodes their dashed
   ring. :not(#_) beats dag.css and methods-studio.css. */
:is(.ms-graph,#ms-dag-editor .dag-canvas) marker path:not(#_){fill:var(--ink)}
:is(.ms-graph .ms-edges,#ms-dag-editor .dag-canvas svg>g[marker-end]):not(#_){stroke:var(--ink)}
:is(.ms-graph,#ms-dag-editor .dag-canvas) circle:not(#_){stroke:var(--ink)}
:is(.ms-graph,#ms-dag-editor .dag-canvas) text:not(#_){fill:var(--ink);font-family:var(--font-sans)}
.ms-graph .ms-node circle:not(#_),#ms-dag-editor .dag-canvas circle[fill="#fff"]:not(#_){fill:var(--surface)}
:is(.ms-graph .ms-node[data-node=Y],.ms-graph .ms-node.conditioned) circle:not(#_),#ms-dag-editor .dag-canvas circle[fill="#e5eefb"]:not(#_){fill:var(--soft)}
#ms-dag-editor .dag-canvas circle[fill="#e3f2e8"]:not(#_){fill:var(--rule)}

/* 6. "My contribution" panel (review 6.3.9): full content width, 1px rule above, no box, no stripe. */
.contribution{padding:1.5rem 0 0;border:0;border-top:1px solid var(--rule);border-radius:0;background:transparent}
/* Gallery intro on the page colours: no white band, muted dek instead of the old navy (gallery-v023.css, gallery-finished.css). */
#gallery>.intro{background:transparent}
#gallery>.intro .dek{color:var(--ink-muted)}
/* Scope strip (index.html): the strip has no left border any more (M3), so its 20px side padding only pushed the text off the
   gallery edge. It takes the 4% gutter of the gallery title, caption and exhibit list instead. The global em rule of
   preview.css styles the exhibit-list subtitles; inside this sentence "my contribution" keeps the sentence's own size and colour. */
#gallery>.scope-strip{margin-left:4%;margin-right:4%;padding-left:0;padding-right:0}
#gallery>.scope-strip em{font-size:inherit;color:inherit;margin-left:0;font-style:inherit}
/* BLS context cards (observatory-context-view.js): the key line above each card is drawn with the same pattern as
   its chart line (2.8). */
.cx-key{display:block;margin:0 0 .5rem}

/* 7. Night (review decision 5 A): the tokens switch on <html data-theme="dark">; these rules only re-point museum surfaces. */
html[data-theme=dark] body{background:var(--page);color:var(--ink)}
html[data-theme=dark] :is(.observatory,.ms-studio){color:var(--ink);--ms-line:var(--edge);--ms-green:var(--ink);--ms-navy:var(--ink)}
html[data-theme=dark] :is(.evidence-panel,.library-context,.library-lesson,.library-sources,.library-notebook,.la-cards article,.la-reading article,.ms-panel,.ms-reading,.ms-room-link,.ms-area-grid button,.ob-masthead,.ob-instrument,.ob-panel,.cx-table thead){background:var(--surface);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] :is(.unmodeled,.structure-badge,.room-preview-note,.library-feedback,.library-feedback.supported,.la-boundary,.ms-boundary,.ms-feedback,.ms-good,.ms-result-pair article,.ms-result-pair article+article,.ms-panel thead,.ob-freshness,.ob-warning,#evidence-reveal,#dag-status,#ms-dag-editor .dag-inspector){background:var(--soft);color:var(--ink)!important;border-color:var(--edge)}
html[data-theme=dark] :is(.dek,.exhibit-list span,.exhibit-list em,.exhibit-list p,.toolbar span,aside p,.gallery-help,.room-intro,.scope-note,.source-grid p,.sequence-panel>p,.step-text p,.chemical-tools output,#chemical-view>.small,.evidence-intro,.evidence-help,.evidence-progress,.evidence-panel p,.evidence-boundary p,.membrane-inspector p,.membrane-pathways span,#membrane-view>.small,.dag-exhibit figcaption,.dag-intro,.dag-legend,.dag-help,.library-sources .source-type,.source-hint,.ob-note,.ob-comparison,#ob-saved,.ms-panel p,.ms-panel li,.ms-notebook p){color:var(--muted)}
html[data-theme=dark] .ms-note{color:var(--muted)!important}
html[data-theme=dark] :is(.eyebrow,.detail-number,.observatory .eyebrow,.membrane-kicker,.evidence-example-label,.library-sources .source-active summary){color:var(--ink)!important}
html[data-theme=dark] :is(.scope-strip a,.source-grid a,.evidence-refs a,.evidence-boundary a,.ms-result-pair strong){color:var(--ink)}
html[data-theme=dark] :is(button,.room-links a,.room-action,.ob-country-tabs a){background:var(--surface);color:var(--ink);border-color:var(--edge)}
html[data-theme=dark] :is(button,.room-links a,.room-action,.ob-country-tabs a):hover{background:var(--soft)}
html[data-theme=dark] #detail .contribution-jump button:hover{background:var(--soft)}
html[data-theme=dark] :is(input,select,textarea,.la-select select,.library textarea,.ms-notebook textarea,.ms-reading select,.observatory select,.observatory input,.observatory textarea,.ob-scale-control select,#ms-dag-editor input,#ms-dag-editor select,#ms-dag-editor textarea){background:var(--page);color:var(--ink);border-color:var(--edge);accent-color:var(--ink)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:var(--muted)}
/* Observatory KPI cards: the top rule is the chart key (2.4.8) and keeps its data token in Night; only the other three
   sides and the fill are re-pointed, so no rule above can overwrite border-top-color (revision 2). */
html[data-theme=dark] .ob-kpi{border-right-color:var(--edge);border-bottom-color:var(--edge);border-left-color:var(--edge)}
html[data-theme=dark] :is(.ob-kpi.headline,.ob-kpi.total-reference){background:var(--soft);color:var(--ink)}
html[data-theme=dark] :is(.exhibit-list>a:hover,.ms-area-grid button:first-child){background:var(--soft)}
html[data-theme=dark] :is(.library-choice,.library-sources details,.library-safety,.observatory th,.observatory td,.ob-table-wrap,.cx-explainer,.app-roadmap,#dag-edges li){border-color:var(--edge)}

/* Exhibit 02's vector DAG adapts to Night. Illustrated and 3D media are never inverted or filtered. */
html[data-theme=dark] :is(.dag-canvas,.ms-graph){background:var(--surface);border-color:var(--edge)}
html[data-theme=dark] #ms-dag-editor .dag-canvas svg>rect[fill="#f8fbfa"]{fill:var(--surface)}
html[data-theme=dark] .dag-node rect:not(.dag-node-pad){fill:var(--soft);stroke:var(--edge)}
html[data-theme=dark] .dag-node text{fill:var(--ink);stroke:var(--surface)}
html[data-theme=dark] .dag-order{fill:var(--muted)}
html[data-theme=dark] .dag-edge-line{stroke:var(--ink-muted)}
html[data-theme=dark] :is(.dag-edge.paper,.dag-edge.evidence) .dag-edge-line{stroke:var(--ink)}
html[data-theme=dark] .dag-node.is-selected text{fill:var(--ink)}
html[data-theme=dark] :is(.dag-question,.dag-caution,.dag-small,.dag-references small){color:var(--muted)}

/* Fixed light plate in Night (plan 4.4): the retatrutide cell diagram (owner answer 2c a) and every chemical fallback image. The Methods diagrams left the plate in Bundle E item 7.
   #1c1d1f is the Light --ink value, so text on the plate keeps the Light contrast (14.53:1 on --plate-light). */
html[data-theme=dark] :is(#cell-view,#cell-view svg){background:var(--plate-light);color:#1c1d1f;color-scheme:light}
html[data-theme=dark] #ms-dag-editor .dag-node text{stroke:none}
html[data-theme=dark] :is(.chemical-stage,#model-view){background:var(--exhibit-stage);color:var(--ink);color-scheme:dark}
/* The vector drawing replaces the <img> and is recoloured by chemical-view.js. While an <img> is still in the stage
   (the drawing could not load), the stage is the light plate. :not(#_) beats the exhibit stage rules that name an id. */
html[data-theme=dark] .chemical-stage:has(img):not(#_){background:var(--plate-light);color-scheme:light}

/* Hotspots stay transparent over the rendered exhibit images. */
html[data-theme=dark] :is(.evidence-hotspot,.dag-exhibit-stage .dag-exhibit-panel){background:transparent}

@media print{.museum-subrow{display:none}}
