/* Pixel cursors for v2 only (html.v2). Assets in /cursors/.
   Coarse-pointer reset lives in mobile.css.
   :where() keeps list specificity flat so later rules can override.
   Crosshair is scoped to the chart canvas (not .v2-chart-pane *), so Retry and
   other controls inside the pane keep the pointer cursor. */
.v2,
.v2 * {
  cursor:
    url("/cursors/arrow.png") 0 0,
    auto;
  cursor:
    -webkit-image-set(url("/cursors/arrow.png") 1x, url("/cursors/arrow-2x.png") 2x) 0 0,
    auto;
  cursor:
    image-set(url("/cursors/arrow.png") 1x, url("/cursors/arrow-2x.png") 2x) 0 0,
    auto;
}

.v2
  :where(
    a,
    button,
    summary,
    label,
    select,
    [role="button"],
    .v2-btn,
    .v2-unit-tog,
    .v2-power > *,
    .v2-segbar > *,
    .v2-navb,
    .v2-cap,
    .v2-logo,
    .v2-wallet-go,
    .v2l-cta,
    .v2l-brand,
    .v2l-btn,
    .v2l-form button,
    .v2-tab-bar a,
    .v2-tab-main .cta,
    .v2-chart-tools .v2-btn,
    .v2-chart-chips .v2-btn,
    .v2-chart-msg .v2-btn,
    .v2-node,
    .v2-mkt,
    .v2-copy,
    .v2-brow,
    .v2-tick,
    .v2-ac-row,
    .v2-pos-row,
    .v2-nav-more,
    .pshare,
    .wli,
    #tdModal .btn,
    #tdModal .btnw,
    #tdModal .tpgo
  ) {
  cursor:
    url("/cursors/pointer.png") 4 0,
    pointer;
  cursor:
    -webkit-image-set(url("/cursors/pointer.png") 1x, url("/cursors/pointer-2x.png") 2x) 4 0,
    pointer;
  cursor:
    image-set(url("/cursors/pointer.png") 1x, url("/cursors/pointer-2x.png") 2x) 4 0,
    pointer;
}

.v2 :where(input, textarea, [contenteditable="true"], [contenteditable=""], .v2-field input, .v2-search input, .v2-addr) {
  cursor:
    url("/cursors/text.png") 5 8,
    text;
  cursor:
    -webkit-image-set(url("/cursors/text.png") 1x, url("/cursors/text-2x.png") 2x) 5 8,
    text;
  cursor:
    image-set(url("/cursors/text.png") 1x, url("/cursors/text-2x.png") 2x) 5 8,
    text;
}

/* Chart canvas only — not every descendant of the pane (Retry lives in .v2-chart-msg). */
.v2 :where(.v2-chart-pane, .v2-chart-cv),
.v2 :where(.v2-chart-cv *) {
  cursor:
    url("/cursors/crosshair.png") 8 9,
    crosshair;
  cursor:
    -webkit-image-set(url("/cursors/crosshair.png") 1x, url("/cursors/crosshair-2x.png") 2x) 8 9,
    crosshair;
  cursor:
    image-set(url("/cursors/crosshair.png") 1x, url("/cursors/crosshair-2x.png") 2x) 8 9,
    crosshair;
}

/* Drawing tool / interact locked: pixel arrow (beats :where crosshair). */
.v2 .v2-chart-cv.is-locked,
.v2 .v2-chart-cv.is-locked * {
  cursor:
    url("/cursors/arrow.png") 0 0,
    auto;
  cursor:
    -webkit-image-set(url("/cursors/arrow.png") 1x, url("/cursors/arrow-2x.png") 2x) 0 0,
    auto;
  cursor:
    image-set(url("/cursors/arrow.png") 1x, url("/cursors/arrow-2x.png") 2x) 0 0,
    auto;
}

/* Right price axis: system ns-resize via class only (kchart never sets style.cursor). */
.v2 .v2-chart-cv.is-price-axis,
.v2 .v2-chart-cv.is-price-axis * {
  cursor: ns-resize;
}

/* Interactive controls inside the chart pane always win over crosshair (0,2,0). */
.v2 .v2-chart-pane :where(button, a, .v2-btn, [role="button"]) {
  cursor:
    url("/cursors/pointer.png") 4 0,
    pointer;
  cursor:
    -webkit-image-set(url("/cursors/pointer.png") 1x, url("/cursors/pointer-2x.png") 2x) 4 0,
    pointer;
  cursor:
    image-set(url("/cursors/pointer.png") 1x, url("/cursors/pointer-2x.png") 2x) 4 0,
    pointer;
}

.v2 :where(.v2-grab, [data-v2-cursor="grab"]) {
  cursor:
    url("/cursors/grab.png") 8 9,
    grab;
  cursor:
    -webkit-image-set(url("/cursors/grab.png") 1x, url("/cursors/grab-2x.png") 2x) 8 9,
    grab;
  cursor:
    image-set(url("/cursors/grab.png") 1x, url("/cursors/grab-2x.png") 2x) 8 9,
    grab;
}

.v2 :where(.v2-grabbing, .v2-grab:active, [data-v2-cursor="grabbing"]) {
  cursor:
    url("/cursors/grabbing.png") 8 5,
    grabbing;
  cursor:
    -webkit-image-set(url("/cursors/grabbing.png") 1x, url("/cursors/grabbing-2x.png") 2x) 8 5,
    grabbing;
  cursor:
    image-set(url("/cursors/grabbing.png") 1x, url("/cursors/grabbing-2x.png") 2x) 8 5,
    grabbing;
}

/* :is() → (0,2,0) so disabled beats the chart-pane pointer override above. */
.v2 :is(:disabled, [disabled], [aria-disabled="true"], .v2-disabled) {
  cursor:
    url("/cursors/not-allowed.png") 7 8,
    not-allowed;
  cursor:
    -webkit-image-set(url("/cursors/not-allowed.png") 1x, url("/cursors/not-allowed-2x.png") 2x) 7 8,
    not-allowed;
  cursor:
    image-set(url("/cursors/not-allowed.png") 1x, url("/cursors/not-allowed-2x.png") 2x) 7 8,
    not-allowed;
}
