/* ═══════════════════════════════════════════════════════════════
   DOCS VIEWER — Design System
   Monochrome-first · OKLCH · DM Sans · Mobile-first
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Color Tokens (Light) ── */
  --c-bg-0: oklch(99% 0 0);
  --c-bg-1: oklch(97% 0 0);
  --c-bg-2: oklch(94.5% 0 0);
  --c-bg-3: oklch(92% 0 0);
  --c-bg-elevated: oklch(100% 0 0);
  --c-bg-overlay: oklch(100% 0 0 / 0.92);
  --c-bg-code: oklch(96% 0 0);
  --c-bg-code-block: oklch(18% 0 0);

  --c-text-0: oklch(14% 0 0);
  --c-text-1: oklch(32% 0 0);
  --c-text-2: oklch(50% 0 0);
  --c-text-3: oklch(62% 0 0);
  --c-text-inv: oklch(99% 0 0);
  --c-text-code: oklch(88% 0 0);

  --c-border-0: oklch(88% 0 0);
  --c-border-1: oklch(92% 0 0);
  --c-border-2: oklch(95% 0 0);

  --c-surface-hover: oklch(95% 0 0);
  --c-surface-active: oklch(92.5% 0 0);
  --c-surface-selected: oklch(94% 0 0);

  --c-accent: oklch(50% 0.22 305);
  --c-accent-hover: oklch(44% 0.24 305);
  --c-accent-fg: oklch(99% 0 0);
  --c-accent-subtle: oklch(96% 0.03 305);
  --c-accent-muted: oklch(87% 0.07 305);

  /* Functional Colors */
  --c-success: oklch(52% 0.16 145);
  --c-warning: oklch(62% 0.16 80);
  --c-error: oklch(52% 0.2 25);
  --c-info: oklch(52% 0.16 250);

  /* ── Spacing (4px base) ── */
  --s-0: 0px;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;

  /* ── Typography ── */
  --f-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --t-xs: 0.6875rem;   /* 11px */
  --t-sm: 0.8125rem;   /* 13px */
  --t-base: 0.9375rem; /* 15px */
  --t-md: 1rem;        /* 16px */
  --t-lg: 1.125rem;    /* 18px */
  --t-xl: 1.3125rem;   /* 21px */
  --t-2xl: 1.625rem;   /* 26px */
  --t-3xl: 2rem;       /* 32px */
  --t-4xl: 2.5rem;     /* 40px */

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.55;
  --lh-relaxed: 1.7;

  --w-normal: 400;
  --w-medium: 500;
  --w-semi: 600;
  --w-bold: 700;

  /* ── Layout ── */
  --nav-h: 56px;
  --sidebar-w: 272px;
  --content-max: 780px;
  --dropdown-w: 320px;

  /* ── Motion ── */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* ── Shadows ── */
  --sh-xs: 0 1px 2px oklch(0% 0 0 / 0.04);
  --sh-sm: 0 1px 3px oklch(0% 0 0 / 0.06), 0 1px 2px oklch(0% 0 0 / 0.04);
  --sh-md: 0 4px 8px oklch(0% 0 0 / 0.06), 0 2px 4px oklch(0% 0 0 / 0.04);
  --sh-lg: 0 8px 24px oklch(0% 0 0 / 0.08), 0 4px 8px oklch(0% 0 0 / 0.04);
  --sh-xl: 0 16px 48px oklch(0% 0 0 / 0.1), 0 8px 16px oklch(0% 0 0 / 0.05);

  /* ── Radius ── */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-full: 9999px;
}

/* ── Dark Theme ── */
[data-theme="dark"] {
  --c-bg-0: oklch(12% 0 0);
  --c-bg-1: oklch(15% 0 0);
  --c-bg-2: oklch(18.5% 0 0);
  --c-bg-3: oklch(22% 0 0);
  --c-bg-elevated: oklch(16% 0 0);
  --c-bg-overlay: oklch(12% 0 0 / 0.92);
  --c-bg-code: oklch(20% 0 0);
  --c-bg-code-block: oklch(10% 0 0);

  --c-text-0: oklch(94% 0 0);
  --c-text-1: oklch(78% 0 0);
  --c-text-2: oklch(60% 0 0);
  --c-text-3: oklch(46% 0 0);
  --c-text-inv: oklch(10% 0 0);
  --c-text-code: oklch(86% 0 0);

  --c-border-0: oklch(26% 0 0);
  --c-border-1: oklch(22% 0 0);
  --c-border-2: oklch(18% 0 0);

  --c-surface-hover: oklch(20% 0 0);
  --c-surface-active: oklch(23% 0 0);
  --c-surface-selected: oklch(21% 0 0);

  --c-accent: oklch(70% 0.18 305);
  --c-accent-hover: oklch(74% 0.2 305);
  --c-accent-fg: oklch(10% 0 0);
  --c-accent-subtle: oklch(19% 0.04 305);
  --c-accent-muted: oklch(28% 0.08 305);

  --sh-xs: 0 1px 2px oklch(0% 0 0 / 0.2);
  --sh-sm: 0 1px 3px oklch(0% 0 0 / 0.3), 0 1px 2px oklch(0% 0 0 / 0.2);
  --sh-md: 0 4px 8px oklch(0% 0 0 / 0.3), 0 2px 4px oklch(0% 0 0 / 0.2);
  --sh-lg: 0 8px 24px oklch(0% 0 0 / 0.35), 0 4px 8px oklch(0% 0 0 / 0.2);
  --sh-xl: 0 16px 48px oklch(0% 0 0 / 0.4), 0 8px 16px oklch(0% 0 0 / 0.25);
}

/* ═══════════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════════ */

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-y: scroll;
}

body {
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  color: var(--c-text-0);
  background: var(--c-bg-0);
  transition: background var(--dur-base) var(--ease-in-out),
              color var(--dur-base) var(--ease-in-out);
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT SHELL
   ═══════════════════════════════════════════════════════════════ */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.nav-spacer {
  height: calc(var(--nav-h) + var(--s-3) + var(--s-3));
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════
   FLOATING NAVBAR
   ═══════════════════════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: var(--s-3);
  left: var(--s-3);
  right: var(--s-3);
  height: var(--nav-h);
  background: var(--c-bg-overlay);
  border: 1px solid var(--c-border-1);
  border-radius: var(--r-xl);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: var(--sh-md);
  z-index: 100;
  transition: all var(--dur-base) var(--ease-in-out);
}

.navbar__inner {
  height: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--s-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
}

/* Brand */
.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  text-decoration: none;
  color: var(--c-text-0);
  flex-shrink: 0;
}

.navbar__logo {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: var(--r-md);
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}

.navbar__logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.navbar__title {
  display: none;
  font-size: var(--t-md);
  font-weight: var(--w-semi);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.navbar__version {
  display: none;
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  color: var(--c-text-3);
  background: var(--c-bg-2);
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  line-height: 1.4;
}

/* Breadcrumb */
.navbar__breadcrumb {
  display: none;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-sm);
  color: var(--c-text-3);
  min-width: 0;
  overflow: hidden;
}

.navbar__breadcrumb-sep {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--c-text-3);
  opacity: 0.5;
}

.navbar__breadcrumb-current {
  color: var(--c-text-1);
  font-weight: var(--w-medium);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions */
.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  flex-shrink: 0;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--c-text-2);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-in-out);
  font-size: 18px;
  position: relative;
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--c-surface-hover);
  color: var(--c-text-0);
}

.btn-icon:active {
  background: var(--c-surface-active);
  transform: scale(0.94);
}

.btn-icon[aria-expanded="true"] {
  background: var(--c-surface-selected);
  color: var(--c-accent);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR (Desktop ≥1024px)
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════
   NAV DROPDOWN (Mobile/Tablet)
   ═══════════════════════════════════════════════════════════════ */

.nav-dropdown-anchor {
  position: relative;
}

.nav-dropdown {
  /* Mobile: fixed panel below the navbar, full viewport width */
  position: fixed;
  top: calc(var(--nav-h) + var(--s-3) + var(--s-3));
  left: var(--s-3);
  right: var(--s-3);
  /* Stop above the FAB: 52px height + 24px bottom offset + 12px gap */
  max-height: calc(100dvh - var(--nav-h) - var(--s-3) - var(--s-3) - 52px - var(--s-6) - var(--s-3));
  background: var(--c-bg-elevated);
  border: 1px solid var(--c-border-1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.99);
  transform-origin: top center;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out),
              visibility var(--dur-base) var(--ease-out);
  z-index: 110;
}

.nav-dropdown[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nav-dropdown__header {
  padding: var(--s-4);
  border-bottom: 1px solid var(--c-border-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.nav-dropdown__label {
  font-size: var(--t-xs);
  font-weight: var(--w-semi);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
}

.nav-dropdown__body {
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
  padding: var(--s-2);
}

/* ═══════════════════════════════════════════════════════════════
   NAVIGATION TREE (shared between sidebar + dropdown)
   ═══════════════════════════════════════════════════════════════ */

.nav-tree {
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}

.nav-section {
  margin-bottom: var(--s-2);
}

.nav-section__title {
  font-size: var(--t-xs);
  font-weight: var(--w-semi);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-3);
  padding: var(--s-2) var(--s-3);
  margin-bottom: var(--s-1);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--c-text-2);
  font-size: var(--t-sm);
  font-weight: var(--w-medium);
  transition: all var(--dur-fast) var(--ease-in-out);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  line-height: var(--lh-snug);
}

.nav-link:hover {
  background: var(--c-surface-hover);
  color: var(--c-text-0);
}

.nav-link[aria-current="page"] {
  background: var(--c-accent-subtle);
  color: var(--c-accent);
  font-weight: var(--w-semi);
}

.nav-link__icon {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  opacity: 0.7;
}

.nav-link[aria-current="page"] .nav-link__icon {
  opacity: 1;
  color: var(--c-accent);
}

.nav-link__text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-link__chevron {
  font-size: 14px;
  flex-shrink: 0;
  color: var(--c-text-3);
  transition: transform var(--dur-fast) var(--ease-out);
  margin-left: auto;
}

.nav-link[aria-expanded="true"] .nav-link__chevron {
  transform: rotate(90deg);
}

/* Nested children */
.nav-children {
  overflow: hidden;
  transition: height var(--dur-base) var(--ease-out);
}

.nav-children[aria-hidden="true"] {
  height: 0 !important;
}

.nav-children__inner {
  padding-left: var(--s-6);
  padding-top: var(--s-1);
  padding-bottom: var(--s-1);
  position: relative;
}

.nav-children__inner::before {
  content: '';
  position: absolute;
  left: calc(var(--s-3) + 9px);
  top: var(--s-1);
  bottom: var(--s-1);
  width: 1px;
  background: var(--c-border-0);
}

/* Depth indentation for deeply nested */
.nav-children .nav-children .nav-children__inner {
  padding-left: var(--s-5);
}

.nav-children .nav-children .nav-children__inner::before {
  left: calc(var(--s-2) + 9px);
}

/* ═══════════════════════════════════════════════════════════════
   OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.overlay {
  position: fixed;
  inset: 0;
  background: oklch(0% 0 0 / 0.2);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: all var(--dur-base) var(--ease-in-out);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

/* ═══════════════════════════════════════════════════════════════
   FAB
   ═══════════════════════════════════════════════════════════════ */

.fab {
  position: fixed;
  bottom: var(--s-6);
  right: var(--s-6);
  width: 52px;
  height: 52px;
  background: var(--c-accent);
  color: var(--c-accent-fg);
  border: none;
  border-radius: var(--r-full);
  box-shadow: var(--sh-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all var(--dur-fast) var(--ease-out);
  z-index: 90;
}

.fab:hover {
  transform: scale(1.06);
  box-shadow: var(--sh-xl);
}

.fab:active {
  transform: scale(0.94);
}

.fab i {
  transition: transform var(--dur-base) var(--ease-out),
              opacity var(--dur-fast) var(--ease-in-out);
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════════ */

.main {
  flex: 1;
  overflow-x: hidden;
}

.main__container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--s-6) var(--s-4) var(--s-20);
}

/* ── Frontmatter Meta ── */
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-bottom: var(--s-6);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border-1);
}

.doc-meta__tag {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  color: var(--c-text-3);
  background: var(--c-bg-2);
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-full);
  white-space: nowrap;
}

.doc-meta__tag i {
  font-size: 12px;
  opacity: 0.7;
}

/* ── Loading State ── */
.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  gap: var(--s-4);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--c-border-0);
  border-top-color: var(--c-accent);
  border-radius: var(--r-full);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.state-loading p {
  font-size: var(--t-sm);
  color: var(--c-text-3);
}

/* ── Error State ── */
.state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  gap: var(--s-4);
  text-align: center;
}

.state-error__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg-2);
  border-radius: var(--r-full);
  font-size: 24px;
  color: var(--c-text-3);
}

.state-error h2 {
  font-size: var(--t-xl);
  font-weight: var(--w-bold);
}

.state-error p {
  color: var(--c-text-2);
  font-size: var(--t-sm);
  max-width: 360px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-5);
  background: var(--c-accent);
  color: var(--c-accent-fg);
  text-decoration: none;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-sans);
  font-size: var(--t-sm);
  font-weight: var(--w-semi);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-in-out);
}

.btn-primary:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

/* ═══════════════════════════════════════════════════════════════
   DOCUMENT CONTENT — Typography & Elements
   ═══════════════════════════════════════════════════════════════ */

.doc-content {
  animation: fadeIn var(--dur-slow) var(--ease-out);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.doc-content h1 {
  font-size: clamp(var(--t-2xl), 4.5vw, var(--t-4xl));
  font-weight: var(--w-bold);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  margin-bottom: var(--s-4);
  color: var(--c-text-0);
}

.doc-content h2 {
  font-size: var(--t-xl);
  font-weight: var(--w-bold);
  line-height: var(--lh-snug);
  letter-spacing: -0.015em;
  margin-top: var(--s-12);
  margin-bottom: var(--s-4);
  padding-top: var(--s-4);
  padding-left: var(--s-4);
  border-top: 1px solid var(--c-border-1);
  scroll-margin-top: calc(var(--nav-h) + var(--s-12));
  color: var(--c-text-0);
  position: relative;
}

.doc-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: calc(var(--s-4) + 0.15em);
  width: 3px;
  height: 0.85em;
  background: var(--c-accent);
  border-radius: var(--r-full);
}

.doc-content h2:first-child {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.doc-content h2:first-child::before {
  top: 0.15em;
}

.doc-content h3 {
  font-size: var(--t-lg);
  font-weight: var(--w-semi);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
  color: var(--c-text-0);
}

.doc-content h4 {
  font-size: var(--t-md);
  font-weight: var(--w-semi);
  margin-top: var(--s-6);
  margin-bottom: var(--s-2);
  color: var(--c-text-0);
}

.doc-content p {
  margin-bottom: var(--s-4);
  line-height: var(--lh-relaxed);
  color: var(--c-text-1);
}

.doc-content p strong {
  color: var(--c-text-0);
  font-weight: var(--w-semi);
}

.doc-content ul,
.doc-content ol {
  margin-bottom: var(--s-4);
  padding-left: var(--s-6);
  color: var(--c-text-1);
}

.doc-content li {
  margin-bottom: var(--s-2);
  line-height: var(--lh-relaxed);
}

.doc-content li > ul,
.doc-content li > ol {
  margin-bottom: 0;
  margin-top: var(--s-1);
}

.doc-content li::marker {
  color: var(--c-text-3);
}

/* ── Inline Code ── */
.doc-content code:not(pre code) {
  font-family: var(--f-mono);
  font-size: 0.86em;
  font-weight: var(--w-medium);
  color: var(--c-accent);
  background: var(--c-accent-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--c-accent-muted);
  word-break: break-word;
}

/* ── Code Blocks ── */
.code-block {
  position: relative;
  margin: var(--s-5) 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--c-bg-code-block);
  border: 1px solid oklch(26% 0 0);
  border-left: 3px solid oklch(50% 0.22 305);
}

[data-theme="dark"] .code-block {
  border-color: oklch(22% 0 0);
}

.code-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-2) var(--s-3) var(--s-2) var(--s-4);
  border-bottom: 1px solid oklch(24% 0 0);
  background: oklch(15% 0 0);
}

[data-theme="dark"] .code-block__header {
  background: oklch(8% 0 0);
  border-color: oklch(18% 0 0);
}

.code-block__lang {
  font-family: var(--f-mono);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  color: oklch(70% 0.18 305);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block__copy {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  padding: var(--s-1) var(--s-2);
  border: none;
  background: oklch(25% 0 0);
  color: oklch(65% 0 0);
  border-radius: var(--r-sm);
  font-family: var(--f-sans);
  font-size: var(--t-xs);
  font-weight: var(--w-medium);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-in-out);
  white-space: nowrap;
}

.code-block__copy:hover {
  background: oklch(30% 0 0);
  color: oklch(80% 0 0);
}

.code-block__copy:active {
  transform: scale(0.95);
}

.code-block__copy[data-copied="true"] {
  color: var(--c-success);
}

.code-block__copy i {
  font-size: 14px;
}

.code-block pre {
  margin: 0;
  padding: var(--s-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: var(--t-sm);
  line-height: var(--lh-relaxed);
}

.code-block pre code {
  font-family: var(--f-mono);
  font-size: inherit;
  color: var(--c-text-code);
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  tab-size: 2;
}

/* ── Syntax Highlighting ── */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: oklch(52% 0.03 256); font-style: italic; }
.token.punctuation { color: oklch(62% 0.02 256); }
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol { color: oklch(76% 0.18 200); }  /* cyan */
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin { color: oklch(75% 0.16 145); }  /* green */
.token.operator,
.token.entity,
.token.url { color: oklch(78% 0.1 195); }  /* teal */
.token.atrule,
.token.attr-value,
.token.keyword { color: oklch(75% 0.18 285); }  /* violet */
.token.function,
.token.class-name { color: oklch(80% 0.15 55); }  /* amber */
.token.regex,
.token.important,
.token.variable { color: oklch(76% 0.16 32); }  /* orange */
.token.important,
.token.bold { font-weight: var(--w-semi); }
.token.italic { font-style: italic; }

/* ── Blockquote ── */
.doc-content blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4);
  padding-left: var(--s-5);
  border-left: 3px solid var(--c-accent);
  background: var(--c-bg-1);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  color: var(--c-text-1);
}

.doc-content blockquote p {
  margin-bottom: 0;
  color: inherit;
}

.doc-content blockquote p:not(:last-child) {
  margin-bottom: var(--s-2);
}

.doc-content blockquote strong {
  color: var(--c-text-0);
}

/* ── Tables ── */
.doc-content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--s-5) 0;
  border: 1px solid var(--c-border-0);
  border-radius: var(--r-lg);
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.doc-content thead {
  background: var(--c-bg-2);
}

.doc-content th {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  font-weight: var(--w-semi);
  color: var(--c-text-0);
  white-space: nowrap;
  border-bottom: 1px solid var(--c-border-0);
}

.doc-content td {
  padding: var(--s-3) var(--s-4);
  color: var(--c-text-1);
  border-bottom: 1px solid var(--c-border-1);
}

.doc-content tr:last-child td {
  border-bottom: none;
}

.doc-content tbody tr:hover td {
  background: var(--c-surface-hover);
}

/* ── Links ── */
.doc-content a {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-color: var(--c-accent-muted);
  text-underline-offset: 2px;
  transition: color var(--dur-fast) var(--ease-in-out),
              text-decoration-color var(--dur-fast) var(--ease-in-out);
}

.doc-content a:hover {
  color: var(--c-accent-hover);
  text-decoration-color: var(--c-accent);
}

/* ── Images ── */
.doc-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  margin: var(--s-5) 0;
  border: 1px solid var(--c-border-1);
}

/* ── Horizontal Rule ── */
.doc-content hr {
  margin: var(--s-10) 0;
  border: none;
  border-top: 1px solid var(--c-border-1);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ── sm (640px) ── */
@media (min-width: 640px) {
  .navbar {
    left: var(--s-4);
    right: var(--s-4);
  }

  .navbar__title {
    display: block;
  }

  .navbar__version {
    display: block;
  }

  /* Keep dropdown aligned to navbar edges */
  .nav-dropdown {
    left: var(--s-4);
    right: var(--s-4);
  }
}

/* ── md (768px) ── */
@media (min-width: 768px) {
  .navbar {
    left: var(--s-6);
    right: var(--s-6);
  }

  .navbar__breadcrumb {
    display: flex;
  }

  /* Keep dropdown aligned to navbar edges at tablet */
  .nav-dropdown {
    left: var(--s-6);
    right: var(--s-6);
  }

  .main__container {
    padding: var(--s-8) var(--s-6) var(--s-20);
  }
}

/* ── lg (1024px) ── Desktop: Show sidebar, hide dropdown + fab ── */
@media (min-width: 1024px) {
  .navbar {
    left: calc(var(--sidebar-w) + var(--s-4));
    right: var(--s-6);
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--c-bg-1);
    border-right: 1px solid var(--c-border-1);
    z-index: 90;
    overflow: hidden;
  }

  .sidebar__header {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-4);
    border-bottom: 1px solid var(--c-border-1);
    flex-shrink: 0;
  }

  .sidebar__logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-accent-fg);
    border-radius: var(--r-md);
    font-size: 16px;
    flex-shrink: 0;
  }

  .sidebar__logo-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
  }

  .sidebar__title {
    font-size: var(--t-md);
    font-weight: var(--w-semi);
    color: var(--c-text-0);
    letter-spacing: -0.01em;
  }

  .sidebar__version {
    font-size: var(--t-xs);
    font-weight: var(--w-medium);
    color: var(--c-text-3);
    background: var(--c-bg-3);
    padding: 2px var(--s-2);
    border-radius: var(--r-full);
    margin-left: auto;
  }

  .sidebar__nav {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--s-3);
  }

  .sidebar__footer {
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--c-border-1);
    flex-shrink: 0;
  }

  .sidebar__theme-btn {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    width: 100%;
    padding: var(--s-2) var(--s-3);
    border: none;
    background: transparent;
    color: var(--c-text-2);
    border-radius: var(--r-md);
    font-family: var(--f-sans);
    font-size: var(--t-sm);
    font-weight: var(--w-medium);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-in-out);
  }

  .sidebar__theme-btn:hover {
    background: var(--c-surface-hover);
    color: var(--c-text-0);
  }

  .sidebar__theme-btn i {
    font-size: 16px;
  }

  .nav-dropdown-anchor {
    display: none;
  }

  .fab {
    display: none;
  }

  .app__body {
    margin-left: var(--sidebar-w);
  }

  .main__container {
    padding: var(--s-8) var(--s-10) var(--s-20);
  }

  /* Hide brand from navbar on desktop (shown in sidebar) */
  .navbar__brand {
    display: none;
  }
}

/* ── xl (1280px) ── */
@media (min-width: 1280px) {
  .sidebar {
    --sidebar-w: 300px;
    width: var(--sidebar-w);
  }

  .navbar {
    left: calc(300px + var(--s-6));
    right: var(--s-8);
  }

  .app__body {
    margin-left: 300px;
  }

  .main__container {
    padding: var(--s-10) var(--s-12) var(--s-20);
  }
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--c-border-0);
  border-radius: var(--r-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--c-text-3);
}

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

[hidden] {
  display: none !important;
}
