/* Structural workspace: the visualization owns scrolling; control planes do not. */
.workspace-shell,.workspace-filters,.control-deck,.filter-grid>*,.comparison-filter-grid>*,.studio-builder>*,fieldset{min-width:0}
.workspace-ready .site-header .workspace-tabs{overflow:visible;flex-wrap:wrap}
.workspace-filters{overflow-y:auto;overflow-x:visible}
.workspace-filters .primary-filters{margin-top:8px}
.workspace-filters .control-actions{display:flex;flex-wrap:wrap}
.workspace-filters .control-actions button{flex:1 1 40%}
.workspace-ready select{max-width:100%;min-width:0;width:100%}
.workspace-ready .workspace-content{padding:12px;position:relative}
.workspace-panel .comparison-controls{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;position:sticky;top:0;z-index:5;opacity:1}
.workspace-panel .comparison-controls>div:first-child{display:none}
.workspace-ready .axis-switch{grid-column:auto;justify-self:stretch;flex-wrap:wrap;min-width:0}
.workspace-ready .axis-switch label{white-space:normal;flex:1;justify-content:center}
.workspace-ready .comparison-filter-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.workspace-ready #panel-compare{--compare-controls:140px}
.workspace-ready .analysis-grid{position:sticky;top:var(--compare-controls);z-index:2;background:#091824}
.workspace-ready .analysis-grid .analysis-panel{max-height:55dvh;overflow-y:auto;position:static}
.workspace-ready #panel-compare #finalComparison{margin-top:14px}
.workspace-ready #meuGrafico{display:grid;grid-template-columns:235px minmax(0,1fr);gap:12px;align-items:start;overflow:visible}
#meuGrafico>.surface-heading{grid-column:1/-1}
.workspace-ready .studio-builder{grid-column:1;grid-row:2/9;display:flex;flex-direction:column;position:sticky;top:0;max-height:calc(100dvh - var(--workspace-header) - 70px);overflow-y:auto;padding:4px}
#meuGrafico>.studio-legend,#meuGrafico>.replay-transport,#meuGrafico>.replay-status,#meuGrafico>.replay-error,#meuGrafico>.replay-layout,#meuGrafico>.microcopy,#meuGrafico>.replay-events{grid-column:2;min-width:0}
.workspace-ready .studio-builder .studio-choices{max-height:none;overflow:visible;display:flex;flex-direction:column}
.workspace-ready .studio-builder #studioOverlays{max-height:none;overflow:visible}
.workspace-ready .replay-layout{grid-template-columns:minmax(0,1fr)}
.workspace-ready .replay-layout>.chart-wrap{position:sticky;top:0;background:#0b1b26;z-index:2}
.workspace-ready .replay-rail:empty{display:none}
.workspace-ready #customChart{max-height:45dvh;min-height:210px}
.workspace-ready .atlas-layout{grid-template-columns:minmax(0,1fr) 290px;align-items:start}
.workspace-ready .map-stage{position:sticky;top:0}
.workspace-ready #atlasMap{height:clamp(300px,65dvh,650px);touch-action:none}
.atlas-inspector{min-width:0;gap:8px}.atlas-inspector meter{display:block;width:100%;height:8px;margin-top:4px}.heat-scale{flex-wrap:wrap}.heat-scale i{min-width:80px}#candidateColor{width:100%;height:32px;padding:2px}.territory-detail strong{font-size:14px;overflow-wrap:anywhere}.atlas-toolbar{flex-wrap:wrap}.atlas-search{flex:1;min-width:160px}.atlas-tabs{flex-wrap:wrap}
@media(max-width:1100px){.workspace-shell{grid-template-columns:190px minmax(0,1fr)}.workspace-ready #meuGrafico{grid-template-columns:170px minmax(0,1fr);padding:10px}.workspace-ready .atlas-layout{display:grid;grid-template-columns:minmax(0,1fr)}.workspace-ready .atlas-inspector{display:grid;grid-template-columns:1fr 1fr}.workspace-ready .map-stage{position:static}.workspace-ready #atlasMap{height:350px}.workspace-ready .analysis-grid{grid-template-columns:minmax(0,1fr)}.workspace-ready .analysis-grid .analysis-panel{order:-1;max-height:130px}.workspace-ready .candidate-filter{display:flex;flex-wrap:wrap}.workspace-ready .analysis-panel .analytics-metrics,.workspace-ready .analysis-panel>.microcopy{display:none}}
@media(max-width:600px){.workspace-ready .workspace-filters{max-height:145px;padding:6px}.workspace-ready .primary-filters{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.workspace-ready .workspace-content{padding:6px}.workspace-ready #meuGrafico{display:block}.workspace-ready .studio-builder{position:sticky;top:0;z-index:5;display:grid;grid-template-columns:1fr 1fr;max-height:165px;overflow-y:auto;background:#10242f;padding:6px;gap:5px;border-bottom:1px solid #568d9c}.workspace-ready .studio-builder .studio-choices{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;padding:5px}.studio-builder .studio-choices strong{grid-column:1/-1}.workspace-ready #customChart{min-height:180px;max-height:32dvh}.workspace-ready .replay-layout>.chart-wrap{top:165px}.workspace-ready .analysis-grid{top:125px}.workspace-ready .comparison-controls{padding:6px}.workspace-ready .comparison-filter-grid{gap:4px}.workspace-ready .axis-switch label{font-size:11px;padding:5px}.workspace-ready .atlas-inspector{padding:10px}.workspace-ready #atlasMap{height:280px}.workspace-ready .atlas-tabs button{padding:8px}.workspace-ready .workspace-tabs{flex-wrap:nowrap}.workspace-tab{white-space:normal;min-width:0;flex:1}}
/* Sticky offsets follow the measured comparison plane, including small screens. */
.workspace-ready #panel-compare .analysis-grid{top:var(--compare-controls)}
.workspace-ready .atlas-inspector .territory-detail{order:-1;margin-bottom:8px}
.workspace-ready .atlas-inspector .territory-detail p{margin:5px 0}
.workspace-ready .atlas-inspector .territory-detail meter{height:6px}
@media(max-width:600px){.workspace-filters>button,.workspace-filters>.streams-launch{min-height:28px;padding:4px}.workspace-ready .workspace-filters{max-height:180px}.workspace-ready .analysis-grid .analysis-panel{max-height:105px;padding:5px}.workspace-ready .analysis-grid .chart-surface{padding:10px}.workspace-ready .chart-heading .legend{max-height:35px}.workspace-ready #trendChart{max-height:240px}.workspace-ready .studio-builder{max-height:180px}.workspace-ready .replay-layout>.chart-wrap{top:180px}}
/* Grid/flex ordering must agree: plot follows, never paints over candidates. */
@media(max-width:1100px){.workspace-ready .analysis-grid .analysis-panel{grid-row:1;position:static!important;top:auto!important;width:100%}.workspace-ready .analysis-grid .chart-surface{grid-row:2}.workspace-ready .analysis-grid{gap:8px}}
@media(max-width:1100px){.workspace-ready #panel-compare .analysis-grid{position:relative;top:auto}.workspace-ready #panel-compare .analysis-panel{position:sticky!important;top:var(--compare-controls)!important;z-index:4;background:#10242f}.workspace-ready .analysis-panel .surface-heading{display:none}.workspace-ready .analysis-panel .candidate-filter{margin:0;max-height:88px;overflow-y:auto}.workspace-ready #panel-compare .chart-surface{position:sticky;top:calc(var(--compare-controls) + 105px)}.workspace-ready .chart-surface .chart-wrap{min-height:0}.workspace-ready #trendChart{max-height:200px}}
/* At deep scroll keep the whole compact plot/selection group, not its short-lived children. */
@media(max-width:1100px){.workspace-ready #panel-compare .analysis-grid{position:sticky;top:var(--compare-controls);align-self:start}.workspace-ready #panel-compare .analysis-panel,.workspace-ready #panel-compare .chart-surface{position:static!important;top:auto!important}.workspace-ready #panel-compare .analysis-grid{max-height:calc(100dvh - var(--workspace-header) - 320px);overflow-y:auto}.workspace-ready .chart-heading{padding:4px}.workspace-ready .chart-heading h3{font-size:14px}.workspace-ready .chart-heading p,.workspace-ready #chartNote{display:none}.workspace-ready .analysis-grid .chart-surface{padding:8px}.workspace-ready .chart-heading .legend{max-height:24px}}
