/* Signal visualization palette. Geometry, animation rules and choreography stay in their original files. */
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [stroke="#356b55"]{stroke:var(--ui-positive)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [fill="#356b55"]{fill:var(--ui-positive)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [stroke="#a34c3a"]{stroke:var(--ui-negative)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [fill="#a34c3a"]{fill:var(--ui-negative)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [stroke="#87653e"]{stroke:var(--ui-warning)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [fill="#87653e"]{fill:var(--ui-warning)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [stroke="#236879"]{stroke:var(--ui-muted)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [fill="#236879"]{fill:var(--ui-muted)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) [stroke="#5f685d"]{stroke:var(--ui-line)}
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) text{fill:var(--ui-muted)}
/* Pressure and histogram bars retain their existing transform animation; only ink opacity changes. */
html[data-theme] .rg-studio :is(#analysis-chart,#analysis-subplot) .pressure-bar,
html[data-theme] .rg-studio #analysis-subplot rect:is([fill="#356b55"],[fill="#a34c3a"]){opacity:.85;fill-opacity:1}
html[data-theme] .rg-studio progress::-webkit-progress-value{background:var(--ui-accent)}
html[data-theme] .rg-studio progress::-moz-progress-bar{background:var(--ui-accent)}
/* The monochrome external SVG defaults to black rather than inheriting page text color. */
html[data-theme=light] .model-directory-tiles .model-logo[src$="/chatgpt.svg"]{filter:none}
html[data-theme=dark] .model-directory-tiles .model-logo[src$="/chatgpt.svg"]{background:transparent;filter:invert(1)}
/* Keep the existing model-selection logic while overriding its dark-only inline icon tint. */
html[data-theme=light] .rg-studio [data-focus-logo][src$="/chatgpt.svg"]{filter:none!important}
html[data-theme=dark] .rg-studio [data-focus-logo][src$="/chatgpt.svg"]{filter:invert(1)!important}

/* Public page palette only: keep the existing hero layout, routes and timing. */
html[data-theme=dark] .ui-home :is(.artifact,.artifact.highlight){background:var(--ui-surface);border-color:var(--ui-line)}
html[data-theme=dark] .ui-home .artifact.highlight{border-color:var(--ui-accent)}
html[data-theme=dark] .ui-home :is(.artifact h3,.market-asset,.core-identity,.core-caption,.process-caption h3){color:var(--ui-text)}
html[data-theme=dark] .ui-home :is(.artifact-header,.artifact-header span,.model-status,.market-asset small,.check-line,.context-artifact small,.signal-artifact p,.signal-footer,.signal-footer b,.core-caption small,.stage-meta,.stage-bottom-note,.process-caption p){color:var(--ui-muted)}
html[data-theme=dark] .ui-home :is(.model-status,.signal-footer,.process-tabs){border-color:var(--ui-line)}
html[data-theme=dark] .ui-home .models button{background:var(--ui-surface);color:var(--ui-text)}
html[data-theme=dark] .ui-home .models button:is(.active,.selecting){background:var(--ui-accent-soft);color:var(--ui-text)}
html[data-theme=dark] .ui-home .models button[data-model=ChatGPT] svg.model-logo{fill:var(--ui-text)}
html[data-theme=dark] .ui-home .check-line i{color:var(--ui-positive)}
html[data-theme=dark] .ui-home .scan-track{background:var(--ui-surface-alt)}
html[data-theme=dark] .ui-home .scan-track i{background:var(--ui-accent)}
html[data-theme=dark] .ui-home .context-artifact svg{stroke:var(--ui-accent)}
html[data-theme=dark] .ui-home .signal-direction{color:var(--ui-positive)}
html[data-theme=dark] .ui-home .signal-artifact[data-side=sell] .signal-direction{color:var(--ui-negative)}
html[data-theme=dark] .ui-home .process-tabs button{background:transparent;color:var(--ui-muted)}
html[data-theme=dark] .ui-home .process-tabs button[aria-selected=true]{color:var(--ui-text)}
html[data-theme=dark] .ui-home .process-tabs button i{background:var(--ui-accent)}
html[data-theme=dark] .ui-home .connections{stroke:var(--ui-line)}
html[data-theme=dark] .ui-home .connections :is(#active-route,#flow-tail,#flow-arrow,#arrival-ring){stroke:var(--ui-accent)}
html[data-theme=dark] .ui-home .connections :is(#flow-dot,#flow-follow){fill:var(--ui-accent)}
html[data-theme=dark] .ui-home :is(.core-dot,.status-dot){background:var(--ui-accent)}
@media(max-width:600px){html[data-theme=dark] .ui-home .core-caption{background:linear-gradient(transparent,var(--ui-bg) 30%)}}

/* Readable market illustrations and supporting labels. */
html[data-theme] .ui-home :is(.reason-grid article>span,.pressure-caption,.pressure-live,.eyebrow,.media-types,.community-art>span){color:var(--ui-muted)}
html[data-theme] .ui-home .line-visual svg{stroke:var(--ui-muted)}
html[data-theme] .ui-home .rings i{border-color:var(--ui-muted)}
html[data-theme] .ui-home .buy-depth,html[data-theme] .ui-home .pressure-labels span:first-child{color:var(--ui-positive)}
html[data-theme] .ui-home .sell-depth,html[data-theme] .ui-home .pressure-labels span:last-child{color:var(--ui-negative)}
html[data-theme] .ui-home .pressure-grid{stroke:var(--ui-line)}
html[data-theme] .ui-home .pressure-mid{stroke:var(--ui-muted)}
html[data-theme] .ui-home .pressure-balance i{background:var(--ui-positive)}
html[data-theme] .ui-home .pressure-balance b{background:var(--ui-negative)}
html[data-theme] .ui-home .voice-shape i{background:var(--ui-accent)}

/* Position planner: amount, field surfaces and risk controls use paired theme colors. */
html[data-theme] .ui-home :is(.tool-grid .calculator,.tool-grid .result-sample,.allocation,.result-buttons,.tool-card-actions){border-color:var(--ui-line)}
html[data-theme] .ui-home .calc-top strong{color:var(--ui-text)}
html[data-theme] .ui-home :is(.calc-top>div>span,.calc-currency,.calc-currency small,.calculator label,.calc-foot,.allocation>div:last-child,.result-sample>small,.result-sample>div>span){color:var(--ui-muted)}
html[data-theme] .ui-home .balance-field{background:var(--ui-surface-alt);border-color:var(--ui-line);color:var(--ui-muted)}
html[data-theme] .ui-home .balance-field input[type=number]{background:transparent;color:var(--ui-text)}
html[data-theme] .ui-home .risk-badge{background:var(--ui-accent-soft);color:var(--ui-text)}
html[data-theme] .ui-home .calculator input[type=range]{background:linear-gradient(to right,var(--ui-accent) var(--risk-fill,11.11%),var(--ui-line) var(--risk-fill,11.11%));accent-color:var(--ui-accent)}
html[data-theme] .ui-home .calculator input[type=range]::-webkit-slider-thumb{background:var(--ui-accent);border-color:var(--ui-surface);box-shadow:0 0 0 1px var(--ui-accent)}
html[data-theme] .ui-home .calculator input[type=range]::-moz-range-thumb{background:var(--ui-accent);border-color:var(--ui-surface)}
html[data-theme] .ui-home .allocation strong{color:var(--ui-positive)}
html[data-theme] .ui-home .result-buttons button{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme] .ui-home .result-buttons button[aria-pressed=true]{background:var(--ui-accent-soft);border-color:var(--ui-accent);color:var(--ui-text)}
html[data-theme] .ui-home #result-label{color:var(--ui-positive)!important}
html[data-theme] .ui-home .result-sample:has([data-outcome=loss][aria-pressed=true]) #result-label{color:var(--ui-negative)!important}
html[data-theme] .ui-home .result-sample:has([data-outcome=avoid][aria-pressed=true]) #result-label{color:var(--ui-warning)!important}

/* Secondary public sections and feedback retain the same surface hierarchy. */
html[data-theme=dark] .ui-home :is(.plans small,.plans ul,.plans li:before,.faq p,footer>span,footer>a:not(.brand),footer>small,.brand small,.feedback-audio>span,.feedback-video>span){color:var(--ui-muted)}
html[data-theme=dark] .ui-home :is(.faq details,footer,.status-message){border-color:var(--ui-line)}
html[data-theme=dark] .ui-home .rg-toast{background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-text)}
html[data-theme=dark] .ui-home :is(.rg-toast p,.rg-toast-label){color:var(--ui-muted)}
html[data-theme=dark] .ui-home .growth svg{stroke:var(--ui-warning)}
html[data-theme=dark] .ui-home .growth circle{fill:var(--ui-warning);stroke:var(--ui-surface)}
