/* Reading surfaces only. Technical scene colours and document exports remain independent. */
:root[data-appearance]{color-scheme:light;--appearance-bg:#f5f2eb;--appearance-panel:#faf8f3;--appearance-soft:#ebe8df;--appearance-ink:#30352f;--appearance-muted:#62685e;--appearance-line:#d0cec4;--appearance-accent:#8c583b;--appearance-on-accent:#fff;--appearance-positive:#3f7a52;--appearance-warning:#80591c;--appearance-danger:#b3261e}
:root[data-appearance=dark]{color-scheme:dark;--appearance-bg:#14171d;--appearance-panel:#1c2027;--appearance-soft:#272c34;--appearance-ink:#f0eee9;--appearance-muted:#b0b2ad;--appearance-line:#424852;--appearance-accent:#e5a476;--appearance-on-accent:#14171d;--appearance-positive:#94c7a1;--appearance-warning:#e5be7a;--appearance-danger:#f2a198}
:root[data-appearance]{--atomsh-paper:var(--appearance-bg);--atomsh-ink:var(--appearance-ink);--atomsh-muted:var(--appearance-muted);--atomsh-line:var(--appearance-line);--atomsh-accent:var(--appearance-accent);--atomsh-logo:var(--appearance-ink);--atomsh-cursor:var(--appearance-accent);--mb-paper:var(--appearance-bg);--mb-ink:var(--appearance-ink);--mb-muted:var(--appearance-muted);--mb-line:var(--appearance-line);--mb-accent:var(--appearance-accent)}
:root[data-appearance][data-atomsh-tool]{background:var(--appearance-bg);color:var(--appearance-ink)}
.appearance-toggle{display:none;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;padding:0;border:0;background:none;color:inherit;cursor:pointer;touch-action:manipulation}
:root[data-appearance] .appearance-toggle{display:inline-flex}.appearance-toggle:hover{color:var(--appearance-accent)}.appearance-toggle:focus-visible{outline:2px solid currentColor;outline-offset:2px}.appearance-toggle svg{pointer-events:none}.appearance-toggle .appearance-sun,:root[data-appearance=dark] .appearance-toggle .appearance-moon{display:none}:root[data-appearance=dark] .appearance-toggle .appearance-sun{display:block}

/* Marine Subsea Intelligence: keep basemap, status colours and layer encodings unchanged. */
:root[data-appearance][data-atomsh-tool=marine-subsea-intelligence]{--bg:var(--appearance-bg);--bar:var(--appearance-bg);--panel:var(--appearance-bg);--panel2:var(--appearance-panel);--line:var(--appearance-line);--text:var(--appearance-ink);--muted:var(--appearance-muted);--accent:var(--appearance-accent);--on-accent:var(--appearance-on-accent);--ok:var(--appearance-positive);--warn:var(--appearance-warning);--alert:var(--appearance-danger)}

:root[data-appearance][data-atomsh-tool=cable-lab]{--ink:var(--appearance-ink);--muted:var(--appearance-muted);--line:var(--appearance-line);--orange:var(--appearance-accent);--paper:var(--appearance-panel)}
:root[data-appearance][data-atomsh-tool=rene-descartes]{--paper:var(--appearance-bg);--ink:var(--appearance-ink);--muted:var(--appearance-muted);--line:var(--appearance-line);--accent:var(--appearance-accent);--surface:var(--appearance-panel);--soft:var(--appearance-soft);--accent-ink:var(--appearance-on-accent)}
:root[data-appearance][data-atomsh-tool=sophie-germain]{--paper:var(--appearance-bg);--paper-raised:var(--appearance-panel);--graphite:var(--appearance-ink);--copper:var(--appearance-accent);--ui-muted:var(--appearance-muted);--ui-line:var(--appearance-line);--ui-scheme:inherit;--selected:var(--appearance-soft);--selected-ink:var(--appearance-ink)}
:root[data-appearance][data-atomsh-tool=subsea-optical-lab]{--bg:var(--appearance-bg);--panel:var(--appearance-panel);--line:var(--appearance-line);--muted:var(--appearance-muted);--aqua:var(--appearance-accent);--white:var(--appearance-ink);--gold:var(--appearance-accent);--accent-soft:var(--appearance-soft);--control:var(--appearance-panel);--hover:var(--appearance-soft);--on-accent:var(--appearance-on-accent)}
:root[data-appearance][data-atomsh-tool=cable-academy]{--background:var(--appearance-bg);--foreground:var(--appearance-ink);--card:var(--appearance-panel);--card-foreground:var(--appearance-ink);--popover:var(--appearance-panel);--popover-foreground:var(--appearance-ink);--primary:var(--appearance-accent);--primary-foreground:var(--appearance-on-accent);--secondary:var(--appearance-soft);--secondary-foreground:var(--appearance-ink);--muted:var(--appearance-soft);--muted-foreground:var(--appearance-muted);--accent:var(--appearance-soft);--accent-foreground:var(--appearance-ink);--border:var(--appearance-line);--input:var(--appearance-line);--ring:var(--appearance-accent);--brand-accent:var(--appearance-accent);--brand-accent-text:var(--appearance-accent);--brand-hover:var(--appearance-accent);--surface-soft:var(--appearance-soft);--surface-warm:var(--appearance-soft);--strong-surface:#30372f;--sidebar-paper:var(--appearance-panel);--sidebar-ink:var(--appearance-ink);--sidebar-muted:var(--appearance-muted);--sidebar-line:var(--appearance-line);--sidebar-hover:var(--appearance-soft);--sidebar-selected:var(--appearance-soft);--sidebar-track:var(--appearance-line);--header-paper:var(--appearance-bg);--header-ink:var(--appearance-ink);--header-muted:var(--appearance-muted);--header-line:var(--appearance-line)}

:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(.project-strip,.profile-panel,.controls-panel,.results-strip,.data-panel,.comparison,.modal,.project-toolbar,.dynamic-config,.mesh-study,.verification-evidence,.dropzone,.form-grid input,.mapping-grid select,th){background:var(--appearance-panel);color:var(--appearance-ink);border-color:var(--appearance-line)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(.project-icon,.model-tag,.input-wrap,.play-button,.formula,.dynamic-empty,.command-table input:disabled){background:var(--appearance-soft);color:var(--appearance-ink);border-color:var(--appearance-line)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(.text-button,.project-name>div>span,.timeline-caption,.kp-readout small,.model-tag>span,.section-label,.section-label>span,.depth-value>span,.depth-value small,.input-wrap>span,.control-hint,.result-mini strong small,.result-mini>div:first-child>span,.eyebrow,.local-tag){color:var(--appearance-muted)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(.depth-value strong,.input-wrap input){color:var(--appearance-ink)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(input:not([type=range]):not([type=checkbox]),select,textarea){background:var(--appearance-panel);color:var(--appearance-ink);border-color:var(--appearance-line)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] :is(.notice,.notice.danger,.dynamic-demo,.mesh-verdict,.mesh-verdict.attention,.limit-badge,.limit-badge.over){background:var(--appearance-soft);color:var(--appearance-warning);border-color:var(--appearance-line)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] .data-badge{background:var(--appearance-soft);color:var(--appearance-positive)!important}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] .data-badge.synthetic{color:var(--appearance-warning)!important}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] .chart-text{fill:var(--appearance-muted)}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] .profile-wrap :is(polyline,circle)[stroke="#426f71"]{stroke:#88b8b4}
:root[data-appearance=dark][data-atomsh-tool=cable-lab] .profile-wrap circle[fill="#426f71"]{fill:#88b8b4}
:root[data-appearance][data-atomsh-tool=sophie-germain] :is(.view-status,.section-note){background:var(--paper);color:var(--ui-muted)}
:root[data-appearance][data-atomsh-tool=sophie-germain] .inspector .evidence span{color:var(--appearance-positive)}
/* The scene stays dark in both reading themes. Its overlays need their own ink. */
:root[data-appearance][data-atomsh-tool=sophie-germain] :is(.title-block,.scene-tabs,.view-controls,.camera-controls,.viewpoints,.annotation,.scene-caption,.scene-hint,.flow-legend,.scale){--text:#f0eee9;--muted:#c2cdd2;--line:#617681;--accent:#efb48f;--selected:#f0eee9;--selected-ink:#14232b;color:var(--text);color-scheme:dark}

/* Existing helper text uses the same readable contrast in both appearances. */
:root[data-appearance][data-atomsh-tool=cable-lab] :is(.project-name>div>span,.dynamic-empty>p,.experimental-pill,.dynamic-config>p>span,.workspace-footer p){color:var(--appearance-muted)}
:root[data-appearance=light][data-atomsh-tool=cable-lab] .data-badge.synthetic{color:var(--appearance-warning)!important}
:root[data-appearance][data-atomsh-tool=sophie-germain] #scale-label{color:var(--muted)}
:root[data-appearance][data-atomsh-tool=subsea-optical-lab] .ends{color:var(--appearance-muted)}
:root[data-appearance][data-atomsh-tool=cable-academy] .source-context{color:var(--appearance-muted)!important}
