@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

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

:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --surface-2: #181818;
  --surface-3: #202020;
  --border: #242424;
  --border-hover: #363636;
  --text: #f2f2f2;
  --text-secondary: #888;
  --text-muted: #484848;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.04);
  --indigo: #6366f1;
  --indigo-dim: rgba(99,102,241,0.12);
  --success: #4caf50;
  --danger: #ef5350;
  --warning: #ff9800;
  --radius: 10px;
  --radius-lg: 14px;
  --mono: 'Space Mono', 'Courier New', monospace;
  --font: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --tr: 0.15s ease;
}

html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; line-height: 1.6; font-size: 15px; }
a { color: inherit; text-decoration: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── AUTH SCREEN ── */
#auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

#auth-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.55;
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
}

.auth-top-logo {
  width: 220px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 40px rgba(99,102,241,0.18));
}

.auth-tagline {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: -8px;
}

.auth-card {
  width: 100%;
  background: rgba(17,17,17,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.auth-credit {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}
.auth-credit strong { color: var(--text-secondary); font-weight: 600; }

/* ── TABS ── */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color var(--tr);
  letter-spacing: 0.2px;
}

.auth-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--tr);
  border-radius: 2px 2px 0 0;
}

.auth-tab.active { color: var(--text); }
.auth-tab.active::after { transform: scaleX(1); }
.auth-tab:hover:not(.active) { color: var(--text-secondary); }

form { padding: 28px; }
form .form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 7px;
}

.input-wrap { position: relative; }

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color var(--tr), background var(--tr), box-shadow var(--tr);
}

.form-input:focus {
  border-color: rgba(255,255,255,0.25);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.04);
}

.form-input::placeholder { color: var(--text-muted); font-weight: 400; }
.input-wrap .form-input { padding-right: 46px; }

.eye-toggle {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--tr);
}
.eye-toggle:hover { color: var(--text-secondary); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--tr);
  text-decoration: none;
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
  width: 100%;
}
.btn-primary:hover { background: #e0e0e0; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(255,255,255,0.12); }
.btn-primary:active { background: #c0c0c0; transform: translateY(0); box-shadow: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); }
.btn-sm { padding: 7px 14px; font-size: 12px; font-weight: 600; letter-spacing: 0.2px; }

.auth-error {
  background: rgba(239,83,80,0.08);
  border: 1px solid rgba(239,83,80,0.2);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #ef9a9a;
  margin-top: 12px;
  display: none;
}

/* ── DIVIDER ── */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  margin: 4px 0 20px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.5px;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── SOCIAL BUTTONS ── */
.social-icon-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 28px 28px;
}

.social-icon-btn {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--tr), background var(--tr), transform var(--tr);
  text-decoration: none;
  flex-shrink: 0;
}
.social-icon-btn:hover { border-color: var(--border-hover); background: var(--surface-3); transform: translateY(-2px); }

/* ── FLOATING NAVBAR ── */
.navbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  height: 54px;
  background: rgba(14,14,14,0.92);
  border: 1px solid var(--border);
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px 0 14px;
  z-index: 200;
  box-shadow: 0 4px 32px rgba(0,0,0,0.55);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 6px;
}
.navbar-logo { width: 26px; height: auto; }
.navbar-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

/* Nav links inside the navbar */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.navbar-nav::-webkit-scrollbar { display: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--tr), color var(--tr);
  flex-shrink: 0;
}
.nav-link:hover { background: rgba(255,255,255,0.07); color: var(--text); }
.nav-link.active { background: rgba(255,255,255,0.10); color: var(--text); }
.nav-link i { font-size: 12px; opacity: 0.8; }

/* Right side of navbar */
.navbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.navbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.navbar-avatar-fallback {
  width: 30px; height: 30px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
}

.navbar-logout-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: var(--tr);
  flex-shrink: 0;
}
.navbar-logout-btn:hover { border-color: var(--danger); color: var(--danger); }

.navbar-back-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--tr);
  white-space: nowrap;
}
.navbar-back-btn:hover { color: var(--text); border-color: var(--border-hover); }

/* ── MAIN CONTENT ── */
.main-content {
  padding: 86px 28px 48px;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  max-width: 900px;
  margin: 0 auto;
}
.page { display: none; opacity: 0; }
.page.active { display: block; opacity: 1; }

.page-header { margin-bottom: 36px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.8px; margin-bottom: 4px; line-height: 1.2; }
.page-subtitle { font-size: 14px; color: var(--text-secondary); font-weight: 400; }

/* ── STATS GRID ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--tr), transform var(--tr);
}
.stat-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }

.stat-label { font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px; }
.stat-value { font-size: 34px; font-weight: 700; letter-spacing: -1.5px; line-height: 1; }
.stat-sub { font-size: 12px; color: var(--text-secondary); margin-top: 6px; font-weight: 400; }
.stat-icon { float: right; width: 36px; height: 36px; background: var(--surface-3); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 14px; }

/* ── SECTION CARD ── */
.section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; margin-bottom: 24px; }
.section-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.3px; }

.create-key-form { display: flex; gap: 10px; margin-bottom: 14px; }
.create-key-form .form-input { flex: 1; }

.key-warning-text { font-size: 12px; color: var(--text-muted); font-weight: 400; }

/* ── KEYS HERO BANNER ── */
.keys-hero-banner {
  background: var(--indigo-dim);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.keys-hero-content { display: flex; align-items: flex-start; gap: 16px; }
.keys-hero-icon {
  width: 40px; height: 40px; flex-shrink: 0;
  background: rgba(99,102,241,0.15);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--indigo);
  font-size: 16px;
}
.keys-hero-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.keys-hero-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.5; font-weight: 400; }

/* ── LIMITS GRID ── */
.limits-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.limit-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.limit-num { font-size: 28px; font-weight: 700; letter-spacing: -1px; margin-bottom: 4px; }
.limit-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* ── KEYS LIST ── */
.keys-list { display: flex; flex-direction: column; gap: 10px; }

.key-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--tr), transform var(--tr);
}
.key-item:hover { border-color: var(--border-hover); transform: translateX(2px); }

.key-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.key-status-dot.active  { background: var(--success); box-shadow: 0 0 8px rgba(76,175,80,0.5); }
.key-status-dot.revoked { background: var(--text-muted); }

.key-info { flex: 1; min-width: 0; }
.key-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.key-value { font-family: var(--mono); font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 500; }
.key-actions { display: flex; gap: 6px; }

.btn-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  transition: var(--tr);
}
.btn-icon:hover { border-color: var(--border-hover); color: var(--text); }
.btn-icon.danger:hover { border-color: rgba(239,83,80,0.35); color: var(--danger); background: rgba(239,83,80,0.05); }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-active  { background: rgba(76,175,80,0.08); color: #81c784; border: 1px solid rgba(76,175,80,0.18); }
.badge-revoked { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); }

/* ── LOGS TABLE ── */
.logs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.logs-table th { text-align: left; padding: 10px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.logs-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
.logs-table tr:last-child td { border-bottom: none; }
.logs-table tr:hover td { background: var(--accent-dim); }
.log-valid   { color: var(--success); font-weight: 700; }
.log-invalid { color: var(--danger);  font-weight: 700; }
.log-amount  { font-family: var(--mono); font-size: 12px; }
.log-reason  { color: var(--text-muted); font-size: 12px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── INLINE CODE ── */
.inline-code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty-state i { font-size: 32px; margin-bottom: 14px; display: block; opacity: 0.5; }
.empty-state p { font-size: 14px; font-weight: 400; }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 13px 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text); min-width: 260px; max-width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,0.7); animation: slideIn 0.2s ease; }
.toast.success { border-color: rgba(76,175,80,0.25); }
.toast.error   { border-color: rgba(239,83,80,0.25); }

@keyframes slideIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 24px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; max-width: 460px; width: 100%; }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; letter-spacing: -0.3px; }
.modal-body  { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; line-height: 1.6; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; }

/* ── SPINNER ── */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(0,0,0,0.15); border-top-color: #0a0a0a; border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row td { text-align: center; padding: 40px; color: var(--text-muted); }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.pagination button { padding: 6px 14px; background: transparent; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); font-family: var(--font); font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--tr); }
.pagination button:hover:not(:disabled) { border-color: var(--border-hover); color: var(--text); }
.pagination button:disabled { opacity: 0.25; cursor: not-allowed; }
.current-page { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ════════════════════════════════════════
   DOCS PAGE
════════════════════════════════════════ */
#page-docs { max-width: 860px; }

.docs-hero {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
}
.docs-hero-logo { width: 56px; height: auto; flex-shrink: 0; margin-top: 4px; opacity: 0.85; }
.docs-hero-title { font-size: 22px; font-weight: 700; letter-spacing: -0.6px; margin-bottom: 8px; }
.docs-hero-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.65; font-weight: 400; margin-bottom: 20px; }
.docs-base-url {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  flex-wrap: wrap;
}
.docs-base-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); white-space: nowrap; }
.docs-base-code { font-family: var(--mono); font-size: 13px; color: var(--text); flex: 1; }

.docs-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 20px;
  position: relative;
}
.docs-section-anchor { position: absolute; top: -80px; }
.docs-section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.docs-section-title i { font-size: 14px; color: var(--indigo); }
.docs-section-body { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 20px; font-weight: 400; }
.docs-sub-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin: 24px 0 12px; }

.docs-link { color: var(--indigo); font-weight: 500; border-bottom: 1px solid rgba(99,102,241,0.3); transition: border-color var(--tr); }
.docs-link:hover { border-color: var(--indigo); }

/* Endpoint pill */
.endpoint-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 16px;
}
.method-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
}
.method-post { background: rgba(99,102,241,0.15); color: var(--indigo); }
.endpoint-path { font-family: var(--mono); font-size: 13px; color: var(--text); }

/* Code blocks */
.code-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-3);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 6px 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
.code-tab {
  padding: 7px 16px;
  border: none;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--tr), background var(--tr);
  letter-spacing: 0.2px;
}
.code-tab:hover { color: var(--text-secondary); }
.code-tab.active { background: var(--surface-2); color: var(--text); }

.code-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.code-tabs + .code-block { border-radius: 0 0 var(--radius) var(--radius); border-top: none; }

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-3);
  border-bottom: 1px solid var(--border);
}
.code-block-lang { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }
.btn-copy-code {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  transition: var(--tr);
}
.btn-copy-code:hover { border-color: var(--border-hover); color: var(--text); }

.code-pre {
  padding: 20px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}

/* Token colours */
.tok-cmd    { color: #81c784; font-weight: 700; }
.tok-flag   { color: #90caf9; }
.tok-str    { color: #ce93d8; }
.tok-key    { color: #90caf9; }
.tok-colon  { color: var(--text-muted); }
.tok-bool   { color: #ffb74d; }
.tok-num    { color: #80cbc4; }
.tok-brace  { color: #f2f2f2; }

/* Params table */
.params-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.params-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.params-table th { background: var(--surface-3); text-align: left; padding: 10px 14px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.params-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: top; line-height: 1.6; }
.params-table tr:last-child td { border-bottom: none; }
.params-table tr:hover td { background: var(--accent-dim); }

.req-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 20px; font-size: 10px; font-weight: 700; background: rgba(99,102,241,0.12); color: var(--indigo); border: 1px solid rgba(99,102,241,0.2); white-space: nowrap; }
.opt-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 20px; font-size: 10px; font-weight: 700; background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }

.status-ok   { color: #81c784 !important; }
.status-warn { color: #ffb74d !important; }
.status-err  { color: #ef9a9a !important; }

/* Callouts */
.docs-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
}
.docs-callout i { flex-shrink: 0; margin-top: 2px; }
.docs-callout-warn { background: rgba(255,152,0,0.06); border: 1px solid rgba(255,152,0,0.15); color: #ffcc80; }
.docs-callout-warn i { color: var(--warning); }
.docs-callout-info { background: rgba(99,102,241,0.06); border: 1px solid rgba(99,102,241,0.15); color: #b0b3f7; }
.docs-callout-info i { color: var(--indigo); }

/* Docs footer */
.docs-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 0 8px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}
.docs-footer strong { color: var(--text-secondary); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .navbar { top: 8px; left: 8px; right: 8px; height: 50px; }
  .main-content { padding: 78px 16px 40px; }
  .navbar-name { display: none; }
  .nav-link span { display: none; }
  .nav-link { padding: 7px 9px; }
  .navbar-back-btn span { display: none; }
  .navbar-back-btn { padding: 6px 10px; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 26px; }
  .create-key-form { flex-direction: column; }
  .auth-top-logo { width: 160px; }
  .auth-wrap { max-width: 100%; }
  .docs-hero { flex-direction: column; gap: 16px; padding: 20px; }
  .docs-hero-logo { width: 40px; }
  .limits-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .keys-hero-content { flex-direction: column; }
  .section-card { padding: 18px; }
  .key-item { flex-wrap: wrap; gap: 10px; }
  .page-title { font-size: 22px; }
  .params-table-wrap { font-size: 12px; }
  .code-pre { font-size: 11.5px; padding: 14px; }
  .docs-section { padding: 20px; }
  .endpoint-pill { flex-wrap: wrap; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .limits-grid { grid-template-columns: 1fr; }
  .auth-top-logo { width: 140px; }
}
