/* The drawing tools live beside analysis layers; the menu never consumes chart space. */
.ct-button{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:3px 9px;background:none;border:1px solid var(--line);color:var(--text);font:12px var(--f-body);white-space:nowrap}
.ct-button.on{border-color:var(--seal);color:var(--seal)}
.ct-button svg,.ct-menu svg{fill:none;stroke:currentColor;stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.ct-button:disabled{color:var(--faint)}
.ct-button:focus-visible,.ct-menu button:focus-visible,.ct-actions button:focus-visible{outline:2px solid var(--text);outline-offset:2px}
.ct-menu{position:fixed;z-index:40;width:330px;max-width:calc(100vw - 12px);background:var(--bg);border:1px solid var(--line);padding:4px;box-shadow:0 7px 24px #0002}
.ct-menu button{display:flex;align-items:center;gap:10px;width:100%;min-height:34px;padding:7px 8px;border:0;background:none;color:var(--text);font:12px var(--f-body);text-align:left}
.ct-menu button:hover,.ct-menu button[aria-checked="true"]{background:var(--surface-2)}
.ct-menu button:disabled{color:var(--faint);cursor:default}
.ct-menu button[data-ct="undo"]{margin-top:4px;border-top:1px solid var(--line-soft)}
.ct-menu kbd{margin-left:auto;font:10px var(--f-mono);color:var(--muted);white-space:nowrap}
.ct-menu kbd:empty{display:none}
.ct-drawings{position:absolute;top:0;left:0;z-index:3;overflow:hidden;pointer-events:none;color:var(--text)}
.ct-line{stroke:var(--text);stroke-width:1.2}
.ct-shape.selected .ct-line{stroke-width:1.6}
.ct-level-label{fill:var(--text);font:10px var(--f-mono);paint-order:stroke;stroke:var(--bg);stroke-width:3px;stroke-linejoin:round}
.ct-shape.down{color:var(--seal)}
.ct-range{fill:currentColor;fill-opacity:.07;stroke:currentColor;stroke-opacity:.18;stroke-width:1}
.ct-diagonal{stroke:currentColor;stroke-width:1;stroke-dasharray:4 3}
.ct-badge{fill:currentColor}
.ct-measure-label{fill:var(--bg);font:10px var(--f-mono);text-anchor:middle}
.ct-shape.down .ct-measure-label{fill:#fff}
.ct-handle{fill:var(--bg);stroke:var(--text);stroke-width:1.3}
.ct-actions{position:absolute;z-index:6;display:flex;gap:2px;border:1px solid var(--line);background:var(--bg);box-shadow:0 3px 12px #0002;white-space:nowrap}
.ct-actions button{min-height:28px;padding:4px 7px;border:0;background:none;color:var(--text);font:11px var(--f-body)}
.ct-actions button:hover,.ct-actions button[aria-pressed="true"]{background:var(--surface-2)}
#chart.ct-working{touch-action:none}
#chart.ct-working,#chart.ct-working *{cursor:crosshair!important}
/* over a drawing, and while it is dragged: what the drag does */
#chart[data-ct-hover="body"],#chart[data-ct-hover="body"] *{cursor:move!important}
#chart[data-ct-hover="level"],#chart[data-ct-hover="level"] *{cursor:ns-resize!important}
#chart[data-ct-hover="end"],#chart[data-ct-hover="end"] *{cursor:grab!important}
@media (max-width:600px){.ct-button{min-height:32px}.ct-menu button{min-height:44px}.ct-actions button{min-height:40px;padding:6px 10px}}
@media (prefers-reduced-motion:reduce){.ct-menu{scroll-behavior:auto}}
/* Phones: the toolbar is one row that scrolls sideways, and every control in it moves with it (owner 12.11.2026: a
   control pinned to the right edge covered the ones scrolling under it). The tools button is an icon there; its name
   remains for screen readers, held inside the button (relative): positioned against anything further out, the hidden
   name would sit past the screen's edge, outside the scrolling row, and widen the whole page. */
@media (max-width:600px){
  .ct-button{position:relative}
  .ct-button>span:not([aria-hidden]){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
