:root {
  --bg: #ffffff;
  --sidebar-bg: #f7f8fb;
  --card-bg: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef2ff;
  --code-bg: #0f1115;
  --code-text: #e8e9ec;
  --code-head-bg: #1c1f26;
  --table-head-bg: #f7f8fb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea580c;
  --gray: #9ca3af;
  --status-4xx-bg: #fef3c7;
  --status-4xx-text: #92400e;
  --status-5xx-bg: #fee2e2;
  --status-5xx-text: #991b1b;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 0.9em;
}

/* Shell layout */
.docs-shell {
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
}

.docs-sidebar-inner {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
}

.docs-brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.docs-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.docs-cta {
  text-align: center;
}

/* Content */
.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 32px 100px;
}

.docs-section {
  scroll-margin-top: 24px;
  margin-bottom: 56px;
}

.docs-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 16px;
}

.docs-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 24px 0 10px;
}

.docs-hero {
  border-bottom: 1px solid var(--border);
  padding-bottom: 40px;
}

.docs-hero h1 {
  font-size: 2.1rem;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}

.lead {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 24px;
}

.docs-hero-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff !important;
  text-decoration: none !important;
}

/* Endpoint markers */
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.method {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.method-post {
  background: #dcfce7;
  color: #166534;
}

.method-get {
  background: #dbeafe;
  color: #1e40af;
}

.endpoint-path {
  font-size: 1.05rem;
  font-weight: 600;
  background: none;
  color: var(--text);
  padding: 0;
}

/* Code blocks */
.code-block {
  background: var(--code-bg);
  border-radius: 10px;
  overflow: hidden;
  margin: 8px 0 16px;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--code-head-bg);
  padding: 8px 14px;
  font-size: 0.75rem;
  color: #9aa0ab;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.copy-btn {
  background: none;
  border: 1px solid #333844;
  color: #c9cdd6;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  text-transform: none;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: #fff;
}

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
}

pre code {
  background: none;
  color: var(--code-text);
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 12px 16px;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

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

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.dot-green { background: var(--green); }
.dot-red { background: var(--red); }
.dot-orange { background: var(--orange); }
.dot-gray { background: var(--gray); }

.status-chip {
  display: inline-block;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.status-4xx {
  background: var(--status-4xx-bg);
  color: var(--status-4xx-text);
}

.status-5xx {
  background: var(--status-5xx-bg);
  color: var(--status-5xx-text);
}

.docs-footer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --sidebar-bg: #14161c;
    --card-bg: #181b22;
    --border: #262a33;
    --text: #e8e9ec;
    --muted: #9aa0ab;
    --accent: #a5b0fb;
    --accent-2: #c4b5fd;
    --accent-soft: #1a1d2e;
    --code-bg: #08090b;
    --code-head-bg: #16181e;
    --table-head-bg: #181b22;
    --status-4xx-bg: #2a2010;
    --status-4xx-text: #fbbf24;
    --status-5xx-bg: #2c1414;
    --status-5xx-text: #f87171;
  }

  .method-post {
    background: #10291a;
    color: #4ade80;
  }

  .method-get {
    background: #12233d;
    color: #93c5fd;
  }
}

@media (max-width: 860px) {
  .docs-shell {
    flex-direction: column;
  }

  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .docs-sidebar-inner {
    padding: 16px 20px;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
  }

  .docs-nav {
    flex-direction: row;
    gap: 4px;
  }

  .docs-nav a {
    white-space: nowrap;
  }

  .docs-cta {
    white-space: nowrap;
  }

  .docs-content {
    padding: 32px 20px 60px;
  }
}
