
/* Shared light/dark controls; photos and logos are never inverted. */
html[data-theme="light"]{color-scheme:light;--ui-bg:#f6f9fc;--ui-panel:#fff;--ui-soft:#e8f0f6;--ui-fg:#17384e;--ui-muted:#496273;--ui-border:#8da6b6;--ui-accent:#076b96;--ui-on:#fff}
html[data-theme="dark"]{color-scheme:dark;--ui-bg:#0b0e12;--ui-panel:#151d26;--ui-soft:#1e2b36;--ui-fg:#edf4fa;--ui-muted:#b4c6d4;--ui-border:#637b8c;--ui-accent:#8bd8ff;--ui-on:#10212c}
html[data-theme] body{background:var(--ui-bg)!important;color:var(--ui-fg)!important;--bg:var(--ui-bg);--surface:var(--ui-panel);--raised:var(--ui-soft);--text:var(--ui-fg);--muted:var(--ui-muted);--line:var(--ui-border);--accent:var(--ui-accent);--on-accent:var(--ui-on);--blue:var(--ui-accent)}
html[data-theme] :is(.header,.site-header,.case-header,.footer,footer,.site-footer,.case-footer,.hero,.method,.responsibility,.stories,.case-section,.applications,.cs-section,.contact,.contact-section,.plan,.plan-section,.capability,.doors,.doors-bar){background:var(--ui-bg)!important;color:var(--ui-fg)!important}
html[data-theme] :is(.door,.case-card,.cs-card,.e-case-card,.issue-group,.issue-content,.group-title,.index-links a,.problem-map,.plan-sheet,.deliverables,.capability-board,.feature-story,.case-row,.case-aside,.case-proof,.method-section,.method-band,.plan-panel,.application,.tech-card,.diagram,.diagram-step,.contact-form,.summary-box,.contact-options details,.contact-paths details,.door-details details:target){background:var(--ui-panel)!important;color:var(--ui-fg)!important;border-color:var(--ui-border)!important}
html[data-theme] :is(.plan-content,.plan-notes,.plan-frame,.cap-list span,.chip,.tag,.case-topics span,.issue-tags a,.flow span){background:var(--ui-soft)!important;color:var(--ui-fg)!important;border-color:var(--ui-border)!important}
html[data-theme] :is(h1,h2,h3,h4,p,li,summary,strong,small){color:var(--ui-fg)!important}
html[data-theme] :is(.muted,.lede,.lead,.hero-intro,.cs-note,.micro-note,.legal,.image-note,.prototype-note,.footer-bottom,.case-intro>p:not(.label),.case-content p){color:var(--ui-muted)!important}
html[data-theme] :is(.eyebrow,.label,.cs-kicker,.detail-label,.tag,.chip,.door-meta,.door-index,.image-chip,.map-num,.map-label,.cap-number,.tech-icon,.context-line){color:var(--ui-accent)!important}
html[data-theme] :is(h1 em,h2 em,.blue,.text-link,.line-link,.cs-read,.cs-related a,.case-aside a,.footer-links a:hover,.footer-grid a:hover){color:var(--ui-accent)!important}
html[data-theme] :is(.brand strong,.brand-wordmark strong){color:var(--ui-accent)!important}
html[data-theme] :is(.button,.btn,.nav .button){background:var(--ui-accent)!important;color:var(--ui-on)!important;border-color:var(--ui-accent)!important}
html[data-theme] :is(.button,.btn) :is(span,strong){color:inherit!important}
html[data-theme] :is(.button-outline,.btn.outline,.button.light){background:transparent!important;color:var(--ui-fg)!important;border-color:var(--ui-border)!important}
html[data-theme] :is(input,select,textarea){background:var(--ui-panel)!important;color:var(--ui-fg)!important;border-color:var(--ui-border)!important}
html[data-theme] input::placeholder,html[data-theme] textarea::placeholder{color:var(--ui-muted);opacity:1}
html[data-theme] .door-symbol{background:var(--ui-soft)!important;color:var(--ui-accent)!important}
html[data-theme] :is(.art-caption,.photo-caption,.photo-index,.image-chip,.image-top,.image-caption span,.cs-photo figcaption,.e-case-photo figcaption,.cs-door-photo figcaption){background:#092638f2!important;color:#fff!important}
html[data-theme] :is(.hero-stamp,.photo-door){background:#0b2639!important;color:#fff!important}
html[data-theme] .photo-door :is(h3,p,span,b){color:#fff!important}
html[data-theme] .hero-stamp :is(p,span){color:#fff!important}
html[data-theme] body[data-variant="D"] .hero{background:#0b2639!important;color:#fff!important}
html[data-theme] body[data-variant="D"] .hero :is(h1,p,a:not(.button),span){color:#fff!important}
html[data-theme] body[data-variant="D"] .hero h1 em{color:#8bd8ff!important}
html[data-theme] body[data-variant="D"] .hero .button span{color:var(--ui-on)!important}
html[data-theme] .mobile-nav nav{background:var(--ui-panel)!important}
html[data-theme] :is(a,button,summary,input,select,textarea):focus-visible{outline:3px solid var(--ui-accent)!important;outline-offset:4px}
.display-preferences{background:var(--ui-panel);color:var(--ui-fg);border-bottom:1px solid var(--ui-border);padding:9px max(20px,5vw);display:flex;justify-content:flex-end;align-items:center;gap:22px;position:relative;z-index:15;font:13px/1.4 "Segoe UI",Arial,sans-serif}
.display-preferences .preference-group{display:flex;align-items:center;gap:5px}
.display-preferences .preference-label{font-size:11px;letter-spacing:.07em;text-transform:uppercase;margin-right:7px;color:var(--ui-muted)}
.display-preferences button,.display-preferences a{font:600 12px/1.3 "Segoe UI",Arial,sans-serif;min-width:44px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--ui-fg);padding:9px 12px;text-decoration:none;cursor:pointer}
.display-preferences button[aria-pressed="true"],.display-preferences a[aria-current="true"]{background:var(--ui-accent);color:var(--ui-on);border-color:var(--ui-accent)}
.display-preferences button:hover,.display-preferences a:hover{border-color:var(--ui-accent)}
.preference-noscript{background:var(--ui-soft);padding:12px 5%;font:13px/1.5 "Segoe UI",Arial,sans-serif;color:var(--ui-fg)}
@media(max-width:600px){.display-preferences{justify-content:space-between;padding:8px 12px;gap:8px;flex-wrap:wrap}.display-preferences .preference-label{display:none}.display-preferences button,.display-preferences a{padding:9px 10px;min-height:44px}}


/* Keep navigation and secondary copy legible in both palettes. */
html[data-theme] :is(.footer-grid a,.footer-links a,.case-header a,.case-footer a,.mobile-nav a,.desktop-nav>a:not(.btn),.nav>a:not(.button)){color:var(--ui-fg)!important}
html[data-theme] :is(.hero-baseline,.hero-under,.plan-notes>div,.map-end,.diagram-top,.diagram-bottom,.sheet-head,.story-meta,.tech-foot>span){color:var(--ui-muted)!important;border-color:var(--ui-border)!important}
html[data-theme] :is(.cap-grid a,.issue-tags a,.index-links a,.contact-paths a,.cs-related>span){color:var(--ui-accent)!important}
html[data-theme] body[data-variant="D"] .hero-bottom a{color:#fff!important}
