:root {
  color-scheme: light;
  --header-height: 64px;
  --ink: #172033;
  --muted: #64748b;
  --line: #dce3ed;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
}

* { box-sizing: border-box; }

/* Redoc owns section scrolling and active-menu synchronization. */
html { scroll-behavior: auto; }

body {
  margin: 0;
  min-width: 320px;
  background: #fff;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.skip-link {
  position: fixed;
  z-index: 1001;
  top: 0.65rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  background: #111827;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 120ms ease;
}

.skip-link:focus { transform: translateY(0); }

.docs-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem clamp(1rem, 3vw, 2.25rem);
  border-top: 4px solid var(--blue);
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 1px 8px rgb(15 23 42 / 6%);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: max-content;
}

.title {
  color: #202b3a;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
}

.docs-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.docs-links a {
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  color: #475569;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.docs-links a:hover {
  background: #f1f5f9;
  color: var(--ink);
}

.docs-links a:focus-visible,
.title:focus-visible {
  outline: 3px solid rgb(37 99 235 / 35%);
  outline-offset: 2px;
}

.docs-links .docs-login {
  margin-left: 0.35rem;
  background: var(--blue);
  color: #fff;
}

.docs-links .docs-login:hover {
  background: var(--blue-dark);
  color: #fff;
}

.docs-status,
.docs-fallback {
  width: min(44rem, calc(100% - 2rem));
  margin: 10vh auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #475569;
  text-align: center;
}

.docs-status[hidden] { display: none; }

/* Keep Redoc's sticky navigation and code panel below the site header. */
#redocContainer .menu-content,
#redocContainer .right-panel {
  top: var(--header-height) !important;
  max-height: calc(100vh - var(--header-height));
}

.docs-spinner {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.45rem;
  border: 2px solid #bfdbfe;
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: docs-spin 700ms linear infinite;
}

.docs-status-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.docs-fallback h1 {
  margin-top: 0;
  color: var(--ink);
  font-size: 1.25rem;
}

.docs-fallback a { color: var(--blue-dark); }

@keyframes docs-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .docs-spinner { animation: none; }
}

@media (max-width: 42rem) {
  .docs-header { align-items: flex-start; }
  .docs-links a:not(.docs-login) { display: none; }
}
