/* Generated documentation additions. The existing three-column docs layout remains authoritative. */

.docs-platform-sidebar__group {
  margin-top: 0.5rem;
  padding: 0.125rem 0.75rem 0.375rem;
}

.docs-platform-sidebar__group:first-of-type { margin-top: 0.5rem; }

.docs-platform-sidebar__group h2 {
  margin: 0 0 0.5rem;
  padding: 0 0.5rem;
  color: var(--color-text-emphasis);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.4;
}

.docs-status-badge {
  margin-left: auto;
  color: var(--color-text-tertiary);
  font-size: 0.6875rem;
  font-weight: 500;
}

.docs-preview-notice {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  color: var(--color-text-secondary);
  background: var(--color-surface-secondary);
  font-size: 0.875rem;
}

.docs-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 2rem;
  color: var(--color-text-tertiary);
  font-size: 0.8125rem;
}

.docs-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

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

.docs-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border-subtle);
  color: var(--color-text-tertiary);
  font-size: 0.8125rem;
}

.docs-article-meta__label {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.docs-article-meta a {
  color: var(--color-text-secondary);
}

.docs-sidebar-empty {
  padding: 0 1.25rem;
  color: var(--color-text-tertiary);
  font-size: 0.875rem;
}

#docs-sidebar-toggle {
  display: none;
  position: fixed;
  top: calc(var(--docs-total-header) + 0.75rem);
  left: 0.75rem;
  z-index: 95;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 0.625rem;
  color: var(--color-text-emphasis);
  background: var(--color-surface);
  font-size: 1rem;
}

.docs-home,
.docs-empty-platform {
  width: min(70rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 5rem 0;
}

.docs-home > div:first-child {
  max-width: 47rem;
}

.docs-home h1,
.docs-empty-platform h1 {
  margin: 0.5rem 0 1rem;
  color: var(--color-text-emphasis);
  font-size: 2.5rem;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.docs-home p,
.docs-empty-platform p {
  color: var(--color-text-secondary);
  line-height: 1.75;
}

.docs-home__label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 650;
}

.docs-home__platforms {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 3rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0.75rem;
  background: var(--color-border);
}

.docs-home__platforms a {
  display: flex;
  min-height: 10rem;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.5rem;
  color: var(--color-text-emphasis);
  background: var(--color-surface);
  text-decoration: none;
  transition: background-color 180ms ease-out;
}

.docs-home__platforms a:hover {
  background: var(--color-surface-secondary);
}

.docs-home__platforms span,
.docs-home__platforms small {
  color: var(--color-text-secondary);
}

.docs-home__platforms small {
  margin-top: auto;
}

@media (max-width: 1023px) {
  #docs-sidebar-toggle {
    display: flex;
  }

  .docs-platform-main {
    padding-top: 4rem;
  }
}

@media (max-width: 680px) {
  .docs-home,
  .docs-empty-platform {
    padding: 3rem 0;
  }

  .docs-home h1,
  .docs-empty-platform h1 {
    font-size: 2rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  .docs-home__platforms a {
    transition: none;
  }
}
/* Python syntax colors: restrained, semantic, and readable in both themes. */
.docs-article pre {
  position: relative;
  margin-block: 1rem 1.25rem;
  padding: 2.45rem 1rem 1rem;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  border: 1px solid oklch(0.28 0.01 255);
  border-radius: 0.7rem;
  background:
    linear-gradient(to bottom, oklch(0.205 0.008 255) 0 2rem, oklch(0.145 0.008 255) 2rem 100%);
  color: oklch(0.91 0.008 255);
  line-height: 1.55;
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: oklch(0.38 0.01 255) transparent;
}

.docs-article pre::before {
  content: "";
  position: absolute;
  top: 0.72rem;
  left: 0.85rem;
  width: 0.58rem;
  height: 0.58rem;
  border-radius: 50%;
  background: oklch(0.67 0.2 28);
  box-shadow: 1rem 0 0 oklch(0.78 0.16 82), 2rem 0 0 oklch(0.72 0.17 145);
}

.docs-article pre::after {
  content: attr(data-terminal-title);
  position: absolute;
  top: 0.45rem;
  left: 50%;
  transform: translateX(-50%);
  color: oklch(0.68 0.01 255);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1rem;
  pointer-events: none;
}

.docs-article pre code {
  display: block;
  min-width: max-content;
  color: inherit;
  font-family: "Cascadia Code", "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.855rem;
  font-weight: 430;
  letter-spacing: -0.012em;
  font-variant-ligatures: none;
  white-space: pre;
}

.docs-terminal-copy {
  position: absolute;
  z-index: 2;
  top: 0.38rem;
  right: 0.55rem;
  min-width: 3.5rem;
  height: 1.25rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: 0.32rem;
  background: transparent;
  color: oklch(0.70 0.01 255);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 520;
  line-height: 1.25rem;
  cursor: pointer;
  transition: color 160ms ease-out, background-color 160ms ease-out;
}

.docs-terminal-copy:hover {
  background: oklch(0.29 0.01 255);
  color: oklch(0.94 0.005 255);
}

.docs-terminal-copy:focus-visible {
  outline: 2px solid oklch(0.76 0.13 230);
  outline-offset: 2px;
}

.docs-terminal-copy[data-state="copied"] {
  color: oklch(0.78 0.15 145);
}

.docs-terminal-copy[data-state="error"] {
  color: oklch(0.75 0.17 28);
}

.docs-article :not(pre) > code {
  border: 1px solid var(--color-border-subtle);
  border-radius: 0.3rem;
  background: var(--color-surface-secondary);
  color: oklch(0.72 0.13 230);
  padding: 0.08em 0.34em;
  font-weight: 550;
}

.syntax-keyword,
.syntax-builtin { color: oklch(0.78 0.13 230); }
.syntax-string { color: oklch(0.82 0.13 78); }
.syntax-comment { color: oklch(0.70 0.09 155); font-style: italic; }
.syntax-number,
.syntax-constant { color: oklch(0.78 0.12 305); }
.syntax-function { color: oklch(0.86 0.09 205); }

[data-theme="light"] .docs-article :not(pre) > code { color: oklch(0.43 0.14 240); }
/* Official-reference rhythm: concise title, purpose, then prototype and details. */
.docs-api-hero { margin: 0 0 1.75rem; padding: 0; }
.docs-api-hero h1 { margin: 0 0 0.8rem; overflow-wrap: anywhere; }
.docs-api-hero__intro { max-width: 78ch; margin: 0; color: var(--gray-700, #3d3d3d); font-size: 1rem; line-height: 1.75; }
[data-theme="dark"] .docs-api-hero__intro { color: var(--gray-300, #c8c8c8); }

/* Technical tables need visible row structure, not form-like boxes or loose columns. */
.docs-article table {
  width: 100%;
  margin: 1rem 0 1.6rem;
  border: 1px solid var(--gray-250, #d9d9d9);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.65rem;
  overflow: hidden;
  background: transparent;
  font-size: 0.92rem;
}
.docs-article th,
.docs-article td { padding: 0.72rem 0.85rem; text-align: left; vertical-align: top; }
.docs-article thead th { background: var(--gray-100, #f5f5f5); color: var(--gray-800, #222); font-weight: 650; }
.docs-article tbody td { border-top: 1px solid var(--gray-200, #e7e7e7); }
.docs-article tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--gray-100, #f5f5f5) 48%, transparent); }
.docs-article th + th,
.docs-article td + td { border-left: 1px solid var(--gray-200, #e7e7e7); }

.docs-platform-sidebar__home { display: flex; align-items: center; justify-content: space-between; color: inherit; text-decoration: none; }
.docs-platform-sidebar__home:hover { color: var(--color-text-primary, #111); }

.docs-api-route { margin: 2rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--gray-200, #e5e5e5); }
.docs-api-route__primary { display: flex; flex-wrap: wrap; gap: 0.7rem 1.25rem; }
.docs-api-route a { color: var(--color-text-primary, #111); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.docs-api-route__adjacent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.docs-api-route__adjacent a { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; padding: 0.85rem 0; text-decoration: none; }
.docs-api-route__adjacent a:last-child { text-align: right; }
.docs-api-route__adjacent span { color: var(--gray-550, #707070); font-size: 0.78rem; }

[data-theme="dark"] .docs-article table { border-color: rgba(255,255,255,0.18); background: transparent; }
[data-theme="dark"] .docs-article thead th { background: rgba(255,255,255,0.08); color: #f3f3f3; }
[data-theme="dark"] .docs-article tbody td,
[data-theme="dark"] .docs-article th + th,
[data-theme="dark"] .docs-article td + td { border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .docs-article tbody tr:nth-child(even) td { background: rgba(255,255,255,0.035); }
[data-theme="dark"] .docs-api-route { border-top-color: rgba(255,255,255,0.14); }
[data-theme="dark"] .docs-api-route a { color: #f3f3f3; }

@media (max-width: 720px) {
  .docs-article table { display: block; overflow-x: auto; white-space: nowrap; }
  .docs-api-route__adjacent { grid-template-columns: 1fr; }
  .docs-api-route__adjacent a:last-child { text-align: left; }
}
