:root {
  color-scheme: dark;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  background: #030712;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a,
summary,
textarea,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

.text-balance {
  text-wrap: balance;
}

.text-pretty {
  text-wrap: pretty;
}

.eyebrow {
  color: #9ca3af;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.25;
  text-transform: uppercase;
}

.state-panel {
  min-height: 12rem;
}

.chart-card {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.chart-canvas {
  display: block;
  height: auto;
  max-width: 100%;
  width: 100%;
}

.evidence-table-wrap {
  max-height: 20rem;
  overscroll-behavior: contain;
}

.evidence-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.api-card {
  overflow: hidden;
  border: 1px solid #1f2937;
  border-radius: 0.75rem;
  background: #111827;
}

.api-card-body {
  min-width: 0;
  padding: 1rem;
}

.provenance-value {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.api-quick-reference {
  min-width: 0;
}

.api-code {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.api-description {
  color: #9ca3af;
  font-size: 0.75rem;
  line-height: 1.5;
  margin-top: 0.75rem;
}

.api-detail {
  background: #030712;
  border-radius: 0.5rem;
  color: #d1d5db;
  font-size: 0.72rem;
  line-height: 1.5;
  margin-top: 0.75rem;
  padding: 0.75rem;
}

.api-detail code {
  color: #facc15;
}

.api-detail-label {
  color: #6b7280;
  margin-right: 0.45rem;
}

.method-badge {
  border-radius: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 0.35rem 0.5rem;
}

.method-get {
  background: #14532d;
  color: #bbf7d0;
}

.method-post {
  background: #1e3a8a;
  color: #bfdbfe;
}

.spinner {
  animation: spin 0.7s linear infinite;
  border: 2px solid #374151;
  border-radius: 9999px;
  border-top-color: #6366f1;
  display: inline-block;
  height: 1.25rem;
  width: 1.25rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 640px) {
  header {
    align-items: flex-start;
    flex-direction: column;
  }

  header > div:last-child {
    justify-content: space-between;
    width: 100%;
  }

  nav {
    overflow-x: auto;
  }

  nav .tab-btn {
    flex: 0 0 auto;
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
