/* Market price chart — Gateway tape on /market */

.nexus-market-chart {
  margin: 0 0 1.25rem;
  padding: 1rem 1.1rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--nexus-vault, #22d3ee) 28%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--nexus-ink, #05070d) 72%, transparent);
  backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.05),
    0 12px 32px rgb(0 0 0 / 0.28);
}

.nexus-market-chart__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.nexus-market-chart__kicker {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--nexus-gateway, #3b82f6) 85%, white);
}

.nexus-market-chart__title {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8eefc;
}

.nexus-market-chart__meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, #94a3b8 90%, white);
  text-align: right;
  max-width: 55%;
}

.nexus-market-chart__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  margin-bottom: 0.75rem;
}

.nexus-market-chart__tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.nexus-market-chart__tabs button {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--nexus-gateway, #3b82f6) 32%, transparent);
  background: transparent;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.nexus-market-chart__tabs button:hover {
  border-color: color-mix(in srgb, var(--nexus-gateway, #3b82f6) 70%, transparent);
  color: #fff;
}

.nexus-market-chart__tabs button.is-active {
  border-color: color-mix(in srgb, var(--nexus-gateway, #3b82f6) 80%, transparent);
  background: color-mix(in srgb, var(--nexus-gateway, #3b82f6) 18%, transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--nexus-gateway, #3b82f6) 25%, transparent);
}

.nexus-market-chart__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.nexus-market-chart__stats > div {
  min-width: 0;
}

.nexus-market-chart__stat-label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 0.15rem;
}

.nexus-market-chart__stats strong {
  font-size: 0.95rem;
  font-weight: 650;
  color: #e2e8f0;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.nexus-market-chart__stats strong.is-up {
  color: var(--nexus-vault, #22d3ee);
}
.nexus-market-chart__stats strong.is-down {
  color: var(--nexus-observer, #f97316);
}

.nexus-market-chart__canvas-wrap {
  position: relative;
  width: 100%;
  height: clamp(160px, 28vw, 260px);
  border: 1px solid color-mix(in srgb, var(--nexus-line, #22d3ee) 35%, transparent);
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, color-mix(in srgb, var(--nexus-gateway) 14%, transparent), transparent 55%),
    linear-gradient(180deg, rgb(5 8 16 / 0.35), rgb(5 8 16 / 0.7));
}

.nexus-market-chart__svg {
  display: block;
  width: 100%;
  height: 100%;
}

.nexus-market-chart__grid {
  stroke: color-mix(in srgb, #64748b 35%, transparent);
  stroke-width: 1;
  stroke-dasharray: 3 5;
}

.nexus-market-chart__ylab {
  fill: #64748b;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.nexus-market-chart__line {
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--nexus-gateway, #3b82f6) 45%, transparent));
}

.nexus-market-chart__dot {
  filter: drop-shadow(0 0 6px currentColor);
}

.nexus-market-chart__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nexus-market-chart__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

@media (max-width: 640px) {
  .nexus-market-chart__stats {
    grid-template-columns: 1fr 1fr;
  }
  .nexus-market-chart__stats > div:last-child {
    grid-column: 1 / -1;
  }
  .nexus-market-chart__meta {
    max-width: 42%;
    font-size: 9px;
  }
}
