/* Coin/USDT chart pages under online_tools/*_usdt_chart/. Builds on main.css tokens; coin-chart.js reads the --ch-* colours for the canvas. */
:root {
  --ch-bg: #011B26;
  --ch-grid: rgba(7, 92, 123, 0.45);
  --ch-axis: #075C7B;
  --ch-label: #9FB6C0;
  --ch-price: #EAF2F5;
  --ch-sma50: #F6386C;
  --ch-sma200: #4FA3C4;
  --ch-mid: #9FB6C0;
  --ch-buy: #7FE0B0;
  --ch-sell: #FF8FAB;
}

.ch-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.ch-seg { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.ch-seg button { border: 0; background: none; color: var(--text-dim); font: inherit; font-size: 0.9rem; font-weight: 700; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s ease, color .15s ease; }
.ch-seg button:hover { color: var(--text); background: rgba(7, 92, 123, 0.35); }
.ch-seg button[aria-pressed="true"] { background: var(--pink); color: var(--bg); }
.ch-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border: 1px solid var(--teal); border-radius: 999px; background: transparent; color: var(--text); font: inherit; font-size: 0.95rem; font-weight: 700; cursor: pointer; transition: background-color .15s ease; }
.ch-btn:hover { background: rgba(7, 92, 123, 0.35); }
.ch-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ch-status { margin: 0 0 0 auto; font-size: 0.9rem; color: var(--text-dim); }
.ch-status.err { color: #ff8fab; font-weight: 600; }

/* Readout of the latest candle; the swatches match the canvas series. */
.ch-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0 0 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(0, 46, 62, 0.4); }
.ch-stats div { padding: 14px 16px; border-left: 1px solid var(--line); min-width: 0; }
.ch-stats div:first-child { border-left: 0; }
.ch-stats dt { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); white-space: nowrap; }
.ch-stats dt i { width: 10px; height: 3px; border-radius: 2px; flex: none; background: var(--sw); }
.ch-stats dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-stats [data-sign="pos"] { color: var(--ch-buy); }
.ch-stats [data-sign="neg"] { color: var(--ch-sell); }
@media (max-width: 1000px) {
  .ch-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ch-stats div:nth-child(4n + 1) { border-left: 0; }
  .ch-stats div:nth-child(n + 5) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .ch-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-stats div:nth-child(n) { border-left: 0; }
  .ch-stats div:nth-child(even) { border-left: 1px solid var(--line); }
  .ch-stats div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .ch-status { margin-left: 0; width: 100%; }
}

.ch-frame { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--ch-bg); box-shadow: 0 24px 50px rgba(0, 0, 0, .45); }
.ch-frame canvas { display: block; width: 100%; height: auto; }
.ch-frame canvas + canvas { border-top: 1px solid var(--line); }
/* On phones the chart keeps a readable width and scrolls sideways instead of shrinking its labels. */
@media (max-width: 760px) {
  .ch-frame { overflow-x: auto; overscroll-behavior-x: contain; }
  .ch-frame canvas { width: 760px; max-width: none; }
}

.ch-key { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--text-dim); }
.ch-key li { display: flex; align-items: center; gap: 8px; }
.ch-key i { width: 14px; height: 3px; border-radius: 2px; background: var(--sw); }
.ch-key i.dot { width: 9px; height: 9px; border-radius: 50%; }
.ch-key i.dash { background: repeating-linear-gradient(90deg, var(--sw) 0 5px, transparent 5px 8px); }

.ch-note { margin: 28px 0 0; max-width: 72ch; border: 1px solid rgba(246, 56, 108, 0.35); background: rgba(80, 27, 45, .5); padding: 12px 16px; border-radius: var(--r-sm); color: var(--text); }
