:root {
  --doc-bg: #ffffff;
  --doc-sidebar: #f6f7f8;
  --doc-sidebar-border: #e8e9e9;
  --doc-text: #111111;
  --doc-muted: #6b7280;
  --doc-border: #e8e9e9;
  --doc-accent: #0a0a0a;
  --doc-accent-hover: #333333;
  --doc-accent-soft: #f3f4f6;
  --doc-get: #0a0a0a;
  --doc-post: #0a0a0a;
  --doc-code-bg: #1e1e1e;
  --doc-radius: 4px;
  --doc-radius-sm: 4px;
  --doc-topbar-h: 56px;
  --doc-subnav-h: 44px;
  --doc-font: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--doc-topbar-h) + var(--doc-subnav-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--doc-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--doc-text);
  background: var(--doc-bg);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ─── Top bar ─── */

.doc-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--doc-topbar-h);
  padding: 0 1.25rem;
  background: var(--doc-bg);
  border-bottom: 1px solid var(--doc-border);
  position: sticky;
  top: 0;
  /* Above console workspace so the search dropdown is clickable/visible */
  z-index: 1000;
  overflow: visible;
}

.doc-topbar__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.doc-topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.doc-topbar__brand .doc-topbar__logo {
  gap: 0;
}

.doc-topbar__logo img:not(.app-brand__icon) {
  height: 22px;
  width: auto;
  display: block;
}

.doc-topbar__logo.app-brand,
.doc-topbar__logo .app-brand {
  color: inherit;
}

.doc-topbar .app-brand__icon {
  width: 20px !important;
  height: 20px !important;
  max-width: 20px;
}

.doc-topbar__search {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.doc-topbar__search input {
  width: 100%;
  height: 36px;
  padding: 0 2rem 0 2.25rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  font: inherit;
  font-size: 0.8125rem;
  background: #f9fafb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239ca3af' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4' stroke-linecap='round'/%3E%3C/svg%3E") 0.75rem center no-repeat;
  color: var(--doc-text);
}

.doc-search-clear {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #e5e7eb;
  color: var(--doc-muted);
  font-size: 0.875rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.doc-search-clear:hover {
  background: #d1d5db;
  color: var(--doc-text);
}

.doc-search-clear[hidden] {
  display: none;
}

.doc-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  max-height: 420px;
  overflow-y: auto;
}

.doc-search-dropdown[hidden] {
  display: none;
}

.doc-search-results {
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.doc-search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
}

.doc-search-result:last-child {
  border-bottom: none;
}

.doc-search-result:hover,
.doc-search-result.is-focused {
  background: #f9fafb;
}

.doc-search-result__body {
  flex: 1;
  min-width: 0;
}

.doc-search-result__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--doc-text);
  line-height: 1.35;
}

.doc-search-result__path {
  display: block;
  font-size: 0.75rem;
  color: var(--doc-muted);
  margin-top: 0.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

.doc-search-method {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  color: #fff;
}

.doc-search-method--GET { background: var(--doc-get); }
.doc-search-method--POST { background: var(--doc-post); }

.doc-search-empty {
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  color: var(--doc-muted);
  text-align: center;
}

.doc-topbar__search input:focus {
  outline: none;
  border-color: #c5cad3;
  background-color: #fff;
}

.doc-topbar__actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.doc-env-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  color: var(--doc-muted);
  cursor: pointer;
}

.doc-env-btn:hover {
  color: var(--doc-text);
  border-color: #c5cad3;
  background: #f9fafb;
}

.doc-env-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.doc-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--doc-muted);
  background: #fff;
}

.doc-user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  text-decoration: none;
  color: var(--doc-text);
  font-size: 0.8125rem;
  font-weight: 500;
  background: #fff;
  max-width: 200px;
}

.doc-user:hover {
  border-color: #c5cad3;
  background: #f9fafb;
}

.doc-user__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-user__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Sub navigation ─── */

.doc-subnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  height: var(--doc-subnav-h);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--doc-border);
  background: var(--doc-bg);
  position: sticky;
  top: var(--doc-topbar-h);
  z-index: 25;
}

.doc-subnav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--doc-radius);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--doc-muted);
  text-decoration: none;
}

.doc-subnav__icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.75;
}

.doc-subnav__link.is-active .doc-subnav__icon {
  opacity: 1;
}

.doc-subnav__link:hover {
  color: var(--doc-text);
  background: #f3f4f6;
}

.doc-subnav__link.is-active {
  color: var(--doc-text);
  background: #f3f4f6;
  font-weight: 500;
}

.doc-subnav__spacer { flex: 1; }

.doc-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--doc-muted);
  cursor: pointer;
}

.doc-copy-btn:hover {
  color: var(--doc-text);
  border-color: #c5cad3;
}

/* ─── Workspace ─── */

.doc-workspace {
  display: flex;
  flex: 1;
  align-items: flex-start;
  min-height: calc(100vh - var(--doc-topbar-h) - var(--doc-subnav-h));
}

.doc-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--doc-topbar-h) + var(--doc-subnav-h));
  height: calc(100vh - var(--doc-topbar-h) - var(--doc-subnav-h));
  overflow-y: auto;
  background: var(--doc-sidebar);
  border-right: 1px solid var(--doc-sidebar-border);
  padding: 1.25rem 0.85rem 2rem;
}

.doc-sidebar__group {
  margin-bottom: 1.25rem;
}

.doc-sidebar__head {
  padding: 0 0.55rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.doc-sidebar__link {
  display: block;
  padding: 0.42rem 0.65rem;
  border-radius: var(--doc-radius);
  color: var(--doc-text);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.doc-sidebar__link:hover {
  background: rgba(0, 0, 0, 0.04);
}

.doc-sidebar__link.is-active {
  background: #eceef1;
  font-weight: 500;
}

.doc-main {
  flex: 1;
  min-width: 0;
  background: var(--doc-bg);
}

.doc-content {
  max-width: 780px;
  padding: 2rem 2.5rem 4rem;
}

/* ─── Guide hero ─── */

.doc-welcome {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--doc-radius);
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.doc-lead {
  margin: 0 0 2rem;
  max-width: 640px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--doc-muted);
}

.doc-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: calc(var(--doc-topbar-h) + var(--doc-subnav-h) + 16px);
}

.doc-section h2 {
  margin: 0 0 1rem;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.doc-section p {
  margin: 0 0 0.85rem;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.6;
}

.doc-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.5;
}

.doc-checklist__icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: var(--doc-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Start here cards ─── */

.doc-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.doc-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-card:hover {
  border-color: #c5cad3;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.doc-card__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.doc-card__icon {
  width: 28px;
  height: 28px;
  border-radius: var(--doc-radius);
  background: var(--doc-accent-soft);
  color: var(--doc-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.doc-card__icon svg {
  width: 16px;
  height: 16px;
}

.doc-card__title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--doc-text);
}

.doc-card__arrow {
  color: var(--doc-muted);
  font-size: 0.8125rem;
}

.doc-card p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--doc-muted);
  line-height: 1.45;
}

/* ─── Integration steps ─── */

.doc-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.doc-step {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.45;
}

.doc-step__num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--doc-accent);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── API reference blocks ─── */

.section h2 {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--doc-border);
}

.base-url {
  background: #f9fafb;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}

.base-url__label {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--doc-muted);
  margin-bottom: 0.35rem;
}

.base-url code { font-size: 0.875rem; word-break: break-all; }

.auth-line {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: #374151;
}

.auth-line code { font-size: 0.75rem; }

.endpoint {
  background: #fff;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.endpoint__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--doc-border);
  background: #f9fafb;
}

.method {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.35rem;
  border-radius: 3px;
  font-family: ui-monospace, monospace;
  color: #fff;
}

.method--GET { background: var(--doc-get); }
.method--POST { background: var(--doc-post); }

.endpoint__path {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  font-weight: 500;
}

.tag {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  background: #f3f4f6;
  color: #4b5563;
}

.tag--auth { background: #fef3c7; color: #92400e; }

.endpoint__body { padding: 1rem 1.15rem 1.15rem; }

.params-title {
  margin: 1rem 0 0.55rem;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--doc-muted);
}

.params-title:first-child { margin-top: 0; }

.params-empty { margin: 0; font-size: 0.8125rem; color: var(--doc-muted); }

.table-wrap { overflow-x: auto; margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  background: #fff;
}

th, td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--doc-border);
  vertical-align: top;
}

th {
  background: #f9fafb;
  font-weight: 500;
  font-size: 0.6875rem;
  color: var(--doc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td code { font-size: 0.75rem; }

.col-name { width: 26%; min-width: 120px; }
.col-type {
  width: 16%;
  min-width: 90px;
  color: var(--doc-muted);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.6875rem;
}
.col-desc { color: #374151; line-height: 1.45; }

.pill {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  line-height: 1.2;
}

.pill--req { background: #dcfce7; color: #166534; }
.pill--opt { background: #f3f4f6; color: #6b7280; }

pre, .code-block {
  background: var(--doc-code-bg);
  color: #d4d4d4;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
  border-radius: var(--doc-radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  margin: 0.65rem 0 0;
}

.callout {
  background: var(--doc-accent-soft);
  border: 1px solid rgba(26, 61, 72, 0.18);
  border-radius: var(--doc-radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.8125rem;
  margin: 0.85rem 0;
  color: var(--doc-accent);
}

@media (max-width: 960px) {
  .doc-sidebar { display: none; }
  .doc-content { padding: 1.5rem 1.25rem 3rem; }
  .doc-card-grid { grid-template-columns: 1fr; }
  .doc-topbar__search { max-width: 200px; }
  .doc-user__name { display: none; }
}

@media (max-width: 640px) {
  .doc-topbar__search { display: none; }
}
