/* Appearance only: dimensions, positions and analysis rendering stay shared. */
html[data-theme="light"]{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark;--ink:#e3edf7;--muted:#a5b7ca;--teal:#59d6dc;--line:#294052;--bg:#0b1722}
html[data-theme="dark"] body{background:radial-gradient(ellipse at 73% 0,#122d40 0,transparent 48%),#0b1722;color:var(--ink)}
html[data-theme="dark"] a{color:#75dbe5}
html[data-theme="dark"] .topbar{background:#132432f2;border-color:#263b4c;box-shadow:0 2px 16px #0002}
html[data-theme="dark"] .brand{color:#f1f7fc}
html[data-theme="dark"] .brand-icon{background:linear-gradient(145deg,#289cba,#176680);color:#e8feff}
html[data-theme="dark"] .brand small,html[data-theme="dark"] .rail-caption,html[data-theme="dark"] .rail-bottom>small{color:#94adbf}
html[data-theme="dark"] .breadcrumb,html[data-theme="dark"] .breadcrumb strong{color:#d8e5f0}
html[data-theme="dark"] .icon-button,html[data-theme="dark"] .rail-close,html[data-theme="dark"] nav span{color:#b5c9dc}
html[data-theme="dark"] .avatar{background:#70d9e4;color:#153041}
html[data-theme="dark"] .left-rail{background:#142431f5;border-color:#263d50;box-shadow:3px 0 18px #0001}
html[data-theme="dark"] .rail-dashboard,html[data-theme="dark"] .left-rail .steps a,html[data-theme="dark"] .left-rail .steps span,html[data-theme="dark"] .rail-bottom>a{color:#b3c7d9}
html[data-theme="dark"] .left-rail .steps a:hover{background:#1c3447;color:#d4f5ff}
html[data-theme="dark"] .left-rail .steps .active,html[data-theme="dark"] .rail-bottom>[aria-current="page"]{background:#1a3e51;color:#7ce9ed;box-shadow:inset 3px 0 #65e6e4}
html[data-theme="dark"] .rail-help{background:#1b3143;border-color:#2a4257;color:#d3e6f5}
html[data-theme="dark"] .rail-help span{color:#9fb8cd}
html[data-theme="dark"] .guide-card,html[data-theme="dark"] .section-map{background:#172936ed;border-color:#233c4f;box-shadow:0 5px 20px #0002}
html[data-theme="dark"] .guide-card p,html[data-theme="dark"] .section-map small{color:#abc0d3}
html[data-theme="dark"] .section-map a{color:#e0eaf5}
html[data-theme="dark"] .section-map a>span,html[data-theme="dark"] .step-number{background:linear-gradient(140deg,#7df1e5,#45bdcf);color:#10303b;box-shadow:0 3px 7px #0003}
html[data-theme="dark"] .preset-guide>button:not(.text-button){background:#203549;border-color:#304b61;color:#d2e5f5}
html[data-theme="dark"] .preset-guide>button:first-of-type{background:#1c3d4a;color:#8aeee9;border-color:#315d66}
html[data-theme="dark"] .preset-guide>button.text-button,html[data-theme="dark"] .text-button{color:#79dae7}
html[data-theme="dark"] .landscape-card{background:linear-gradient(135deg,#112b43,#09182b 70%,#17364d);border-color:#284054}
html[data-theme="dark"] .landscape-card h2{color:#f0f7ff}
html[data-theme="dark"] .landscape-card p:not(.eyebrow),html[data-theme="dark"] .landscape-card small{color:#aac8dc}
html[data-theme="dark"] .landscape-card .eyebrow{color:#83becf}
html[data-theme="dark"] .projectbar{background:#102532f2;border-color:#213b4c}
html[data-theme="dark"] .projectbar span{color:#9ab2c5}
html[data-theme="dark"] .page-hero .lead,html[data-theme="dark"] .lead,html[data-theme="dark"] .muted{color:#abc0d3}
html[data-theme="dark"] .dataset-caption{color:#9bb4c8}
html[data-theme="dark"] .eyebrow{color:#77dfe2}
html[data-theme="dark"] .card,html[data-theme="dark"] .setting-card{background:#10222ff5;border-color:#253d50;box-shadow:0 6px 22px #0002}
html[data-theme="dark"] .data-preview{background:#182f42}
html[data-theme="dark"] .setting-header p{color:#a5bcd0}
html[data-theme="dark"] .setting-help{color:#76d9eb}
html[data-theme="dark"] .setting-card .synonym-rule{background:#172e3e;border-color:#2a455a}
html[data-theme="dark"] .setting-card .word-settings-grid button{background:#163141;color:#80e3e4;border-color:#2f5965}
html[data-theme="dark"] .project-card{color:#e4eff8}
html[data-theme="dark"] .project-card p{color:#a5bdd1}
html[data-theme="dark"] .project-card:hover{border-color:#50afb8}
html[data-theme="dark"] button,html[data-theme="dark"] .button{background:#20374a;color:#d9eaf7;border-color:#365269}
html[data-theme="dark"] .primary{background:linear-gradient(110deg,#227f9a,#196e87);border-color:#3597ae;color:#f4fdff;box-shadow:0 3px 10px #0002}
html[data-theme="dark"] .secondary{background:#1a3a4a;border-color:#2d5665;color:#83e1e6}
html[data-theme="dark"] .quiet,html[data-theme="dark"] .icon-button,html[data-theme="dark"] .rail-close,html[data-theme="dark"] .setting-help,html[data-theme="dark"] .text-button{background:transparent}
html[data-theme="dark"] .setting-help,html[data-theme="dark"] .text-button{color:#76d9eb}
html[data-theme="dark"] input:not([type=checkbox]):not([type=range]),html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#1c3143;color:#dfedf9;border-color:#345168;box-shadow:inset 0 1px 3px #0002}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#8ca6bc;opacity:1}
html[data-theme="dark"] input[type=checkbox],html[data-theme="dark"] input[type=radio]{accent-color:#63d9e5}
html[data-theme="dark"] input:focus,html[data-theme="dark"] textarea:focus,html[data-theme="dark"] select:focus,html[data-theme="dark"] button:focus-visible,html[data-theme="dark"] a:focus-visible,html[data-theme="dark"] summary:focus-visible{outline-color:#5dc9df}
html[data-theme="dark"] details>summary{background:#1b3447;border-color:#2c485f;color:#c1deed}
html[data-theme="dark"] details.card>summary{background:transparent;color:#e2edf7}
html[data-theme="dark"] th{background:#243e54;color:#d1e5f6}
html[data-theme="dark"] th,html[data-theme="dark"] td{border-color:#294459}
html[data-theme="dark"] tbody tr:nth-child(even){background:#162b3c}
html[data-theme="dark"] .list-row{border-color:#294052}
html[data-theme="dark"] .badge{background:#20464e;color:#94e6de}
html[data-theme="dark"] .notice{background:#163940;color:#b9e1e2;border-color:#55afaf}
html[data-theme="dark"] .alert{background:#452c25;color:#ffd3b4;border-color:#936648}
html[data-theme="dark"] .word-duplicates,html[data-theme="dark"] .synonym-rule .has-duplicates{color:#ffafa8}
html[data-theme="dark"] .upload{background:#172f3b;border-color:#48788a}
html[data-theme="dark"] .intro-tags span{color:#abc4d6;border-color:#3a5368}
html[data-theme="dark"] .analysis-list-actions summary{color:#ffd1b0}
html[data-theme="dark"] .trash-list table{background:#122736;border-color:#2a455a}
html[data-theme="dark"] .trash-list tbody tr:hover{background:#1f384b}
html[data-theme="dark"] .floating-dialog{background:#152b3b;color:#e2effb;border-color:#34556e;box-shadow:0 22px 80px #0009}
html[data-theme="dark"] .floating-dialog::backdrop{background:#030d1970}
html[data-theme="dark"] .floating-dialog>header button{background:#27465c;color:#dbedfc}
html[data-theme="dark"] .preset-item{background:#1a3447;border-color:#2e4f68}
html[data-theme="dark"] #preset-status{color:#82e2df}
html[data-theme="dark"] .analysis-settings-panel{background:#122736;color:#dcecf8;border-color:#3b5d74;box-shadow:0 12px 40px #0009}
html[data-theme="dark"] .analysis-settings-panel>header{background:#183548}
html[data-theme="dark"] .submit-caption,html[data-theme="dark"] footer{color:#91aabd}
html[data-theme="dark"] footer{border-color:#20394c}
html[data-theme="dark"] .net-motion-panel{background:#172f41;border-color:#34536b}
html[data-theme="dark"] #wc-form{background:#10222ff2}
html[data-theme="dark"] .chart-download-link{background:transparent;color:#78dfe8;border:0}
/* All figure surfaces remain light. Never invert, recolor or filter generated images. */
.chart,.net-canvas,.net-canvas svg,.wc-preview,.wc-preview img{background:#fff;color-scheme:light;filter:none}
.net-canvas{--ink:#19363d;--muted:#63777b;--line:#dce6e5;--teal:#147d80;color:#19363d}
html[data-theme="dark"] .net-canvas .net-sources{background:#fff;color:#19363d;border-color:#9bb9b5}
html[data-theme="dark"] .net-canvas .net-source-header{background:#f1f8fa;color:#19363d}
html[data-theme="dark"] .net-canvas .net-sources button{background:#fff;color:#19363d;border-color:#dce6e5}
html[data-theme="dark"] .net-canvas .net-sources article{background:#fff;color:#19363d}
html[data-theme="dark"] .net-canvas .net-sources p strong{color:#102e34;background:#fff2bd}
/* Slider labels sit over the graph while scrolling and retain their light plotting context. */
html[data-theme="dark"] .net-controls{color:#19363d}
/* A crisp one-pixel outline stays readable on both dark UI and white plots. */
html[data-theme="dark"] .net-controls label>span,
html[data-theme="dark"] .net-controls .net-edge-extra p{
 color:#f0f6fb;
 text-shadow:-1px -1px 0 #102936,0 -1px 0 #102936,1px -1px 0 #102936,
             -1px 0 0 #102936,1px 0 0 #102936,
             -1px 1px 0 #102936,0 1px 0 #102936,1px 1px 0 #102936;
}
html[data-theme="dark"] .net-controls input[type=range]{accent-color:#147d80}
.theme-options{display:flex;flex-direction:column;gap:12px;margin:22px 0}
.theme-option{display:flex;align-items:flex-start;gap:12px;border:1px solid var(--line);border-radius:9px;padding:16px;background:#f7fbfd;margin:0;cursor:pointer}
.theme-option input[type=radio]{display:block;width:17px;height:17px;flex-shrink:0;margin:3px 0 0;padding:0;accent-color:#099b9e}
.theme-option strong{font-size:14px}.theme-option small{display:block;font-size:12px;color:var(--muted);font-weight:400;line-height:1.8;margin-top:5px}
.theme-option:has(input:checked){border-color:#44adaf;background:#edf8f8;box-shadow:0 0 0 1px #44adaf}
html[data-theme="dark"] .theme-option{background:#1a3142;border-color:#314d62}
html[data-theme="dark"] .theme-option:has(input:checked){background:#1c4150;border-color:#5ccdd7;box-shadow:0 0 0 1px #5ccdd7}
#theme-save-status{color:#16868c;font-size:12px}html[data-theme="dark"] #theme-save-status{color:#8ae0de}
@media(max-width:680px){html[data-theme="dark"] .right-rail{background:#102430}html[data-theme="dark"] .left-rail{background:#142431}}
.wc-preview{border-color:#dce6e5}
html[data-theme="dark"] .net-motion-toggle button[aria-pressed="true"]{background:#63cfd9;color:#10333e}
