/* v2 chart context menu → kit x-ctx. Compact (anh): narrow, small text, tight pad.
   Clip-path steps reveal. Independent of v1 css/ctxmenu.css. */

@keyframes x-pop {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

.v2-cxm,
.v2-cxm.x-ctx {
  position: fixed;
  z-index: 120;
  border-radius: 0;
}
.v2-cxm[hidden] {
  display: none !important;
}
.v2-cxm-ghost {
  pointer-events: none;
}
.v2-cxm-c {
  position: relative;
  min-width: 180px;
  max-width: min(240px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px;
  background: var(--tile);
  border: 1px solid var(--acc);
  box-shadow: 4px 4px 0 var(--acc);
  border-radius: 0;
  color: var(--tx);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  outline: none;
  animation: x-pop 120ms steps(4, end);
}
.v2-cxm.sub .v2-cxm-c {
  min-width: 140px;
}
.v2-cxm-hl {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--alt);
  opacity: 0;
  pointer-events: none;
  border-radius: 0;
}
.v2-cxm-hl[data-tone="danger"] {
  background: var(--crit);
  opacity: 0.18;
}
.v2-cxm-i {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--tx);
  font: 600 12px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.v2-cxm-i:hover:not(:disabled),
.v2-cxm-i[data-active]:not(:disabled),
.v2-cxm-i:focus-visible:not(:disabled) {
  background: var(--acc);
  color: var(--ink);
  font-weight: 700;
  outline: 0;
}
.v2-cxm-i:disabled {
  opacity: 0.35;
  cursor: default;
  color: var(--mute);
}
.v2-cxm-i[data-tone="danger"] {
  color: var(--crit-tx);
}
.v2-cxm-i[data-tone="danger"]:hover:not(:disabled),
.v2-cxm-i[data-tone="danger"][data-active]:not(:disabled) {
  background: var(--crit);
  color: var(--ink);
}
.v2-cxm-i .lab {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-cxm-i .hint {
  flex: 0 0 auto;
  color: var(--mute);
  font-weight: 400;
}
.v2-cxm-i:hover .hint,
.v2-cxm-i[data-active] .hint {
  color: var(--ink);
  opacity: 0.75;
}
.v2-cxm-i .chev {
  flex: 0 0 auto;
  color: var(--mute);
}
.v2-cxm-i:hover .chev,
.v2-cxm-i[data-active] .chev {
  color: var(--ink);
}
.v2-cxm-i .v2-cxm-ind {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--alt);
}
.v2-cxm-i.on .v2-cxm-ind,
.v2-cxm-i[aria-checked="true"] .v2-cxm-ind {
  background: var(--acc);
  border-color: var(--acc);
  color: var(--ink);
}
.v2-cxm-i:hover .v2-cxm-ind,
.v2-cxm-i[data-active] .v2-cxm-ind {
  border-color: var(--ink);
}
.v2-cxm-i .v2-cxm-ind.radio {
  border-radius: 0;
}
.v2-cxm-i .v2-cxm-ind.radio > i {
  display: none;
  width: 6px;
  height: 6px;
  background: var(--ink);
}
.v2-cxm-i.on .v2-cxm-ind.radio > i,
.v2-cxm-i[aria-checked="true"] .v2-cxm-ind.radio > i {
  display: block;
}
.v2-cxm-sep {
  height: 1px;
  margin: 2px 0;
  background: var(--line);
  border: 0;
}
.v2-cxm-lab {
  padding: 4px 8px 2px;
  color: var(--mute);
  font-size: var(--fs-12);
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
html.v2-cxm-press {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Compact chart settings panel (opened from the menu). */
.v2-chart-set {
  position: fixed;
  z-index: 121;
  width: 240px;
  max-width: calc(100vw - 16px);
  background: var(--tile);
  border: 1px solid var(--acc);
  box-shadow: 4px 4px 0 var(--acc);
  border-radius: 0;
  color: var(--tx);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  touch-action: manipulation;
  animation: x-pop 160ms steps(4, end);
}
.v2-chart-set[hidden] {
  display: none !important;
}
.v2-chart-set .v2-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  background: var(--alt);
  border-bottom: 1px solid var(--line);
}
.v2-chart-set .v2-chart-set-x {
  margin-left: auto;
  height: 26px;
  min-height: 26px;
  padding: 0 8px;
}
.v2-chart-set-b {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
}
.v2-chart-set-b .v2-btn,
.v2-chart-set-b .v2-chart-set-row {
  height: 30px;
  min-height: 30px;
  justify-content: flex-start;
  padding: 0 8px;
  background: var(--tile);
  border: 0;
  border-radius: 0;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  touch-action: manipulation;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v2-chart-set-b .v2-btn.on,
.v2-chart-set-b .v2-btn.on:hover,
.v2-chart-set-b .v2-chart-set-row.on,
.v2-chart-set-b .v2-chart-set-row.on:hover {
  background: var(--acc);
  color: var(--ink);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .v2-cxm-c,
  .v2-chart-set {
    animation: none;
  }
}
