/* #region zone:desk.style.chart-tools — แผงเครื่องมือกราฟ: ชุดสำเร็จรูป กลุ่ม แถวสวิตช์ (กล่องกลางจอเมื่อกว้าง <1024) */
/* Desk design: tokens only (desk-tokens.css), 44px rows, controls never touch, reduced motion respected. */
.ind-pop {
  width: 340px;
  max-height: max(320px, min(600px, calc(100vh - 390px)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sp-2);
  gap: 0;
}
.ind-pop .tb-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px var(--sp-1) 6px var(--sp-2);
  font-size: 14px;
  font-weight: 700;
}
.ind-pop .tb-pop-head::before {
  display: none;
}
.ind-presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  padding: 2px 6px var(--sp-3);
}
.ind-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--u-radius-pill);
  background: var(--panel2);
  color: var(--text);
  font-size: var(--u-text-xs);
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
button.ind-chip:hover {
  background: var(--hover);
}
.ind-chip[aria-checked='true'] {
  background: var(--acc-soft);
  border-color: var(--acc-ring);
  color: var(--accent-text);
}
.ind-chip-custom {
  color: var(--muted);
  border-style: dashed;
  background: transparent;
  cursor: default;
}
.ind-chip-custom[aria-checked='true'] {
  color: var(--accent-text);
  border-style: solid;
}
.ind-group-title {
  padding: var(--sp-3) 10px 2px;
  font-size: var(--u-text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.ind-item {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: 14px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  height: auto;
  padding: 5px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 0.15s ease;
}
.ind-item[hidden] {
  display: none;
}
.ind-item:hover {
  background: var(--hover);
}
.ind-item:focus-visible {
  background: var(--hover);
  outline-offset: -2px;
}
.ind-item:disabled,
.ind-item[data-unavailable] {
  opacity: 0.55;
  cursor: default;
}
.ind-item[data-unavailable]:hover {
  background: transparent;
}
.ind-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ind-name {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.35;
}
.ind-desc {
  font-size: var(--u-text-xs);
  color: var(--muted);
  line-height: 1.4;
}

/* Swatches follow the chart's own line colours (chart.js COLORS). */
.ind-sw {
  width: 14px;
  height: 3px;
  border-radius: 2px;
}
.sw-e20 {
  background: var(--ema20);
}
.sw-e50 {
  background: var(--ema50);
}
.sw-e200 {
  height: 4px;
  background: var(--ema200);
}
.sw-bb {
  height: 8px;
  background: rgba(41, 98, 255, 0.25);
  box-shadow:
    inset 0 1px 0 #5b7fe0,
    inset 0 -1px 0 #5b7fe0;
}
.sw-atr {
  background: linear-gradient(90deg, var(--up) 50%, var(--down) 50%);
}
.sw-vol {
  height: 10px;
  width: 10px;
  justify-self: center;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--up) 50%, var(--down) 50%);
}
.sw-rsi {
  background: #7e57c2;
}
.sw-macd {
  background: linear-gradient(90deg, #2962ff 50%, #ff6d00 50%);
}
.sw-rs {
  background: var(--rs-line);
}
.sw-lv {
  background: repeating-linear-gradient(90deg, var(--tag-down-bg) 0 3px, transparent 3px 5px);
}
.sw-ev {
  width: 8px;
  height: 8px;
  justify-self: center;
  border-radius: 50%;
  background: var(--ev-scan);
}
.sw-cx {
  width: 8px;
  height: 8px;
  justify-self: center;
  border-radius: 50%;
  background: var(--muted);
}
.sw-xc {
  width: 8px;
  height: 12px;
  justify-self: center;
  border-radius: 1px;
  background: var(--ev-scan);
}
.sw-fe {
  width: 10px;
  height: 10px;
  justify-self: center;
  border-radius: 50%;
  background: var(--ev-earn);
}
.sw-vp {
  height: 10px;
  background: repeating-linear-gradient(180deg, var(--vp-value) 0 2px, transparent 2px 4px);
}
.sw-sm {
  height: 0;
  border-top: 2px solid var(--up);
}
.sw-ob {
  height: 10px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--up) 28%, transparent);
  border: 1px solid var(--up);
}
.sw-fvg {
  height: 10px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--down) 18%, transparent);
}
.sw-eq {
  height: 0;
  border-top: 2px dotted var(--muted);
}
.sw-pd {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--down) 35%, transparent) 0 30%,
    transparent 30% 70%,
    color-mix(in srgb, var(--up) 35%, transparent) 70%
  );
}
.sw-ew {
  background: var(--accent);
}
.lg-rsUp .lg-k,
.lg-rsUp .lg-v {
  color: var(--up);
}
.lg-rsDown .lg-k,
.lg-rsDown .lg-v {
  color: var(--down);
}
.lg-rs .lg-k {
  color: var(--muted);
}
.lg-atrUp .lg-k,
.lg-atrUp .lg-v {
  color: var(--up);
}
.lg-atrDown .lg-k,
.lg-atrDown .lg-v {
  color: var(--down);
}

/* Below 1200px the panel is a centred modal dialog (owner rule: anything to click is a centred modal). */
@media (max-width: 1199px) {
  .ind-pop {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    z-index: 56;
    width: min(420px, calc(100vw - 32px));
    max-height: min(82vh, 640px);
    padding: var(--sp-3) var(--sp-3) var(--sp-4);
    border-radius: var(--r-card);
    transform: translate(-50%, -50%);
    box-shadow: var(--pop-shadow);
  }
  .ind-pop.open {
    animation: toolsIn 0.2s var(--ease-out);
  }
  .ind-pop .tb-pop-head {
    font-size: 15px;
    padding: 2px 0 var(--sp-2) 8px;
  }
  .ind-pop .tb-pop-close {
    width: 44px;
    height: 44px;
  }
  .ind-item {
    min-height: 52px;
  }
}
@keyframes toolsIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ind-pop.open {
    animation: none;
  }
  .ind-chip,
  .ind-item {
    transition: none;
  }
}
.chart-marker-legend {
  margin: var(--sp-2);
  border-top: 1px solid var(--line);
  padding-top: var(--sp-2);
  font-size: var(--u-text-xs);
  color: var(--muted);
}
.chart-marker-legend summary {
  min-height: 32px;
  cursor: pointer;
  color: var(--text);
}
.chart-marker-legend p {
  margin: var(--sp-2) 0;
  line-height: 1.5;
}
/* Keep pane readouts clear of the tools panel on the left. */
.chart-host .sub-legend,
.chart-host:has(#draw-tools-rail:not([hidden])) .sub-legend {
  left: auto;
  right: 80px;
  width: max-content;
  max-width: calc(100% - 96px);
  background: var(--chart-bg);
}
/* #endregion */

/* #region zone:desk.style.chart-event-card — การ์ดเหตุการณ์เลื่อนอ่านได้ทั้งเมาส์และสัมผัส */
#chart-tip {
  pointer-events: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
/* #endregion */
