/* One chart surface, with detail in a shared tool sheet. */
.chart-ux-ready #chart-workspace{display:block;min-width:0}
.chart-ux-ready #chart-workspace>.levels-panel{display:none}
.chart-ux-ready .chart-panel{min-width:0;overflow:hidden}
.chart-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.25rem 1.5rem .7rem}
.chart-heading>div:first-child{display:flex;align-items:baseline;gap:.75rem;flex-wrap:wrap;min-width:0}
.chart-heading h3{font-size:1rem;font-weight:550;letter-spacing:-.015em;margin:0}
.chart-heading #bias{display:none}.chart-context-label{font-size:.8125rem;color:var(--text-secondary)}
.chart-heading-actions{display:flex;align-items:center;gap:.4rem;flex-shrink:0}
.chart-control{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;min-height:2.75rem;padding:.55rem .8rem;border:1px solid transparent;border-radius:.5rem;background:transparent;color:var(--text-secondary);font:500 .875rem/1.3 var(--sans);white-space:nowrap;cursor:pointer}
.chart-control svg{width:1rem;height:1rem;flex-shrink:0}
.chart-control:hover{background:var(--surface-hover);color:var(--text-primary)}
.chart-control[aria-expanded=true],.chart-control[aria-pressed=true]{background:var(--surface-information);color:var(--color-information)}
.chart-control:focus-visible,.chart-layer-chip:focus-visible{outline:2px solid var(--color-information);outline-offset:2px}
.chart-control:disabled{color:var(--color-disabled);opacity:.7;cursor:not-allowed}
.chart-icon-control{width:2.75rem;padding:.55rem;flex-shrink:0}
.chart-commandbar{display:flex;align-items:center;gap:.35rem;padding:0 1.5rem .75rem;border-bottom:1px solid var(--border-subtle);flex-wrap:wrap}
.chart-commandbar .chart-timeframe-button{color:var(--text-primary);background:var(--surface-raised);margin-right:.4rem;border:1px solid var(--border-subtle)}
.chart-commandbar #chart-options-button{margin-left:auto}
.chart-control-count{font-size:.75rem;font-weight:600;color:var(--color-information);background:var(--surface-information);padding:.1rem .35rem;border-radius:.25rem}
.chart-active-tools{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.5rem 1.5rem 0}
.chart-layer-chip{border:0;background:transparent;color:var(--color-information);font:400 .8125rem var(--sans);min-height:2.75rem;display:inline-flex;gap:.65rem;align-items:center;padding:.4rem .55rem;border-radius:.4rem;cursor:pointer}
.chart-layer-chip:hover{background:var(--surface-hover)}.chart-layer-chip>span{font-size:1.125rem;line-height:1;color:var(--text-secondary)}
.chart-ux-ready .chart-wrap{height:clamp(22rem,48vw,32rem);margin:.6rem .7rem 0;min-width:0}
.chart-ux-ready .chart-zoom{right:.45rem;bottom:.45rem;display:flex;gap:.4rem}
.chart-ux-ready .chart-zoom button{width:2.75rem;height:2.75rem;background:var(--surface-raised);border:1px solid var(--border-subtle);color:var(--text-primary)}
.chart-ux-ready .chart-tooltip{top:.65rem;left:.65rem;max-width:min(30rem,calc(100% - 2rem));padding:.65rem .8rem;white-space:pre-line;background:#111a26f5;border:1px solid var(--border-control);border-radius:.5rem;color:var(--text-primary);font:400 .8125rem/1.6 var(--sans);box-shadow:var(--shadow-card);pointer-events:none;overflow-wrap:anywhere}
.chart-ux-ready .chart-caption{display:flex;align-items:center;justify-content:space-between;flex-direction:row;padding:.6rem 1.5rem;gap:1rem}
.chart-caption>div{display:flex;flex-direction:column;gap:.2rem;font-size:.75rem;color:var(--text-secondary);min-width:0;line-height:1.6}
.chart-data-status{margin:0;padding:0 1.5rem 1rem;color:var(--text-secondary);font-size:.75rem;line-height:1.7;overflow-wrap:anywhere}
.chart-data-status[data-state=stale]{color:var(--color-stale)}
.chart-ux-ready .chart-panel>.takeaway{display:none}
.chart-ux-ready .pattern-overlay-caption{font-size:.75rem;margin:.2rem 0 .75rem;padding-inline:1.5rem}
.chart-ux-ready .pattern-brief{font-size:.875rem}.chart-ux-ready [hidden]{display:none!important}
.chart-tool-dialog{background:var(--surface-card);color:var(--text-primary);border:1px solid var(--border-subtle);border-radius:var(--radius-card);padding:0;width:min(32rem,calc(100vw - 2rem));max-width:none;max-height:calc(100dvh - 3rem);margin:auto 1.5rem auto auto;box-shadow:var(--shadow-dialog,0 24px 70px #0006);overflow:hidden}
.chart-tool-dialog[open]{display:flex;flex-direction:column}
.chart-tool-dialog::backdrop{background:#04080d88}.chart-tools-open{overflow:hidden}
.chart-sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1.25rem 1.5rem;border-bottom:1px solid var(--border-subtle);flex-shrink:0}
.chart-sheet-heading .eyebrow{font-size:.75rem;letter-spacing:.08em;color:var(--text-secondary)}
.chart-sheet-heading h2{font:500 1.35rem/1.4 var(--sans);letter-spacing:-.02em;margin:.35rem 0 0}
.chart-sheet-body{padding:1.25rem 1.5rem;overflow:auto;overscroll-behavior:contain;min-height:0}
.chart-sheet-footer{padding:1rem 1.5rem;border-top:1px solid var(--border-subtle);display:flex;justify-content:flex-end;flex-shrink:0}
.chart-sheet-footer button{min-width:6.5rem;min-height:2.75rem;font-size:.875rem}
.chart-tool-section{min-width:0}.chart-tool-section h3{font-size:1.0625rem;line-height:1.5;margin:1rem 0 .5rem}
.chart-tool-section .chart-field{display:grid;gap:.55rem;font-size:.875rem;line-height:1.5;color:var(--text-secondary);margin-bottom:1.1rem;min-width:0}
.chart-tool-section select{max-width:100%;width:100%;min-height:2.75rem;padding:.7rem .8rem;background:var(--surface-canvas);color:var(--text-primary);border:1px solid var(--border-control);border-radius:.5rem;font:400 1rem/1.5 var(--sans)}
.chart-tool-section select:focus-visible{outline:2px solid var(--color-information);outline-offset:2px}
.chart-tool-section .chart-check{display:flex;align-items:center;gap:.75rem;min-height:2.75rem;line-height:1.5;font-size:.9375rem;margin:.25rem 0}
.chart-check input{width:1.1rem;height:1.1rem;accent-color:var(--color-information);flex-shrink:0}
.chart-tool-section input:disabled+span{color:var(--color-disabled)}
.chart-tool-note,.chart-tool-section .data-note{font-size:.8125rem!important;line-height:1.7!important;color:var(--text-secondary);margin:.75rem 0 1rem}
.chart-tool-section #chart-settings{display:block!important;padding:0;border:0;background:none;margin:0}
.chart-tool-section #chart-settings>summary{display:none}
.chart-tool-explain,.chart-drawing-controls{border-top:1px solid var(--border-subtle);margin-top:1.2rem;padding-top:.35rem}
.chart-tool-explain>summary,.chart-drawing-controls>summary{font-size:.9375rem;min-height:2.75rem;line-height:1.5;padding:.75rem 0;cursor:pointer}
.chart-tool-explain p{font-size:1rem;line-height:1.7;color:var(--text-secondary)}
.chart-drawing-controls[open]>.chart-field{margin-top:1rem}
.chart-window-field>span{font-size:.875rem;color:var(--text-secondary)}
.chart-tool-section .ranges{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem;margin:.75rem 0;width:100%;border:0}
.chart-tool-section .ranges button{padding:.6rem;min-height:2.75rem;border-radius:.5rem;font-size:.875rem;border:1px solid var(--border-subtle);background:var(--surface-canvas);color:var(--text-secondary)}
.chart-tool-section .ranges button.active{color:var(--color-information);background:var(--surface-information);border-color:var(--color-information)}
.chart-level-preview,.chart-pattern-result dl{display:grid;gap:1rem;padding:1rem 0;border-block:1px solid var(--border-subtle);margin:1rem 0}
.chart-level-preview>div,.chart-pattern-result dl>div{display:grid;grid-template-columns:1fr 1.2fr;gap:1rem;align-items:start}
.chart-level-preview dt,.chart-pattern-result dt{color:var(--text-secondary);font-size:.875rem;line-height:1.6}
.chart-level-preview dd,.chart-pattern-result dd{margin:0;font-size:.9375rem;line-height:1.6;overflow-wrap:anywhere}
.chart-level-preview small{display:block;font-size:.75rem;color:var(--text-secondary)}
.chart-pattern-filters{margin-top:1rem;display:grid;grid-template-columns:1fr 1fr;gap:0 1rem}
.chart-pattern-filters label:last-child{grid-column:1/-1}
.chart-pattern-result{margin:1rem 0;padding:1rem 0;border-top:1px solid var(--border-subtle)}
.chart-pattern-result>p{font-size:.875rem;line-height:1.6;color:var(--text-secondary)}
.chart-mode-field{padding:0;margin:0 0 1rem;border:0;min-width:0}.chart-mode-field legend{font-size:.875rem;color:var(--text-secondary);margin-bottom:.75rem}
.chart-mode-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.3rem;padding:.3rem;border-radius:.6rem;background:var(--surface-canvas)}
.chart-mode-options button{border:0;background:none;color:var(--text-secondary);font:500 .875rem var(--sans);min-height:2.75rem;border-radius:.4rem;cursor:pointer}
.chart-mode-options button[aria-pressed=true]{background:var(--surface-information);color:var(--color-information)}
.chart-tool-section .chart-tools{padding:1rem 0;display:grid;gap:.7rem}.chart-tool-section .chart-tools>span{font-size:.8125rem;color:var(--text-secondary);line-height:1.6}
.chart-tool-section #move-levels{display:inline-flex!important}.chart-tool-section #export{min-height:2.75rem;font-size:.875rem;margin:.5rem 0}
#chart-clean-reset{display:block;min-height:2.75rem;font-size:.875rem;margin-top:1rem}
#chart-compare-slot>#technical-relative{border:0;margin:0;padding:0;background:none}#chart-compare-slot>#technical-relative>summary{display:none}#chart-compare-slot .disclosure-content{padding:0}
#chart-compare-slot .relative-controls{display:grid;grid-template-columns:1fr;gap:1rem}#chart-compare-slot .relative-controls label{font-size:.875rem}
#chart-manual-level-slot .manual-level{padding:0;background:none;border:0;margin:1rem 0}#chart-manual-level-slot .manual-title{font-size:.875rem}#chart-manual-level-slot input{min-height:2.75rem;font-size:1rem}
.chart-ux-ready #chart-dialog .chart-panel{height:100%;overflow:hidden;display:flex;flex-direction:column}
.chart-ux-ready #chart-dialog .chart-heading,.chart-ux-ready #chart-dialog .chart-commandbar,.chart-ux-ready #chart-dialog .chart-active-tools,.chart-ux-ready #chart-dialog .chart-caption,.chart-ux-ready #chart-dialog .chart-data-status{flex-shrink:0}
.chart-ux-ready #chart-dialog .chart-wrap{flex:1 1 auto;height:0;min-height:9rem}
.chart-ux-ready #chart-dialog .pattern-brief,.chart-ux-ready #chart-dialog .pattern-overlay-caption{display:none!important}
@media(max-width:760px){
 .chart-heading{padding:1rem 1rem .5rem;gap:.5rem;align-items:flex-start}.chart-heading>div:first-child{display:grid;gap:.25rem}.chart-context-label{font-size:.75rem}.chart-heading-actions{gap:0}.chart-heading-actions #chart-mode-toggle{padding-inline:.5rem}
 .chart-commandbar{padding:.3rem 1rem .75rem;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.25rem}
 .chart-commandbar .chart-timeframe-button{grid-column:1/4;margin:0;justify-content:space-between}
 .chart-commandbar #chart-options-button{grid-column:4;grid-row:1;justify-self:end;margin:0}
 .chart-commandbar #overview-indicators{grid-column:1;grid-row:2}.chart-commandbar #overview-patterns{grid-column:2;grid-row:2}.chart-commandbar #technical-auto-levels{grid-column:3;grid-row:2}.chart-commandbar #chart-compare-button{grid-column:4;grid-row:2}
 .chart-commandbar .chart-control{padding:.5rem .2rem;font-size:.875rem;gap:.25rem}.chart-commandbar #technical-auto-levels{white-space:normal}
 .chart-active-tools{padding:.35rem .6rem 0;gap:.2rem}.chart-layer-chip{padding-inline:.45rem}
 .chart-ux-ready .chart-wrap{height:22rem;margin:.3rem .3rem 0}
 .chart-ux-ready .chart-tooltip{font-size:.75rem;max-width:calc(100% - 1.3rem);left:.35rem;top:.35rem;padding:.55rem .65rem}
 .chart-ux-ready .chart-caption{padding:.5rem 1rem;gap:.5rem}.chart-caption>div{font-size:.75rem}.chart-data-status{padding:0 1rem .85rem;font-size:.75rem}
 .chart-tool-dialog{margin:auto 0 0;width:100%;max-height:90dvh;border:1px solid var(--border-subtle);border-bottom:0;border-radius:1rem 1rem 0 0}
 .chart-sheet-heading{padding:1rem 1.25rem}.chart-sheet-body{padding:1rem 1.25rem}.chart-sheet-footer{padding:.75rem 1.25rem max(.75rem,env(safe-area-inset-bottom));}.chart-sheet-footer button{width:100%}
 .chart-tool-dialog .quiet-button,.chart-tool-dialog .text-button{min-height:2.75rem;font-size:.875rem}
 .chart-ux-ready #chart-dialog .chart-heading{padding:.75rem 1rem .3rem}.chart-ux-ready #chart-dialog .chart-commandbar{padding-block:.3rem}
 .chart-ux-ready #chart-dialog .chart-data-status{padding-bottom:max(.5rem,env(safe-area-inset-bottom))}
}
@media(max-height:500px) and (orientation:landscape){
 .chart-ux-ready #chart-dialog .chart-heading{padding:.25rem .75rem;align-items:center}.chart-ux-ready #chart-dialog .chart-heading>div:first-child{display:flex;gap:.75rem}.chart-ux-ready #chart-dialog .chart-heading h3{font-size:.875rem}
 .chart-ux-ready #chart-dialog .chart-commandbar{display:flex;flex-wrap:nowrap;padding:.15rem .75rem;gap:.3rem}.chart-ux-ready #chart-dialog .chart-timeframe-button{margin-right:.3rem}
 .chart-ux-ready #chart-dialog .chart-commandbar .chart-control{min-height:2.75rem;padding:.3rem .5rem}.chart-ux-ready #chart-dialog .chart-active-tools,.chart-ux-ready #chart-dialog .chart-caption{display:none!important}
 .chart-ux-ready #chart-dialog .chart-data-status{font-size:.75rem;padding:.25rem .75rem}.chart-ux-ready #chart-dialog .chart-wrap{min-height:9rem;margin-top:0}
 .chart-tool-dialog{max-height:96dvh;width:min(32rem,100%);margin:auto 0 auto auto;border-radius:.75rem 0 0 .75rem}.chart-sheet-heading,.chart-sheet-footer{padding:.5rem 1rem}
}
@media(prefers-reduced-motion:reduce){.chart-control,.chart-layer-chip,.chart-tool-dialog{transition:none;animation:none}}
