/* Mellow Data Portal (MellowLedger Matte-Obsidian Design System) */
:root {
  --bg: #0B0C0F;
  --surface: #121419;
  --surface-2: #181B22;
  --surface-3: #20242D;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);

  --text: #F4F5F7;
  --text-2: #A3A9B6;
  --text-3: #7A8396;
  --muted: #6C7484;

  --accent: #F4F5F7;
  --accent-ink: #0B0C0F;
  --mint: #34D399;
  --teal: #2DD4BF;
  --slate: #93B4D4;
  --amber: #F5B82E;
  --rose: #ED72C8;
  --coral: #F87171;
  --plum: #C084FC;

  --radius: 14px;
  --radius-sm: 10px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100dvh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ─── Top Navigation Bar ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 12, 15, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 11px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

.topbar-brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
}

.brand-wordmark {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.status-pill:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.55);
  flex-shrink: 0;
}

.status-pill.is-loading .status-dot {
  background: var(--amber);
  box-shadow: 0 0 8px rgba(245, 184, 46, 0.5);
}

.status-pill.is-error .status-dot {
  background: var(--coral);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.topbar-spacer {
  flex: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.84rem;
  font-weight: 500;
}

.nav-links a {
  color: var(--text-2);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* ─── Layout Shells ─── */
.page-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.legal-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 44px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Hero ─── */
.hero {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  max-width: 760px;
}

.hero-sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 680px;
}

.metric-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.metric-cell {
  padding: 13px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-right: 1px solid var(--border);
}

.metric-cell:last-child {
  border-right: none;
}

.metric-val {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}

.metric-lbl {
  font-size: 0.74rem;
  color: var(--text-3);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: border-color 0.14s ease, background-color 0.14s ease, opacity 0.14s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-hi);
}

.btn-ghost:hover {
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-sm {
  height: 30px;
  padding: 0 11px;
  font-size: 0.77rem;
  border-radius: 8px;
}

/* ─── Section Headers & Boxed Containers ─── */
.section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 72px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-note {
  font-size: 0.82rem;
  color: var(--text-3);
}

.section-box {
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── Segmented Tabs (MellowLedger exact pattern) ─── */
.seg-control {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  gap: 2px;
  flex-wrap: wrap;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.77rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.seg-btn:hover {
  color: var(--text);
}

.seg-btn.active {
  background: var(--surface-3);
  color: var(--text);
}

/* ─── Live Endpoint Inspector ─── */
.inspector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inspector-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: var(--text-2);
}

.meta-ok {
  color: var(--mint);
  font-weight: 600;
}

.meta-err {
  color: var(--coral);
  font-weight: 600;
}

.url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

.http-verb {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--mint);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.30);
  padding: 2px 7px;
  border-radius: 5px;
  flex-shrink: 0;
}

.url-text {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}

.url-text::-webkit-scrollbar {
  display: none;
}

.json-console {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.79rem;
  line-height: 1.55;
  color: var(--text-2);
  max-height: 360px;
  overflow: auto;
  white-space: pre;
}

.j-key { color: var(--slate); }
.j-str { color: var(--mint); }
.j-num { color: var(--amber); }
.j-bool { color: var(--plum); }
.j-null { color: var(--muted); }

/* ─── Dataset Dots & Ledger Grid ─── */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.dot-mint { background: var(--mint); box-shadow: 0 0 6px rgba(52, 211, 153, 0.55); }
.dot-teal { background: var(--teal); box-shadow: 0 0 6px rgba(45, 212, 191, 0.55); }
.dot-slate { background: var(--slate); box-shadow: 0 0 6px rgba(147, 180, 212, 0.55); }
.dot-amber { background: var(--amber); box-shadow: 0 0 6px rgba(245, 184, 46, 0.55); }
.dot-rose { background: var(--rose); box-shadow: 0 0 6px rgba(237, 114, 200, 0.55); }
.dot-plum { background: var(--plum); box-shadow: 0 0 6px rgba(192, 132, 252, 0.55); }

.dataset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dataset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dataset-card:hover {
  border-color: var(--border-hi);
  background: var(--surface-2);
}

.dataset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dataset-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
}

.dataset-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.dataset-desc {
  font-size: 0.84rem;
  color: var(--text-2);
  line-height: 1.5;
}

.dataset-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.route-code {
  font-size: 0.77rem;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
}

.inspect-link {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 4px;
}

.inspect-link:hover {
  color: var(--text);
}

/* ─── Remote MCP Quick-Connect ─── */
.mcp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.mcp-sub {
  font-size: 0.84rem;
  color: var(--text-2);
}

.code-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
}

.mcp-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
}

.mcp-links a {
  color: var(--text-2);
  border-bottom: 1px dashed var(--border-hi);
  padding-bottom: 1px;
}

.mcp-links a:hover {
  color: var(--mint);
  border-color: var(--mint);
}

/* ─── Pricing Spec Grid ─── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tier-card.is-featured {
  border-color: rgba(52, 211, 153, 0.36);
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.05) 0%, var(--surface) 44%);
}

.tier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tier-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.tier-tag {
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--mint);
}

.tier-price {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.tier-price span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-3);
}

.tier-quota {
  font-size: 0.78rem;
  color: var(--text-2);
  padding: 6px 9px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 7px;
}

.tier-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 0.81rem;
  color: var(--text-2);
  margin-bottom: 6px;
}

.tier-list li {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.tier-list li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-3);
  margin-top: 7px;
  flex-shrink: 0;
}

.tier-card.is-featured .tier-list li::before {
  background: var(--mint);
}

.tier-cta {
  margin-top: auto;
  width: 100%;
}

.billing-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-2);
}

.billing-note strong {
  color: var(--text);
  font-weight: 600;
}

.billing-note a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-hi);
}

.billing-note a:hover {
  color: var(--mint);
}

/* ─── Legal Documents ─── */
.legal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.legal-card h1 {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
}

.legal-date {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: -8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.legal-card h2 {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
}

.legal-card p {
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.68;
}

.legal-card a {
  color: var(--mint);
}

.legal-card a:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 6px;
}

.back-link:hover {
  color: var(--text);
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 20px 36px;
}

.footer-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-3);
}

.footer-inner.is-legal {
  max-width: 720px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-2);
}

.footer-links a:hover {
  color: var(--text);
}

/* ─── Responsive ─── */
@media (max-width: 880px) {
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .metric-cell:nth-child(2) {
    border-right: none;
  }
  .metric-cell:nth-child(1),
  .metric-cell:nth-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 10px 14px;
    gap: 8px;
  }
  .topbar-spacer {
    display: none;
  }
  .nav-links {
    width: 100%;
    gap: 14px;
    padding-top: 6px;
    border-top: 1px solid var(--border);
    overflow-x: auto;
  }
  .page-wrap {
    padding: 26px 14px 48px;
    gap: 32px;
  }
  .dataset-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }
  .url-bar {
    flex-wrap: wrap;
  }
  .legal-card {
    padding: 20px 18px;
  }
}
