/* 0.4.1 application: plots fit their viewport; domain colours remain semantic. */
html body .chart.qe-live-chart{width:100%;min-width:0;max-width:100%;height:auto;min-height:0;overflow:hidden;scroll-behavior:auto;touch-action:pan-y;position:relative}
html body .qe-live-chart .qe-plot{width:100%;min-width:0;overflow:hidden;position:relative}
html body .qe-live-chart svg{min-width:0!important;width:auto;max-width:none;height:auto;aspect-ratio:auto}
html body .qe-live-chart svg text{font-family:inherit}
.qe-live-tools{display:flex;justify-content:flex-end;align-items:flex-start;gap:8px;flex-wrap:wrap;margin-top:8px;min-width:0}
.qe-live-tools:empty{display:none}.qe-live-tools button,.qe-live-tools summary,.qe-live-tools input{min-height:44px;max-width:100%;font:inherit;font-size:12px}.qe-live-tools details{padding:0;border:0}.qe-live-tools summary{display:flex;align-items:center;cursor:pointer;color:var(--muted)}
.qe-live-tools details[open]{display:flex;flex-wrap:wrap;gap:8px}.qe-live-tools button[hidden]{display:none!important}
.history-chart-toolbar{align-items:flex-start;gap:12px}.history-series-controls{flex-wrap:wrap}
.history-chart-frame{min-width:0}.card,.card-head>div{min-width:0}.card-head h2,.card-head h3{overflow-wrap:anywhere;line-height:1.45}
.metric-card,.backtest-metric,.result-card{padding:20px!important}.metric-card strong,.backtest-metric strong{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.table-scroll{max-width:100%;overscroll-behavior-x:contain}.table-scroll table{font-variant-numeric:tabular-nums}.table-scroll th{position:sticky;top:0;background:var(--surface)}
html body .history-selected-snapshot:not(.qr-native-readout){display:block;margin:12px 0}.history-selected-values{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px}
.chart-help{display:none}
@media(max-width:600px){
 .card{padding:16px!important}.card-head{gap:12px;align-items:flex-start}.card-head h2,.card-head h3{font-size:16px}
 .history-chart-toolbar{display:block}.history-series-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.history-series-controls button{min-height:44px;white-space:normal;text-align:left}
 .history-chart-meta{grid-template-columns:1fr}.table-scroll td,.table-scroll th{padding:12px}
 .metric-card,.backtest-metric,.result-card{padding:16px!important}.qe-live-tools input{width:135px}
}

/* 0.4.2 neutral surfaces; signal and execution colours stay semantic. */
html[data-design-engine] :is(.status-panel,.flow-normalization-card,.history-chart-callout){background:var(--qe-surface);color:var(--qe-text);border-color:var(--qe-border)}

/* Pinned common shell 0.4.2 sha256:d3ef280dc5d36fad3b4e2b32d170e70fdc2b64fbde91e463e1c08bd11f3be485 */
/* Quant 0.4.2: shell roles only. Load explicitly after project styles. */
html[data-theme="dark"]{--qs-bg:#101416;--qs-surface:#171d20;--qs-raised:#20282c;--qs-text:#edf3f2;--qs-muted:#a6b4b6;--qs-border:#364247;--qs-accent:#69d3cf}
html[data-theme="light"]{--qs-bg:#f2f5f4;--qs-surface:#ffffff;--qs-raised:#e9efed;--qs-text:#172725;--qs-muted:#536762;--qs-border:#c6d3ce;--qs-accent:#007e79}
html:root[data-theme] body.qd-v04,html:root[data-theme][data-quant-silicon] body.qd-v04{--qd-bg:var(--qs-bg)!important;--qd-surface:var(--qs-surface)!important;--qd-raised:var(--qs-raised)!important;--qd-text:var(--qs-text)!important;--qd-muted:var(--qs-muted)!important;--qd-border:var(--qs-border)!important;--qd-accent:var(--qs-accent)!important;background:var(--qs-bg)!important;color:var(--qs-text)!important}
html[data-theme] body.qd-v04 :is(.qd-sidebar,.qd-shell){--qd-bg:var(--qs-bg)!important;--qd-surface:var(--qs-surface)!important;--qd-raised:var(--qs-raised)!important;--qd-text:var(--qs-text)!important;--qd-muted:var(--qs-muted)!important;--qd-border:var(--qs-border)!important;--qd-accent:var(--qs-accent)!important;--qd-soft:var(--qs-raised)!important;background:var(--qs-bg)!important;color:var(--qs-text)!important;border-color:var(--qs-border)!important}
/* Explicit neutral component roles; semantic series/topic colors are inherited. */
:root{--qs-card-padding:24px;--qs-card-gap:20px;--qs-section-gap:32px;--qs-card-radius:16px;--qs-line:color-mix(in srgb,var(--qs-text) 10%,transparent)}
html[data-theme] body [data-quant-card],html:root[data-theme] body.qd-v04 :is([data-quant-card],#quant-neutral-card-role){min-width:0;padding:var(--qs-card-padding)!important;border:1px solid var(--qs-line)!important;border-radius:var(--qs-card-radius)!important;background:var(--qs-surface)!important;box-shadow:none!important}
html[data-theme] body [data-quant-card] [data-quant-card],html:root[data-theme] body.qd-v04 :is([data-quant-card],#quant-neutral-card-role) [data-quant-card]{padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
[data-quant-card]>:is(h2,h3,h4):first-child{margin-top:0}
[data-quant-section]{min-width:0;margin-block-start:var(--qs-section-gap)}
[data-quant-section]:first-child{margin-block-start:0}
[data-quant-card-grid]{display:grid;gap:var(--qs-card-gap)}
[data-quant-metrics]{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,140px),1fr));gap:var(--qs-card-gap);font-variant-numeric:tabular-nums}
[data-quant-metrics] strong{font-size:clamp(20px,2vw,28px);line-height:1.25;letter-spacing:-.025em}
[data-quant-table-wrap]{max-width:100%;overflow:auto}
[data-quant-table]{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
[data-quant-table] :is(th,td){padding:12px 14px;border-bottom:1px solid var(--qs-line);line-height:1.6}
[data-quant-table] th{color:var(--qs-muted);font-size:12px;font-weight:600;text-align:left}
[data-quant-table] [data-numeric]{text-align:right}
@media(max-width:640px){:root{--qs-card-padding:20px;--qs-card-gap:16px;--qs-section-gap:24px}[data-quant-table] :is(th,td){padding:11px 12px}}

/* End pinned common shell 0.4.2 */

/* Common 0.4.2 card roles. Remote shared tokens remain the source of truth. */
html[data-design-engine] body [data-quant-card]{padding:var(--qs-card-padding,24px)!important;border-radius:var(--qs-card-radius,16px)!important;background:var(--qe-surface)!important;border:1px solid var(--qs-line,color-mix(in srgb,var(--qe-text) 10%,transparent))!important;box-shadow:none!important}
@media(max-width:600px){html[data-design-engine] body [data-quant-card]{padding:var(--qs-card-padding,20px)!important}}
html[data-design-engine] body .history-chart-frame{border:0;background:transparent;border-radius:0}
html[data-design-engine] body .qe-live-chart{background:transparent}
html[data-design-engine] body .chart-grid{gap:var(--qs-card-gap,20px)}
html[data-design-engine] body .card-head{margin-bottom:20px}
html[data-design-engine] body .history-chart-meta{border:0;background:transparent;padding-inline:0}
html[data-design-engine] body .history-chart-frame{border:0!important;background:transparent!important;border-radius:0!important}
html[data-design-engine] body .qe-live-chart{background:transparent!important}

/* Plot gestures own zoom and range selection. */
html[data-theme] body :is(.qd-focus-button,.qd-focus-tools) {display:none!important}
[data-quant-touch-chart]:focus-visible {outline:2px solid var(--qs-focus);outline-offset:3px}
[data-quant-touch-chart][data-quant-gesture=compare] .qe-point-tooltip {visibility:hidden!important}
