:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #647084;
  --line: #d8dee8;
  --soft-line: #e8edf4;
  --blue: #0580ff;
  --blue-dark: #005fc7;
  --blue-soft: #e9f4ff;
  --blue-tint: #f5faff;
  --green: #087b5b;
  --code-bg: #0f172a;
  --code-ink: #e8eefc;
}
* { 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;
  color: var(--ink);
  background: var(--bg);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(280px, 440px);
  align-items: center;
  gap: 24px;
  height: 68px;
  padding: 0 28px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-logo { width: 128px; height: auto; display: block; }
.brand strong, .brand small { display: block; }
.brand strong { display: none; }
.brand small { color: var(--muted); margin-top: 0; font-size: 12px; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a {
  color: #3f4c61;
  text-decoration: none;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 14px;
}
.topnav a:hover { background: #f0f4f8; color: var(--blue); }
.search {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  padding: 11px 13px;
  outline: none;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.search:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,93,183,.12); }
.layout {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 0;
}
.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 22px 18px 34px;
  background: #fff;
  border-right: 1px solid var(--line);
}
.sidebar-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #8a94a6;
  margin-bottom: 16px;
}
.nav-group { margin: 18px 0; }
.nav-title { font-size: 12px; color: var(--blue-dark); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; font-weight: 800; }
.nav-link {
  display: block;
  color: #4b5567;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.28;
}
.nav-link:hover { background: #eef5ff; color: var(--blue); }
main { min-width: 0; padding: 30px 34px 64px; }
.hero, .panel, .card, .toc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 34px;
  background:
    linear-gradient(135deg, rgba(5,128,255,.12), rgba(5,128,255,.035)),
    var(--panel);
}
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: 0; font-size: 42px; line-height: 1.03; letter-spacing: -.02em; }
.lede { max-width: 780px; color: #536174; line-height: 1.65; font-size: 16px; }
.hero-actions { display: flex; gap: 10px; margin-top: 22px; }
.primary-action, .secondary-action {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.primary-action { background: var(--blue); color: #fff; box-shadow: 0 10px 22px rgba(5,128,255,.18); }
.secondary-action { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 10px;
  margin: 0;
  align-content: start;
}
.stats div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255,255,255,.75);
  min-width: 112px;
}
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 3px 0 0; font-weight: 700; }
.panel { padding: 26px; margin-top: 20px; }
.section-heading { max-width: 880px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading.endpoint-heading { margin: 0 0 16px; }
.section-heading h2 { margin: 0 0 8px; font-size: 26px; }
.section-heading p { color: var(--muted); line-height: 1.6; margin: 0; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-grid article { border: 1px solid var(--soft-line); border-radius: 8px; padding: 18px; }
.step { display: inline-flex; margin-bottom: 12px; color: var(--blue); font-weight: 800; font-size: 12px; }
.guide-grid h3 { margin: 0 0 8px; }
.guide-grid p, .guide-grid li { color: var(--muted); line-height: 1.55; }
.guide-grid ul { padding-left: 18px; margin: 8px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 10px 0; }
.chips code { background: var(--blue-soft); color: var(--blue-dark); border-radius: 999px; padding: 5px 8px; }
code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--code-bg);
  border: 1px solid #1e293b;
  border-radius: 7px;
  padding: 13px;
  color: var(--code-ink);
  line-height: 1.45;
}
.code-shell, .code-block { position: relative; }
.code-shell { margin-top: 12px; }
.code-shell pre, .code-block pre {
  padding-top: 42px;
}
pre code { color: #dbe7ff; }
.hl-key { color: #7dd3fc; }
.hl-string { color: #86efac; }
.hl-number { color: #fbbf24; }
.hl-literal { color: #f472b6; }
.hl-url, .hl-endpoint { color: #93c5fd; text-decoration: underline; text-decoration-color: rgba(147,197,253,.32); }
.hl-symbol { color: #c4b5fd; font-weight: 700; }
.hl-param { color: #fde68a; }
button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 9px 12px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}
button:hover { border-color: var(--blue); color: var(--blue); }
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(255,255,255,.08);
  color: #dbe7ff;
  border-color: rgba(255,255,255,.18);
  padding: 5px 8px;
  font-size: 12px;
}
.copy-btn:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }
.inline-copy {
  white-space: nowrap;
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
  color: var(--blue);
}
.directory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.directory-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 15px;
}
.directory-card:hover { border-color: rgba(21,93,183,.35); box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.directory-card strong { display: block; margin-bottom: 4px; }
.directory-card span { color: var(--muted); font-size: 13px; }
.endpoint-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  margin-top: 22px;
}
.cards { display: grid; gap: 18px; }
.card { padding: 0; overflow: hidden; scroll-margin-top: 90px; }
.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--soft-line);
}
.card h3 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.meta { color: var(--muted); font-size: 13px; margin: 7px 0 0; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  background: #ecfdf5;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}
.card-body { padding: 18px 24px 24px; }
.endpoint-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px;
}
.endpoint-label { color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.endpoint-path {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  color: #0f172a;
}
.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--blue);
  font-size: 13px;
}
.card-actions { display: flex; gap: 10px; margin-top: 14px; }
.examples { display: grid; gap: 12px; margin-top: 16px; }
.code-block { position: relative; }
.code-block h4 { margin: 0 0 7px; font-size: 13px; color: var(--muted); }
.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  margin-top: 16px;
}
.guide-content { display: grid; gap: 16px; margin-bottom: 16px; }
.doc-section {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}
.doc-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--blue-dark);
}
.doc-section p,
.doc-section li {
  color: #536174;
  line-height: 1.62;
}
.doc-section p { margin: 0 0 10px; }
.doc-section ol,
.doc-section ul { margin: 0; padding-left: 20px; }
.doc-content {
  margin: 18px 0 16px;
  color: #40516a;
  line-height: 1.62;
}
.doc-content h4 {
  margin: 18px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--soft-line);
  color: #162033;
  font-size: 17px;
}
.doc-content h5 {
  margin: 14px 0 8px;
  color: #24364d;
  font-size: 15px;
}
.doc-content p { margin: 8px 0; }
.doc-content ul { margin: 8px 0 12px; padding-left: 20px; }
.doc-content li { margin: 4px 0; }
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  overflow: hidden;
  border-radius: 7px;
}
.info-table th,
.info-table td {
  border: 1px solid var(--soft-line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: top;
}
.info-table th {
  width: 190px;
  background: var(--blue-tint);
  color: #24364d;
  font-weight: 750;
}
.info-table thead th {
  width: auto;
  background: var(--blue-soft);
}
.compact-table th { width: 210px; }
.param-table-wrap {
  margin: 12px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}
.param-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
}
.param-table th {
  background: #f1f7ff;
  color: #24364d;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.param-table th,
.param-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  vertical-align: top;
}
.param-table tbody tr:last-child td { border-bottom: 0; }
.param-table code {
  color: var(--blue-dark);
  background: #eef6ff;
  border-radius: 5px;
  padding: 2px 5px;
}
.required {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.required.yes { background: #ecfdf5; color: #047857; }
.required.no { background: #f3f6fb; color: #64748b; }
.sequence-diagram {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75);
}
.auth-sequence-svg {
  display: block;
  min-width: 820px;
  width: 100%;
  height: auto;
  font-family: Inter, Arial, sans-serif;
}
.participant {
  fill: var(--blue);
  stroke: #006ce0;
  stroke-width: 1;
}
.participant-text {
  fill: #fff;
  font-size: 14px;
  font-weight: 800;
}
.life-line {
  stroke: #8aa5c5;
  stroke-width: 1.2;
  stroke-dasharray: 4 5;
}
.activation {
  fill: #5aaef7;
  stroke: #1f7fd8;
  stroke-width: 1;
}
.message {
  stroke: var(--blue);
  stroke-width: 1.6;
  fill: none;
}
.dashed-message {
  stroke-dasharray: 5 5;
}
.message-label {
  fill: #24364d;
  font-size: 13px;
  font-weight: 750;
}
.message-note {
  fill: #5a6b82;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.sequence-footnote {
  fill: #536174;
  font-size: 13px;
  font-weight: 650;
}
.empty { padding: 34px; color: var(--muted); text-align: center; }
.toc {
  position: sticky;
  top: 88px;
  height: fit-content;
  padding: 16px;
}
.toc-title {
  color: #8a94a6;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 10px;
}
.toc a {
  display: block;
  color: #536174;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.28;
  padding: 6px 0;
  border-bottom: 1px solid #f0f3f7;
}
.toc a:hover { color: var(--blue); }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  background: #111827;
  color: #fff;
  border-radius: 7px;
  padding: 10px 13px;
  box-shadow: 0 12px 28px rgba(15,23,42,.2);
  transition: .18s ease;
  z-index: 40;
}
.toast.show { transform: translateY(0); opacity: 1; }
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr; height: auto; padding: 14px; gap: 10px; }
  .topnav { overflow: auto; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  main { padding: 18px; }
  .hero, .guide-grid, .endpoint-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .toc { display: none; }
}
@media print {
  .topbar, .sidebar, .toc, .copy-btn { display: none !important; }
  .layout { display: block; }
  main { margin: 0; padding: 0; }
  .card { break-inside: avoid; }
}