/* Drawing on the chart (lot G1): a key per group of tools with the arrow that lists the group by name, the bar of a
   selected drawing (colour, width, lock, text, remove) at the foot of the candles, the dialog of a note's text. Tokens
   only; hover only where a pointer hovers; never italic; logical properties. */

/* ---- a group's key: the tool it starts, and its arrow ---- */
.ct-gk { display: inline-flex; align-items: center; border-radius: var(--r-sm); }
.ct-caret { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 28px; padding: 0; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--dim); cursor: pointer; }
.ct-caret .i { width: 10px; height: 10px; }
.ct-caret[aria-expanded="true"] { background: var(--surface-4); color: var(--text); }
.ct-caret:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cpop[data-kind="drawg"] { width: min(260px, calc(100% - 16px)); padding: 6px; gap: 2px; }
.cpop[data-kind="draw"] .cpop-h { margin: 6px 6px 2px; }
.cpop[data-kind="draw"] .cpop-h:first-child { margin-top: 2px; }

/* ---- the selected drawing's bar, at the foot of the candles' pane ---- */
.ds { position: absolute; top: 0; left: 50%; z-index: 6; display: flex; align-items: center; gap: 2px; max-width: calc(100% - var(--axis, 64px) - 16px);
  padding: 3px; border-radius: var(--r); background: var(--surface-2); box-shadow: var(--shadow-pop);
  transform: translate(-50%, calc(var(--ds-y, 0px) - 100%)); animation: ds-in var(--t) var(--ease); }
@keyframes ds-in { from { opacity: 0; } }
.ds[hidden] { display: none; }
.ds-name { flex: 0 1 auto; min-width: 0; padding: 0 8px; overflow: hidden; color: var(--mute); font-size: 11.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ds-sws { display: inline-flex; gap: 3px; padding: 0 6px; border-inline: 1px solid var(--hair); }
.ds-sw { width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35); cursor: pointer; }
.ds-sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3.5px var(--text); }
.ds-sw:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.ds-w { width: 34px; }
.ds-wl { display: block; width: 16px; border-top: 1px solid currentColor; }
.ds-wl[data-w="2"] { border-top-width: 2px; }
.ds-wl[data-w="3"] { border-top-width: 3px; }
.ds-wl[data-w="4"] { border-top-width: 4px; }
.ds .ct-b[data-sel="del"] { color: var(--mute); }
.chartwrap[data-sel="1"] .chart-flag { opacity: 0; }

/* ---- a note's text ---- */
.dtext { width: min(400px, calc(100vw - 32px)); margin-top: 18vh; background: var(--surface-2); color: var(--text); }
.dtext[open] { display: flex; flex-direction: column; }
.dt-h { margin: 14px 14px 0; font-size: 14px; font-weight: 600; }
.dtext .field { margin: 12px 14px; }
.dtext .dt-in { font-size: 13px; }

/* ---- a phone: the bar keeps a thumb's size ---- */
.term[data-form="phone"] .ds { max-width: calc(100% - 16px); flex-wrap: wrap; justify-content: center; }
.term[data-form="phone"] .ds .ct-b { width: 40px; height: 40px; }
.term[data-form="phone"] .ds-sws { order: 9; flex-basis: 100%; justify-content: center; gap: 8px; padding: 6px 0 2px; border: 0; border-top: 1px solid var(--hair); }
.term[data-form="phone"] .ds-sw { width: 26px; height: 26px; }

@media (hover: hover) {
  .ct-caret:hover { background: var(--surface-3); color: var(--text); }
  .ct-gk:hover .ct-b { color: var(--text); }
}
@media (prefers-reduced-motion: reduce) { .ds { animation: none; } }
