/* Semantic palette. Light is the no-script and first-visit default. */
:root,html[data-theme="light"]{
  color-scheme:light;--bg:#f7fafb;--panel:#fff;--line:#cbd7dd;--text:#172c39;
  --muted:#4e6571;--green:#087454;--cyan:#08716b;--soft:#edf3f5;
  --accent-soft:#e3f2eb;--accent-text:#096347;--button-text:#fff;
  --header-bg:#f7fafbf5;--field:#fff;--control-line:#74858f;
  --error:#ad2d24;--hero-gradient:linear-gradient(100deg,#08716b,#256e24);
  --strip:linear-gradient(110deg,#e2f2e9,#ecf3f8);
}
html[data-theme="dark"]{
  color-scheme:dark;--bg:#080d12;--panel:#101920;--line:#344850;--text:#edf2f3;
  --muted:#a4b7bf;--green:#9df5c5;--cyan:#50dcca;--soft:#111e27;
  --accent-soft:#142d24;--accent-text:#b0f2ce;--button-text:#10231d;
  --header-bg:#080d12f5;--field:#091116;--control-line:#70868d;
  --error:#ffab9e;--hero-gradient:linear-gradient(100deg,#70e9d1,#b4f894);
  --strip:linear-gradient(110deg,#122b24,#101b23);
}
.header{background:var(--header-bg);border-color:var(--line)}
.header .nav{gap:18px}.nav nav{gap:26px}.nav-actions{display:flex;align-items:center;gap:16px}
.nav nav a,.eyebrow,.section-kicker,.hero-description,.hero-note,.visual-top,.visual-bottom,
.visual-label,.idea-intro p,.concept p,.concept-number,.card-meta,.article-card p,.about-copy p,
.about-signature,.footer-top p,.footer-top>a:last-child,.footer-bottom,.filters a,
.article-summary,.prose{color:var(--muted)}
.nav nav a:hover,.nav nav a.active,.formula,.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6{color:var(--text)}
.visual-live,.card-meta>span{color:var(--accent-text)}
.hero h1 em{background:var(--hero-gradient);background-clip:text;-webkit-text-fill-color:transparent}
.nav-action,.button,.concept,.about-signature,.visual-bottom,.footer-bottom,.prose td,.prose th{border-color:var(--line)}
.nav-action,.button,.filters a{border-color:var(--control-line)}
.tiny-line{background:var(--muted)}.idea-section,.footer{background:var(--soft)}
.primary,.filters a.selected,.qr-actions .primary{color:var(--button-text);background:var(--green);border-color:var(--green)}
.button:hover{background:var(--accent-soft);color:var(--accent-text);border-color:var(--green)}
.skip{color:var(--button-text)}
.prose{color:var(--text)}.prose blockquote{background:var(--accent-soft)}
.prose pre,.prose code{background:var(--soft);color:var(--text);border-color:var(--line)}
.prose pre code{background:none}.prose th{background:var(--soft)}
.preview-banner{background:var(--accent-soft);border-color:var(--green);color:var(--accent-text)}
/* Original images and the QR canvas are never inverted or dimmed. Transparent
   article illustrations get a stable white surface in either theme. */
.prose img,.article-cover,.card-art img{background:#fff}
.card-art{border-color:var(--control-line)}
.art-caption,.art-index{color:#c0d9d2}.art-glyph span{color:#a0e8d1}
.art-practice .art-glyph span{color:#b2dce8}
/* Existing dark artwork remains a self-contained illustration. */
html[data-theme="light"] .growth-visual{background:radial-gradient(ellipse at 66% 42%,#d9eee6,transparent 65%)}
html[data-theme="light"] .growth-svg #line stop{stop-color:#087454;stop-opacity:1}
html[data-theme="light"] .growth-svg #line stop:last-child{stop-color:#426c12}
html[data-theme="light"] .growth-svg #fill stop{stop-color:#087454}
html[data-theme="light"] .growth-svg #grid path{stroke:#536e79;stroke-opacity:.16}
html[data-theme="light"] .growth-svg ellipse{stroke:#087454;stroke-opacity:.2}
html[data-theme="light"] .growth-svg path[stroke="#637d87"],
html[data-theme="light"] .growth-svg path[stroke="#65858f"]{stroke:#4e6571;stroke-opacity:.6}
html[data-theme="light"] .growth-svg path[stroke="#c5ff76"]{stroke:#426c12}
html[data-theme="light"] .growth-svg circle{fill:#087454;stroke:#087454}
html[data-theme="light"] .growth-svg circle[r="17"]{fill:none}
.growth-svg text{fill:var(--muted)}
/* Tools: use the same palette for every nested surface and state. */
.tool-entry,.home-tool-strip{background:var(--strip);border-color:var(--line)}
.tool-badge{color:var(--accent-text);background:var(--accent-soft);border-color:var(--line)}
.tool-entry p,.tool-entry-bottom,.panel-title>span,.qr-label,.qr-input-meta,
.qr-hint strong,.qr-hint p,.qr-empty,.qr-footnote,.qr-output pre{color:var(--muted)}
.tool-entry-bottom,.qr-hint{border-color:var(--line)}
.tool-panel{background:var(--panel);border-color:var(--line)}
#qr-input{background:var(--field);color:var(--text);border-color:var(--control-line)}
#qr-input::placeholder{color:var(--muted);opacity:1}
#qr-input[aria-invalid="true"]{border-color:var(--error)}
.qr-actions .button{background:var(--soft);color:var(--text);border-color:var(--control-line)}
.qr-actions .primary{background:var(--green);color:var(--button-text);border-color:var(--green)}
.qr-actions .button:hover:not(:disabled){background:var(--accent-soft);color:var(--accent-text);border-color:var(--green)}
.qr-actions button:disabled{opacity:1;background:var(--soft);color:var(--muted);border-color:var(--line)}
.qr-status{color:var(--green)}.qr-status[data-state="error"],.qr-error{color:var(--error)}
.qr-error{border-color:var(--error)}
.qr-stage{background:var(--soft);border-color:var(--control-line)}
.qr-empty>span{color:var(--muted)}.qr-output{background:var(--soft);border-color:var(--line)}
@media(max-width:1100px){.nav-actions .nav-action{display:none}.nav nav{gap:20px}}
@media(min-width:601px) and (max-width:800px){.header .nav{flex-wrap:wrap;height:auto;padding:12px 0;gap:6px 16px}.header .nav nav{order:3;width:100%;justify-content:center}.nav nav a{padding:10px 8px}.nav nav a.active:after{bottom:2px}}
@media(max-width:600px){.header .nav{justify-content:space-between;gap:6px 10px}.nav-actions{margin-left:auto}.nav nav{order:3}.nav nav a.active{background:var(--accent-soft);color:var(--green)}.appearance-switch>span{display:none}.appearance-switch select{width:104px}.header .brand{font-size:18px;gap:6px}.header .brand img{width:28px;height:28px}}
