/* ── Layout ────────────────────────────── */

.docs-page {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  gap: 48px;
}

/* ── Mobile toggle ─────────────────────── */

.docs-mobile-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
  cursor: pointer;
  margin-bottom: 16px;
  position: sticky;
  top: 16px;
  z-index: 20;
}

.docs-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 30;
}

/* ── Sidebar ───────────────────────────── */

.docs-sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.docs-sidebar__header {
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.docs-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar__link {
  position: relative;
  padding: 9px 12px;
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: 8px;
  transition: all 0.15s;
  overflow: hidden;
}

.docs-sidebar__link:hover {
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
}

.docs-sidebar__link--active {
  color: var(--intel-cyan);
  background: rgba(97, 223, 255, 0.06);
}

.docs-sidebar__indicator {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--intel-cyan);
}

/* ── Breadcrumb ────────────────────────── */

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

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

.docs-breadcrumb a:hover {
  color: var(--intel-cyan);
}

.docs-breadcrumb__sep {
  color: var(--color-border);
}

.docs-breadcrumb__current {
  color: var(--color-text-primary);
}

/* ── Content ───────────────────────────── */

.docs-content {
  flex: 1;
  min-width: 0;
  max-width: 780px;
}

.docs-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.docs-description {
  font-size: 1.0625rem;
  color: var(--color-text-secondary);
  margin: 0 0 32px;
  line-height: 1.6;
}

/* ── Table of contents ─────────────────── */

.docs-toc {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  margin-bottom: 36px;
}

.docs-toc__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding-top: 3px;
  flex-shrink: 0;
}

.docs-toc__links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.docs-toc__link {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}

.docs-toc__link:hover {
  border-color: var(--intel-cyan);
  color: var(--color-text-primary);
}

.docs-toc__link--active {
  background: var(--intel-cyan);
  border-color: var(--intel-cyan);
  color: #0a0a0a;
}

/* ── Body typography ───────────────────── */

.docs-body h2 {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 56px 0 18px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
  letter-spacing: -0.01em;
  scroll-margin-top: 100px;
}

.docs-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 36px 0 12px;
  scroll-margin-top: 100px;
}

.docs-body h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 24px 0 8px;
}

.docs-body p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin: 0 0 16px;
}

.docs-body ul, .docs-body ol {
  margin: 0 0 16px;
  padding-left: 24px;
}

.docs-body li {
  line-height: 1.7;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.docs-body a {
  color: var(--intel-cyan);
  text-decoration: none;
}

.docs-body a:hover {
  text-decoration: underline;
}

.docs-body strong {
  color: var(--color-text-primary);
}

/* ── Code ──────────────────────────────── */

.docs-body code {
  font-family: 'JetBrains Mono', SF Mono, Fira Code, monospace;
  font-size: 0.825rem;
  padding: 2px 6px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--intel-cyan);
  word-break: break-word;
}

.docs-body pre {
  margin: 20px 0;
  padding: 20px;
  background: #0d0d0d;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow-x: auto;
}

.docs-body pre code {
  font-size: 0.8rem;
  line-height: 1.65;
  padding: 0;
  background: none;
  border: none;
  color: #e0e0e0;
}

/* ── Callout ───────────────────────────── */

.docs-body .callout {
  padding: 16px 20px;
  background: rgba(97, 223, 255, 0.04);
  border-left: 3px solid var(--intel-cyan);
  border-radius: 0 10px 10px 0;
  margin: 28px 0;
}

.docs-body .callout-title {
  font-weight: 600;
  color: var(--intel-cyan);
  margin-bottom: 4px;
}

.docs-body .callout p {
  margin: 0;
  font-size: 0.9375rem;
}

/* ── Feature grid ──────────────────────── */

.docs-body .feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.docs-body .feature-card {
  padding: 20px;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color 0.2s;
}

.docs-body .feature-card:hover {
  border-color: var(--intel-cyan);
}

.docs-body .feature-card h4 {
  margin: 0 0 6px;
  color: var(--color-text-primary);
}

.docs-body .feature-card p {
  margin: 0;
  font-size: 0.85rem;
}

/* ── Tables ────────────────────────────── */

.docs-body table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-body th, .docs-body td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.docs-body th {
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-bg-elevated);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.docs-body td {
  color: var(--color-text-secondary);
}

.docs-body tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

/* ── Steps (numbered) ──────────────────── */

.docs-body .step {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.docs-body .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--intel-cyan);
  color: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.docs-body .step-content p {
  margin: 0;
}

/* ── Search engine setup card ──────────── */

.docs-body .setup-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(97, 223, 255, 0.05) 0%, rgba(97, 223, 255, 0.01) 100%);
  border: 1px solid rgba(97, 223, 255, 0.12);
  border-radius: 12px;
  margin: 24px 0;
}

.docs-body .setup-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(97, 223, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--intel-cyan);
  flex-shrink: 0;
}

.docs-body .setup-card__steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 0;
  padding: 0;
}

.docs-body .setup-card__steps li {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  padding: 3px 0;
}

.docs-body .setup-card__steps code {
  font-size: 0.8rem;
}

/* ── Responsive ────────────────────────── */

@media (max-width: 900px) {
  .docs-page {
    flex-direction: column;
    gap: 0;
    padding: 24px 16px 60px;
  }

  .docs-mobile-toggle {
    display: flex;
  }

  .docs-sidebar-overlay {
    display: block;
  }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    z-index: 40;
    background: #0d0d0d;
    border-right: 1px solid var(--color-border);
    padding: 24px 20px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    max-height: none;
  }

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

  .docs-title {
    font-size: 1.75rem;
  }

  .docs-body .feature-grid {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    flex-direction: column;
    gap: 8px;
  }
}

/* x.ai-style docs surface */
.docs-page {
  max-width: none;
  min-height: calc(100vh - 76px);
  margin: 0;
  padding: 0;
  gap: 0;
  background: var(--bg, #0a0a0a);
}

.docs-sidebar {
  position: fixed;
  top: 76px;
  left: 0;
  width: 280px;
  height: calc(100vh - 76px);
  max-height: none;
  padding: 118px 16px 24px;
  background: var(--bg, #0a0a0a);
  border-right: 1px solid var(--card-border, #38383a);
}

.docs-sidebar__header {
  border-bottom: 0;
  margin: 0 8px 26px;
  padding: 0;
  color: var(--fg-tertiary, #636366);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.docs-sidebar__link {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--fg-secondary, #98989d);
  font-size: 14px;
}

.docs-sidebar__link:hover,
.docs-sidebar__link--active {
  background: var(--bg-secondary, #1c1c1e);
  color: var(--fg, #f5f5f7);
}

.docs-content {
  width: calc(100vw - 280px);
  max-width: none;
  margin-left: 280px;
  padding: 0 24px 110px;
}

.docs-xai-toolbar {
  position: relative;
  top: auto;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(1120px, 100%);
  min-height: 64px;
  margin: 0 auto 6px;
  padding: 0;
  border-bottom: 1px solid var(--card-border, #38383a);
  background: transparent;
  backdrop-filter: none;
}

.docs-xai-toolbar > span {
  grid-column: 2;
  color: var(--fg, #f5f5f7);
  font-size: 15px;
  font-weight: 500;
}

.docs-xai-toolbar > div {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-xai-toolbar button,
.docs-xai-toolbar a,
.docs-xai-intro__actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
}

.docs-xai-toolbar button {
  gap: 18px;
  min-width: 210px;
  padding: 0 14px;
  background: transparent;
  color: var(--fg-secondary, #98989d);
}

.docs-xai-toolbar a,
.docs-xai-intro__actions a:first-child {
  padding: 0 18px;
  background: var(--fg, #f5f5f7);
  color: var(--bg, #0a0a0a);
}

.docs-xai-intro {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(0, 1.22fr);
  gap: 28px;
  align-items: stretch;
  width: min(1120px, 100%);
  min-height: 408px;
  margin: 6px auto 48px;
  padding: 40px;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 22px;
  background: var(--card, #1c1c1e);
  overflow: hidden;
}

.docs-xai-intro__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.docs-xai-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 999px;
  color: var(--fg-secondary, #98989d);
  font-size: 13px;
}

.docs-xai-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #00e67a);
}

.docs-xai-intro h1 {
  margin: 18px 0;
  color: var(--fg, #f5f5f7);
  font-size: clamp(2.7rem, 3.7vw, 4.25rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: 0;
}

.docs-xai-intro p {
  max-width: 440px;
  margin: 0;
  color: var(--fg-secondary, #98989d);
  font-size: 17px;
  line-height: 1.6;
}

.docs-xai-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.docs-xai-intro__actions a {
  min-height: 46px;
  padding: 0 20px;
  color: var(--fg, #f5f5f7);
}

.docs-xai-snippet {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 12px;
  background: #0d0d0d;
}

.docs-xai-snippet > div {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--card-border, #38383a);
  color: var(--fg-tertiary, #636366);
  font-size: 13px;
}

.docs-xai-snippet > div span:first-child {
  color: var(--fg, #f5f5f7);
}

.docs-xai-snippet pre {
  min-height: 318px;
  max-width: 100%;
  margin: 0;
  padding: 30px 28px;
  overflow: auto;
  color: var(--fg, #f5f5f7);
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  line-height: 1.72;
}

.docs-breadcrumb,
.docs-title,
.docs-description {
  display: none;
}

.docs-toc {
  position: sticky;
  top: 148px;
  z-index: 15;
  width: min(1120px, 100%);
  margin: 0 auto 36px;
  border-color: var(--card-border, #38383a);
  border-radius: 8px;
  background: var(--card, #1c1c1e);
}

.docs-toc__link--active,
.docs-toc__link:hover {
  border-color: var(--fg, #f5f5f7);
  background: var(--fg, #f5f5f7);
  color: var(--bg, #0a0a0a);
}

.docs-body h2 {
  color: var(--fg, #f5f5f7);
  font-size: 2rem;
  font-weight: 500;
  border-top-color: var(--card-border, #38383a);
}

.docs-body {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.docs-body h3,
.docs-body h4 {
  color: var(--fg, #f5f5f7) !important;
  font-weight: 500;
}

.docs-body p,
.docs-body li,
.docs-body td {
  color: var(--fg-secondary, #98989d);
}

.docs-body .feature-card,
.docs-body .setup-card,
.docs-body pre,
.docs-body th {
  border: 1px solid var(--card-border, #38383a);
  border-radius: 8px;
  background: var(--card, #1c1c1e);
}

.docs-body code {
  background: var(--bg-secondary, #1c1c1e);
  color: var(--fg, #f5f5f7);
}

.docs-body a,
.docs-body a[style] {
  color: var(--fg, #f5f5f7) !important;
}

.docs-body .setup-card__icon {
  background: var(--bg-secondary, #1c1c1e);
  border: 1px solid var(--card-border, #38383a);
  color: var(--fg-secondary, #98989d);
}

@media (max-width: 1080px) {
  .docs-xai-toolbar {
    grid-template-columns: 1fr auto;
  }

  .docs-xai-toolbar > span {
    grid-column: 1;
    justify-self: start;
  }

  .docs-xai-toolbar > div {
    grid-column: 2;
  }

  .docs-xai-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .docs-page {
    padding: 0;
  }

  .docs-mobile-toggle {
    position: fixed;
    right: 16px;
    top: 86px;
    z-index: 70;
    display: inline-flex;
    background: var(--card, #1c1c1e);
    border-color: var(--card-border, #38383a);
    color: var(--fg, #f5f5f7);
  }

  .docs-sidebar {
    top: 76px;
    left: 0;
    z-index: 60;
    padding-top: 82px;
  }

  .docs-content {
    width: 100%;
    margin-left: 0;
    padding: 0 16px 72px;
  }

  .docs-xai-toolbar {
    top: 76px;
    min-height: 68px;
    margin: 0 -16px 32px;
    padding: 0 16px;
  }

  .docs-xai-toolbar > div {
    display: none;
  }

  .docs-xai-intro {
    min-height: 0;
    padding: 22px;
    border-radius: 16px;
  }

  .docs-xai-intro h1 {
    font-size: 2.65rem;
  }

  .docs-xai-snippet pre {
    min-height: 260px;
    padding: 20px;
    font-size: 12px;
  }
}

/* Final docs-only shell. Keep this last. */
.docs-xai-shell {
  min-height: 100vh;
  background: var(--bg, #0a0a0a);
  color: var(--fg, #f5f5f7);
}

.docs-xai-shell .docs-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 280px;
  height: 100vh;
  padding: 118px 16px 28px;
  overflow-y: auto;
  background: var(--bg, #0a0a0a);
  border-right: 1px solid var(--card-border, #38383a);
  transform: none;
}

.docs-xai-brand {
  position: fixed;
  top: 116px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  text-decoration: none;
}

.docs-xai-brand img {
  width: 24px;
  height: 24px;
}

.docs-xai-shell .docs-sidebar__header {
  margin: 44px 8px 10px;
  color: var(--fg, #f5f5f7);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.docs-xai-shell .docs-sidebar__nav {
  gap: 2px;
}

.docs-xai-shell .docs-sidebar__link {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--fg-secondary, #98989d);
  font-size: 13px;
  line-height: 1;
}

.docs-xai-shell .docs-sidebar__link:hover,
.docs-xai-shell .docs-sidebar__link--active {
  background: var(--bg-secondary, #1c1c1e);
  color: var(--fg, #f5f5f7);
}

.docs-xai-shell .docs-sidebar__indicator {
  display: none;
}

.docs-xai-shell .docs-page {
  display: block;
  min-height: 100vh;
  margin: 0 0 0 280px;
  padding: 0;
  background: var(--bg, #0a0a0a);
}

.docs-xai-shell .docs-xai-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 96px;
  margin: 0;
  padding: 0 24px;
  border-bottom: 0;
  background: color-mix(in srgb, var(--bg, #0a0a0a) 94%, transparent);
  backdrop-filter: blur(18px);
}

.docs-xai-shell .docs-xai-toolbar > span {
  grid-column: 2;
  justify-self: center;
  color: var(--fg, #f5f5f7);
  font-size: 15px;
  font-weight: 500;
}

.docs-xai-shell .docs-xai-toolbar > div {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.docs-xai-shell .docs-xai-toolbar button,
.docs-xai-shell .docs-xai-toolbar a {
  min-height: 40px;
  border-radius: 999px;
}

.docs-xai-shell .docs-xai-toolbar button {
  min-width: 210px;
  background: transparent;
}

.docs-xai-shell .docs-content {
  width: min(1152px, calc(100vw - 360px));
  max-width: none;
  margin: 0 auto;
  padding: 104px 0 120px;
}

.docs-xai-shell .docs-xai-intro {
  width: 100%;
  min-height: 480px;
  margin: 0 0 96px;
  padding: 40px;
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
  gap: 34px;
  border-radius: 22px;
  background: var(--card, #1c1c1e);
  overflow: hidden;
}

.docs-xai-shell .docs-xai-intro h1 {
  font-size: clamp(3rem, 4vw, 4.5rem);
}

.docs-xai-shell .docs-xai-snippet {
  width: 100%;
}

.docs-xai-shell .docs-xai-snippet pre {
  min-height: 378px;
  overflow: auto;
}

.docs-xai-shell .docs-toc,
.docs-xai-shell .docs-body {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.docs-xai-shell .docs-toc {
  position: sticky;
  top: 96px;
  margin-bottom: 36px;
}

@media (max-width: 1120px) {
  .docs-xai-shell .docs-content {
    width: min(720px, calc(100vw - 328px));
  }

  .docs-xai-shell .docs-xai-intro {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .docs-xai-shell .docs-page {
    margin-left: 0;
  }

  .docs-xai-shell .docs-sidebar {
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }

  .docs-xai-shell .docs-sidebar--open {
    transform: translateX(0);
  }

  .docs-xai-shell .docs-content {
    width: min(100% - 28px, 720px);
    padding-top: 48px;
  }

  .docs-xai-shell .docs-xai-toolbar {
    min-height: 76px;
  }

  .docs-xai-shell .docs-xai-toolbar > div {
    display: none;
  }

  .docs-mobile-toggle {
    display: inline-flex;
  }
}

.docs-xai-shell .docs-xai-toolbar button {
  gap: 10px;
}

.docs-xai-shell .docs-xai-toolbar button svg {
  flex-shrink: 0;
}

.docs-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 24px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(14px);
}

.docs-search-panel {
  width: min(720px, 100%);
  border: 1px solid var(--card-border, #38383a);
  border-radius: 18px;
  background: var(--card, #1c1c1e);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.docs-search-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border-bottom: 1px solid var(--card-border, #38383a);
}

.docs-search-panel__header svg {
  color: var(--fg-secondary, #98989d);
  flex-shrink: 0;
}

.docs-search-panel__header input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--fg, #f5f5f7);
  font: inherit;
  font-size: 15px;
}

.docs-search-panel__header input::placeholder {
  color: var(--fg-tertiary, #636366);
}

.docs-search-panel__header button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-secondary, #98989d);
  cursor: pointer;
}

.docs-search-panel__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
  color: var(--fg-tertiary, #636366);
  font-size: 12px;
}

.docs-search-panel__results {
  display: flex;
  flex-direction: column;
  max-height: 420px;
  overflow: auto;
  padding: 12px 8px 8px;
}

.docs-search-result {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--fg, #f5f5f7);
  cursor: pointer;
  text-align: left;
}

.docs-search-result:hover {
  background: var(--hover-overlay, rgba(255, 255, 255, 0.05));
}

.docs-search-result__kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--card-border, #38383a);
  border-radius: 999px;
  color: var(--fg-secondary, #98989d);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.docs-search-result__title {
  color: var(--fg, #f5f5f7);
  font-size: 14px;
  font-weight: 500;
}

.docs-search-result__desc {
  color: var(--fg-secondary, #98989d);
  font-size: 13px;
  white-space: nowrap;
}

.docs-search-empty {
  padding: 28px 20px 34px;
  color: var(--fg-secondary, #98989d);
  font-size: 14px;
  text-align: center;
}

[data-theme="light"] .docs-xai-shell {
  background: #fafafa;
  color: #0f172a;
}

[data-theme="light"] .docs-xai-shell .docs-sidebar,
[data-theme="light"] .docs-xai-shell .docs-xai-toolbar,
[data-theme="light"] .docs-xai-shell .docs-xai-intro,
[data-theme="light"] .docs-xai-shell .docs-toc,
[data-theme="light"] .docs-search-panel {
  background: #ffffff;
  border-color: #e4e4e7;
}

[data-theme="light"] .docs-xai-shell .docs-sidebar__link:hover,
[data-theme="light"] .docs-xai-shell .docs-sidebar__link--active,
[data-theme="light"] .docs-search-result:hover {
  background: #f4f4f5;
}

[data-theme="light"] .docs-xai-shell .docs-xai-toolbar button,
[data-theme="light"] .docs-xai-shell .docs-xai-toolbar a,
[data-theme="light"] .docs-xai-shell .docs-xai-intro__actions a {
  border-color: #d4d4d8;
}

[data-theme="light"] .docs-xai-shell .docs-xai-toolbar button {
  background: #ffffff;
  color: #52525b;
}

[data-theme="light"] .docs-xai-shell .docs-xai-intro p,
[data-theme="light"] .docs-xai-shell .docs-sidebar__link,
[data-theme="light"] .docs-xai-shell .docs-sidebar__header,
[data-theme="light"] .docs-xai-shell .docs-xai-status,
[data-theme="light"] .docs-xai-shell .docs-xai-toolbar > span,
[data-theme="light"] .docs-xai-shell .docs-toc__label,
[data-theme="light"] .docs-xai-shell .docs-body p,
[data-theme="light"] .docs-xai-shell .docs-body li,
[data-theme="light"] .docs-search-panel__meta,
[data-theme="light"] .docs-search-result__desc,
[data-theme="light"] .docs-search-empty {
  color: #52525b;
}

[data-theme="light"] .docs-xai-shell .docs-xai-intro h1,
[data-theme="light"] .docs-xai-shell .docs-body h2,
[data-theme="light"] .docs-xai-shell .docs-body h3,
[data-theme="light"] .docs-xai-shell .docs-body h4,
[data-theme="light"] .docs-search-result__title,
[data-theme="light"] .docs-xai-shell .docs-xai-toolbar button,
[data-theme="light"] .docs-xai-shell .docs-xai-toolbar a,
[data-theme="light"] .docs-xai-shell .docs-xai-intro__actions a:first-child {
  color: #111827;
}

[data-theme="light"] .docs-xai-shell .docs-xai-snippet,
[data-theme="light"] .docs-xai-shell .docs-body pre,
[data-theme="light"] .docs-xai-shell .docs-body .feature-card,
[data-theme="light"] .docs-xai-shell .docs-body .setup-card,
[data-theme="light"] .docs-xai-shell .docs-body th,
[data-theme="light"] .docs-search-result__kind {
  background: #f8fafc;
  border-color: #e4e4e7;
}

[data-theme="light"] .docs-xai-shell .docs-xai-snippet pre,
[data-theme="light"] .docs-xai-shell .docs-body code {
  background: #ffffff;
  color: #0f172a;
}

[data-theme="light"] .docs-search-overlay {
  background: rgba(255, 255, 255, 0.56);
}

/* Final docs light-mode hardening. Keep last to prevent dark x.ai surfaces leaking into light mode. */
[data-theme="light"] .docs-xai-shell .docs-page,
[data-theme="light"] .docs-xai-shell .docs-content,
[data-theme="light"] .docs-xai-shell .docs-body {
  background: #fafafa;
  color: #111827;
}

[data-theme="light"] .docs-xai-shell .docs-xai-toolbar {
  background: rgba(255, 255, 255, 0.92);
  border-color: #e4e4e7;
}

[data-theme="light"] .docs-xai-shell .docs-xai-snippet > div,
[data-theme="light"] .docs-xai-shell .docs-xai-snippet,
[data-theme="light"] .docs-xai-shell .docs-body pre,
[data-theme="light"] .docs-search-panel__header {
  background: #f8fafc;
  border-color: #d4d4d8;
}

[data-theme="light"] .docs-xai-shell .docs-xai-snippet pre,
[data-theme="light"] .docs-xai-shell .docs-body pre code {
  background: #ffffff;
  color: #111827;
}

[data-theme="light"] .docs-xai-shell .docs-xai-toolbar a,
[data-theme="light"] .docs-xai-shell .docs-xai-intro__actions a:first-child,
[data-theme="light"] .docs-xai-shell .docs-toc__link--active,
[data-theme="light"] .docs-xai-shell .docs-toc__link:hover {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

[data-theme="light"] .docs-xai-shell .docs-xai-toolbar button,
[data-theme="light"] .docs-xai-shell .docs-xai-intro__actions a:not(:first-child),
[data-theme="light"] .docs-xai-shell .docs-toc__link,
[data-theme="light"] .docs-search-panel__header button {
  background: #ffffff;
  border-color: #d4d4d8;
  color: #111827;
}

[data-theme="light"] .docs-search-panel__header input,
[data-theme="light"] .docs-search-panel__header input::placeholder,
[data-theme="light"] .docs-xai-shell .docs-xai-snippet > div,
[data-theme="light"] .docs-xai-shell .docs-xai-snippet > div span,
[data-theme="light"] .docs-xai-shell .docs-body th,
[data-theme="light"] .docs-xai-shell .docs-body td,
[data-theme="light"] .docs-search-result__kind {
  color: #52525b;
}

[data-theme="light"] .docs-xai-shell .docs-xai-snippet > div span:first-child,
[data-theme="light"] .docs-xai-shell .docs-body strong,
[data-theme="light"] .docs-search-panel__header input {
  color: #111827;
}

[data-theme="light"] .docs-xai-shell .docs-body .setup-card__icon {
  background: #ffffff;
  border-color: #d4d4d8;
  color: #52525b;
}
