/* Code Black's chart (cbchart.js), the phone app's and the PC web app's alike: the values written over it, the box of
   the candle under the finger, and the text tabs around it (timeframes, indicators, sections), as the big exchanges'
   apps draw them (owner, 2026-11-12). The colours are each app's own tokens (the PC names some differently). */
.cx-chart {
  position: relative;
  display: flex;
  flex-direction: column;
}
.cx-chart > .cbc-main {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}
.cx-chart > .cbc-rsi {
  position: relative;
  flex: none;
  height: 92px;
  border-top: 1px solid var(--border);
}
.cx-empty {
  margin: 0;
  padding: 14px 12px;
  font-size: 12.5px;
  color: var(--muted);
}
.cx-legend {
  position: absolute;
  top: 6px;
  left: 10px;
  right: 78px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 1px 10px;
  font-family: var(--mono, var(--font-mono, ui-monospace, monospace));
  font-size: 10px;
  line-height: 1.35;
  pointer-events: none;
}
.cx-legend:empty {
  display: none;
}
.cx-legend.rsi {
  top: 4px;
  color: #f5c35b;
}
.cx-vol-legend {
  position: absolute;
  left: 10px;
  z-index: 3;
  font-family: var(--mono, var(--font-mono, ui-monospace, monospace));
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}
.cx-tip {
  position: absolute;
  top: 40px;
  z-index: 4;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgb(20 20 22 / 0.94);
  font-size: 10.5px;
  pointer-events: none;
}
.cx-tip[hidden] {
  display: none;
}
.cx-tip[data-side="left"] {
  left: 8px;
}
.cx-tip[data-side="right"] {
  right: 80px;
}
.cx-tip div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}
.cx-tip span {
  color: var(--muted);
}
.cx-tip b {
  font-family: var(--mono, var(--font-mono, ui-monospace, monospace));
  font-weight: 500;
}
.cx-tip b.up {
  color: var(--up);
}
.cx-tip b.down {
  color: var(--down);
}

/* timeframes: text tabs, the chosen one underlined in gold */
.cx-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 8px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.cx-tabs::-webkit-scrollbar {
  display: none;
}
.cx-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
  height: 38px;
  padding: 0 9px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.cx-tab:hover {
  color: var(--fg);
}
.cx-tab[data-on="true"] {
  color: var(--fg);
}
.cx-tab[data-on="true"]::after {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.cx-tab svg {
  opacity: 0.7;
}
/* indicators: text tabs, the ones on in gold */
.cx-inds {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}
.cx-ind {
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--dim, var(--muted));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.cx-ind:hover {
  color: var(--fg);
}
.cx-ind[data-on="true"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}
.cx-sep {
  flex: none;
  width: 1px;
  height: 14px;
  margin: 0 5px;
  background: var(--border-strong);
}
/* sections under the chart (Trades, Info, Research): bigger text tabs */
.cx-sections {
  display: flex;
  gap: 20px;
  padding: 0 4px;
  border-bottom: 1px solid var(--border);
}
.cx-sect {
  position: relative;
  height: 38px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cx-sect:hover,
.cx-sect[data-on="true"] {
  color: var(--fg);
}
.cx-sect[data-on="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}
.cx-sect .count {
  margin-left: 4px;
  font-size: 11px;
  color: var(--muted);
}

/* ---------- the phone's chart (owner, 2026-11-13): every touch is the chart's, the candle's values in the corner, a way
   back after zooming, and a handle under it to make it taller ---------- */
.cx-touch {
  touch-action: none;
}
/* its size and how much of the chart shows through it are the owner's (Settings → Chart: --cx-tip-scale, --cx-tip-a) */
.cx-tip[data-side="corner"] {
  top: 4px;
  left: 6px;
  grid-template-columns: auto auto;
  column-gap: 14px;
  row-gap: 1px;
  min-width: 0;
  padding: 6px 9px;
  border-radius: 10px;
  border-color: rgb(255 255 255 / calc(var(--cx-tip-a, 0.86) * 0.14));
  background: rgb(14 14 16 / var(--cx-tip-a, 0.86));
  font-size: 10px;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.9); /* readable over the candles when the panel is clear */
  transform: scale(var(--cx-tip-scale, 1));
  transform-origin: 0 0;
}
/* Settings → Chart: the sample panel over a few candles */
.tip-demo {
  position: relative;
  height: 132px;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: rgb(0 0 0 / 0.22);
}
.tip-demo-candles {
  position: absolute;
  inset: 8px;
}
.cx-tip[data-side="corner"] div {
  gap: 8px;
}
.cx-reset {
  position: absolute;
  top: 6px;
  right: 80px;
  z-index: 5;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: rgb(20 20 22 / 0.92);
  color: var(--fg);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
}
.cx-reset[hidden] {
  display: none;
}
.cx-grip {
  display: grid;
  place-items: center;
  height: 24px;
  margin-top: 2px;
  touch-action: none;
  cursor: ns-resize;
  -webkit-user-select: none;
  user-select: none;
}
.cx-grip i {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--border-strong);
}
.cx-grip.on i,
.cx-grip:active i {
  background: var(--accent);
}
