/* =========================================================
   $GPUINU market cap + volume chart (assets/js/chart.js)
   ========================================================= */
.chart {
  --mc: #23a30f;
  --vol: #e0690a;
  position: relative;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e6e9e3);
  border-radius: var(--radius, 22px);
  box-shadow: var(--shadow);
  padding: clamp(14px, 3vw, 22px);
  font-family: var(--font-body);
  color: var(--ink, #0f110e);
  min-width: 0;
}
.chart__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.chart__title { margin: 0; font-family: var(--font-display); font-size: clamp(15px, 2.2vw, 18px); font-weight: 700; letter-spacing: -.01em; }
.chart__tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line, #e6e9e3); border-radius: 999px; background: var(--bg, #fbfbfb); }
.chart__tab {
  appearance: none; border: 0; background: transparent; color: var(--ink-2, #3c4239);
  font: 600 13px/1 var(--font-body); padding: 8px 12px; min-width: 44px; border-radius: 999px; cursor: pointer;
}
.chart__tab:hover { color: var(--ink, #0f110e); }
.chart__tab[aria-pressed="true"] { background: var(--ink, #0f110e); color: #fff; }
.chart__tab:focus-visible, .chart__retry:focus-visible { outline: 2px solid var(--green, #12b812); outline-offset: 2px; }

.chart__stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.chart__stat { margin: 0; padding: 10px 12px; border: 1px solid var(--line, #e6e9e3); border-radius: var(--radius-sm, 14px); min-width: 0; }
.chart__stat dt { font-size: 12px; color: var(--muted, #6a7166); margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart__stat dd { margin: 0; font-size: clamp(15px, 2.4vw, 19px); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart__stat dd.is-up { color: var(--green-ink, #0a7d0a); }
.chart__stat dd.is-down { color: #c2262c; }

.chart__plot { position: relative; margin-top: 14px; height: 422px; }
.chart__plot canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; cursor: crosshair; }
.chart__tip {
  position: absolute; top: 6px; left: 0; z-index: 2; pointer-events: none;
  min-width: 150px; max-width: calc(100% - 8px); padding: 8px 10px;
  background: var(--surface, #fff); border: 1px solid var(--line-2, #d7dcd3); border-radius: 10px;
  box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; color: var(--ink, #0f110e);
}
.chart__tip-time { color: var(--muted, #6a7166); margin-bottom: 2px; white-space: nowrap; }
.chart__tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.chart__tip-row b { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.chart__key { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart__key--mc { background: var(--mc); }
.chart__key--vol { background: var(--vol); }

.chart__msg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; margin: 14px 0 0; padding: 36px 16px; border: 1px dashed var(--line-2, #d7dcd3); border-radius: var(--radius-sm, 14px); color: var(--ink-2, #3c4239); font-size: 14px; }
.chart__retry { appearance: none; border: 1px solid var(--line-2, #d7dcd3); background: var(--surface, #fff); color: var(--ink, #0f110e); font: 600 13px/1 var(--font-body); padding: 10px 16px; border-radius: 999px; cursor: pointer; }
.chart__retry:hover { border-color: var(--ink-2, #3c4239); }
.chart__sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chart__foot { margin: 10px 0 0; font-size: 11px; color: var(--muted, #6a7166); }

/* states */
.chart [hidden] { display: none !important; }
.chart.is-loading .chart__stat dd, .chart.is-loading .chart__plot {
  color: transparent;
  background: linear-gradient(90deg, var(--line, #e6e9e3) 0%, var(--bg, #fbfbfb) 50%, var(--line, #e6e9e3) 100%) 0 0 / 200% 100%;
  border-radius: 8px;
  animation: chart-shimmer 1.4s linear infinite;
}
.chart.is-loading .chart__plot canvas { visibility: hidden; }
@keyframes chart-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .chart.is-loading .chart__stat dd, .chart.is-loading .chart__plot { animation: none; }
}

@media (max-width: 600px) {
  .chart__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart__plot { height: 346px; }
  .chart__tab { padding: 8px 10px; }
}
