/* OriginalPoint — OpenRouter-inspired Design System v2 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card2: #141414;
  --border: #2a2a2a;
  --border-light: #333;
  --primary: #6e42e5;
  --primary-hover: #7c52f0;
  --primary-dim: rgba(110,66,229,0.15);
  --primary-glow: rgba(110,66,229,0.3);
  --text: #e5e5e5;
  --text-muted: #888;
  --text-dim: #555;
  --radius: 8px;
  --nav-h: 60px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Typography ── */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-muted); line-height: 1.7; }
a { color: inherit; text-decoration: none; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: var(--radius);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; transition: all .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 20px var(--primary-glow); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border-light); }
.btn-secondary:hover { background: var(--bg-card); border-color: #444; }
.btn-ghost { background: transparent; color: var(--text-muted); padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,.05); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(15,15,15,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.nav-logo-icon {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 6px 12px; border-radius: var(--radius);
  color: var(--text-muted); font-size: 14px; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-link.active { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }

/* Mobile Nav */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: var(--text); }
.nav-mobile { display: none; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; flex-direction: column; gap: 4px; }
  .nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all .2s; }
  .nav-mobile {
    position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 999;
    background: var(--bg-card2); border-bottom: 1px solid var(--border);
    padding: 12px 16px; display: flex; flex-direction: column; gap: 4px;
  }
  .nav-mobile .nav-link { padding: 10px 14px; }
  .nav-right .btn:not(.btn-primary) { display: none; }
}

/* ── Page wrapper ── */
.page { padding-top: var(--nav-h); min-height: 100vh; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 760px; margin: 0 auto; padding: 0 24px; }
.container-xs { max-width: 480px; margin: 0 auto; padding: 0 24px; }

/* ── Hero ── */
.hero {
  padding: 100px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse at center, rgba(110,66,229,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: var(--primary-dim); border: 1px solid rgba(110,66,229,.3);
  color: var(--primary); font-size: 12px; font-weight: 500; margin-bottom: 24px;
}
.hero h1 {
  max-width: 760px; margin: 0 auto 20px;
  background: linear-gradient(135deg, #fff 0%, #b8a4ff 50%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { max-width: 560px; margin: 0 auto 36px; font-size: 17px; color: var(--text-muted); }
.hero-ctas { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Logo Scroll Strip ── */
.logo-scroll-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.logo-scroll-section::before,
.logo-scroll-section::after {
  content: '';
  position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2;
  pointer-events: none;
}
.logo-scroll-section::before { left: 0; background: linear-gradient(to right, var(--bg), transparent); }
.logo-scroll-section::after  { right: 0; background: linear-gradient(to left, var(--bg), transparent); }

/* track: the moving belt; inner: one set of badges */
.logo-scroll-track {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}
.logo-scroll-inner {
  display: inline-flex;
  gap: 16px;
  padding-right: 16px; /* gap between last item and clone start */
  flex-shrink: 0;
}

.provider-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  transition: border-color .2s, color .2s;
}
.provider-badge:hover { border-color: #444; color: var(--text); }

/* ── Stats bar ── */
.stats-bar {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  padding: 32px 0;
  display: flex; justify-content: center; gap: 0;
}
.stat-item {
  flex: 1; max-width: 200px; text-align: center;
  padding: 0 32px; position: relative;
}
.stat-item:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 20%; bottom: 20%;
  width: 1px; background: var(--border);
}
.stat-num { font-size: 2rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Section ── */
.section { padding: 80px 0; }
.section-header { text-align: center; margin-bottom: 56px; }
.section-header p { max-width: 520px; margin: 12px auto 0; font-size: 16px; }

/* ── Feature grid ── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px;
}
.feature-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.feature-card:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(110,66,229,.2);
  transform: translateY(-4px);
}
.feature-icon {
  width: 44px; height: 44px; border-radius: var(--radius);
  background: var(--primary-dim); border: 1px solid rgba(110,66,229,.25);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.feature-icon svg { color: #a78bfa; }
.feature-card h3 { margin-bottom: 8px; font-size: 16px; }
.feature-card p { font-size: 14px; }

/* ── Onboarding Steps ── */
.onboarding-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; position: relative;
}
@media (max-width: 768px) { .onboarding-steps { grid-template-columns: 1fr; } }
.onboarding-steps::before {
  content: '';
  position: absolute; top: 40px; left: calc(33.33% - 12px); right: calc(33.33% - 12px);
  height: 2px; background: linear-gradient(to right, var(--primary), var(--primary-hover));
  z-index: 0;
}
@media (max-width: 768px) { .onboarding-steps::before { display: none; } }

.onboarding-step { position: relative; z-index: 1; }
.step-number {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; margin: 0 auto 16px;
  position: relative; z-index: 2;
}
.step-title { font-size: 15px; font-weight: 600; color: var(--text); text-align: center; margin-bottom: 16px; }
.step-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; min-height: 160px;
}

/* Step 1 — form mockup */
.mock-form-field {
  height: 32px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 10px; padding: 0 10px;
  display: flex; align-items: center;
}
.mock-form-field span { font-size: 12px; color: var(--text-dim); }
.mock-btn {
  height: 32px; background: var(--primary); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: #fff; margin-top: 4px;
}

/* Step 2 — API key mockup */
.mock-api-key {
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 10px 12px; font-family: monospace; font-size: 12px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.mock-copy-btn {
  font-size: 11px; color: var(--primary); cursor: pointer; flex-shrink: 0; margin-left: 8px;
}
.mock-key-label { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }

/* Step 3 — code mockup */
.mock-code {
  background: #0d1117; border: 1px solid #30363d; border-radius: 6px;
  padding: 12px 14px; font-family: 'Courier New', monospace; font-size: 11px;
  line-height: 1.7; overflow-x: auto;
}
.code-keyword { color: #ff7b72; }
.code-string  { color: #a5d6ff; }
.code-func    { color: #d2a8ff; }
.code-var     { color: #ffa657; }
.code-comment { color: #8b949e; }
.code-num     { color: #79c0ff; }

/* ── Trend labels ── */
.trend-up   { color: #22c55e; font-size: 12px; font-weight: 600; }
.trend-down { color: #ef4444; font-size: 12px; font-weight: 600; }

/* ── Social proof ── */
.trust-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
}
.trust-badge {
  padding: 8px 18px; border-radius: 30px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted); font-weight: 500;
  transition: border-color .2s, color .2s;
}
.trust-badge:hover { border-color: var(--border-light); color: var(--text); }

/* ── Coming soon links ── */
.coming-soon-link {
  color: var(--text-dim) !important;
  pointer-events: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.soon-badge {
  display: inline-block;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(136,136,136,.15); border: 1px solid var(--border);
  font-size: 10px; color: var(--text-dim); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}

/* ── Model card ── */
.models-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.model-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  transition: border-color .2s, background .2s;
  cursor: pointer;
}
.model-card:hover { border-color: #3a3a3a; background: #1e1e1e; }
.model-card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.model-provider-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.model-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.model-provider { font-size: 12px; color: var(--text-muted); }
.model-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag {
  padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 500;
  background: rgba(255,255,255,.06); border: 1px solid var(--border);
  color: var(--text-muted);
}
.tag.tag-primary { background: var(--primary-dim); border-color: rgba(110,66,229,.3); color: #a78bfa; }
.tag.tag-green { background: rgba(34,197,94,.1); border-color: rgba(34,197,94,.2); color: #4ade80; }
.tag.tag-blue { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.2); color: #60a5fa; }
.tag.tag-orange { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.2); color: #fbbf24; }
.model-pricing { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--border); }
.model-price-item { text-align: center; }
.model-price-value { font-size: 13px; font-weight: 600; color: var(--text); }
.model-price-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.model-trend { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 3px; }

/* ── Models page ── */
.models-page { padding: 32px 0; }
.models-toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 24px; }
.search-box { flex: 1; min-width: 240px; position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.search-box input {
  width: 100%; padding: 10px 12px 10px 38px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px;
  outline: none; transition: border-color .2s;
}
.search-box input:focus { border-color: var(--primary); }
.search-box input::placeholder { color: var(--text-dim); }
.filter-select {
  padding: 10px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px;
  outline: none; cursor: pointer; transition: border-color .2s;
}
.filter-select:focus { border-color: var(--primary); }
.models-table-wrap { overflow-x: auto; }
.models-table { width: 100%; border-collapse: collapse; }
.models-table th, .models-table td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.models-table th { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; background: var(--bg-card2); }
.models-table tbody tr { background: var(--bg-card); transition: background .15s; }
.models-table tbody tr:hover { background: #222; cursor: pointer; }
.models-table td:first-child { font-weight: 500; }
.model-table-name { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.model-table-provider { font-size: 12px; color: var(--text-muted); }
.models-count { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

/* ── Pricing ── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px;
  position: relative; transition: transform .2s, border-color .2s;
}
.pricing-card:hover { transform: translateY(-3px); }
.pricing-card.featured { border-color: var(--primary); box-shadow: 0 0 40px var(--primary-dim); }
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.pricing-plan { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.pricing-price { font-size: 3rem; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 6px; }
.pricing-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.pricing-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.pricing-features li { font-size: 14px; color: var(--text); display: flex; align-items: flex-start; gap: 10px; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.pricing-features li.dim { color: var(--text-muted); }
.pricing-features li.dim::before { color: var(--text-dim); content: '—'; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 80px 16px; background: var(--bg); position: relative;
}
.auth-page::before {
  content: ''; position: absolute; top: -100px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 500px;
  background: radial-gradient(ellipse, rgba(110,66,229,.12) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card { width: 100%; max-width: 440px; position: relative; z-index: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 36px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo a { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.auth-sub { font-size: 14px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }
.oauth-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); color: var(--text); font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer; transition: border-color .2s, background .2s; margin-bottom: 10px; }
.oauth-btn:hover { border-color: #444; background: #1e1e1e; }
.oauth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text-muted); font-size: 13px; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--text); }
.form-input { width: 100%; padding: 11px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 14px; outline: none; transition: border-color .2s; }
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-dim); }
.form-input::placeholder { color: var(--text-dim); }
.form-submit { width: 100%; padding: 12px; background: var(--primary); color: #fff; border: none; border-radius: var(--radius); font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; transition: background .2s, box-shadow .2s; margin-top: 6px; }
.form-submit:hover { background: var(--primary-hover); box-shadow: 0 4px 20px var(--primary-glow); }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-footer a { color: var(--primary); }

/* ── Dashboard ── */
.dash-layout { display: flex; min-height: calc(100vh - var(--nav-h)); }
.dash-sidebar { width: 230px; flex-shrink: 0; background: var(--bg-card2); border-right: 1px solid var(--border); padding: 24px 12px; position: sticky; top: var(--nav-h); height: calc(100vh - var(--nav-h)); overflow-y: auto; }
.dash-sidebar-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); padding: 0 12px; margin-bottom: 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--text-muted); font-size: 14px; font-weight: 500; transition: background .15s, color .15s; }
.sidebar-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sidebar-link.active { background: var(--primary-dim); color: var(--primary); }
.sidebar-link svg { flex-shrink: 0; }
.dash-main { flex: 1; padding: 32px; min-width: 0; overflow-x: hidden; }
.dash-header { margin-bottom: 28px; }
.dash-header h2 { font-size: 22px; margin-bottom: 4px; }
.dash-header p { font-size: 14px; }

@media (max-width: 768px) {
  .dash-sidebar { display: none; }
  .dash-main { padding: 20px 16px; }
}

/* ── Stat cards ── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.stat-card-value { font-size: 1.75rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.stat-card-sub { font-size: 12px; color: var(--success); margin-top: 4px; }

/* ── Tables ── */
.table-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.table-card-header h4 { font-size: 15px; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 13px 20px; text-align: left; }
.data-table th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); background: var(--bg-card2); border-bottom: 1px solid var(--border); }
.data-table td { border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(255,255,255,.02); }

/* ── API Key ── */
.key-mask { font-family: monospace; font-size: 13px; color: var(--text-muted); background: var(--bg); padding: 3px 8px; border-radius: 4px; border: 1px solid var(--border); }
.badge { padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-active { background: rgba(34,197,94,.1); color: var(--success); }
.badge-inactive { background: rgba(136,136,136,.1); color: var(--text-muted); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.7); backdrop-filter: blur(4px); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 28px; width: 100%; max-width: 440px; animation: modalIn .2s ease; }
@keyframes modalIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; font-size: 20px; line-height: 1; transition: color .2s; }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ── Chart ── */
.chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 28px; }
.chart-card h4 { margin-bottom: 16px; font-size: 15px; }
.chart-area { width: 100%; height: 200px; }

/* ── Billing ── */
.balance-card { background: linear-gradient(135deg, var(--bg-card) 0%, rgba(110,66,229,.08) 100%); border: 1px solid var(--primary); border-radius: 12px; padding: 28px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; }
.balance-amount { font-size: 2.5rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.balance-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Code block ── */
.code-block {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 20px 24px;
  font-family: 'Courier New', 'Consolas', monospace;
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  position: relative;
  counter-reset: line;
}
.code-block .line {
  display: block;
  position: relative;
  padding-left: 3em;
}
.code-block .line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute; left: 0; width: 2em;
  text-align: right;
  color: #3d444d;
  user-select: none;
  font-size: 12px;
}
.code-lang-badge {
  position: absolute; top: 10px; right: 14px;
  font-size: 11px; color: #8b949e; font-family: var(--font);
  text-transform: uppercase; letter-spacing: .06em;
}
.code-copy-btn {
  position: absolute; top: 8px; right: 60px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-muted);
  padding: 3px 8px; font-size: 11px; font-family: var(--font);
  cursor: pointer; transition: color .2s, border-color .2s;
}
.code-copy-btn:hover { color: var(--text); border-color: #444; }

/* ── Playground ── */
.playground-layout {
  display: flex; height: calc(100vh - var(--nav-h));
}
.playground-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--bg-card2); border-right: 1px solid var(--border);
  padding: 20px 16px; overflow-y: auto;
}
.playground-main {
  flex: 1; display: flex; flex-direction: column; min-width: 0;
}
.playground-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-card2);
}
.playground-topbar h2 { font-size: 16px; font-weight: 600; }
.playground-model-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 20px;
  background: var(--primary-dim); border: 1px solid rgba(110,66,229,.3);
  font-size: 12px; color: #a78bfa; font-weight: 500;
}
.playground-messages {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.playground-input-area {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; gap: 12px; align-items: flex-end;
  background: var(--bg-card2);
}
.playground-textarea {
  flex: 1; min-height: 44px; max-height: 160px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text);
  font-family: var(--font); font-size: 14px;
  padding: 10px 14px; resize: none; outline: none;
  transition: border-color .2s;
  overflow-y: auto;
}
.playground-textarea:focus { border-color: var(--primary); }
.playground-textarea::placeholder { color: var(--text-dim); }

/* Chat bubbles */
.chat-bubble-user {
  align-self: flex-end; max-width: 70%;
  background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 18px 18px 4px 18px;
  font-size: 14px; line-height: 1.5;
  word-break: break-word;
}
.chat-bubble-assistant {
  align-self: flex-start; max-width: 70%;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: 18px 18px 18px 4px;
  font-size: 14px; line-height: 1.5;
  word-break: break-word;
}
.bubble-label {
  font-size: 11px; color: var(--text-dim); font-weight: 500; margin-bottom: 4px;
}
.bubble-user-wrap { display: flex; flex-direction: column; align-items: flex-end; }
.bubble-assistant-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.chat-cursor { display: inline-block; width: 2px; height: 14px; background: var(--primary); animation: blink .7s infinite; vertical-align: middle; margin-left: 2px; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* Sidebar slider */
.sidebar-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: 8px; display: block; }
.sidebar-section { margin-bottom: 24px; }
.param-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: flex; justify-content: space-between; }
input[type=range] {
  width: 100%; accent-color: var(--primary);
  background: transparent; height: 4px; cursor: pointer;
}
.pg-select {
  width: 100%; padding: 8px 10px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-family: var(--font); font-size: 13px;
  outline: none; cursor: pointer; transition: border-color .2s;
}
.pg-select:focus { border-color: var(--primary); }
.demo-notice {
  background: rgba(110,66,229,.1); border: 1px solid rgba(110,66,229,.25);
  border-radius: 6px; padding: 8px 12px; font-size: 12px; color: #a78bfa;
  margin-top: 16px;
}

/* ── Docs page ── */
.docs-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
  margin-top: 40px;
}
.docs-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 28px; transition: border-color .2s, transform .2s;
  position: relative; overflow: hidden;
}
.docs-card:hover { border-color: var(--primary-hover); transform: translateY(-2px); }
.docs-card.featured { border-color: rgba(110,66,229,.4); }
.docs-card-icon { font-size: 28px; margin-bottom: 12px; }
.docs-card h3 { font-size: 16px; margin-bottom: 6px; }
.docs-card p { font-size: 13px; margin-bottom: 16px; }
.docs-coming-badge {
  display: inline-block; padding: 2px 8px;
  background: rgba(136,136,136,.1); border: 1px solid var(--border);
  border-radius: 4px; font-size: 11px; color: var(--text-dim);
  font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}

/* ── Legal pages ── */
.legal-page { max-width: 800px; margin: 0 auto; padding: 60px 24px; }
.legal-page h1 { font-size: 2rem; margin-bottom: 8px; }
.legal-date { color: var(--text-dim); font-size: 13px; margin-bottom: 40px; }
.legal-section { margin-bottom: 36px; }
.legal-section h2 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.legal-section p { font-size: 14px; margin-bottom: 12px; }
.legal-section ul { list-style: disc; padding-left: 20px; color: var(--text-muted); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 48px 24px 32px; margin-top: 80px; }
.footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-brand p { margin-top: 12px; font-size: 13px; max-width: 260px; }
.footer-col h5 { font-size: 13px; font-weight: 600; margin-bottom: 14px; color: var(--text); }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-col ul li a { font-size: 13px; color: var(--text-muted); transition: color .2s; }
.footer-col ul li a:hover { color: var(--text); }
.footer-bottom { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

/* ── Compare table ── */
.compare-table-wrap { overflow-x: auto; margin-top: 60px; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--border); }
.compare-table th { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-muted); background: var(--bg-card2); }
.compare-table .check { color: var(--success); font-weight: 700; }
.compare-table .cross { color: var(--text-dim); }

/* FAQ */
.faq-list { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q { padding: 18px 20px; font-weight: 500; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; transition: background .2s; user-select: none; }
.faq-q:hover { background: rgba(255,255,255,.03); }
.faq-icon { transition: transform .3s; color: var(--text-muted); flex-shrink: 0; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-a { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height .3s ease, padding .3s; }
.faq-item.open .faq-a { max-height: 200px; padding: 0 20px 18px; }
.faq-a p { font-size: 14px; }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .stats-bar { flex-wrap: wrap; }
  .stat-item:not(:last-child)::after { display: none; }
  .stat-item { min-width: 45%; }
}

/* ── Misc ── */
.divider { height: 1px; background: var(--border); margin: 40px 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #b8a4ff 50%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== v3 additions ===== */

/* Rankings */
.rank-number { font-size: 1.2em; font-weight: 700; color: var(--primary); width: 32px; display: inline-block; }
.trend-up { color: #22c55e; font-weight: 600; }
.trend-down { color: #ef4444; font-weight: 600; }

/* Apps grid */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: transform .15s, box-shadow .15s; cursor: pointer; }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.app-icon { font-size: 2em; margin-bottom: 10px; }
.app-name { font-weight: 700; font-size: 1.05em; margin-bottom: 6px; }
.app-desc { font-size: 0.88em; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }

/* Status page */
.status-banner { background: #d1fae5; border: 1px solid #6ee7b7; border-radius: 12px; padding: 28px; text-align: center; margin-bottom: 32px; }
.status-dot { width: 16px; height: 16px; background: #10b981; border-radius: 50%; display: inline-block; margin-right: 8px; box-shadow: 0 0 0 4px rgba(16,185,129,.2); vertical-align: middle; }
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; }
.status-ok { display: inline-block; background: #d1fae5; color: #065f46; padding: 2px 10px; border-radius: 20px; font-size: 0.82em; font-weight: 600; }
.uptime-grid { display: flex; gap: 2px; margin-top: 8px; flex-wrap: wrap; }
.uptime-bar { width: 8px; height: 28px; border-radius: 2px; background: #10b981; }
.uptime-bar.degraded { background: #f59e0b; }
.uptime-bar.incident { background: #ef4444; }

/* Compare page */
.compare-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
@media (max-width: 600px) { .compare-selectors { grid-template-columns: 1fr; } }
.compare-table td:first-child { color: var(--text-muted); font-size: 0.9em; }
.compare-table td:not(:first-child) { font-weight: 600; }

/* Enterprise */
.enterprise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 24px; }
.enterprise-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.enterprise-feature h4 { margin-bottom: 6px; font-size: 1em; }
.enterprise-feature p { font-size: 0.88em; color: var(--text-muted); margin: 0; line-height: 1.55; }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 32px; max-width: 540px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.9em; font-weight: 600; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95em; outline: none; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { min-height: 100px; resize: vertical; }

/* ── Dark / Light theme ─────────────────────────────── */
:root {
  --bg: #09080d;
  --surface: #111118;
  --border: #1e1e2e;
  --text: #e8e8f0;
  --text-muted: #7c7c9a;
  --accent: #6e42e5;
  --accent-hover: #8b5cf6;
}
[data-theme="light"] {
  --bg: #f8f9fc;
  --surface: #ffffff;
  --border: #e2e4ea;
  --text: #0f0f23;
  --text-muted: #636e72;
  --accent: #6e42e5;
  --accent-hover: #5b35c8;
}

/* ── Fade-in animation ───────────────────────────────── */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.45s ease, transform 0.45s ease; }
.fade-in-visible { opacity: 1; transform: translateY(0); }

/* ── Toast ───────────────────────────────────────────── */
.toast { position: fixed; bottom: 24px; right: 24px; background: #10b981; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 0.9em; font-weight: 600; z-index: 9999; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; }
.toast-visible { opacity: 1; transform: translateY(0); }

/* ── Global search modal ─────────────────────────────── */
.search-modal { display: none; position: fixed; inset: 0; z-index: 8888; }
.search-modal.search-modal-open { display: flex; align-items: flex-start; justify-content: center; padding-top: 80px; }
.search-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.search-box-modal { position: relative; z-index: 1; width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.search-input-wrap input { flex: 1; background: none; border: none; outline: none; font-size: 1em; color: var(--text); }
.search-input-wrap kbd { background: var(--border); color: var(--text-muted); padding: 2px 8px; border-radius: 4px; font-size: 0.8em; cursor: pointer; }
.search-results { max-height: 360px; overflow-y: auto; padding: 8px; }
.search-result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; color: var(--text); }
.search-result-item:hover { background: var(--border); }
.sr-name { font-weight: 600; font-size: 0.95em; }
.sr-desc { font-size: 0.82em; color: var(--text-muted); }
.search-empty { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.9em; }

/* ── Copy button (code blocks) ───────────────────────── */
.copy-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.1); color: var(--text); border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; font-size: 0.8em; cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.2); }

/* ── Theme toggle button ─────────────────────────────── */
#theme-toggle { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 5px 10px; cursor: pointer; font-size: 14px; }

/* ── Rankings ────────────────────────────────────────── */
.rank-number { font-size: 1.1em; font-weight: 700; color: var(--accent); min-width: 32px; }

/* ── Apps grid ───────────────────────────────────────── */
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 24px; }
.app-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: transform .15s, box-shadow .15s; }
.app-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.app-icon { font-size: 2em; margin-bottom: 10px; }
.app-name { font-weight: 700; font-size: 1em; margin-bottom: 6px; }
.app-desc { font-size: 0.87em; color: var(--text-muted); margin-bottom: 12px; line-height: 1.55; }

/* ── Status page ─────────────────────────────────────── */
.status-banner-ok { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); border-radius: 14px; padding: 32px; text-align: center; margin-bottom: 32px; }
.status-dot-big { display: inline-block; width: 18px; height: 18px; background: #10b981; border-radius: 50%; margin-right: 10px; box-shadow: 0 0 0 6px rgba(16,185,129,.15); vertical-align: middle; }
.status-row { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; border-bottom: 1px solid var(--border); }
.status-ok { display: inline-block; background: rgba(16,185,129,.15); color: #10b981; padding: 2px 12px; border-radius: 20px; font-size: 0.82em; font-weight: 600; }
.uptime-grid { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 6px; }
.uptime-bar { width: 8px; height: 28px; border-radius: 2px; background: #10b981; }
.uptime-bar.degraded { background: #f59e0b; }
.uptime-bar.incident { background: #ef4444; }

/* ── Compare ─────────────────────────────────────────── */
.compare-selectors { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 28px; }
@media(max-width:600px){ .compare-selectors { grid-template-columns: 1fr; } }
.compare-table td:first-child { color: var(--text-muted); font-size: 0.88em; width: 160px; }
.compare-table td:not(:first-child) { font-weight: 600; }

/* ── Enterprise ──────────────────────────────────────── */
.enterprise-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-top: 24px; }
.enterprise-feature { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.enterprise-feature h4 { margin-bottom: 6px; font-size: 1em; }
.enterprise-feature p { font-size: 0.87em; color: var(--text-muted); }
.contact-form { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px; max-width: 560px; margin: 0 auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 0.88em; font-weight: 600; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-size: 0.95em; outline: none; font-family: inherit; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--accent); }
.form-group textarea { min-height: 100px; resize: vertical; }
