:root {
  --bg: #07070f;
  --bg2: #0c0c18;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --cyan: #06b6d4;
  --green: #34d399;
  --red: #ff3860;
  --orange: #ff7a3a;
  --yellow: #ffc857;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --border: rgba(255, 255, 255, 0.07);
  --card: rgba(255, 255, 255, 0.04);
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.9em; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(7, 7, 15, 0.85); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.2rem; font-weight: 900;
  background: linear-gradient(135deg, #a78bfa, #34d399);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.nav-logo svg { width: 24px; height: 24px; }
.nav-right { display: flex; gap: 1.5rem; align-items: center; font-size: 0.9rem; }
.nav-right a { color: var(--muted); transition: color 0.15s; }
.nav-right a:hover { color: var(--text); }
.nav-right .who { color: var(--muted); font-size: 0.85rem; }

/* CONTAINERS */
.container { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 4rem 1.5rem; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 2rem;
}

/* FORMS */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-bottom: 0.4rem; }
.input, .textarea, .select {
  width: 100%; padding: 0.7rem 0.9rem;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: inherit; font-size: 0.95rem;
  transition: border-color 0.15s;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: rgba(139, 92, 246, 0.5); }
.textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.7rem 1.3rem; border-radius: 8px; font-weight: 600;
  font-size: 0.9rem; cursor: pointer; border: none; font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--green));
  color: white; box-shadow: 0 6px 16px -8px rgba(139, 92, 246, 0.45);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(139, 92, 246, 0.65); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.06); }
.btn-danger { background: rgba(255, 56, 96, 0.12); color: var(--red); border: 1px solid rgba(255, 56, 96, 0.25); }
.btn-danger:hover { background: rgba(255, 56, 96, 0.2); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* HEADINGS */
.page-title { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.page-sub { color: var(--muted); margin-bottom: 2rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.page-head .page-title { margin-bottom: 0.25rem; }
.page-head .page-sub { margin-bottom: 0; }

/* MESSAGES */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert.error { background: rgba(255, 56, 96, 0.1); color: var(--red); border: 1px solid rgba(255, 56, 96, 0.25); }
.alert.success { background: rgba(52, 211, 153, 0.1); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.25); }
.alert.info { background: rgba(96, 165, 250, 0.1); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.25); }
.alert.warn { background: rgba(255, 200, 87, 0.08); color: var(--yellow); border: 1px solid rgba(255, 200, 87, 0.25); }

/* TABLE */
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.list th { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
table.list tr:last-child td { border-bottom: none; }
table.list tr:hover td { background: rgba(255, 255, 255, 0.02); }

.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; color: var(--dim); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.row { display: flex; gap: 0.6rem; align-items: center; }
.gap { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* DOT INDICATOR */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.45rem; }
.dot.green { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, 0.6); }
.dot.dim { background: var(--dim); }

/* STAT CARDS */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.85rem; margin-bottom: 2rem; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.2rem; }
.stat .num { font-size: 1.7rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }

/* CATEGORY CHIPS */
.cat-chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.18rem 0.65rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); color: var(--text);
}
.cat-chip .swatch { width: 9px; height: 9px; border-radius: 50%; }

.api-key-display {
  font-family: ui-monospace, monospace; font-size: 0.95rem;
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 8px; padding: 0.85rem 1rem; word-break: break-all; user-select: all;
}

/* CHART CONTAINER */
.chart-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 1.5rem; margin-bottom: 1.5rem;
}
.chart-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.chart-wrap { position: relative; height: 280px; }

/* CODE BLOCK */
pre.code {
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border); border-radius: 8px;
  padding: 0.9rem 1rem; font-family: ui-monospace, monospace; font-size: 0.82rem;
  overflow-x: auto; line-height: 1.55;
}

@media (max-width: 600px) {
  .container { padding: 1.25rem; }
  .container-narrow { padding: 2rem 1.25rem; }
  table.list th, table.list td { padding: 0.6rem 0.5rem; font-size: 0.85rem; }
  .nav { padding: 1rem 1.25rem; }
}
