:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --text: #172033;
  --muted: #5b667a;
  --border: #d9e1ec;
  --brand: #1747b0;
  --brand-strong: #12398f;
  --success: #0f766e;
  --warning: #92400e;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.08);
  --radius: 16px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.layout {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #4f7fe7);
}
.brand h1 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
  word-break: break-word;
}
.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}
nav a:hover,
nav a.active {
  background: #eaf1ff;
  color: var(--brand);
  text-decoration: none;
}
.sidebar-footer {
  margin-top: 18px;
}

.content {
  min-width: 0;
}

.mobile-nav-toggle {
  display: none;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font: inherit;
}

.hero,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 20px;
  padding: 28px;
  margin-bottom: 24px;
}
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eaf1ff;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 600;
}
.hero h2 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.1;
}
.hero p { margin: 0 0 18px; color: var(--muted); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid var(--brand);
}
.button:hover { background: var(--brand-strong); text-decoration: none; }
.button.secondary {
  background: #fff;
  color: var(--brand);
  border-color: #bfd0f5;
}
.button.secondary:hover {
  background: #f8fbff;
}

.grid.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
section {
  margin-bottom: 24px;
}
section > h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}
.card {
  padding: 22px;
  min-width: 0;
}
.endpoint + .endpoint {
  margin-top: 16px;
}
.endpoint-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}
.method {
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.method.get { background: var(--success); }
.method.post { background: var(--brand); }
.method.patch { background: var(--warning); }
.method.delete { background: var(--danger); }

h3, h4 { margin-top: 0; }
ul { padding-left: 20px; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
code {
  background: #f3f6fa;
  padding: 0.12rem 0.32rem;
  border-radius: 6px;
  word-break: break-word;
}
pre {
  margin: 12px 0 0;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 14px;
  overflow-x: auto;
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}
pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  word-break: normal;
}
.code-card {
  align-self: start;
}

table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
thead, tbody { width: 100%; }
th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .sidebar {
    position: static;
    max-height: none;
    display: none;
    margin-bottom: 16px;
  }
  .sidebar.open {
    display: block;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .hero,
  .grid.two-up {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }
  .layout {
    gap: 16px;
    padding: 12px;
  }
  .hero,
  .card {
    border-radius: 16px;
  }
  .hero {
    padding: 18px;
  }
  .card {
    padding: 16px;
  }
  .hero h2 {
    font-size: 1.65rem;
  }
  .button {
    width: 100%;
  }
  .endpoint-head {
    align-items: flex-start;
  }
}
