/* Global appearance. Page and laboratory styles retain the original light identity. */
:root{--chart-paper:#fff;--chart-ink:#586270;--chart-grid:#e9edf2;--theme-focus:#45679a}
html.theme-changing *,html.theme-changing *::before,html.theme-changing *::after{transition:none!important}
.theme-toggle{display:inline-flex!important;align-items:center;justify-content:center;gap:.42rem;flex:0 0 auto!important;min-height:40px;min-width:76px;padding:.4rem .65rem!important;margin:0!important;font:500 12px/1.25 system-ui,sans-serif!important;white-space:nowrap;border:1px solid var(--line,#d8dce2);border-radius:3px;touch-action:manipulation;background:transparent;color:var(--ink,#303740)!important;box-shadow:none;cursor:pointer}
.theme-toggle svg{width:16px;height:16px;display:block;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}
.theme-toggle:focus-visible{outline:2px solid var(--theme-focus);outline-offset:3px}.theme-toggle:hover{transform:none!important;background:var(--cloud,#f3f4f6)!important;border-color:var(--accent,#45679a)!important}
.quarto-navbar-tools{gap:.45rem}.laboratory-shortcuts{gap:.5rem!important}.laboratory-shortcuts .button{background:transparent!important;color:var(--ink)!important;border-color:var(--line)!important;font-size:.85rem;padding:.6rem .85rem}.laboratory-shortcuts .button:hover{border-color:var(--accent)!important}.dropdown-menu{max-height:75vh;overflow:auto}
html[data-theme=dark]{color-scheme:dark;background:#10110f;--page:#10110f;--paper:#191a17;--surface:#191a17;--surface-raised:#22231e;--cloud:#22231e;--soft:#22231e;--white:#191a17;--ink:#f0ece2;--ink-soft:#d3ccbc;--muted:#b9b2a4;--line:#3d3e33;--line-strong:#6d6b5b;--accent:#d3b16b;--accent-soft:#302b1e;--blue:#94b6e2;--blue-soft:#222f40;--red:#dc9985;--red-soft:#392823;--green:#91bcac;--green-soft:#23342c;--amber:#d7b579;--amber-soft:#342d20;--gold:#d3b16b;--gold-soft:#302b1e;--teal:#91bcac;--pale:#23302b;--danger:#eca99c;--success:#a5ccb2;--shadow:0 14px 35px #0003;--chart-paper:#191a17;--chart-ink:#e9e5db;--chart-grid:#38392f;--theme-focus:#e3c17c;--bs-body-color:#f0ece2;--bs-body-bg:#10110f;--bs-emphasis-color:#f0ece2;--bs-secondary-color:#b9b2a4;--bs-border-color:#3d3e33;--bs-tertiary-bg:#22231e;--bs-link-color:#ddbd7c;--bs-link-hover-color:#f2d69b}
html[data-theme=dark] body{background:var(--page);color:var(--ink)}
html[data-theme=dark] ::selection{background:#6a542c;color:#fff7e3}
html[data-theme=dark] :is(h1,h2,h3,h4,h5,h6,summary){color:var(--ink)}
html[data-theme=dark] :is(a,.text-link,.card-link){color:#ddbd7c;text-decoration-color:#75633f}
html[data-theme=dark] a:hover{color:#f2d69b}
html[data-theme=dark] :is(.eyebrow,.events-kicker,.talk-series-kicker,.book-edition-kicker,.event-detail-date,.course-index,.mini-date,.journey-date){color:var(--accent)}
html[data-theme=dark] :is(.landing-intro,.about-copy p,.atlas-copy p,.research-ribbon,.subtitle,.muted,.software-meta,.book-status,.selected-info,.live-position,.pending-note,.precision-note,.notice,.metric-strip span,.plot-hint){color:var(--muted)}
/* Navigation and controls. */
html[data-theme=dark] :is(.navbar,.nav-footer,.page-footer,.topbar,.app-header,.ed-topbar,.d-topbar,.dropdown-menu){background:var(--paper)!important;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.navbar .nav-link,.navbar .dropdown-item,.navbar .navbar-toggler,.navbar .quarto-search-button,.nav-footer a){color:var(--ink-soft)!important}
html[data-theme=dark] #quarto-search :is(button,svg){color:var(--ink-soft)!important}
html[data-theme=dark] :is(.navbar .nav-link:hover,.navbar .nav-link.active,.navbar .active-language,.dropdown-item:hover){color:var(--accent)!important}
html[data-theme=dark] .dropdown-item:hover{background:var(--surface-raised)}
html[data-theme=dark] .navbar-toggler-icon{filter:invert(.9)}
html[data-theme=dark] :is(.navbar-logo,.brand img){filter:invert(.94) sepia(.12)}
html[data-theme=dark] button{background:var(--paper);color:var(--ink);border-color:#77705e}
html[data-theme=dark] :is(.button,.small-button,.app-button,.d-button,.ed-button){color:var(--ink)!important;background:transparent;border-color:#77705e}
html[data-theme=dark] :is(.button:hover,.small-button:hover,.app-button:hover,.d-button:hover,.ed-button:hover){background:#28291f;color:#fff4da!important;border-color:var(--accent)}
html[data-theme=dark] :is(.button.primary,.small-button.primary,.d-button.primary,.ed-button.primary){background:#d3b16b!important;border-color:#d3b16b!important;color:#18170f!important}
html[data-theme=dark] :is(.button.primary:hover,.small-button.primary:hover){background:#e4c580!important;border-color:#e4c580!important}
html[data-theme=dark] .site-back-to-top{background:var(--paper);color:var(--accent);border-color:var(--line)}
/* Academic pages and mathematical figures. */
html[data-theme=dark] .landing-hero::before{background:radial-gradient(ellipse at 85% 30%,#34302166,transparent 55%),linear-gradient(110deg,#10110f 35%,#1a1c16 100%)}
html[data-theme=dark] .landing-hero::after{opacity:.08;filter:invert(1) sepia(.4)}
html[data-theme=dark] .landing-hero h1 em{color:#ddbd7c}
html[data-theme=dark] :is(.hero-secondary,.home-event-mini,.project-card,.spotlight,.spotlight-book){border-color:#77613b}
html[data-theme=dark] :is(.spotlight,.spotlight-book,.project-card,.abstract-card,.software-visual,.book-status-strip,.event-detail-side,.event-detail-panel,.definition-editorial,.math-learn-more,.definition-example,.orcid-preview,.video-wrap){background:var(--surface-raised);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .book-cover-image{box-shadow:8px 12px 0 #302c22,12px 18px 28px #0004}
html[data-theme=dark] .book-notice{border-color:var(--line);color:var(--ink-soft)}
html[data-theme=dark] .software-visual img{filter:invert(.91) hue-rotate(180deg) saturate(.72);opacity:.95}
html[data-theme=dark] :is(.manifold,.math-scene){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.manifold-stage,.scene-stage){background:radial-gradient(ellipse at center,#3a372854,transparent 72%),var(--paper)}
html[data-theme=dark] :is(.manifold-topline,.manifold figcaption,.manifold-controls button,.scene-topline,.scene-controls button,.math-scene figcaption){color:var(--muted)}
html[data-theme=dark] :is(.manifold-controls,.scene-controls){border-color:var(--line)}
html[data-theme=dark] :is(.manifold-controls button[aria-pressed=true],.scene-controls button[aria-pressed=true]){background:#302b1e;border-color:#a78a50;color:#f0d49b}
html[data-theme=dark] :is(.manifold-index,.scene-equation,.scene-topline span:last-child,.orcid-work span,.event-date-block strong){color:var(--accent)}
html[data-theme=dark] :is(.tangent-study,.tangent-study figure){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .tangent-study .tangent-panel{background:var(--surface-raised);border-color:var(--line)}
html[data-theme=dark] :is(.tangent-study figcaption,.tangent-study .tangent-heading){color:var(--muted)}
html[data-theme=dark] .tangent-study :is(.tangent-bound,button){border-color:var(--line-strong)}
html[data-theme=dark] .tangent-study button:hover{background:#302b1e}
.definition-math .math.inline{display:inline-block;max-width:100%;overflow-x:auto;overflow-y:hidden;vertical-align:middle}
@media(max-width:767px){:is(.software-page,#tangent-plane) .math.inline{display:inline-block;max-width:100%;overflow-x:auto;vertical-align:middle}}
/* Calendar, tables, citations and overlays. */
html[data-theme=dark] .event-calendar{background:var(--paper);border-color:var(--line)}
html[data-theme=dark] :is(.event-calendar-day,.calendar-nav){background:var(--paper);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .event-calendar-day.is-highlight-day{background:#3a301d}
html[data-theme=dark] .event-calendar-day.is-event-range{background:#23302b}
html[data-theme=dark] .event-calendar-day.is-selected{outline-color:var(--accent);background:#302b1e}
html[data-theme=dark] :is(.event-chip,.legend-dot){background:#283d3b;color:#c6ddd4}
html[data-theme=dark] :is(.event-chip-highlight,.legend-highlight){background:#6b542c;color:#fff1cf}
html[data-theme=dark] .legend-range{background:#587f76}
html[data-theme=dark] :is(code,pre,div.sourceCode){background:#22231e;color:#e5ddcd;border-color:var(--line)}
html[data-theme=dark] code.sourceCode span{color:#e5ddcd}
html[data-theme=dark] code.sourceCode :is(.dt,.kw,.va){color:#e2bc7b}
html[data-theme=dark] code.sourceCode :is(.st,.ot){color:#a6cebf}
html[data-theme=dark] :is(.table,table){color:var(--ink);border-color:var(--line);--bs-table-bg:transparent;--bs-table-color:var(--ink);--bs-table-border-color:var(--line)}
html[data-theme=dark] :is(th,td){border-color:var(--line)}
html[data-theme=dark] :is(.image-lightbox,.search-modal,.aa-Panel){background:#171914f5;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(.aa-Input,.aa-Form,.aa-Item,.search-result-doc){color:var(--ink);background:var(--paper);border-color:var(--line)}
/* The ten laboratories use a common surface and text hierarchy. */
html[data-theme=dark] :is(.controls,.result-card,.status,.plot-card,.plot-head,.plot-hint,.lab-plot,.lab-theory details,.theory>details,.formula-card,.point-check,.target-panel,.interval-card,.ed-sidebar,.ed-results,.ed-result,.ed-plot-wrap,.ed-section,.ed-plot-toolbar,.d-sidebar,.d-card,.d-panel,.d-side-section,.d-side-section>summary,.d-formula-preview,.d-plot-summary,.d-metric,.partition-editor-wrap,.module-nav,.stage-card,.stage-toolbar,.sidebar,.metrics,.metric,.reading,.sum-history){background:var(--paper)!important;color:var(--ink);border-color:var(--line)}
html[data-theme=dark] :is(input,select,textarea,.ed-input,.ed-select,.d-input,.d-select,.d-textarea){background:#24251f!important;color:var(--ink);border-color:#77705e}
html[data-theme=dark] input::placeholder{color:#b1aa9a;opacity:1}
html[data-theme=dark] input[type=range]{background:transparent!important;accent-color:var(--accent)}
html[data-theme=dark] input[type=checkbox]{accent-color:var(--accent)}
html[data-theme=dark] :is(.field small,.formula-label,.control-group p,.help,.canvas-label,.plot-caption,.target-hint,.d-label,.ed-label){color:var(--muted)}
html[data-theme=dark] :is(.preset-guide,.theorem,.junction-note,.plot-navigation,.how-to,.syntax-help){background:#22251f;border-color:#7a6a48;color:var(--ink-soft)}
html[data-theme=dark] :is(.tabs button[aria-pressed=true],.lab-nav a[aria-current],.view-tabs button[aria-selected=true],.d-segment button.active){background:#302b1e!important;color:#f0d49b!important;border-color:#a78a50}
html[data-theme=dark] .lab-nav a{background:transparent;color:var(--ink-soft)}
html[data-theme=dark] :is(.warning,.invalid-message,.error){color:#efb3a6}
html[data-theme=dark] .success{color:#acd2bc}
html[data-theme=dark] :is(.ed-status,.d-status){border-color:var(--line)}
html[data-theme=dark] :is(.ed-status.warning,.d-status.warning){background:#342d20;color:#f0cd8f}
html[data-theme=dark] :is(.ed-status.error,.d-status.error){background:#392823;color:#efb3a6}
html[data-theme=dark] :is(.ed-status.success,.d-status.success){background:#23342c;color:#acd2bc}
html[data-theme=dark] :is(.ed-main,.d-main){background:var(--page)}
html[data-theme=dark] :is(.ed-segment button.active,.ed-segmented button.active){background:#302b1e;color:#f0d49b;border-color:#a78a50}
html[data-theme=dark] :is(.brand-mark,.ed-mark){background:#302b1e;color:#f0d49b;border:1px solid #a78a50}
html[data-theme=dark] .ed-results strong,html[data-theme=dark] .d-metric strong{color:var(--ink)}
html[data-theme=dark] :is(.d-key.operator,.d-key.function,.sum-switch .quick-refine){background:#24271f;color:var(--ink);border-color:#77705e}
html[data-theme=dark] :is(.error,.status[data-kind=error]){background:#392823;color:#efb3a6;border-color:#bf887a}
html[data-theme=dark] :is(.scene,.scene-label,.sum-switch,.lang,.definition-card,.definition-grid>div,.reference-note,.d-help,.ed-help,.d-summary,.d-tab,.ed-tab,.partition-zoom-controls button){background:var(--paper);color:var(--ink-soft);border-color:var(--line)}
html[data-theme=dark] :is(button.primary,button[aria-pressed=true],button[aria-selected=true]){background:#302b1e;color:#f0d49b;border-color:#a78a50}
html[data-theme=dark] button:not(.theme-toggle):hover{background:#28291f;color:var(--ink);border-color:var(--accent)}
html[data-theme=dark] .partition-editor-svg [fill="#FFFFFF"]{fill:var(--paper)}
html[data-theme=dark] .partition-editor-svg :is([fill="#172033"],[fill="#39445A"]){fill:var(--chart-ink)}
html[data-theme=dark] .partition-editor-svg [stroke="#E5E9F0"]{stroke:var(--chart-grid)}
html[data-theme=dark] .partition-editor-svg [stroke="#172033"]{stroke:var(--line-strong)}
html[data-site-surface=jordan][data-theme=dark]{--soft:#d3ccbc}
html[data-site-surface=jordan] .app-header{position:sticky;top:0;z-index:900}
html[data-theme=dark] .js-plotly-plot .svg-container>svg.main-svg:first-of-type{background:var(--chart-paper)!important}
html[data-theme=dark] .js-plotly-plot .bg{fill:var(--chart-paper)!important}
html[data-theme=dark] .js-plotly-plot .modebar{background:transparent!important}
html[data-theme=dark] .js-plotly-plot .modebar-btn path{fill:#c5bcaa!important}
@media(max-width:767px){.theme-toggle{min-height:44px;min-width:72px}.navbar .theme-toggle{margin-left:.25rem!important}.theme-toggle .theme-label{font-size:11px}}
@media(prefers-reduced-motion:reduce){.theme-toggle{transition:none!important}}
