/* an5-brand:start — generated from an5Brand/tokens.json, do not edit */
:root {
  --an5-gradient-start: #38bdf8;
  --an5-gradient-end: #6366f1;
  --an5-gradient: linear-gradient(135deg, var(--an5-gradient-start) 0%, var(--an5-gradient-end) 100%);
  --an5-on-badge: #ffffff;
  --an5-on-surface: #c5c5c5;
  --an5-cyan-rgb: 56,189,248;
  --an5-blue-rgb: 99,102,241;
  --an5-badge-ratio: 1.7308;
  --an5-badge-radius: 8;
}
/* an5-brand:end */

/* ─── AN5 ORM Docs Theme (matching an5Site design system) ───────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #070b14;
  --bg-2: #0d1220;
  --bg-3: #111827;
  --border: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(var(--an5-cyan-rgb), 0.3);
  --text: #e2e8f0;
  --text-muted: #8892a4;
  --cyan: var(--an5-gradient-start);
  --cyan-dark: #0ea5e9;
  --blue: var(--an5-gradient-end);
  --purple: #a855f7;
  --green: #22d3ee;
  --orange: #fb923c;
  --pink: #ec4899;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 60px rgba(var(--an5-cyan-rgb), 0.12);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
  --nav-h: 68px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--cyan-dark);
  text-decoration: none;
}

code {
  font-family: var(--mono);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-2);
}

::-webkit-scrollbar-thumb {
  background: rgba(var(--an5-cyan-rgb), 0.3);
  border-radius: 3px;
}

/* ─── Background Glow ───────────────────────────────────────────────────────── */
.hero-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(var(--an5-cyan-rgb), 0.1) 0%, transparent 70%);
  top: -150px;
  left: -150px;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--an5-blue-rgb), 0.08) 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* ─── Container ──────────────────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ─── Nav ────────────────────────────────────────────────────────────────────── */
/* The header is hidden on phones only — see the 768px block. Below that the
   sidebar would just repeat it. */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.logo-badge {
  background: var(--an5-gradient);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.logo-text {
  color: var(--text);
}

.logo-docs-tag {
  font-size: 0.75rem;
  color: var(--cyan);
  background: rgba(var(--an5-cyan-rgb), 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.2);
  margin-left: 4px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--bg-3);
}

.nav-github {
  background: var(--bg-3) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.nav-github:hover {
  border-color: var(--border-hover) !important;
  color: var(--cyan) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: var(--transition);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px;
    display: none;
    gap: 12px;
  }

  .nav-links.open {
    display: flex;
  }
}

/* ─── Docs Layout & Sidebar ─────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  padding-top: 28px;
  padding-bottom: 60px;
  position: relative;
  z-index: 1;
}

.docs-sidebar {
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-heading {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-bottom: 4px;
}

.sidebar-group ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-group a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-group a i {
  width: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.sidebar-group a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-group a.active {
  color: var(--cyan);
  background: rgba(var(--an5-cyan-rgb), 0.08);
  border-left-color: var(--cyan);
  font-weight: 600;
}

.sidebar-group a.active i {
  color: var(--cyan);
}

/* Mobile elements. On desktop the top nav owns the brand/links, and groups are
   always visible, so these are not rendered on desktop. */
.sidebar-groups {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar Header (Brand & Mobile Toggle) */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.sidebar-logo:hover {
  color: var(--text);
  opacity: 0.9;
}

.sidebar-toggle {
  display: none;
}

/* GitHub button in sidebar (visible on both desktop and mobile) */
.sidebar-github {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-3);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 8px;
}

.sidebar-github:hover {
  border-color: var(--border-hover);
  color: var(--cyan);
}

@media (max-width: 920px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    height: auto;
  }
}

/* ─── Docs Content Card ────────────────────────────────────────────────────── */
.docs-content {
  min-width: 0;
}

.card-glass {
  background: rgba(13, 18, 32, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

@media (max-width: 640px) {
  .card-glass {
    padding: 24px 16px;
  }
}

/* ─── Markdown Content Typography ───────────────────────────────────────────── */
/* Identifiers, URLs and slash-separated API lists (``a`/`b`/`c` ``) have no
   space to break at, so without this they set the page's min-content width and
   spill out of the card on narrow screens. `pre` is excluded on purpose: code
   blocks scroll horizontally instead of reflowing. */
.docs-body {
  overflow-wrap: break-word;
  word-break: normal;
}

.docs-body p,
.docs-body li,
.docs-body dd,
.docs-body dt,
.docs-body a {
  overflow-wrap: break-word;
  word-break: normal;
}

.docs-body :not(pre) > code {
  overflow-wrap: break-word;
  word-break: normal;
}

.docs-body th,
.docs-body td {
  overflow-wrap: break-word;
  word-break: normal;
}

.docs-body h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text) 0%, var(--cyan) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.docs-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--cyan);
}

.docs-body p {
  margin-bottom: 16px;
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.7;
}

.docs-body ul,
.docs-body ol {
  margin: 0 0 16px 24px;
  color: #cbd5e1;
}

.docs-body li {
  margin-bottom: 6px;
}

/* ─── Task Lists / Checklists ────────────────────────────────────────────────── */
.docs-body ul.task-list {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.docs-body li.task-list-item {
  list-style: none;
  list-style-type: none;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.docs-body input.task-list-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.6);
  cursor: default;
  margin: 3px 0 0 0;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
}

.docs-body input.task-list-item-checkbox:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.docs-body input.task-list-item-checkbox:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.docs-body inline-code,
.docs-body p code,
.docs-body li code,
.docs-body table code {
  background: rgba(var(--an5-cyan-rgb), 0.1);
  color: var(--cyan);
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.2);
  font-size: 0.88rem;
}

.docs-body table code,
.docs-body td code,
.docs-body th code {
  white-space: nowrap;
}

/* ─── Architecture Visual & Mermaid Diagrams ───────────────────────────────── */
.arch-diagram-card {
  background: rgba(13, 18, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin: 20px 0 24px;
  overflow-x: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  justify-content: center;
  align-items: center;
}

.arch-diagram-card svg {
  display: block;
  max-width: 100%;
  width: auto !important;
  height: auto !important;
  min-width: unset;
  margin: 0 auto;
}

/* ─── Mermaid Diagram Theme Integration ─────────────────────────────────────── */
.arch-diagram-card.mermaid,
.mermaid {
  width: 100%;
  box-sizing: border-box;
}

.mermaid svg {
  font-family: var(--font) !important;
}

.mermaid .node rect,
.mermaid .node polygon,
.mermaid .node circle {
  fill: #141c2e !important;
  stroke: rgba(var(--an5-cyan-rgb), 0.35) !important;
  stroke-width: 1.5px !important;
  rx: 8px !important;
  ry: 8px !important;
  transition: all var(--transition);
}

.mermaid .node:hover rect,
.mermaid .node:hover polygon,
.mermaid .node:hover circle {
  stroke: var(--cyan) !important;
  filter: drop-shadow(0 0 10px rgba(var(--an5-cyan-rgb), 0.45)) !important;
}

.mermaid .node .label {
  color: #f1f5f9 !important;
  font-family: var(--font) !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  line-height: 1.4 !important;
}

.mermaid .cluster rect {
  fill: rgba(10, 15, 29, 0.7) !important;
  stroke: rgba(var(--an5-cyan-rgb), 0.22) !important;
  stroke-width: 1px !important;
  rx: 12px !important;
  ry: 12px !important;
}

.mermaid .cluster-label text,
.mermaid .cluster-label span {
  fill: var(--cyan) !important;
  color: var(--cyan) !important;
  font-family: var(--font) !important;
  font-weight: 600 !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.02em;
}

.mermaid .edgePath .path {
  stroke: var(--an5-gradient-end) !important;
  stroke-width: 1.8px !important;
}

.mermaid .arrowheadPath {
  fill: var(--an5-gradient-end) !important;
  stroke: var(--an5-gradient-end) !important;
}

.mermaid .edgeLabel {
  background-color: #070b14 !important;
  color: #94a3b8 !important;
  font-family: var(--mono) !important;
  font-size: 0.75rem !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.arch-node {
  transition: all 0.2s ease;
  cursor: default;
}

.arch-node:hover rect {
  filter: brightness(1.25) drop-shadow(0 0 12px rgba(var(--an5-cyan-rgb), 0.35));
}

/* ─── Architecture Module Grid Cards ─────────────────────────────────────────── */
.arch-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin: 20px 0 28px;
}

.arch-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}

.arch-module-card {
  background: rgba(13, 18, 32, 0.75);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.arch-module-card:hover {
  border-color: rgba(var(--an5-cyan-rgb), 0.35);
  transform: translateY(-2px);
}

.arch-module-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.arch-module-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
}

.arch-module-badge {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  font-weight: 600;
}

.arch-subgroup {
  margin-bottom: 14px;
}

.arch-subgroup:last-child {
  margin-bottom: 0;
}

.arch-subgroup-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: #94a3b8;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.arch-item-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.88rem;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  list-style: none !important;
}

.arch-item code {
  color: var(--cyan) !important;
  font-size: 0.84rem;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.arch-item-desc {
  color: #94a3b8;
  font-size: 0.8rem;
  text-align: right;
}


/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dark), var(--blue));
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(14, 165, 233, 0.45);
}

.btn-secondary {
  background: var(--bg-3);
  color: var(--text) !important;
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.btn-outline {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan) !important;
}

/* ─── Hero inside index.md ─────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

/* Grid children default to `min-width: auto`, i.e. their min-content width.
   A <pre> keeps that width even with `overflow-x: auto`, so one long code line
   used to push the whole track past the card and widen the page. */
.hero > *,
.features-grid > * {
  min-width: 0;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 12px;
}

.hero-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ─── Features Grid inside index.md ────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 24px 0 48px;
}

@media (max-width: 860px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .features-grid {
    grid-template-columns: 1fr;
  }
}

.feature-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}

.feature-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ─── Code Window ───────────────────────────────────────────────────────────── */
.code-window {
  background: #090d16;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: var(--shadow);
}

.code-titlebar {
  background: #0d1220;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.red {
  background: #ff5f56;
}

.dot.yellow {
  background: #ffbd2e;
}

.dot.green {
  background: #27c93f;
}

.code-filename {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.code-window pre,
pre[class*="language-"] {
  background: #090d16 !important;
  margin: 0 !important;
  padding: 16px !important;
  font-family: var(--mono) !important;
  font-size: 0.88rem !important;
  line-height: 1.6 !important;
  overflow-x: auto;
}

/* ─── Tabs inside Docs ──────────────────────────────────────────────────────── */
.example-tabs {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}

.example-tabs-header {
  display: flex;
  background: #0d1220;
  border-bottom: 1px solid var(--border);
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px 20px;
  font-family: var(--font);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
  background: rgba(var(--an5-cyan-rgb), 0.06);
}

.tab-content {
  display: none;
  padding: 0;
}

.tab-content.active {
  display: block;
}

.example-tabs .tab-content table {
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

/* ─── Markdown Tables ───────────────────────────────────────────────────────── */
.docs-body table {
  display: block;
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  /* A wide reference table scrolls inside the card rather than widening the
     page. `overflow-y` stays hidden so the rounded corners still clip. */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.docs-body th,
.docs-body td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  vertical-align: top;
  overflow-wrap: break-word;
  word-break: normal;
}

.docs-body th {
  background: #0d1220;
  font-weight: 600;
  color: var(--cyan);
}

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

/* ─── Blockquotes / Alerts ─────────────────────────────────────────────────── */
.docs-body blockquote {
  background: rgba(var(--an5-cyan-rgb), 0.05);
  border-left: 4px solid var(--cyan);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.docs-body blockquote p {
  margin: 0;
}

/* ─── CTA Section ───────────────────────────────────────────────────────────── */
.cta-section {
  background: linear-gradient(135deg, rgba(var(--an5-cyan-rgb), 0.08) 0%, rgba(var(--an5-blue-rgb), 0.08) 100%);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  margin-top: 48px;
}

.cta-section h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
  border: none;
}

.cta-section p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-large {
  padding: 14px 32px;
  font-size: 1rem;
}

/* ─── Footer ────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-inner > *,
.footer-links > * {
  min-width: 0;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 320px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.footer-social a {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}

.footer-social a:hover {
  border-color: var(--border-hover);
  color: var(--cyan);
}

.footer-links {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: var(--cyan);
}

.footer-bottom {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 24px 24px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ─── Mobile Responsive Optimizations ─────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --nav-h: 60px;
  }

  /* The header duplicates the docs tree and costs 60px before anything is
     readable. On phones the sidebar becomes the only navigation. */
  .nav {
    display: none;
  }

  .container {
    padding: 0 16px;
  }

  .docs-layout {
    padding-top: 12px;
    padding-bottom: 48px;
    gap: 0;
  }

  /* The "/" shortcut only means something with a keyboard attached. */
  .docs-search-hint {
    display: none;
  }

  .docs-sidebar {
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    margin: 0 -16px 14px;
    overflow-y: visible;
    gap: 0;
  }

  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 8px;
  }

  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar-toggle:hover,
  .sidebar-toggle:focus-visible,
  .sidebar-toggle[aria-expanded="true"] {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(var(--an5-cyan-rgb), 0.08);
  }

  .docs-search {
    margin-bottom: 0;
    padding: 0 16px;
  }

  .docs-search input {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  /* The tree stays folded until the toggle opens the menu. */
  .docs-sidebar:not(.menu-open) .sidebar-groups {
    display: none;
  }

  .sidebar-groups {
    gap: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .sidebar-github {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 16px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-3);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
  }

  .sidebar-github:hover {
    border-color: var(--border-hover);
    color: var(--cyan);
  }

  .sidebar-group {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .sidebar-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .sidebar-heading {
    padding: 8px 16px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar-heading::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
    transition: transform 0.2s;
  }

  .sidebar-group.collapsed .sidebar-heading::after {
    transform: rotate(-90deg);
  }

  .sidebar-group.collapsed ul {
    display: none;
  }

  .sidebar-group ul {
    padding: 0 8px;
  }

  .sidebar-group a {
    padding: 10px 12px;
    font-size: 0.95rem;
    border-left: none;
    border-radius: 8px;
  }

  .sidebar-group a.active {
    border-left: none;
  }

  .card-glass {
    border-radius: var(--radius);
    margin: 0 -8px 32px;
  }

  .docs-body h1 {
    font-size: 1.8rem;
  }

  .docs-body h2 {
    font-size: 1.3rem;
    margin: 28px 0 12px;
  }

  .docs-body h3 {
    font-size: 1.1rem;
  }

  .docs-body p {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .docs-body th,
  .docs-body td {
    padding: 10px 12px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .docs-body blockquote {
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 0.9rem;
  }

  .code-window {
    margin: 16px -8px;
    border-radius: 8px;
  }

  .code-window pre,
  pre[class*="language-"] {
    font-size: 0.82rem !important;
    padding: 12px !important;
  }

  .example-tabs {
    margin: 16px 0;
  }

  .example-tabs-header {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    padding: 12px 16px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-description {
    font-size: 0.9rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-code {
    margin: 0 -8px;
  }

  .features-grid {
    gap: 12px;
    margin: 16px 0 32px;
  }

  .feature-card {
    padding: 16px;
  }

  .feature-card h3 {
    font-size: 0.95rem;
  }

  .feature-card p {
    font-size: 0.82rem;
  }

  .cta-section {
    padding: 24px 16px;
    margin-top: 32px;
  }

  .cta-section h2 {
    font-size: 1.4rem;
  }

  .btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .btn-large {
    padding: 14px 24px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }

  .footer-brand {
    max-width: 100%;
  }

  .footer-links {
    gap: 24px;
    flex-direction: column;
  }

  .footer-col {
    width: 100%;
  }

  .footer-col ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }
}

@media (max-width: 480px) {
  .nav-links {
    padding: 16px;
  }

  .nav-links a {
    padding: 14px 16px;
    border-radius: 8px;
  }

  .docs-body h1 {
    font-size: 1.6rem;
  }

  .docs-body h2 {
    font-size: 1.2rem;
  }

  .docs-body code {
    font-size: 0.82rem;
  }

  .code-window pre,
  pre[class*="language-"] {
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
  }

  .feature-icon {
    font-size: 1.5rem;
  }
}
/* ─── SEARCH ──────────────────────────────────────────────────────────────── */
.docs-search {
  position: relative;
  margin-bottom: 1.25rem;
}

.docs-search input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.docs-search input::placeholder {
  color: var(--text-muted);
}

.docs-search input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(var(--an5-cyan-rgb), 0.12);
}

.docs-search-hint,
.docs-search-empty {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.docs-search-empty {
  color: var(--orange);
}

.docs-search-hint kbd {
  padding: 0.05rem 0.3rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.docs-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: 22rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.docs-search-results li a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  transition: background var(--transition);
}

.docs-search-results li a:hover,
.docs-search-results li.active a {
  background: rgba(var(--an5-cyan-rgb), 0.1);
}

.hit-title {
  display: block;
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 600;
}

.hit-snippet {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

/* ─── COPY BUTTON ─────────────────────────────────────────────────────────── */
.code-window {
  position: relative;
}

.copy-code {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.25rem 0.55rem;
  background: rgba(13, 18, 32, 0.9);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), color var(--transition),
    border-color var(--transition);
}

.code-window:hover .copy-code,
.copy-code:focus-visible {
  opacity: 1;
}

.copy-code:hover {
  color: var(--cyan);
  border-color: var(--border-hover);
}

.copy-code.copied {
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.4);
  opacity: 1;
}

/* Keep the button from covering the last line of a short block. */
.code-window pre {
  padding-bottom: 2.2rem;
}

/* Shared diagram viewer: readable at natural size with contained touch pan & zoom. */
.diagram-viewer {
  display: block;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.diagram-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px 8px;
  background: rgba(13, 18, 32, 0.65);
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.16);
  border-radius: 9px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.diagram-controls[hidden] {
  display: none;
}

.diagram-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.diagram-btn {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  color: #cbd5e1 !important;
  background: #141c2e !important;
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.22) !important;
  border-radius: 6px;
  padding: 0 12px;
  height: 34px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  text-decoration: none;
}

.diagram-btn:hover:not(:disabled) {
  background: #1e293b !important;
  border-color: var(--an5-gradient-start) !important;
  color: #f8fafc !important;
  box-shadow: 0 0 10px rgba(var(--an5-cyan-rgb), 0.3);
}

.diagram-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.diagram-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-muted) !important;
}

.diagram-btn-fit[aria-pressed="true"] {
  background: rgba(var(--an5-cyan-rgb), 0.12) !important;
  border-color: rgba(var(--an5-cyan-rgb), 0.35) !important;
  color: var(--an5-gradient-start) !important;
}

.diagram-zoom-group {
  display: inline-flex;
  align-items: center;
  background: #0d1220;
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.2);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.diagram-btn-zoom {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #94a3b8 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.15s ease;
}

.diagram-btn-zoom:hover:not(:disabled) {
  background: rgba(var(--an5-cyan-rgb), 0.15) !important;
  color: var(--an5-gradient-start) !important;
}

.diagram-btn-zoom:active:not(:disabled) {
  background: rgba(var(--an5-cyan-rgb), 0.28) !important;
  transform: none;
}

.diagram-btn-zoom:disabled {
  opacity: 0.25 !important;
  cursor: not-allowed;
}

.diagram-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--an5-gradient-start);
  min-width: 44px;
  height: 32px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-left: 1px solid rgba(var(--an5-cyan-rgb), 0.14);
  border-right: 1px solid rgba(var(--an5-cyan-rgb), 0.14);
  background: rgba(10, 15, 29, 0.4);
  user-select: none;
}

.diagram-status:empty::before {
  content: "Fit";
  color: #64748b;
  font-weight: 400;
}

.diagram-btn-download {
  background: rgba(var(--an5-cyan-rgb), 0.08) !important;
  border-color: rgba(var(--an5-cyan-rgb), 0.3) !important;
  color: var(--an5-gradient-start) !important;
}

.diagram-btn-download:hover:not(:disabled) {
  background: rgba(var(--an5-cyan-rgb), 0.2) !important;
  border-color: var(--an5-gradient-start) !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(var(--an5-cyan-rgb), 0.35) !important;
}

.diagram-btn-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}

.btn-text-short {
  display: none;
}

.diagram-viewport {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-x pan-y;
  border-radius: 8px;
}

.diagram-viewport:active {
  cursor: grabbing;
}

.diagram-viewport:focus-visible,
.diagram-controls button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.diagram-viewer .mermaid svg {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
}

.diagram-expanded .mermaid {
  width: var(--diagram-width, 900px);
  min-width: 100%;
}

.diagram-expanded .mermaid svg {
  max-width: none;
}

@media (max-width: 768px) {
  .diagram-viewer {
    padding: 12px 6px;
  }
  .diagram-controls {
    justify-content: space-between;
    gap: 6px;
    padding: 5px 6px;
    margin-bottom: 10px;
  }
  .diagram-toolbar-group {
    gap: 6px;
  }
  .diagram-btn {
    height: 34px;
    padding: 0 10px;
    font-size: 0.76rem;
  }
  .diagram-btn-zoom {
    width: 32px;
    height: 32px;
  }
  .diagram-status {
    min-width: 40px;
    height: 32px;
    font-size: 10.5px;
  }
  .diagram-viewer .mermaid {
    width: var(--diagram-width, 600px);
    min-width: 100%;
  }
  .diagram-viewer .mermaid svg {
    max-width: none;
  }
  .diagram-viewer.diagram-fit .mermaid {
    width: 100%;
  }
  .arch-grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .btn-text-full {
    display: none;
  }
  .btn-text-short {
    display: inline;
  }
  .diagram-controls {
    gap: 4px;
    padding: 4px;
  }
  .diagram-toolbar-group {
    gap: 4px;
  }
  .diagram-btn {
    padding: 0 8px;
    font-size: 0.72rem;
  }
}

/* Language/provider controls on contextual guides. */
.docs-context { border: 1px solid var(--border-color, #384155); padding: 1rem; border-radius: 12px; margin: 1.5rem 0; }
.docs-context form { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.docs-context select, .docs-context button { font: inherit; padding: .5rem; border-radius: 6px; background: #162035; color: #fff; border: 1px solid #62718e; max-width: 100%; }

/* ─── Docs Header Bar (Stack Selector) ───────────────────────────────────────── */
.docs-header-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 0;
}

.docs-header-selectors {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-select-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-select-item label {
  font-size: 0.8rem;
  font-weight: 500;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.header-select {
  appearance: none;
  -webkit-appearance: none;
  background: #141c2e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2338bdf8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: #f8fafc;
  border: 1px solid rgba(var(--an5-cyan-rgb), 0.28);
  border-radius: 7px;
  padding: 6px 30px 6px 12px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-select:hover {
  border-color: var(--an5-gradient-start);
  background-color: #1e293b;
  box-shadow: 0 0 10px rgba(var(--an5-cyan-rgb), 0.3);
}

.header-select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px rgba(var(--an5-cyan-rgb), 0.3);
}

@media (max-width: 768px) {
  .docs-header-bar {
    padding: 0;
    margin-bottom: 12px;
    gap: 8px;
  }
  .docs-header-selectors {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .header-select-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
  }
  .header-select-item label {
    font-size: 0.72rem;
  }
  .header-select {
    width: 100%;
    padding: 5px 22px 5px 8px;
    font-size: 0.76rem;
    box-sizing: border-box;
  }
}
