/* ═══════════════════════════════════════════════════════════════════════
   Web Agent Bridge — Design System & Styles
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2236;
  --bg-card-hover: #1f2a42;
  --bg-surface: #0f1629;
  --bg-input: #1a2236;

  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #60a5fa;

  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;

  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-secondary: linear-gradient(135deg, #06b6d4, #3b82f6);
  --gradient-accent: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-hero: linear-gradient(160deg, #0a0e1a 0%, #111827 40%, #1a1a3e 100%);

  --border-color: #1e293b;
  --border-hover: #334155;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 30px rgba(59,130,246,0.15);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--text-link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-blue-hover); }

/* ─── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
h4 { font-size: 1.2rem; }

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 100px 0;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }

@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
}

/* ─── Navbar ─────────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 0;
  backdrop-filter: blur(20px);
  background: rgba(10, 14, 26, 0.8);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-normal);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
}

.navbar-brand .brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  color: var(--text-secondary);
  font-size: 0.925rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .mobile-menu-btn { display: block; }
  .navbar-actions .btn-ghost { display: none; }
}

/* ─── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(59,130,246,0.4);
  color: white;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 20px;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-icon { padding: 10px; border-radius: var(--radius-md); }

.btn-danger { background: var(--accent-red); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { background: #059669; color: white; }

/* ─── Hero ───────────────────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  text-align: center;
  background: var(--gradient-hero);
  position: relative;
  overflow: hidden;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(circle at 25% 25%, rgba(59,130,246,0.06) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(139,92,246,0.06) 0%, transparent 50%);
  animation: heroGlow 15s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-5%, -5%); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--accent-blue);
  margin-bottom: 28px;
}

.hero h1 {
  margin-bottom: 24px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-code {
  margin-top: 60px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  text-align: left;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  overflow: hidden;
}

.hero-code::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.hero-code code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.hero-code .keyword { color: var(--accent-purple); }
.hero-code .string { color: var(--accent-green); }
.hero-code .property { color: var(--accent-blue); }
.hero-code .comment { color: var(--text-muted); font-style: italic; }
.hero-code .boolean { color: var(--accent-orange); }

/* ─── Cards ──────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.card-icon.blue { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.card-icon.purple { background: rgba(139,92,246,0.12); color: var(--accent-purple); }
.card-icon.cyan { background: rgba(6,182,212,0.12); color: var(--accent-cyan); }
.card-icon.green { background: rgba(16,185,129,0.12); color: var(--accent-green); }
.card-icon.orange { background: rgba(245,158,11,0.12); color: var(--accent-orange); }
.card-icon.pink { background: rgba(236,72,153,0.12); color: var(--accent-pink); }

.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.65; }

/* ─── Section Header ─────────────────────────────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-header .label {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-header h2 { margin-bottom: 16px; }
.section-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ─── Pricing ────────────────────────────────────────────────────────── */
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.pricing-card.featured {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-glow);
}

.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-tier {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
  min-height: 44px;
}

.pricing-features {
  list-style: none;
  flex: 1;
  margin-bottom: 32px;
}

.pricing-features li {
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
  font-size: 0.85rem;
}

.pricing-features li.disabled {
  color: var(--text-muted);
  text-decoration: line-through;
}

.pricing-features li.disabled::before {
  content: '✗';
  color: var(--text-muted);
}

/* ─── Code Block ─────────────────────────────────────────────────────── */
.code-block {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #10b981; }

.code-lang {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.code-body {
  padding: 20px 24px;
  overflow-x: auto;
}

.code-body pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.code-body .kw { color: var(--accent-purple); }
.code-body .fn { color: var(--accent-blue); }
.code-body .str { color: var(--accent-green); }
.code-body .cm { color: var(--text-muted); font-style: italic; }
.code-body .num { color: var(--accent-orange); }
.code-body .bool { color: var(--accent-orange); }
.code-body .prop { color: var(--accent-cyan); }

/* ─── Footer ─────────────────────────────────────────────────────────── */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 12px;
  max-width: 300px;
  line-height: 1.6;
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: var(--text-muted); font-size: 0.9rem; }
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Forms ──────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4H4.5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* ─── Auth Pages ─────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-hero);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-lg);
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 8px;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.auth-card .btn { width: 100%; margin-top: 8px; }

.auth-footer {
  text-align: center;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 20px;
  display: none;
}

.alert-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--accent-red);
}

.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: var(--accent-green);
}

/* ─── Dashboard ──────────────────────────────────────────────────────── */
.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
}

.sidebar-brand {
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: rgba(59,130,246,0.1);
  color: var(--text-primary);
}

.sidebar-nav a.active { color: var(--accent-blue); }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
}

.main-content {
  flex: 1;
  margin-left: 260px;
  padding: 32px 40px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 1.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.stat-card .value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card .change {
  font-size: 0.8rem;
  margin-top: 4px;
}

.stat-card .change.up { color: var(--accent-green); }
.stat-card .change.down { color: var(--accent-red); }

/* ─── Table ──────────────────────────────────────────────────────────── */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 24px;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td { border-bottom: 1px solid var(--border-color); color: var(--text-secondary); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(59,130,246,0.03); }

/* ─── Badge ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-free { background: rgba(100,116,139,0.15); color: var(--text-muted); }
.badge-starter { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.badge-pro { background: rgba(139,92,246,0.15); color: var(--accent-purple); }
.badge-enterprise { background: rgba(245,158,11,0.15); color: var(--accent-orange); }
.badge-active { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-inactive { background: rgba(239,68,68,0.15); color: var(--accent-red); }

/* ─── Modal ──────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 { font-size: 1.2rem; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text-primary); }

.modal-body { padding: 28px; }
.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ─── Tabs ───────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.tab {
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}

.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ─── Toggle ─────────────────────────────────────────────────────────── */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.toggle-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.toggle-label small { display: block; color: var(--text-muted); font-size: 0.8rem; margin-top: 2px; }

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent-blue);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ─── Snippet Box ────────────────────────────────────────────────────── */
.snippet-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  position: relative;
}

.snippet-box pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ─── Docs ───────────────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  gap: 40px;
  padding-top: 100px;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.docs-sidebar ul { list-style: none; }
.docs-sidebar li { margin-bottom: 4px; }
.docs-sidebar a {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--transition-fast);
}
.docs-sidebar a:hover { color: var(--text-secondary); background: rgba(59,130,246,0.05); }
.docs-sidebar a.active { color: var(--accent-blue); border-left-color: var(--accent-blue); background: rgba(59,130,246,0.08); }

.docs-content {
  flex: 1;
  min-width: 0;
  padding-bottom: 80px;
}

.docs-content h2 {
  font-size: 1.6rem;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.docs-content h2:first-child { margin-top: 0; }

.docs-content h3 {
  font-size: 1.2rem;
  margin-top: 32px;
  margin-bottom: 12px;
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.7;
}

.docs-content ul, .docs-content ol {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-left: 24px;
}

.docs-content li { margin-bottom: 6px; line-height: 1.6; }

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  color: var(--accent-cyan);
}

.docs-content pre code {
  display: block;
  padding: 20px 24px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.7;
  border: none;
}

@media (max-width: 768px) {
  .docs-sidebar { display: none; }
}

/* ─── Utilities ──────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Animations ─────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }

/* ─── Scrollbar ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }
