/* Docs chrome — same tokens as theme.css; layout only. */

.docs-body {
  margin: 0;
  min-height: 100vh;
  background: var(--section-bg);
  color: var(--text-primary);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.docs-body a {
  color: inherit;
}

.docs-skip {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 80;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.docs-skip:focus {
  top: 12px;
}

/* Top bar */

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 20px;
  background: rgba(7, 9, 13, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.docs-brand img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.docs-brand-name {
  font-family: Outfit, system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.docs-top-links {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: 12px;
}

.docs-top-links a {
  color: var(--steel);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.docs-top-links a:hover,
.docs-top-links a[aria-current="page"] {
  color: #fff;
}

.docs-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.docs-search-btn,
.docs-icon-btn,
.docs-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--steel-bright);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.docs-search-btn kbd {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px;
  color: var(--steel);
}

.docs-search-btn:hover,
.docs-icon-btn:hover,
.docs-menu-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.docs-download {
  display: inline-flex;
  align-items: center;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  padding: 8px 12px;
}

.docs-download:hover {
  background: #f3f4f6;
}

.docs-icon-btn {
  padding: 8px;
  text-decoration: none;
}

.docs-menu-btn {
  display: none;
}

/* Shell */

.docs-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 220px;
  column-gap: 28px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
}

.docs-body[data-docs-layout="hub"] .docs-shell {
  display: block;
  max-width: none;
}

.docs-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
  padding: 24px 8px 40px 12px;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}

.docs-nav-group + .docs-nav-group {
  margin-top: 22px;
}

.docs-nav-group h2 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.docs-nav-group a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13.5px;
  line-height: 1.35;
  text-decoration: none;
}

.docs-nav-group a:hover {
  background: var(--section-bg);
}

.docs-nav-group a[aria-current="page"] {
  background: rgba(46, 230, 197, 0.14);
  color: #0b3d36;
  font-weight: 600;
}

#docs-main,
.docs-main {
  min-width: 0;
  padding: 32px 8px 80px 28px;
}

.docs-body[data-docs-layout="hub"] #docs-main,
.docs-body[data-docs-layout="hub"] .docs-main {
  padding: 0 0 80px;
}

.docs-article {
  max-width: 760px;
}

.docs-body[data-docs-layout="hub"] .docs-article {
  max-width: none;
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.docs-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--text-primary);
}

.docs-article > h1,
.docs-hero h1 {
  margin: 0 0 12px;
  font-family: Outfit, system-ui, sans-serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}

.docs-lead {
  margin: 0 0 28px;
  max-width: 42rem;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.docs-article h2 {
  margin: 40px 0 12px;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.docs-article h3 {
  margin: 28px 0 8px;
  font-size: 1.05rem;
}

.docs-article p,
.docs-article li {
  line-height: 1.65;
  color: var(--text-secondary);
}

.docs-article p {
  margin: 0 0 14px;
}

.docs-article ul,
.docs-article ol {
  margin: 0 0 16px;
  padding-left: 1.2rem;
}

.docs-article :not(pre) > code,
.docs-kicker code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86em;
  background: #eef2f7;
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

.docs-article pre code,
.code-panel code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.docs-article pre {
  margin: 0;
  overflow: auto;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.docs-article a:not(.docs-card):not(.docs-cta):not(.docs-cta-secondary) {
  color: #0f766e;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-figure {
  margin: 0 0 24px;
  padding: 20px;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
}

.docs-figure svg {
  width: 100%;
  height: auto;
  min-width: 640px;
}

.docs-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Cards and groups */

.docs-card-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 16px;
  margin: 0 0 36px;
  align-items: stretch;
}

.docs-card-group[data-cols="2"] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.docs-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  padding: 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
}

a.docs-card:hover {
  border-color: rgba(46, 230, 197, 0.45);
}

.docs-article .docs-card h3,
.docs-card h3,
.docs-card .docs-card-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.docs-article .docs-card p,
.docs-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.docs-card .docs-card-cta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(46, 230, 197, 0.16);
  color: #0b3d36;
  font-size: 11px;
  font-weight: 600;
}

.docs-callout {
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #cce8e4;
  background: #ecfeff;
}

.docs-callout.warn {
  border-color: #fde68a;
  background: #fffbeb;
}

.docs-callout h3 {
  margin: 0 0 6px;
  color: var(--text-primary);
}

.docs-callout p:last-child {
  margin-bottom: 0;
}

.docs-steps {
  counter-reset: docs-step;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}

.docs-steps > li {
  position: relative;
  padding: 0 0 20px 44px;
}

.docs-steps > li::before {
  counter-increment: docs-step;
  content: counter(docs-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-related {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #e2e8f0;
}

.docs-related h2 {
  margin-top: 0;
}

.docs-related ul {
  padding-left: 1.1rem;
}

.docs-cta,
.docs-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.docs-cta {
  background: var(--brand);
  color: var(--ink);
}

.docs-cta:hover {
  filter: brightness(1.08);
}

.docs-cta-secondary {
  border: 1px solid #d5dbe3;
  background: #fff;
  color: var(--text-primary);
}

.docs-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 8px;
}

.docs-table-wrap {
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  margin: 0 0 24px;
}

.docs-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.docs-table-wrap th,
.docs-table-wrap td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  vertical-align: top;
}

.docs-table-wrap th {
  background: #f8fafc;
  color: var(--text-primary);
}

.docs-table-wrap td:first-child {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: #0f766e;
  white-space: nowrap;
}

/* Hub */

.docs-hero {
  background: var(--hero-bg);
  color: #fff;
  padding: 56px 20px 48px;
}

.docs-hero-inner,
.docs-hub {
  max-width: 1120px;
  margin: 0 auto;
}

.docs-hero h1 {
  color: #fff;
}

.docs-hero .docs-lead {
  color: var(--steel-bright);
}

.docs-hero .docs-cta-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #e5e7eb;
}

.docs-hero .docs-cta-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}

.docs-hub {
  padding: 48px 20px 0;
}

.docs-hub-section {
  margin: 0 0 48px;
}

.docs-hub-section h2 {
  margin: 0;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
}

.docs-hub-section > p {
  margin: 8px 0 20px;
  max-width: 42rem;
  color: var(--text-secondary);
}

/* TOC */

.docs-toc {
  position: sticky;
  top: 88px;
  padding: 32px 20px 40px 8px;
}

.docs-toc p {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.docs-toc a {
  display: block;
  padding: 4px 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.docs-toc a:hover,
.docs-toc a[aria-current="location"] {
  color: var(--text-primary);
}

.docs-toc a.level-3 {
  padding-left: 12px;
  font-size: 12.5px;
}

/* Footer */

.docs-footer {
  background: var(--hero-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 40px 20px;
  color: var(--steel);
}

.docs-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  max-width: 1120px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.docs-footer a {
  color: var(--steel);
  text-decoration: none;
  font-size: 14px;
}

.docs-footer a:hover {
  color: #fff;
}

.docs-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.docs-footer .docs-brand-name {
  font-size: 18px;
}

.docs-footer p {
  max-width: 28rem;
  line-height: 1.6;
  font-size: 14px;
}

.docs-legal {
  margin-top: 20px;
  font-size: 12px;
  color: #4b5563;
}

/* Search */

.docs-search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(72vh, 560px);
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(7, 9, 13, 0.24);
}

.docs-search-dialog::backdrop {
  background: rgba(7, 9, 13, 0.45);
}

.docs-search-dialog input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 18px;
  font: inherit;
  font-size: 16px;
  outline: none;
}

.docs-search-results {
  overflow: auto;
  max-height: 420px;
  padding: 8px;
}

.docs-search-results a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}

.docs-search-results a:hover,
.docs-search-results a:focus {
  background: var(--section-bg);
}

.docs-search-results strong {
  display: block;
  color: var(--text-primary);
}

.docs-search-results span {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.docs-search-empty {
  padding: 20px;
  color: var(--text-secondary);
}

/* Command cards */

command-card {
  display: block;
  margin: 0 0 12px;
}

.code-panel {
  background: #0b0f16;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  overflow: hidden;
}

.code-panel .code-panel-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.code-panel .code-panel-bar span {
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
}

.code-panel button {
  border: 0;
  background: transparent;
  color: var(--cyan, #22d3ee);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.code-panel pre {
  padding: 16px;
  color: var(--steel-bright);
}

.docs-sidebar-backdrop {
  display: none;
}

@media (max-width: 1080px) {
  .docs-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    column-gap: 24px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 860px) {
  .docs-menu-btn {
    display: inline-flex;
  }

  .docs-top-links,
  .docs-search-btn kbd {
    display: none;
  }

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

  .docs-sidebar {
    position: fixed;
    z-index: 70;
    top: 64px;
    left: 0;
    width: min(320px, 86vw);
    height: calc(100vh - 64px);
    transform: translateX(-110%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 32px rgba(7, 9, 13, 0.18);
  }

  .docs-body.docs-nav-open .docs-sidebar {
    transform: translateX(0);
  }

  .docs-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 64px 0 0;
    z-index: 55;
    background: rgba(7, 9, 13, 0.4);
  }

  .docs-body.docs-nav-open .docs-sidebar-backdrop {
    display: block;
  }

  #docs-main,
  .docs-main {
    padding: 24px 18px 64px;
  }

  .docs-figure svg {
    min-width: 520px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar,
  .docs-search-btn,
  .docs-card {
    transition: none;
  }
}
