/* Date and OHLC precede the study controls in both DOM and visual order. */
.atlas-workbench .chartcard .chartlabel{font-size:clamp(.875rem,.8rem + .2vw,1rem);line-height:1.5;min-height:0;padding:10px 12px 6px;flex-wrap:wrap;gap:4px 12px;flex-shrink:0}
.atlas-workbench .chartcard #ohlc{min-width:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.atlas-workbench .chartcard .studylist{padding:4px 12px 10px;gap:8px;flex-shrink:0;min-width:0}
.atlas-workbench .chartcard .studybadge{display:grid;grid-template-columns:max-content repeat(3,2rem);align-items:center;gap:6px;max-width:100%;padding:4px 6px;border-radius:6px;line-height:1.45}
.atlas-workbench .chartcard .studybadge>span{font-size:clamp(.875rem,.8rem + .2vw,1rem);min-width:0;overflow-wrap:anywhere}
.atlas-workbench .chartcard .studybadge small{font-size:.875rem;line-height:1.45;overflow-wrap:anywhere}
.atlas-workbench .chartcard .studybadge button{display:inline-flex;align-items:center;justify-content:center;min-width:0;min-height:36px;width:100%;padding:4px;font-size:20px;line-height:1;border-radius:4px;touch-action:manipulation;color:var(--atlas-tool-heading)}
.atlas-workbench .chartcard .studybadge [data-remove-study]{font-size:22px}
.atlas-workbench .chartcard .studybadge button:hover{background:var(--atlas-tool-hover)}
.atlas-workbench .chartcard .studybadge button:focus-visible{outline:2px solid var(--atlas-tool-accent);outline-offset:1px}
@media(max-width:650px),(pointer:coarse){.atlas-workbench .chartcard .studybadge{grid-template-columns:max-content repeat(3,2.75rem);gap:4px}.atlas-workbench .chartcard .studybadge button{min-height:44px}.atlas-workbench .chartcard .studybadge>span{font-size:1rem}}

body.atlas-workbench:not(.chart-maximized) .multi .studylist{max-height:6rem;overflow-y:auto}
.quick-average-add{width:100%;margin-top:12px;min-height:44px;border:1px solid var(--atlas-tool-edge);background:var(--atlas-tool-accent);color:var(--atlas-tool-well);font-weight:600}
.quick-average-add:disabled{opacity:.45;cursor:default}

/* Keep each indicator's identity, settings, and live value visually distinct. */
.atlas-workbench .chartcard .studybadge>.studybadge-content{display:flex;align-items:baseline;flex-wrap:nowrap;white-space:nowrap;column-gap:clamp(.4rem,.8vw,.75rem);row-gap:2px;min-width:0;color:var(--study-color)}
.atlas-workbench .chartcard .studybadge-content .study-indicator-name{font-weight:600}
.atlas-workbench .chartcard .studybadge-content .study-indicator-params{color:var(--muted);white-space:nowrap}
.atlas-workbench .chartcard .studybadge-content .study-status-values{margin-left:.15rem;font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:650px),(pointer:coarse){.atlas-workbench .chartcard .studybadge>.studybadge-content{column-gap:.65rem;row-gap:3px}}

/* Override the older compact typography used by maximized chart cells. */
body.atlas-workbench .chartcard .chartlabel{font-size:clamp(.875rem,.8rem + .2vw,1rem)!important}
body.atlas-workbench .chartcard .studybadge>span{font-size:clamp(.875rem,.8rem + .2vw,1rem)!important}
body.atlas-workbench .chartcard .studybadge button{font-size:20px!important}
body.atlas-workbench .chartcard .studybadge [data-remove-study]{font-size:22px!important}
body.atlas-workbench.chart-maximized .is-maximized .chartcard .studylist{max-height:clamp(7rem,20dvh,12rem);padding:6px 12px 10px}

.atlas-workbench .chartcard #ohlc{display:flex;align-items:center;flex-wrap:wrap;gap:3px 14px;line-height:1.45;font-variant-numeric:tabular-nums}.atlas-workbench .chartcard #ohlc time{color:var(--muted);margin-right:3px}.atlas-workbench .chartcard #ohlc span{white-space:nowrap}.atlas-workbench .chartcard #ohlc b{font-size:.88em;color:var(--muted);font-weight:700}

/* The price scale is an independent vertical zoom surface. */
.price-scale-handle{cursor:ns-resize;touch-action:none;outline:none}
.price-scale-handle:focus-visible{stroke:var(--atlas-tool-accent,#9dc6df);stroke-width:1;fill:#9dc6df0a}
.is-price-scaling,.is-price-scaling *{cursor:ns-resize!important;user-select:none;-webkit-user-select:none}

#chart{position:relative}
.chart-hover-time{position:absolute;bottom:0;max-width:calc(100% - 8px);padding:3px 6px;border-radius:3px;background:var(--atlas-tool-well,#101820);color:var(--atlas-tool-heading,#fff);border:1px solid var(--atlas-tool-edge,#334b5c);font-size:12px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;pointer-events:none;z-index:3;font-variant-numeric:tabular-nums}
.chart-hover-time[hidden]{display:none}

.inactivechart>svg.grid-price{cursor:grab}
.is-chart-panning,.is-chart-panning *{cursor:grabbing!important}

.study-visibility-icon{display:block;width:20px;height:20px;flex-shrink:0}
[data-study-visibility]{color:var(--atlas-tool-heading);touch-action:manipulation}
[data-study-visibility][aria-pressed=false]{color:var(--muted)}

/* Compact single-line study cards; wrap between cards rather than within names. */
body.atlas-workbench .chartcard .chartlabel{font-size:clamp(.8125rem,.76rem + .18vw,.9375rem)!important}
body.atlas-workbench .chartcard .studybadge{flex:0 0 auto;width:max-content;overflow-wrap:normal}
body.atlas-workbench .chartcard .studybadge>span{font-size:clamp(.8125rem,.76rem + .18vw,.9375rem)!important;overflow-wrap:normal}
body.atlas-workbench .chartcard .studybadge small{font-size:.875em;margin-left:0;overflow-wrap:normal}
body.atlas-workbench .chartcard .study-indicator-name{white-space:nowrap}
body.atlas-workbench .chartcard .studylist{overflow-x:auto}

.cloud-layout-controls{padding:8px;border-bottom:1px solid var(--atlas-tool-edge)}#cloud-save-status{font-size:12px;line-height:1.4;margin:6px 0;overflow-wrap:anywhere}#cloud-login{display:grid;gap:12px}#cloud-login label{display:grid;gap:6px}#cloud-login input:not([type=checkbox]){min-height:44px}#cloud-login p{max-width:48ch;font-size:14px;line-height:1.5}

/* Compact chart chrome while preserving the full plotting area. */
body.atlas-workbench .chartcard .chartlabel{font-size:clamp(.75rem,.7rem + .15vw,.8125rem)!important;padding:6px 10px 4px;gap:3px 10px}
body.atlas-workbench .chartcard .studybadge>span{font-size:clamp(.75rem,.7rem + .15vw,.8125rem)!important}
body.atlas-workbench .chartcard .studylist{padding:3px 10px 6px;gap:5px}
body.atlas-workbench .chartcard .assethead{padding:10px 12px}
body.atlas-workbench .chartcard .assethead h2{font-size:clamp(14px,1.1vw,17px)}
body.atlas-workbench .chartcard .quote>b{font-size:clamp(18px,1.5vw,24px)}
body.atlas-workbench .chartcard .quote>span,body.atlas-workbench .chartcard .chartfoot{font-size:12px}
#chart>svg text{font-size:var(--chart-label-size,8px)}

body.atlas-workbench .librarytabs button:disabled{opacity:.4;cursor:not-allowed;filter:grayscale(1);background:var(--atlas-tool-surface);color:var(--atlas-tool-copy);border-color:transparent}

body.atlas-workbench #chart-grid.multi>.chartcell.active{border-color:var(--atlas-tool-accent);box-shadow:inset 0 0 0 2px var(--atlas-tool-accent)}
body.atlas-workbench #chart-grid.multi>.chartcell.active>.gridcellhead{background:var(--atlas-tool-hover);border-bottom:2px solid var(--atlas-tool-accent)}
body.atlas-workbench #chart-grid.multi>.chartcell.active .activatechart{background:var(--atlas-tool-accent);color:var(--atlas-tool-well)}

body.atlas-workbench .timeframepicker button:disabled{opacity:.35;cursor:not-allowed;background:var(--atlas-tool-surface)!important;color:var(--atlas-tool-copy)!important;border-color:var(--atlas-tool-edge)}

body.atlas-workbench .chartcard #ohlc .ohlc-up,body.atlas-workbench .chartcard #ohlc .ohlc-up b{color:var(--green,#2e9f55)!important}
body.atlas-workbench .chartcard #ohlc .ohlc-down,body.atlas-workbench .chartcard #ohlc .ohlc-down b{color:#ef5350!important}
[data-theme=light] body.atlas-workbench .chartcard #ohlc .ohlc-up,[data-theme=light] body.atlas-workbench .chartcard #ohlc .ohlc-up b{color:#137b43!important}

/* Drawing instructions follow the chart theme and remain readable in every grid. */
body.atlas-workbench .chartcard #drawinghint{font-size:clamp(13px,.8rem + .12vw,15px);line-height:1.5;padding:8px 12px;background:var(--atlas-tool-surface,var(--panel));color:var(--atlas-tool-heading);border-top:1px solid var(--atlas-tool-edge);border-bottom:1px solid var(--atlas-tool-edge)}
body.atlas-workbench .chartcard #drawinghint b{color:inherit}
body.atlas-workbench .chartcard #drawinghint button{font-size:16px;min-width:32px;min-height:32px;padding:4px 6px;color:var(--atlas-tool-heading);background:transparent}
@media(pointer:coarse){body.atlas-workbench .chartcard #drawinghint button{min-width:44px;min-height:44px}}

/* Unavailable studies stay visibly muted in both themes; explanations remain accessible. */
body.atlas-workbench .indicatorlibrary .technicalrow.needsfeed .technicalname:disabled{opacity:.4;cursor:not-allowed;background:transparent!important;color:var(--atlas-tool-copy)!important}
body.atlas-workbench .indicatorlibrary .technicalrow.needsfeed .technicalname:disabled :is(span,small){color:inherit!important}
body.atlas-workbench .indicatorlibrary .technicalrow.needsfeed:hover{background:transparent}

/* Scope plot sizing to the plot, never to SVG icons in pane controls. */
body.atlas-workbench .studypane .paneheading{font-size:13px;min-height:36px;gap:8px}
body.atlas-workbench .studypane .paneheading button{display:inline-flex;align-items:center;justify-content:center;flex:0 0 32px;width:32px;height:32px;min-width:32px;min-height:32px;padding:5px;font-size:20px;line-height:1;border-radius:4px;color:var(--atlas-tool-heading);background:transparent}
body.atlas-workbench .studypane .paneheading button svg.study-visibility-icon{display:block;width:20px!important;height:20px!important;max-width:20px;max-height:20px;flex:0 0 20px}
body.atlas-workbench .studypane .paneheading button:hover{background:var(--atlas-tool-hover)}
@media(pointer:coarse){body.atlas-workbench .studypane .paneheading button{flex-basis:44px;width:44px;height:44px;min-width:44px;min-height:44px}}

/* Equal-size OHLC labels with clear spacing inside and between value groups. */
body.atlas-workbench .chartcard #ohlc{column-gap:clamp(18px,1.7vw,28px);row-gap:6px}
body.atlas-workbench .chartcard #ohlc>span{display:inline-flex;align-items:baseline;column-gap:8px;white-space:nowrap}
body.atlas-workbench .chartcard #ohlc>span>b{font-size:1em;font-weight:700;line-height:inherit}

body.atlas-workbench .watchrow .watch-name{font-size:13px;line-height:1.4;letter-spacing:0;margin-top:4px;overflow-wrap:anywhere}body.atlas-workbench .watchrow .ticker{font-size:15px}

#timeframe-loading:not([hidden]){display:flex;align-items:center;gap:10px;color:var(--atlas-tool-heading);font-size:14px}
.atlas-loading-spokes{display:inline-block;flex:0 0 22px;width:22px;height:22px;border-radius:50%;background:repeating-conic-gradient(from 0deg,currentColor 0deg 8deg,transparent 8deg 30deg);mask:radial-gradient(transparent 0 34%,#000 38% 65%,transparent 69%);animation:atlas-spokes-spin .65s steps(12) infinite}
@keyframes atlas-spokes-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.atlas-loading-spokes{animation:none}}

.watch .sectiontitle{align-items:center;gap:8px;margin-bottom:12px}
body.atlas-workbench .watch-panel-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:32px;height:32px;min-height:32px;padding:6px;border:1px solid var(--atlas-tool-edge);border-radius:6px;color:var(--atlas-tool-heading);background:transparent}
.watch-panel-toggle svg{width:18px;height:18px}.watch-panel-toggle[hidden]{display:none!important}
@media(max-width:650px){body.atlas-workbench.watch-panel-open:not(.hidewatch) aside.watch{display:block;position:fixed;top:49px;left:39px;bottom:56px;width:min(280px,calc(100vw - 45px));z-index:40;overflow-y:auto;padding:14px;background:var(--atlas-tool-surface);border-right:1px solid var(--atlas-tool-edge);box-shadow:8px 0 24px #0003}}

.watch-entry{position:relative}.watch-entry .watchrow{padding-right:28px}.watch-entry .watch-remove{position:absolute;top:2px;right:1px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;min-height:24px;padding:0;border:0;background:transparent;color:#ef5350!important;font-size:20px;line-height:1}.watch-entry .watch-remove:hover{background:#ef53501a}.watch-entry .watch-remove:focus-visible{outline:2px solid #ef5350}

/* Own gestures only within the plot; the rest of the page keeps native scrolling/zoom. */
#chart,.inactivechart{touch-action:none;user-select:none;-webkit-user-select:none}
