/* One brand, two display modes. Existing dark palette is unchanged. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:0;background:transparent;color:var(--muted);font:500 12px/1.4 var(--sans);white-space:nowrap;flex-shrink:0}
.theme-toggle:hover{border-color:var(--accent)}
.theme-toggle:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.theme-toggle [aria-hidden]{color:var(--line)}
html[data-theme=light] .theme-light,html[data-theme=dark] .theme-dark{color:var(--paper);text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:5px;font-weight:650}
.header-tools,.theme-tools{display:flex;gap:12px;align-items:center}
.theme-tools{margin-left:auto}
/* Break before the additional control could crowd the navigation. */
@media(max-width:1100px){.cierre-page .header{grid-template-columns:minmax(0,1fr) auto;column-gap:20px;row-gap:16px}.cierre-page .header>.page-nav{display:none}.cierre-page .header>.header-tools{grid-column:2;grid-row:1}.cierre-page .header>.mobile-nav{display:block}}
@media(max-width:600px){.cierre-page .header>.identity{grid-column:1/-1}.cierre-page .header>.header-tools{grid-column:1/-1;grid-row:2;justify-self:stretch;justify-content:space-between;width:100%}.cierre-page .header>.mobile-nav{grid-row:3}.p7-header{flex-wrap:wrap;gap:14px}.p7-header>.theme-tools{width:100%;margin:0;justify-content:space-between}.document-header{align-items:center}.document-header>.theme-toggle{margin-left:auto}}
html[data-theme=dark]{color-scheme:dark}
html[data-theme=light]{--bg:#f3eee4;--surface:#e9e7df;--paper:#101c24;--muted:#4a5e69;--line:#b3b9b7;--accent:#8e4729;--amber:#805616;--ui-border-strong:#6b7b80;--ui-surface-raised:var(--surface);--ui-surface-input:#fbf8f1;--ui-ink:var(--paper);--ui-ink-secondary:var(--muted);--ui-focus:var(--accent);--ui-review-bg:#eee0c2;--ui-review-ink:#66420d;--ui-shadow:#d9d9d1;color-scheme:light}
html[data-theme=light] .hero-kicker,html[data-theme=light] .hero-copy .project-label,html[data-theme=light] .intro,html[data-theme=light] .record-copy>span:last-of-type{color:var(--muted)}
html[data-theme=light] .guide,html[data-theme=light] .contact-path,html[data-theme=light] .services,html[data-theme=light] .services-grid article{background:var(--surface)}
html[data-theme=light] .choices button:hover,html[data-theme=light] .choices button[aria-pressed=true],html[data-theme=light] .record:hover,html[data-theme=light] .record.selected{background:#dde3db;border-color:var(--accent)}
html[data-theme=light] .record[id^=f].selected{background:var(--ui-review-bg);border-top-color:var(--amber)}
html[data-theme=light] .inspector{background:var(--surface);color:var(--paper);border-color:var(--ui-border-strong);box-shadow:none}
html[data-theme=light] .inspector-top,html[data-theme=light] .inspector-status,html[data-theme=light] .inspector-evidence .micro,html[data-theme=light] .source-note,html[data-theme=light] .inspector-summary,html[data-theme=light] .inspector-body{color:var(--muted)}
html[data-theme=light] .inspector-mark,html[data-theme=light] .inspector.is-failure .inspector-mark{color:var(--accent)}
html[data-theme=light] .research-proof{background:var(--surface);border-color:var(--accent)}
html[data-theme=light] .research-proof a{color:var(--accent)}
html[data-theme=light] .research-proof small{color:var(--muted)}
html[data-theme=light] .step,html[data-theme=light] .choices button{border-color:var(--ui-border-strong)}
html[data-theme=light] .step[aria-pressed=true],html[data-theme=light] .step[aria-pressed=true]>span{color:var(--bg)}
html[data-theme=light] .node{fill:var(--bg);stroke:#52694e}
html[data-theme=light] .instrument[data-stage="1"] .node-b .node{fill:#dce5d4;stroke:var(--accent)}
html[data-theme=light] .core circle{fill:var(--bg);stroke:#52694e}
html[data-theme=light] .orbits{stroke:#40583e}
html[data-theme=light] .axes{stroke:var(--line)}
html[data-theme=light] .ticks,html[data-theme=light] .relation{stroke:#52694e}
html[data-theme=light] .question-sign,html[data-theme=light] .footer-mark{color:#d8d9d0}
html[data-theme=light] .boundary svg{stroke:#52694e}
html[data-theme=light] .primary-link{border-color:var(--accent)}
html[data-theme=light] .conversion-page .pair-wire,html[data-theme=light] .conversion-page .receipt .match{color:#2d634d}
html[data-theme=light] .conversion-page [data-state=difference] .pair-wire,html[data-theme=light] .conversion-page .receipt .difference{color:#a03b2c}
html[data-theme=light] .conversion-page [data-state=ambiguous] .pair-wire,html[data-theme=light] .conversion-page .receipt .review{color:#805616}
html[data-theme=light] .match-example .live-demo textarea,html[data-theme=light] .match-example .csv-source select{background:var(--ui-surface-input);color:var(--paper);border-color:var(--ui-border-strong)}
html[data-theme=light] .match-example .csv-source,html[data-theme=light] .match-example .csv-source input[type=file],html[data-theme=light] .match-example .csv-preview-table th,html[data-theme=light] .match-example .csv-preview-table td{border-color:var(--ui-border-strong)}
html[data-theme=light] .match-example .csv-source input[type=file]::file-selector-button{background:var(--surface);color:var(--paper);border-color:var(--ui-border-strong)}
html[data-theme=light] .match-example .csv-mode input,html[data-theme=light] .match-example .csv-header-label input{accent-color:var(--accent)}
html[data-theme=light] .match-example .live-demo [aria-invalid=true],html[data-theme=light] .match-example .csv-source [aria-invalid=true]{border-color:var(--amber)}
html[data-theme=light] .p7-field input,html[data-theme=light] .p7-field select,html[data-theme=light] .p7-field textarea{border-color:var(--ui-border-strong)}
html[data-theme=light] .p7-submit:hover{background:var(--accent)}
html[data-theme=light] .legal-r2-content blockquote{background:var(--surface)}
@media print{.theme-toggle{display:none!important}html[data-theme]{--bg:#fff;--surface:#fff;--paper:#111;--muted:#333;--accent:#111;--amber:#111;--line:#777;color-scheme:light}}

/* Contrast and narrow-header refinements found in browser review. */
.cierre-page .header>.header-tools{display:flex;flex-wrap:nowrap}
html[data-theme=light] .audit-demo-lead,html[data-theme=light] .audit-demo-table th,html[data-theme=light] .audit-demo-under,html[data-theme=light] .audit-demo-bar,html[data-theme=light] .audit-demo-bar .micro,html[data-theme=light] .audit-demo-metrics span,html[data-theme=light] .audit-demo-fence,html[data-theme=light] .audit-demo-details-body>p,html[data-theme=light] .audit-demo-details-body li span,html[data-theme=light] .demo-downloads>span{color:var(--muted)}
html[data-theme=light] .audit-demo-rule{color:var(--paper)}
html[data-theme=light] .audit-demo-input,html[data-theme=light] .audit-demo-output,html[data-theme=light] .audit-demo-details-body{background:var(--surface);border-color:var(--line)}
html[data-theme=light] .audit-demo-table th,html[data-theme=light] .audit-demo-table td,html[data-theme=light] .audit-demo-grid,html[data-theme=light] .audit-demo-bar,html[data-theme=light] .audit-demo-under,html[data-theme=light] .audit-demo-fence{border-color:var(--line)}
html[data-theme=light] .demo-state{color:#2d634d;border-color:#52694e}
html[data-theme=light] .demo-state-review{color:var(--ui-review-ink);background:var(--ui-review-bg);border-color:var(--amber)}
html[data-theme=light] .audit-demo-metrics>div:nth-child(2) strong{color:var(--amber)}
html[data-theme=light] .audit-demo-details summary:hover,html[data-theme=light] .audit-demo-details summary:focus-visible{background:var(--bg)}
html[data-theme=light] .legal-pending{background:var(--surface);color:var(--paper)}

/* Original Lucide icons; a single keyboard-operable toggle. */
.theme-toggle-icons{gap:4px;min-width:80px;min-height:44px;padding:5px;border-radius:999px}
.theme-toggle-icons .theme-icon{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;border-radius:50%;color:var(--muted);text-decoration:none}
.theme-toggle-icons svg{display:block;width:19px;height:19px;pointer-events:none}
html[data-theme=light] .theme-toggle-icons .theme-light,html[data-theme=dark] .theme-toggle-icons .theme-dark{background:var(--accent);color:var(--bg);text-decoration:none}
@media(forced-colors:active){.theme-toggle-icons .theme-icon{color:ButtonText}html[data-theme=light] .theme-toggle-icons .theme-light,html[data-theme=dark] .theme-toggle-icons .theme-dark{outline:2px solid Highlight;outline-offset:-2px;color:ButtonText}}

.theme-toggle-icons .theme-icon svg{color:inherit}
