/* Zenith public docs hub — embedded, no CDN. */

.docs-body {
  --docs-bg: hsl(210 28% 94%);
  --docs-fg: hsl(var(--foreground));
  --docs-muted: hsl(var(--muted-foreground));
  --docs-edge: hsl(var(--foreground) / 0.1);
  --docs-edge-strong: hsl(var(--foreground) / 0.16);
  --docs-panel: hsl(var(--card));
  --docs-sidebar-bg: hsl(var(--sidebar));
  --docs-sidebar-edge: hsl(var(--sidebar-border));
  --docs-soft: hsl(var(--muted));
  --docs-soft-fg: hsl(var(--sidebar-accent));
  --docs-ink-soft: hsl(var(--muted-foreground));
  --docs-code-bg: #0b1220;
  --docs-code-fg: #e8eefc;
  --docs-accent: hsl(var(--primary));
  color: var(--docs-fg);
  position: relative;
  overflow-x: clip;
  background:
    radial-gradient(circle at 50% -12%, hsl(var(--foreground) / 0.045), transparent 32rem),
    var(--docs-bg);
}

.dark .docs-body {
  --docs-bg: hsl(var(--background));
}

.docs-body::before {
  content: "";
  position: fixed;
  inset: 4rem 0 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
  background-image:
    linear-gradient(hsl(var(--foreground) / 0.04) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 36rem);
}

.docs-skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.5rem 0.75rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}

.docs-skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--docs-edge);
  background: hsl(var(--background) / 0.86);
  backdrop-filter: blur(18px) saturate(1.15);
}

.docs-topbar-inner {
  margin: 0 auto;
  max-width: 1440px;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 1rem;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--docs-fg);
  text-decoration: none;
}

.docs-brand-mark {
  display: inline-flex;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  box-shadow: 0 0 0 1px hsl(var(--foreground) / 0.08);
}

.docs-brand-sep {
  color: var(--docs-muted);
  font-weight: 400;
}

.docs-brand-docs {
  color: var(--docs-muted);
  font-weight: 500;
}

.docs-top-links {
  display: none;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem;
  border: 1px solid var(--docs-edge);
  border-radius: 0.7rem;
  background: hsl(var(--muted) / 0.55);
}

.docs-top-links a {
  padding: 0.38rem 0.7rem;
  border-radius: 0.48rem;
  font-size: 0.875rem;
  color: var(--docs-muted);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.docs-top-links a:hover,
.docs-top-links a.is-active {
  color: var(--docs-fg);
}

.docs-top-links a:hover {
  background: hsl(var(--sidebar-accent) / 0.85);
}

.docs-top-links a.is-active {
  background: hsl(var(--background));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.08);
}

.docs-top-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.docs-top-actions > a {
  min-height: 2.75rem;
}

.docs-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--docs-edge);
  background: hsl(var(--background));
  font-size: 0.8rem;
  touch-action: manipulation;
}

.docs-nav-backdrop {
  position: fixed;
  inset: 4rem 0 0;
  z-index: 29;
  border: 0;
  background: hsl(var(--foreground) / 0.35);
  backdrop-filter: blur(2px);
}

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

.docs-body.docs-nav-open {
  overflow: hidden;
}

.docs-shell {
  margin: 0 auto;
  max-width: 1440px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 4rem);
  background: transparent;
}

.docs-sidebar {
  display: none;
  border-right: 1px solid var(--docs-sidebar-edge);
  padding: 1.5rem 0.85rem 2rem;
  background: var(--docs-sidebar-bg);
}

.docs-sidebar.is-open {
  display: block;
  position: fixed;
  inset: 4rem auto 0 0;
  z-index: 30;
  width: min(20rem, calc(100vw - 2.5rem));
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
  border-bottom: 0;
  box-shadow: 18px 0 48px hsl(var(--foreground) / 0.18);
}

.docs-nav-group + .docs-nav-group {
  margin-top: 1.4rem;
}

.docs-nav-group-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
  padding: 0 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--docs-muted);
}

.docs-nav-group-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(to right, var(--docs-edge), transparent);
}

.docs-nav-link {
  position: relative;
  display: block;
  margin: 0.14rem 0;
  padding: 0.52rem 0.7rem 0.52rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 0.62rem;
  font-size: 0.9rem;
  color: var(--docs-ink-soft);
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.docs-nav-link:hover {
  background: var(--docs-soft-fg);
  color: var(--docs-fg);
}

.docs-nav-link.is-active {
  border-color: var(--docs-edge);
  background: var(--docs-soft-fg);
  color: var(--docs-fg);
  font-weight: 600;
}

.docs-nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -0.25rem;
  top: 50%;
  width: 0.2rem;
  height: 1.25rem;
  border-radius: 999px;
  background: hsl(var(--foreground));
  transform: translateY(-50%);
}

.docs-main {
  width: 100%;
  min-width: 0;
  padding: 2rem 1rem 4rem;
  max-width: 56rem;
}

.docs-hero,
.docs-domain-editor,
.docs-config-panel,
.docs-article,
.docs-pager {
  min-width: 0;
  max-width: 100%;
}

.docs-hero {
  position: relative;
  padding: 0.25rem 0 1.8rem;
  border-bottom: 1px solid var(--docs-edge);
}

.docs-hero::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(9rem, 35%);
  height: 1px;
  background: linear-gradient(to right, hsl(var(--foreground) / 0.45), transparent);
}

.docs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.docs-hero h1 {
  margin: 0.75rem 0 0;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 720;
  color: var(--docs-fg);
  text-wrap: balance;
}

.docs-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--docs-muted);
}

.docs-kicker span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: hsl(var(--foreground) / 0.55);
}

.docs-protocol-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--docs-edge);
  border-radius: 999px;
  background: hsl(var(--background));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  color: var(--docs-muted);
}

.docs-protocol-pulse {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: hsl(142 55% 42%);
}

.docs-summary {
  margin: 0.9rem 0 0;
  max-width: 42rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--docs-muted);
}

.docs-domain-editor {
  margin: 1.35rem 0 0.25rem;
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
  border: 1px solid var(--docs-edge-strong);
  border-radius: 0.9rem;
  background: var(--docs-panel);
  box-shadow: 0 10px 28px hsl(var(--foreground) / 0.04);
}

.docs-domain-editor > * {
  min-width: 0;
}

.docs-domain-editor label {
  display: block;
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--docs-fg);
}

.docs-domain-editor p,
.docs-domain-help {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--docs-muted);
}

.docs-domain-control {
  display: flex;
  min-width: 0;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--docs-edge);
  border-radius: 0.6rem;
  background: hsl(var(--background));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
}

.docs-domain-control:focus-within {
  border-color: hsl(var(--foreground) / 0.28);
  box-shadow: 0 0 0 3px hsl(var(--foreground) / 0.08);
}

.docs-domain-control span {
  flex: 0 0 auto;
  padding-left: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  color: var(--docs-muted);
}

.docs-domain-control > .relative {
  flex: 1 1 auto;
  min-width: 0;
}

.docs-domain-control input {
  min-width: 0;
  min-height: 2.75rem;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--docs-fg);
  padding: 0.62rem 0.75rem 0.62rem 0.15rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
}

.docs-domain-help {
  grid-column: 1 / -1;
}

.docs-config-panel {
  position: relative;
  margin: 1.5rem 0 0.5rem;
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem 0.9rem 0.9rem 1.05rem;
  overflow: hidden;
  border: 1px solid var(--docs-edge);
  border-radius: 1rem;
  background: var(--docs-panel);
  box-shadow: 0 12px 32px hsl(var(--foreground) / 0.045);
}

.docs-config-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: hsl(var(--foreground) / 0.35);
}

.docs-config-item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.docs-config-key {
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted);
}

.docs-config-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.84rem;
  color: var(--docs-fg);
  overflow-wrap: anywhere;
}

.docs-article {
  margin-top: 2.25rem;
}

.docs-article h2 {
  position: relative;
  margin: 2.6rem 0 0.9rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--docs-edge);
  font-size: 1.42rem;
  letter-spacing: -0.025em;
  color: var(--docs-fg);
  scroll-margin-top: 5rem;
}

.docs-article h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 3.5rem;
  height: 1px;
  background: hsl(var(--foreground) / 0.4);
}

.docs-article h2:first-child {
  margin-top: 0;
}

.docs-article h3 {
  margin: 1.5rem 0 0.55rem;
  font-size: 1.1rem;
  color: var(--docs-fg);
  scroll-margin-top: 5rem;
}

.docs-article p,
.docs-article li {
  font-size: 0.98rem;
  line-height: 1.7;
  color: hsl(var(--foreground) / 0.88);
}

.docs-article ul {
  margin: 0.75rem 0 1rem;
  padding-left: 1.2rem;
}

.docs-article li + li {
  margin-top: 0.35rem;
}

.docs-article li::marker {
  color: hsl(var(--foreground) / 0.4);
}

.docs-callout {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--docs-edge);
  background: var(--docs-panel);
  box-shadow: 0 8px 22px hsl(var(--foreground) / 0.03);
}

.docs-callout strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.docs-callout p {
  margin: 0;
}

.docs-callout-tip {
  border-color: hsl(var(--foreground) / 0.18);
  background: hsl(var(--muted));
}

.docs-callout-warn {
  border-color: hsl(32 90% 45% / 0.4);
  background: hsl(40 90% 96%);
}

.docs-callout-info {
  border-color: hsl(199 85% 45% / 0.35);
  background: hsl(199 80% 96%);
}

.dark .docs-callout-warn {
  border-color: hsl(32 90% 55% / 0.4);
  background: hsl(32 40% 12%);
}

.dark .docs-callout-info {
  border-color: hsl(199 85% 55% / 0.35);
  background: hsl(199 35% 12%);
}

.docs-table-wrap {
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--docs-edge);
  border-radius: 0.9rem;
  background: var(--docs-panel);
  box-shadow: 0 10px 28px hsl(var(--foreground) / 0.04);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.docs-table th,
.docs-table td {
  padding: 0.7rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--docs-edge);
}

.docs-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted);
  background: var(--docs-soft);
}

.docs-table tbody tr {
  transition: background 140ms ease;
}

.docs-table tbody tr:hover {
  background: hsl(var(--muted) / 0.55);
}

.docs-table tr:last-child td {
  border-bottom: 0;
}

.docs-terminal {
  margin: 1rem 0 1.35rem;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 1px solid #3a3a3c;
  background: #1e1e1e;
  color: #f5f5f7;
  box-shadow: 0 18px 40px hsl(0 0% 0% / 0.28);
}

.docs-terminal-group {
  margin: 1rem 0 1.45rem;
}

.docs-terminal-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.65rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid #1a1a1c;
  background: linear-gradient(180deg, #3a3a3c 0%, #2c2c2e 100%);
}

.docs-terminal-traffic {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.15rem;
}

.docs-terminal-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 0.5px hsl(0 0% 0% / 0.35);
}

.docs-terminal-dot-close {
  background: #ff5f57;
}

.docs-terminal-dot-minimize {
  background: #febc2e;
}

.docs-terminal-dot-zoom {
  background: #28c840;
}

.docs-terminal-title {
  justify-self: center;
  max-width: 100%;
  overflow: hidden;
  color: #d1d1d6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-terminal-copy {
  justify-self: end;
  display: inline-flex;
  min-height: 2rem;
  min-width: 2rem;
  align-items: center;
  justify-content: center;
  border: 1px solid hsl(0 0% 100% / 0.12);
  border-radius: 0.45rem;
  background: hsl(0 0% 100% / 0.06);
  color: #e5e5ea;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.docs-terminal-copy:hover,
.docs-terminal-copy.is-copied {
  border-color: hsl(0 0% 100% / 0.22);
  background: hsl(0 0% 100% / 0.12);
  color: #fff;
}

.docs-terminal-copy .hidden {
  display: none;
}

.docs-code-tabs {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  min-width: 0;
  padding: 0.35rem 0.55rem 0.45rem;
  border-bottom: 1px solid #1a1a1c;
  background: #2a2a2c;
  scrollbar-width: thin;
}

.docs-code-tab {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 1.85rem;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: #8e8e93;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease;
}

.docs-code-tab:hover {
  color: #f2f2f7;
  background: hsl(0 0% 100% / 0.08);
}

.docs-code-tab.is-active {
  color: #fff;
  background: hsl(0 0% 100% / 0.12);
}

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

.docs-terminal-body {
  margin: 0;
  background: #1e1e1e;
}

.docs-terminal-body pre {
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.95rem 1rem 1.1rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.docs-terminal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 2;
  color: #f5f5f7;
}

.docs-token-comment {
  color: #64748b;
  font-style: italic;
}

.docs-token-string {
  color: #a7f3d0;
}

.docs-token-keyword {
  color: #c4b5fd;
  font-weight: 600;
}

.docs-token-number {
  color: #fbbf24;
}

.docs-token-variable {
  color: #7dd3fc;
}

.docs-token-flag {
  color: #f0abfc;
}

.docs-token-function {
  color: #67e8f9;
}

.docs-pager {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--docs-edge);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.docs-pager-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 45%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--docs-edge);
  border-radius: 0.75rem;
  background: var(--docs-panel);
  text-decoration: none;
  color: var(--docs-fg);
  font-weight: 600;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.docs-pager-link:hover {
  border-color: var(--docs-edge-strong);
  box-shadow: 0 8px 20px hsl(var(--foreground) / 0.05);
}

.docs-pager-next {
  text-align: right;
  margin-left: auto;
}

.docs-pager-dir {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-muted);
}

.docs-toc {
  display: none;
  padding: 1.5rem 1rem 2rem 0;
  border-left: 1px solid var(--docs-edge);
  padding-left: 1rem;
}

.docs-toc-label {
  margin-bottom: 0.6rem;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--docs-muted);
}

.docs-toc a {
  display: block;
  padding: 0.28rem 0;
  font-size: 0.84rem;
  color: var(--docs-muted);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--docs-fg);
}

@media (max-width: 380px) {
  .docs-topbar-inner {
    gap: 0.55rem;
    padding-inline: 0.75rem;
  }

  .docs-brand-sep,
  .docs-brand-docs {
    display: none;
  }

  .docs-top-actions {
    gap: 0.4rem;
  }
}

@media (min-width: 768px) {
  .docs-top-links {
    display: inline-flex;
  }

  .docs-nav-toggle {
    display: none;
  }

  .docs-shell {
    grid-template-columns: 15.5rem minmax(0, 1fr);
  }

  .docs-sidebar,
  .docs-sidebar.is-open {
    display: block;
    position: sticky;
    top: 4rem;
    inset: auto;
    max-height: calc(100vh - 4rem);
    overflow: auto;
    box-shadow: none;
    border-bottom: 0;
  }

  .docs-nav-backdrop {
    display: none !important;
  }

  .docs-main {
    padding: 2rem 1.5rem 3.5rem;
  }

  .docs-config-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (min-width: 1100px) {
  .docs-shell {
    grid-template-columns: 15.5rem minmax(0, 1fr) 13rem;
  }

  .docs-toc {
    display: block;
    position: sticky;
    top: 4.75rem;
    align-self: start;
    max-height: calc(100vh - 5rem);
    overflow: auto;
  }

  .docs-config-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .docs-domain-editor {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-body * {
    scroll-behavior: auto !important;
  }
}
