:root {
  --bg: #07070d;
  --s1: #0f0f1a;
  --s2: #161625;
  --s3: #1f1f33;
  --border: #252538;
  --border-focus: #7c6aff;
  --accent: #7c6aff;
  --accent-light: rgba(124, 106, 255, 0.12);
  --accent-glow: rgba(124, 106, 255, 0.28);
  --a2: #ff5f7e;
  --a3: #00e5a0;
  --a3-light: rgba(0, 229, 160, 0.12);
  --a4: #ffb347;
  --a5: #38d9f5;
  --a6: #c084fc;
  --sec: #facc15;
  --text: #eeeef8;
  --muted: #8b8ba8;
  --muted2: #5a5a78;
  --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Syne', sans-serif;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 14px rgba(0,0,0,0.25);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.4);
  color-scheme: dark;
}

html.light, body.light {
  --bg: #f4f4f8;
  --s1: #ffffff;
  --s2: #eeeef6;
  --s3: #e2e2ee;
  --border: #d8d8e8;
  --border-focus: #5b47e0;
  --accent: #5b47e0;
  --accent-light: rgba(91, 71, 224, 0.08);
  --accent-glow: rgba(91, 71, 224, 0.22);
  --a2: #e11d48;
  --a3: #047857;
  --a3-light: rgba(4, 120, 87, 0.1);
  --a4: #b45309;
  --a5: #0369a1;
  --a6: #7c3aed;
  --sec: #b45309;
  --text: #1a1a2e;
  --muted: #64648c;
  --muted2: #8e8eb0;
  --shadow-sm: 0 4px 14px rgba(26,26,46,0.06);
  --shadow-lg: 0 16px 40px rgba(26,26,46,0.08);
  color-scheme: light;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  max-width: 100vw;
}

/* Site Navigation (Consistent with PDFHub) */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(7, 7, 13, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

body.light .site-nav {
  background: rgba(244, 244, 250, 0.9);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  text-decoration: none;
  background: linear-gradient(135deg, #fff 0%, #a594fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.nav-divider {
  color: var(--muted2);
  font-weight: 300;
  font-size: 1.1rem;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  border-radius: 99px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 360px;
  margin: 0 16px;
}

.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.82rem;
  width: 100%;
  transition: all 0.2s ease;
}

.nav-search-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--s2);
}

.nav-search-btn kbd {
  margin-left: auto;
  display: inline-block;
  padding: 1px 6px;
  font-size: 0.68rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted2);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.nav-subtle-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-subtle-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-1px);
}

.nav-btn-manual {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 99px;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-btn-manual:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.global-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.global-theme-toggle:hover {
  border-color: var(--accent);
}

.toggle-track {
  display: inline-flex;
  align-items: center;
  width: 32px;
  height: 18px;
  border-radius: 99px;
  background: var(--s2);
  border: 1px solid var(--border);
  padding: 2px;
  position: relative;
}

.toggle-knob {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #fff;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.light .toggle-knob {
  transform: translateX(14px);
  background: #f59e0b;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.menu-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ==========================================================================
   DOCUMENTATION MENU BAR / CONTROL CENTER DRAWER (#siteMenu)
   ========================================================================== */
.site-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(348px, calc(100vw - 28px));
  max-height: calc(100vh - 84px);
  padding: 16px;
  border-radius: 18px;
  background: rgba(15, 15, 26, 0.98);
  border: 1px solid rgba(124, 106, 255, 0.24);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: none;
  flex-direction: column;
  z-index: 1200;
  box-sizing: border-box;
  overflow: hidden;
  text-align: left;
}

.site-menu.open {
  display: flex !important;
  animation: siteMenuSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes siteMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.light .site-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(124, 106, 255, 0.2);
  box-shadow: 0 22px 60px rgba(48, 42, 100, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.05);
  color: #1a1a2e;
}

.menu-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--border, #252538);
  font-family: var(--font-head, 'Outfit', sans-serif);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text, #f0f0f8);
}

body.light .menu-heading {
  border-color: #e2e2ee;
  color: #1a1a2e;
}

.menu-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-heading small {
  display: inline-block;
  padding: 3px 8px;
  border: 1px solid rgba(0, 229, 160, 0.25);
  border-radius: 99px;
  background: rgba(0, 229, 160, 0.08);
  color: var(--a3, #00e5a0);
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.menu-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border, #252538);
  border-radius: 8px;
  background: var(--s2, #161625);
  color: var(--muted, #8b8ba7);
  cursor: pointer;
  font-size: 0.76rem;
  transition: all 0.15s ease;
}

.menu-close-btn:hover,
.menu-close-btn:focus-visible {
  color: #fff;
  border-color: var(--accent, #7c6aff);
  background: var(--accent, #7c6aff);
}

body.light .menu-close-btn {
  background: #f0f0f8;
  border-color: #d5d5e8;
  color: #606080;
}

body.light .menu-close-btn:hover,
body.light .menu-close-btn:focus-visible {
  color: #fff;
  background: #6758dc;
  border-color: #6758dc;
}

.menu-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 6px;
  position: relative;
}

.menu-search > i {
  position: absolute;
  left: 12px;
  color: var(--muted, #8b8ba7);
  font-size: 0.78rem;
  pointer-events: none;
}

.menu-search input {
  min-width: 0;
  flex: 1;
  min-height: 40px;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border, #252538);
  border-radius: 10px;
  background: var(--s2, #161625);
  color: var(--text, #f0f0f8);
  font-family: var(--font-main, 'DM Sans', sans-serif);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.menu-search input:focus {
  border-color: var(--accent, #7c6aff);
  box-shadow: 0 0 0 3px rgba(124, 106, 255, 0.16);
}

body.light .menu-search input {
  background: #f5f5fc;
  border-color: #d8d8ea;
  color: #1a1a2e;
}

.menu-search button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--accent, #7c6aff);
  border-radius: 10px;
  background: var(--accent, #7c6aff);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.menu-search button:hover {
  background: var(--accent-hover, #6758dc);
  transform: translateY(-1px);
}

.menu-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 4px;
  color: var(--muted, #8b8ba7);
  font-size: 0.68rem;
  font-family: var(--font-main, 'DM Sans', sans-serif);
}

.menu-status i {
  color: var(--a3, #00e5a0);
}

.menu-status-dot {
  color: var(--border, #252538);
  font-size: 0.5rem;
}

.menu-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  margin-top: 8px;
}

.menu-body::-webkit-scrollbar {
  width: 5px;
}

.menu-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
}

.menu-body::-webkit-scrollbar-thumb {
  background: rgba(124, 106, 255, 0.35);
  border-radius: 99px;
}

.menu-body::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 106, 255, 0.6);
}

body.light .menu-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.04);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
}

.menu-section-label {
  padding: 10px 8px 4px;
  color: var(--muted2, #6b6b8a);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.menu-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text, #f0f0f8);
  text-decoration: none;
  font-family: var(--font-main, 'DM Sans', sans-serif);
  font-size: 0.84rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

.menu-action:hover,
.menu-action:focus-visible {
  background: rgba(124, 106, 255, 0.12);
  border-color: rgba(124, 106, 255, 0.22);
  color: #fff;
  transform: none;
}

body.light .menu-action {
  color: #1a1a2e;
}

body.light .menu-action:hover,
body.light .menu-action:focus-visible {
  background: rgba(124, 106, 255, 0.08);
  border-color: rgba(124, 106, 255, 0.2);
  color: var(--accent, #6758dc);
}

.menu-action.active-page {
  background: rgba(124, 106, 255, 0.16);
  border-color: var(--accent, #7c6aff);
  color: #fff;
  font-weight: 700;
}

body.light .menu-action.active-page {
  background: rgba(103, 88, 220, 0.12);
  border-color: #6758dc;
  color: #6758dc;
}

.menu-action i {
  width: 18px;
  text-align: center;
  color: var(--accent, #7c6aff);
  font-size: 0.92rem;
  flex-shrink: 0;
  transition: color 0.15s;
}

.menu-action:hover i,
.menu-action.active-page i {
  color: #fff;
}

body.light .menu-action:hover i,
body.light .menu-action.active-page i {
  color: #6758dc;
}

.menu-action span {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-action-note {
  margin-left: auto;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--s2, #161625);
  color: var(--muted, #8b8ba7);
  border: 1px solid var(--border, #252538);
  flex-shrink: 0;
}

body.light .menu-action-note {
  background: #f0f0f8;
  border-color: #d8d8ea;
  color: #606080;
}

.menu-note {
  margin: 12px 2px 0;
  padding: 10px 8px 2px;
  border-top: 1px solid var(--border, #252538);
  color: var(--muted2, #6b6b8a);
  font-size: 0.68rem;
  line-height: 1.4;
  font-family: var(--font-main, 'DM Sans', sans-serif);
}

body.light .menu-note {
  border-color: #e2e2ee;
  color: #8888a0;
}

/* ==========================================================================
   DESKTOP DOCUMENTATION MENU BAR / CONTROL CENTER (>= 769px)
   ========================================================================== */
@media (min-width: 769px) {
  .site-menu {
    width: min(560px, calc(100vw - 40px));
    max-height: calc(100vh - 84px);
    padding: 20px 22px;
    border-radius: 20px;
    background: rgba(15, 15, 26, 0.98);
    border: 1px solid rgba(124, 106, 255, 0.28);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.05);
  }

  body.light .site-menu {
    background: rgba(255, 255, 255, 0.99);
    border-color: rgba(124, 106, 255, 0.22);
    box-shadow: 0 24px 70px rgba(48, 42, 100, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
    color: #1a1a2e;
  }

  .menu-header {
    gap: 8px;
    padding-bottom: 2px;
  }

  .menu-heading {
    padding: 2px 2px 10px;
    font-size: 0.94rem;
    letter-spacing: 0.3px;
  }

  .menu-heading small {
    padding: 4px 10px;
    font-size: 0.62rem;
    letter-spacing: 0.9px;
  }

  .menu-search {
    padding: 8px 0 6px;
  }

  .menu-search input {
    min-height: 42px;
    font-size: 0.85rem;
    padding: 9px 12px 9px 36px;
    border-radius: 12px;
  }

  .menu-search > i {
    left: 14px;
    font-size: 0.82rem;
  }

  .menu-search button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 0.85rem;
  }

  .menu-status {
    padding: 8px 12px;
    background: rgba(22, 22, 37, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    font-size: 0.72rem;
    justify-content: flex-start;
  }

  body.light .menu-status {
    background: #f0f0f8;
    border-color: #e2e2ee;
    color: #606080;
  }

  .menu-body {
    margin-top: 10px;
    padding-right: 6px;
  }

  .menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 4px;
  }

  .menu-section-label {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 4px 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.1px;
    color: var(--muted, #8b8ba7);
    text-transform: uppercase;
  }

  .menu-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(124, 106, 255, 0.25) 0%, rgba(124, 106, 255, 0.02) 100%);
  }

  body.light .menu-section-label {
    color: #606080;
  }

  body.light .menu-section-label::after {
    background: linear-gradient(90deg, rgba(103, 88, 220, 0.22) 0%, rgba(103, 88, 220, 0.02) 100%);
  }

  .menu-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 50px;
    padding: 10px 14px;
    border-radius: 13px;
    background: rgba(22, 22, 37, 0.75);
    border: 1px solid rgba(124, 106, 255, 0.16);
    color: var(--text, #f0f0f8);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
  }

  .menu-action::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }

  .menu-action:hover,
  .menu-action:focus-visible {
    background: rgba(28, 28, 48, 0.95);
    border-color: rgba(124, 106, 255, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 106, 255, 0.22), 0 0 0 1px rgba(124, 106, 255, 0.25);
  }

  .menu-action:hover::before,
  .menu-action:focus-visible::before {
    opacity: 1;
  }

  .menu-action:active {
    transform: translateY(0);
    box-shadow: 0 3px 10px rgba(124, 106, 255, 0.2);
  }

  .menu-action.active-page {
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.24) 0%, rgba(22, 22, 37, 0.9) 100%);
    border-color: var(--accent, #7c6aff);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 4px 18px rgba(124, 106, 255, 0.3), inset 0 0 0 1px var(--accent, #7c6aff);
  }

  .menu-action i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(124, 106, 255, 0.12);
    border: 1px solid rgba(124, 106, 255, 0.2);
    color: var(--accent, #7c6aff);
    font-size: 0.88rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }

  .menu-action:hover i,
  .menu-action:focus-visible i {
    background: var(--accent, #7c6aff);
    color: #ffffff;
    border-color: var(--accent, #7c6aff);
    transform: scale(1.06);
    box-shadow: 0 3px 10px rgba(124, 106, 255, 0.4);
  }

  .menu-action.active-page i {
    background: var(--accent, #7c6aff);
    color: #ffffff;
    border-color: var(--accent, #7c6aff);
    box-shadow: 0 3px 10px rgba(124, 106, 255, 0.45);
  }

  .menu-action span {
    flex: 1 1 auto;
    font-size: 0.84rem;
    letter-spacing: 0.1px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .menu-action-note {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    background: rgba(124, 106, 255, 0.14);
    border: 1px solid rgba(124, 106, 255, 0.26);
    color: var(--accent, #7c6aff);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }

  .menu-action:hover .menu-action-note,
  .menu-action:focus-visible .menu-action-note {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
  }

  .menu-action.active-page .menu-action-note {
    background: var(--accent, #7c6aff);
    border-color: var(--accent, #7c6aff);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(124, 106, 255, 0.35);
  }

  .menu-note {
    margin: 16px 2px 2px;
    padding: 10px 14px;
    border-radius: 11px;
    background: rgba(124, 106, 255, 0.06);
    border: 1px dashed rgba(124, 106, 255, 0.22);
    font-size: 0.74rem;
    color: var(--muted, #8b8ba7);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  /* Light Theme Desktop */
  body.light .menu-action {
    background: #f7f7fc;
    border-color: #e2e2ee;
    color: #1a1a2e;
    box-shadow: 0 2px 6px rgba(48, 42, 100, 0.05);
  }

  body.light .menu-action::before {
    background: linear-gradient(135deg, rgba(103, 88, 220, 0.08) 0%, transparent 60%);
  }

  body.light .menu-action:hover,
  body.light .menu-action:focus-visible {
    background: #ffffff;
    border-color: var(--accent, #6758dc);
    color: #1a1a2e;
    box-shadow: 0 8px 22px rgba(103, 88, 220, 0.15), 0 0 0 1px rgba(103, 88, 220, 0.2);
  }

  body.light .menu-action.active-page {
    background: linear-gradient(135deg, rgba(103, 88, 220, 0.14) 0%, #ffffff 100%);
    border-color: var(--accent, #6758dc);
    color: #1a1a2e;
    box-shadow: 0 4px 16px rgba(103, 88, 220, 0.18), inset 0 0 0 1px var(--accent, #6758dc);
  }

  body.light .menu-action i {
    background: rgba(103, 88, 220, 0.09);
    border-color: rgba(103, 88, 220, 0.18);
    color: var(--accent, #6758dc);
  }

  body.light .menu-action:hover i,
  body.light .menu-action:focus-visible i {
    background: var(--accent, #6758dc);
    color: #ffffff;
    border-color: var(--accent, #6758dc);
  }

  body.light .menu-action.active-page i {
    background: var(--accent, #6758dc);
    color: #ffffff;
    border-color: var(--accent, #6758dc);
  }

  body.light .menu-action-note {
    background: #ebebf5;
    border-color: #d8d8ea;
    color: #5544cc;
  }

  body.light .menu-action:hover .menu-action-note,
  body.light .menu-action:focus-visible .menu-action-note {
    background: #5544cc;
    border-color: #5544cc;
    color: #ffffff;
  }

  body.light .menu-action.active-page .menu-action-note {
    background: #5544cc;
    border-color: #5544cc;
    color: #ffffff;
  }

  body.light .menu-note {
    background: rgba(103, 88, 220, 0.05);
    border-color: rgba(103, 88, 220, 0.2);
    color: #606080;
  }
}

/* Toast feedback notification */
.docs-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: min(380px, calc(100vw - 32px));
  padding: 12px 18px;
  background: rgba(18, 18, 30, 0.95);
  color: #fff;
  border: 1px solid var(--accent, #7c6aff);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  font-family: var(--font-main, 'DM Sans', sans-serif);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.docs-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

body.light .docs-toast {
  background: rgba(255, 255, 255, 0.98);
  color: #1a1a2e;
  box-shadow: 0 14px 40px rgba(48, 42, 100, 0.16);
  border-color: rgba(124, 106, 255, 0.3);
}

/* Documentation Shell */
.doc-shell {
  flex: 1 0 auto;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 80px;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Hero Section */
.doc-hero {
  text-align: center;
  padding: 30px 16px 42px;
  position: relative;
}

.doc-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.doc-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: 16px;
}

.doc-hero p {
  max-width: 760px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.65;
}

.doc-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  max-width: 980px;
  margin: 0 auto 36px;
}

.doc-stat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: var(--s1);
  border: 1px solid var(--border);
  text-align: left;
  transition: border-color 0.2s, transform 0.2s;
}

.doc-stat-pill:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.doc-stat-pill i {
  font-size: 1.3rem;
  color: var(--accent);
  flex-shrink: 0;
}

.doc-stat-pill.success i {
  color: var(--a3);
}

.doc-stat-pill strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.doc-stat-pill span {
  font-size: 0.72rem;
  color: var(--muted);
}

/* Master Search Bar */
.doc-search-wrapper {
  max-width: 680px;
  margin: 0 auto;
  position: relative;
}

.doc-search-input {
  width: 100%;
  padding: 16px 52px 16px 48px;
  border-radius: 99px;
  background: var(--s1);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.doc-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-sm);
  background: var(--s2);
}

.doc-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.05rem;
  pointer-events: none;
}

.doc-search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--s3);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.doc-search-clear.visible {
  display: inline-flex;
}

.doc-search-clear:hover {
  color: var(--text);
  background: var(--accent);
}

/* Navigation Tabs */
.doc-tabs-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.doc-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 99px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.doc-tab-btn.active {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--accent);
  font-weight: 700;
}

/* Category Filter Chips */
.filter-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--font-main);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Tool Grid & Cards */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 50px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

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

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.tool-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.tool-card-title-group {
  flex: 1;
  min-width: 0;
}

.tool-card-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.tool-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--s2);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.tool-card-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 16px;
  flex-grow: 1;
}

.tool-specs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  background: var(--s2);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.76rem;
}

.tool-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tool-spec-label {
  color: var(--muted2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.tool-spec-val {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.tool-privacy-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 0.72rem;
}

.tool-privacy-tag.local {
  color: var(--a3);
}

.tool-privacy-tag.assisted {
  color: var(--a4);
}

.tool-privacy-tag.api {
  color: #f59e0b;
}

.tool-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.tool-btn-primary {
  grid-column: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.tool-btn-primary:hover {
  background: #6a57f2;
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translateY(-1px);
}

.tool-btn-subtle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.tool-btn-subtle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* Documentation Content Panels */
.doc-section {
  display: none;
  animation: fadeIn 0.3s ease;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

.doc-section.active {
  display: block;
}

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

.doc-panel-box {
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  margin-bottom: 24px;
}

.doc-panel-box h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.doc-panel-box h3 {
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text);
}

.doc-panel-box p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

/* Info Alert Callouts */
.doc-callout {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--s2);
  border-left: 4px solid var(--accent);
  margin: 20px 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.6;
}

.doc-callout i {
  color: var(--accent);
  font-size: 1.2rem;
  margin-top: 2px;
  flex-shrink: 0;
}

.doc-callout.success {
  border-left-color: var(--a3);
  background: var(--a3-light);
}

.doc-callout.success i {
  color: var(--a3);
}

.doc-callout.warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.doc-callout.warning i {
  color: #f59e0b;
}

/* Documentation Tables */
.doc-table-wrapper {
  overflow-x: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.86rem;
}

.doc-table th {
  background: var(--s2);
  color: var(--text);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.doc-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

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

.doc-table tr:hover td {
  background: var(--accent-light);
}

.doc-table td strong {
  color: var(--text);
}

.doc-table code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--s3);
  color: var(--a4);
  font-size: 0.82rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Accordion FAQ */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--s2);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--accent);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: var(--font-head);
  font-size: 0.96rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  gap: 12px;
}

.faq-icon {
  transition: transform 0.2s ease;
  color: var(--muted);
  font-size: 0.85rem;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  display: none;
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Quick Markdown Links Grid */
.md-docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.md-doc-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.md-doc-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  transform: translateY(-2px);
}

.md-doc-card i {
  color: var(--accent);
  font-size: 1.1rem;
}

/* Shared Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--s1);
  padding: 40px 24px 30px;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
}

/* ====================================================================
   DOCUMENTATION TWO/THREE COLUMN ARTICLE LAYOUT
   ==================================================================== */
.docs-layout {
  display: flex;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  min-height: calc(100vh - 65px);
  position: relative;
}

/* ── LEFT SIDEBAR NAVIGATION ────────────────────────── */
.docs-sidebar-left {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

/* Custom scrollbars */
.docs-sidebar-left::-webkit-scrollbar,
.docs-sidebar-right::-webkit-scrollbar {
  width: 5px;
}
.docs-sidebar-left::-webkit-scrollbar-thumb,
.docs-sidebar-right::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.sidebar-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-mobile-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.sidebar-mobile-title i {
  color: var(--accent);
}

.sidebar-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--s2);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.sidebar-close-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.sidebar-search-box {
  margin-bottom: 18px;
}

.sidebar-search-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--s1);
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
}

.sidebar-search-btn:hover {
  border-color: var(--accent);
  background: var(--s2);
  color: var(--text);
}

.sidebar-search-btn kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.7rem;
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted2);
}

.sidebar-nav {
  flex: 1;
}

.sidebar-group {
  margin-bottom: 20px;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted2);
  cursor: pointer;
  user-select: none;
  transition: color 0.2s;
}

.sidebar-group-title:hover {
  color: var(--accent);
}

.sidebar-group-title i {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

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

.sidebar-group.collapsed .sidebar-group-title i {
  transform: rotate(-90deg);
}

.sidebar-category-header {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 8px 4px;
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted2);
}

.sidebar-category-header i {
  font-size: 0.75rem;
  color: var(--accent);
}

.sidebar-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.4;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}

.sidebar-link i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  color: var(--muted2);
  flex-shrink: 0;
  transition: color 0.15s;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--s2);
}

.sidebar-link:hover i {
  color: var(--accent);
}

.sidebar-link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.sidebar-link.active i {
  color: var(--accent);
}

.sidebar-footer-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.sidebar-btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s;
}

.sidebar-btn-download:hover {
  background: var(--accent);
  color: #fff;
}

/* ── MAIN DOCUMENTATION CONTENT ─────────────────────── */
.docs-main-content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  padding: 36px 48px 80px;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted2);
  margin-bottom: 22px;
}

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

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

.docs-breadcrumb .sep {
  color: var(--border);
  font-size: 0.85em;
}

.docs-breadcrumb .current {
  color: var(--text);
  font-weight: 600;
}

.docs-article {
  max-width: 860px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.docs-header {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.docs-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-light);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 14px;
}

.docs-title {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.6px;
  color: var(--text);
  margin-bottom: 14px;
  word-break: break-word;
}

.docs-lead {
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 20px;
  word-break: break-word;
}

.docs-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-download-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  background: var(--s1);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-download-pdf:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Article Headings & Sections */
.docs-article section {
  margin-bottom: 36px;
}

.docs-article h2 {
  font-family: var(--font-head);
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin: 36px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  word-break: break-word;
  scroll-margin-top: 80px;
}

.docs-article h2 i {
  color: var(--accent);
  font-size: 1.1rem;
}

.docs-article h3 {
  font-family: var(--font-head);
  font-size: clamp(1.08rem, 3vw, 1.32rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-word;
  scroll-margin-top: 80px;
}

.docs-article h3 i {
  color: var(--a4);
  font-size: 0.95rem;
}

.docs-article p {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.75;
  margin-bottom: 16px;
  word-break: break-word;
}

.docs-article ul, .docs-article ol {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.75;
  margin: 0 0 20px 24px;
  word-break: break-word;
}

.docs-article li {
  margin-bottom: 8px;
}

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

.docs-article a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}

.docs-article a:hover {
  color: #a594fd;
}

/* Code Blocks & Wrappers */
.code-block-wrapper {
  margin: 20px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--s1);
  overflow: hidden;
  max-width: 100%;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--s2);
  border-bottom: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-block-wrapper pre,
pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--s1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

p code, li code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--s2);
  border: 1px solid var(--border);
  color: var(--a4);
  font-size: 0.84em;
  word-break: break-word;
}

/* Mobile In-Article Collapsible TOC */
.mobile-toc-accordion {
  display: none;
  margin: 18px 0 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--s1);
  overflow: hidden;
  width: 100%;
}

.mobile-toc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: var(--s2);
  border: none;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.mobile-toc-toggle-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.mobile-toc-toggle-left i {
  color: var(--accent);
}

.mobile-toc-toggle-left small {
  color: var(--muted2);
  font-weight: 400;
}

.mobile-toc-chevron {
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.mobile-toc-accordion.open .mobile-toc-chevron {
  transform: rotate(180deg);
}

.mobile-toc-body {
  display: none;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  max-height: 320px;
  overflow-y: auto;
}

.mobile-toc-accordion.open .mobile-toc-body {
  display: block;
}

.mobile-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-toc-list li {
  margin-bottom: 6px;
}

.mobile-toc-list li.toc-sub {
  padding-left: 14px;
}

.mobile-toc-list a {
  display: block;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.83rem;
  line-height: 1.4;
  transition: all 0.15s;
}

.mobile-toc-list a:hover {
  background: var(--s2);
  color: var(--text);
}

.mobile-toc-list a.active {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* ── PREV / NEXT NAVIGATION ─────────────────────────── */
.prev-next-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.prev-next-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  background: var(--s1);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s ease;
}

.prev-next-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
}

.prev-next-card.next {
  text-align: right;
  grid-column: 2;
}

.prev-next-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.prev-next-card.next .prev-next-label {
  justify-content: flex-end;
}

.prev-next-title {
  font-family: var(--font-head);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text);
}

/* ── RIGHT SIDEBAR (ON THIS PAGE) ───────────────────── */
.docs-sidebar-right {
  width: 250px;
  flex-shrink: 0;
  position: sticky;
  top: 65px;
  height: calc(100vh - 65px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 28px 16px 40px;
  border-left: 1px solid var(--border);
}

.toc-heading {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted2);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-heading i {
  color: var(--accent);
}

.toc-list {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.toc-list li {
  margin-bottom: 4px;
}

.toc-list li.toc-sub-item {
  padding-left: 12px;
}

.toc-list a {
  display: block;
  padding: 4px 0 4px 10px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  line-height: 1.45;
  transition: all 0.15s ease;
}

.toc-list a:hover {
  color: var(--text);
  border-left-color: var(--muted);
}

.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.right-sidebar-box {
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--s1);
  border: 1px solid var(--border);
}

.right-sidebar-box h4 {
  font-family: var(--font-head);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.right-sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.right-sidebar-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  transition: color 0.15s;
}

.right-sidebar-links a:hover {
  color: var(--accent);
}

/* ── QUICK SEARCH MODAL (Ctrl+K) ────────────────────── */
.doc-search-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 16px 20px;
}

.doc-search-modal.open {
  display: flex;
}

.doc-search-modal-card {
  width: 100%;
  max-width: 620px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.doc-search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--s2);
}

.doc-search-modal-header i {
  color: var(--accent);
  font-size: 1.1rem;
}

.doc-search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 1rem;
}

.doc-search-modal-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}

.doc-search-modal-close kbd {
  padding: 2px 6px;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.doc-search-modal-results {
  overflow-y: auto;
  padding: 10px;
  max-height: 420px;
}

.doc-search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s ease;
  margin-bottom: 4px;
}

.doc-search-result-item:hover,
.doc-search-result-item.selected {
  background: var(--accent-light);
}

.doc-search-result-item .result-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--s2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.doc-search-result-item .result-info {
  flex: 1;
  min-width: 0;
}

.doc-search-result-item .result-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-search-result-item .result-badge {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--s3);
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}

.doc-search-result-item .result-desc {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-search-result-item .result-arrow {
  color: var(--muted2);
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.doc-search-result-item:hover .result-arrow,
.doc-search-result-item.selected .result-arrow {
  opacity: 1;
  transform: translateX(3px);
  color: var(--accent);
}

.doc-search-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-search-empty i {
  display: block;
  font-size: 1.8rem;
  color: var(--muted2);
  margin-bottom: 10px;
}

.doc-search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--s2);
  font-size: 0.72rem;
  color: var(--muted2);
}

.doc-search-modal-footer kbd {
  padding: 1px 5px;
  background: var(--s3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
}

/* ====================================================================
   RESPONSIVE BREAKPOINTS (Desktop, Tablet, Mobile)
   ==================================================================== */

/* ── TABLET LANDSCAPE & SMALL DESKTOP (<= 1180px) ───── */
@media (max-width: 1180px) {
  .docs-sidebar-right {
    display: none;
  }
  .mobile-toc-accordion {
    display: block;
  }
  .docs-main-content {
    max-width: 100%;
    padding: 32px 36px 70px;
  }
}

/* ── TABLET PORTRAIT (<= 1024px) ────────────────────── */
@media (max-width: 1024px) {
  .sidebar-toggle-btn {
    display: inline-flex;
  }
  .docs-sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: 100vh;
    z-index: 1000;
    background: var(--s1);
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    padding: 20px 16px 40px;
  }
  .docs-sidebar-left.open {
    transform: translateX(0);
  }
  .sidebar-mobile-header {
    display: flex;
  }
  body.sidebar-open {
    overflow: hidden;
  }
  .docs-main-content {
    padding: 28px 24px 60px;
  }
}

/* ── STANDARD MOBILE SCREENS (<= 768px) ─────────────── */
@media (max-width: 768px) {
  .site-nav {
    padding: 10px 16px;
  }
  .site-menu {
    top: calc(100% + 8px);
    right: 0;
    width: min(340px, calc(100vw - 24px));
    max-height: calc(100vh - 74px);
    padding: 14px;
    border-radius: 16px;
  }
  .nav-center {
    display: none;
  }
  .nav-btn-manual,
  .nav-subtle-link {
    display: none;
  }
  .doc-shell {
    padding: 20px 14px 50px;
  }
  .doc-hero {
    padding: 20px 10px 32px;
  }
  .doc-hero h1 {
    font-size: clamp(1.65rem, 6vw, 2.3rem);
  }
  .doc-hero p {
    font-size: 0.95rem;
    margin-bottom: 20px;
  }
  .doc-stats-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    width: 100%;
  }
  .doc-stat-pill {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .doc-tabs-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin: 20px 0;
    width: 100%;
    max-width: 100%;
  }
  .doc-tab-btn {
    white-space: nowrap;
    padding: 8px 14px;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
  .filter-chips {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
  }
  .filter-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .tools-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: 100%;
  }
  .tool-card {
    min-width: 0;
    max-width: 100%;
    width: 100%;
    padding: 18px 16px;
  }
  .docs-main-content {
    padding: 18px 14px 40px;
    overflow-x: hidden;
  }
  .docs-actions-bar {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  .btn-download-pdf {
    width: 100%;
    text-align: center;
  }
  .prev-next-nav {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .prev-next-card.next {
    grid-column: 1;
    text-align: left;
  }
  .prev-next-card.next .prev-next-label {
    justify-content: flex-start;
  }
  .doc-panel-box {
    padding: 20px 16px;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .footer-top, .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .footer-links {
    gap: 14px;
  }
}

/* ── SMALL PHONES (<= 480px, 430px, 414px, 390px, 375px, 360px, 320px) ── */
@media (max-width: 480px) {
  .site-nav {
    padding: 8px 12px;
  }
  .site-menu {
    top: calc(100% + 6px);
    right: 0;
    width: calc(100vw - 16px);
    max-width: 320px;
    padding: 12px;
    border-radius: 14px;
  }
  .menu-action {
    padding: 9px 10px;
    font-size: 0.82rem;
  }
  .nav-left {
    gap: 8px;
  }
  .nav-divider,
  .nav-badge {
    display: none;
  }
  .logo {
    font-size: 1.15rem;
    gap: 8px;
  }
  .logo-mark {
    width: 26px;
    height: 26px;
  }
  .global-theme-toggle {
    padding: 4px 6px;
  }
  .global-theme-toggle .t-label {
    display: none;
  }
  .docs-main-content {
    padding: 14px 10px 40px;
  }
  .docs-title {
    font-size: 1.6rem;
  }
  .tool-card-actions {
    grid-template-columns: minmax(0, 1fr);
  }
  .tool-btn-primary {
    grid-column: 1;
  }
  .doc-search-modal {
    padding: 40px 10px 10px;
  }
  .doc-search-modal-card {
    max-height: 90vh;
  }
}

/* Circular Reveal Theme Transition */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
::view-transition-old(root) {
  z-index: 1;
}
::view-transition-new(root) {
  z-index: 999999;
}
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition: none !important;
}
.theme-reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  will-change: clip-path, opacity;
}
