/* ==========================================================================
   Zerho Theme - Ultra Pro Aesthetics
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Color Palette - Dark by Default */
  --bg-main: #090a0f;
  --bg-surface: #0e111a;
  --bg-surface-elevated: #141824;
  --bg-surface-hover: #1b2030;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-prominent: rgba(255, 255, 255, 0.14);
  --border-focus: #8b5cf6;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #090a0f;

  /* Accents & Gradients */
  --brand-primary: #8b5cf6;
  --brand-primary-hover: #7c3aed;
  --brand-glow: rgba(139, 92, 246, 0.35);
  --cyan-accent: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.3);
  --emerald-accent: #10b981;
  --amber-accent: #f59e0b;
  --rose-accent: #f43f5e;

  --gradient-text: linear-gradient(135deg, #ffffff 10%, #c4b5fd 50%, #38bdf8 100%);
  --gradient-brand: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);

  --header-height: 64px;
  --sidebar-width: 270px;
  --toc-width: 240px;
  --content-max-width: 860px;

  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 35px -5px rgba(139, 92, 246, 0.25);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-prominent: rgba(0, 0, 0, 0.16);
  --border-focus: #7c3aed;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --brand-glow: rgba(139, 92, 246, 0.2);
  --cyan-glow: rgba(6, 182, 212, 0.15);
  --gradient-text: linear-gradient(135deg, #0f172a 20%, #6d28d9 65%, #0284c7 100%);
  --gradient-card: linear-gradient(145deg, rgba(255, 255, 255, 0.9) 0%, rgba(241, 245, 249, 0.7) 100%);
  --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-primary);
  background-color: var(--bg-main);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Backdrops */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  transition: opacity 0.5s ease;
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  left: 20%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
}

.glow-2 {
  width: 450px;
  height: 450px;
  top: 15%;
  right: 10%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
}

[data-theme="light"] .ambient-glow {
  opacity: 0.18;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(9, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="light"] .site-header {
  background: rgba(248, 250, 252, 0.82);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
}

.mobile-menu-btn:hover {
  background: var(--bg-surface-elevated);
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-icon-wrap {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  color: #ffffff;
  box-shadow: 0 0 15px var(--brand-glow);
  flex-shrink: 0;
}

.brand-icon {
  width: 17px;
  height: 17px;
}

.brand-pulse {
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: var(--gradient-brand);
  opacity: 0.3;
  filter: blur(4px);
  animation: pulse-glow 3s infinite ease-in-out;
  z-index: -1;
}

@keyframes pulse-glow {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.08);
    opacity: 0.6;
  }
}

.version-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1;
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 0.24rem 0.5rem;
  border-radius: 9999px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.38rem 0.65rem;
  border-radius: var(--radius-md);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.12);
  font-weight: 600;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1;
  background: rgba(139, 92, 246, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.32);
  padding: 0.16rem 0.42rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-theme="light"] .version-badge,
[data-theme="light"] .nav-badge {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.25);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--border-subtle);
  margin: 0 0.15rem;
  flex-shrink: 0;
}

/* Search Trigger Button */
.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 0 0.7rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  min-width: 175px;
}

.search-trigger-btn:hover {
  border-color: var(--border-prominent);
  color: var(--text-secondary);
  background: var(--bg-surface-elevated);
}

.search-kbd {
  margin-left: auto;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  line-height: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.18rem 0.35rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Action Badges & Buttons */
.deploy-action-badge {
  display: inline-flex;
  align-items: center;
  height: 34px;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0 0.75rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.deploy-action-badge:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--cyan-accent);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.deno-ray {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan-accent);
  box-shadow: 0 0 8px var(--cyan-accent);
  flex-shrink: 0;
}

.theme-toggle-btn,
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover,
.social-icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-prominent);
  background: var(--bg-surface-elevated);
}

/* ==========================================================================
   Language Switcher (i18n)
   ========================================================================== */
.locale-switcher {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.locale-btn {
  display: inline-flex;
  align-items: center;
  height: 34px;
  gap: 0.35rem;
  padding: 0 0.65rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.locale-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-prominent);
  background: var(--bg-surface-elevated);
}

.locale-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 130px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(16px);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  z-index: 100;
}

.locale-item {
  display: flex;
  align-items: center;
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.locale-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.locale-item.active {
  color: var(--cyan-accent);
  background: rgba(6, 182, 212, 0.1);
  font-weight: 600;
}

[data-theme="dark"] .theme-icon-sun {
  display: none;
}
[data-theme="dark"] .theme-icon-moon {
  display: block;
}
[data-theme="light"] .theme-icon-sun {
  display: block;
}
[data-theme="light"] .theme-icon-moon {
  display: none;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.site-layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex: 1;
}

/* Left Sidebar */
.site-sidebar {
  width: var(--sidebar-width);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  border-right: 1px solid var(--border-subtle);
  background: rgba(9, 10, 15, 0.4);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  overflow-y: auto;
}

[data-theme="light"] .site-sidebar {
  background: rgba(248, 250, 252, 0.6);
}

.sidebar-scroller {
  padding: 1.5rem 1rem 3rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
}

.sidebar-group-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.sidebar-item.active .sidebar-link {
  color: var(--brand-primary);
  background: rgba(139, 92, 246, 0.1);
  font-weight: 600;
}

.item-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.item-badge.pro {
  background: var(--gradient-brand);
  color: #ffffff;
}

.item-badge.edge {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-accent);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

/* Main Content Area */
.site-content {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

.site-content.content-home {
  flex-direction: column;
  align-items: center;
}

.doc-container {
  width: 100%;
  max-width: var(--content-max-width);
  padding: 2.5rem 2.5rem 5rem 2.5rem;
}

.doc-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.reading-time {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.doc-edit-link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.doc-edit-link:hover {
  color: var(--brand-primary);
}

.page-title {
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

/* ==========================================================================
   Markdown Elements
   ========================================================================== */
.markdown-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.markdown-body p {
  margin-bottom: 1.25rem;
}

.markdown-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.markdown-body a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
  transition: border-color var(--transition-fast);
}

.markdown-body a:hover {
  border-color: var(--brand-primary);
}

.heading-anchor-wrap {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  scroll-margin-top: 80px;
}

.heading-anchor-wrap h2,
.markdown-body h2 {
  font-size: 1.65rem;
  font-weight: 700;
}

.heading-anchor-wrap h3,
.markdown-body h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.header-anchor {
  opacity: 0;
  margin-left: 0.5rem;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 400;
  transition: opacity var(--transition-fast);
}

.heading-anchor-wrap:hover .header-anchor {
  opacity: 1;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  margin-bottom: 0.35rem;
}

.markdown-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: #38bdf8;
}

[data-theme="light"] .markdown-body code:not(pre code) {
  color: #0284c7;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

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

.docs-table th {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.docs-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

/* ==========================================================================
   Code Blocks & Runnable Sandboxes
   ========================================================================== */
.code-block-wrap,
.runnable-card {
  margin: 1.5rem 0;
  background: #080a10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

[data-theme="light"] .code-block-wrap,
[data-theme="light"] .runnable-card {
  background: #0d1117;
}

.code-block-header,
.runnable-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.code-title-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.copy-code-btn,
.copy-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  transition: all var(--transition-fast);
}

.copy-code-btn:hover,
.copy-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.code-header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.open-playground-btn {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.open-playground-btn:hover {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(139, 92, 246, 0.5);
  color: #ffffff;
}

.copy-feedback {
  display: none;
  color: var(--emerald-accent);
}

.code-pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.6;
  color: #f1f5f9;
}

/* ==========================================================================
   Code Group (Polyglot Synchronized Tabbed Snippets)
   ========================================================================== */
.code-group {
  margin: 1.5rem 0;
  background: #080a10;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-subtle);
}

[data-theme="light"] .code-group {
  background: #0d1117;
}

.code-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.code-group-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.code-group-tabs::-webkit-scrollbar {
  display: none;
}

.code-group-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  user-select: none;
}

.code-group-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.code-group-tab.active {
  color: var(--cyan-accent);
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
  font-weight: 600;
}

.code-group-copy-btn {
  flex-shrink: 0;
}

.code-group-panels .code-group-panel {
  display: none;
}

.code-group-panels .code-group-panel.active {
  display: block;
}

/* ==========================================================================
   Prism Syntax Highlighting Colors (Electric Pro Palette)
   ========================================================================== */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #64748b;
  font-style: italic;
}

.token.punctuation {
  color: #94a3b8;
}

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted {
  color: #f43f5e;
}

.token.boolean,
.token.number {
  color: #fb923c;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #34d399;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #38bdf8;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #c084fc;
  font-weight: 600;
}

.token.function,
.token.class-name {
  color: #60a5fa;
  font-weight: 600;
}

.token.regex,
.token.important,
.token.variable {
  color: #facc15;
}

.token.important,
.token.bold {
  font-weight: bold;
}

.token.italic {
  font-style: italic;
}

/* Runnable Sandbox Component */
.runnable-card {
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.1);
}

.runnable-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.runnable-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-primary);
  box-shadow: 0 0 8px var(--brand-primary);
  animation: pulse-glow 2s infinite;
}

.runnable-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: #c4b5fd;
  text-transform: uppercase;
}

.run-execute-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-brand);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.run-execute-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--brand-glow);
}

.run-execute-btn:active {
  transform: translateY(0);
}

.run-execute-btn:disabled,
.run-execute-btn.is-executing {
  opacity: 0.85;
  cursor: wait;
}

@keyframes btnSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin-icon {
  animation: btnSpin 0.75s linear infinite;
  display: inline-block;
}

@keyframes terminalFlash {
  0% {
    background-color: rgba(139, 92, 246, 0.22);
  }
  100% {
    background-color: transparent;
  }
}

.output-pulse {
  animation: terminalFlash 0.35s ease-out;
}

.runnable-console {
  border-top: 1px solid var(--border-subtle);
  background: #050609;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.console-status {
  color: var(--emerald-accent);
}

.console-output {
  margin: 0;
  padding: 0.85rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: #38bdf8;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
}

/* Callouts / Admonitions */
.callout {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 4px solid;
  background: var(--bg-surface);
  box-shadow: var(--shadow-subtle);
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  margin-bottom: 0.5rem;
}

.callout-content {
  font-size: 0.95rem;
  line-height: 1.6;
}

.callout-content p:last-child {
  margin-bottom: 0;
}

.callout-info {
  border-color: var(--cyan-accent);
  background: rgba(6, 182, 212, 0.05);
}
.callout-info .callout-title {
  color: var(--cyan-accent);
}

.callout-tip {
  border-color: var(--brand-primary);
  background: rgba(139, 92, 246, 0.05);
}
.callout-tip .callout-title {
  color: var(--brand-primary);
}

.callout-warning {
  border-color: var(--amber-accent);
  background: rgba(245, 158, 11, 0.05);
}
.callout-warning .callout-title {
  color: var(--amber-accent);
}

.callout-danger {
  border-color: var(--rose-accent);
  background: rgba(244, 63, 94, 0.05);
}
.callout-danger .callout-title {
  color: var(--rose-accent);
}

.callout-details {
  border-color: var(--border-prominent);
}
.callout-details summary {
  cursor: pointer;
  user-select: none;
}

/* Mermaid Diagrams */
.mermaid-block {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  text-align: center;
}

.mermaid-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   TOC (Right Sidebar)
   ========================================================================== */
.site-toc {
  width: var(--toc-width);
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  padding: 2.5rem 1.5rem 3rem 1rem;
  flex-shrink: 0;
  overflow-y: auto;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  border-left: 1px solid var(--border-subtle);
  padding-left: 0.75rem;
}

.toc-item.level-3 {
  padding-left: 0.75rem;
}

.toc-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: color var(--transition-fast);
}

.toc-link:hover {
  color: var(--text-primary);
}

.toc-link.active {
  color: var(--brand-primary);
  font-weight: 600;
}

.toc-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.toc-action-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.toc-action-link:hover {
  color: var(--brand-primary);
}

/* Prev / Next Doc Nav Cards */
.doc-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

.doc-nav-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.doc-nav-card {
  display: flex;
  flex-direction: column;
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.doc-nav-card:hover {
  border-color: var(--brand-primary);
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.doc-nav-card.next {
  text-align: right;
}

.nav-direction {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ==========================================================================
   Home Hero & Features
   ========================================================================== */
.home-hero {
  max-width: 960px;
  margin: 3.5rem auto 4rem auto;
  text-align: center;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-prominent);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}

.badge-tag {
  background: var(--gradient-brand);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-tagline {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px var(--brand-glow);
}

.btn-interactive {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.btn-interactive:hover {
  background: rgba(139, 92, 246, 0.25);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-prominent);
}

.btn-secondary:hover {
  background: var(--bg-surface-elevated);
  transform: translateY(-2px);
}

/* Hero Preview Sandbox Card */
.hero-sandbox-preview {
  width: 100%;
  max-width: 760px;
  background: #07090f;
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7), 0 0 40px rgba(139, 92, 246, 0.15);
  text-align: left;
}

[data-theme="light"] .hero-sandbox-preview {
  background: #0d1117;
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-subtle);
}

.window-controls {
  display: flex;
  gap: 0.4rem;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f56;
}
.dot.yellow {
  background: #ffbd2e;
}
.dot.green {
  background: #27c93f;
}

.hero-file-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.hero-live-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan-accent);
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
}

.hero-card-body {
  padding: 0.5rem;
}

/* Features Grid */
.home-features {
  max-width: 1200px;
  margin: 0 auto 5rem auto;
  padding: 0 1.5rem;
  width: 100%;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  padding: 2rem;
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-prominent);
  box-shadow: var(--shadow-subtle), var(--shadow-glow);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-accent);
}
.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--brand-primary);
}
.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-accent);
}
.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-accent);
}
.icon-pink {
  background: rgba(236, 72, 153, 0.15);
  color: #ec4899;
}
.icon-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.feature-title {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.feature-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Full Playground Page Specific Styling
   ========================================================================== */
.playground-workspace {
  width: 100%;
  max-width: 1300px;
  margin: 1.5rem auto 4rem auto;
  padding: 0 1.5rem;
}

.playground-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  gap: 1rem;
}

.playground-select-preset {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.playground-select-preset:hover {
  border-color: var(--brand-primary);
}

.playground-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  user-select: none;
}

.playground-live-badge .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: liveDotPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes liveDotPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.playground-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
  overflow: hidden;
  background: #080a10;
}

.playground-editor-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-subtle);
}

.playground-textarea {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  resize: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 1.25rem;
}

.playground-output-pane {
  display: flex;
  flex-direction: column;
  background: #050609;
}

.playground-pane-title {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playground-output-content {
  flex: 1;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #38bdf8;
  white-space: pre-wrap;
  overflow-y: auto;
}

/* ==========================================================================
   Search Modal (Cmd+K)
   ========================================================================== */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.search-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 30px var(--brand-glow);
  overflow: hidden;
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  from {
    transform: scale(0.96) translateY(-10px);
  }
  to {
    transform: scale(1) translateY(0);
  }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

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

.search-close-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  cursor: pointer;
}

.search-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-item {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  color: inherit;
}

.search-item:hover,
.search-item.selected {
  background: rgba(139, 92, 246, 0.12);
  color: var(--text-primary);
}

.search-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.search-item-snippet {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.search-empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-footer-hint {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-footer-hint kbd {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(9, 10, 15, 0.8);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
}

.footer-msg {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .site-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .site-sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    width: 80%;
    max-width: 300px;
    background: var(--bg-surface);
    transition: left var(--transition-normal);
    z-index: 90;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  }

  .site-sidebar.mobile-open {
    left: 0;
  }

  .doc-container {
    padding: 1.5rem 1rem 3rem 1rem;
  }

  .doc-nav-cards {
    grid-template-columns: 1fr;
  }

  .playground-split {
    grid-template-columns: 1fr;
    min-height: 650px;
  }

  .search-trigger-btn {
    min-width: auto;
    padding: 0.45rem;
  }

  .search-placeholder,
  .search-kbd {
    display: none;
  }
}

/* ==========================================================================
   Monaco Editor Container in Playground
   ========================================================================== */
.playground-monaco-container {
  width: 100%;
  height: 480px;
  background: transparent;
}

/* ==========================================================================
   Feedback Widget (Deno KV Edge)
   ========================================================================== */
.feedback-widget {
  margin-top: 3.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.feedback-text {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}

.feedback-buttons {
  display: flex;
  gap: 0.5rem;
}

.feedback-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feedback-btn:hover:not(:disabled) {
  border-color: var(--brand-primary);
  color: var(--text-primary);
  background: rgba(139, 92, 246, 0.12);
}

.feedback-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.feedback-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--emerald-accent);
  font-weight: 600;
  animation: fadeIn 0.2s ease;
}

/* ==========================================================================
   Ask AI & Hybrid Search Modal Tabs
   ========================================================================== */
.search-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
  padding: 0.35rem 0.75rem 0 0.75rem;
  gap: 0.5rem;
}

.search-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.search-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.ai-tab-glow {
  font-size: 0.9rem;
}

.ai-tab-badge {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 9999px;
  background: var(--gradient-brand);
  color: #ffffff;
}

.ai-chat-view {
  padding: 1.25rem;
  max-height: 400px;
  overflow-y: auto;
}

.ai-quick-prompts {
  margin-bottom: 1rem;
}

.ai-prompts-label {
  display: block;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.ai-prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-chip {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-sans);
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.ai-chip:hover {
  color: #ffffff;
  border-color: var(--brand-primary);
  background: rgba(139, 92, 246, 0.2);
  transform: translateY(-1px);
}

.search-action-btn {
  background: var(--brand-primary);
  color: #ffffff;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-right: 0.4rem;
}

.search-action-btn:hover {
  background: var(--brand-light);
  transform: scale(1.05);
}

.ai-response-card {
  background: var(--bg-surface);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.1);
}

.ai-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.ai-avatar {
  font-size: 1.1rem;
}

.ai-bot-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-left: 0.4rem;
}

.ai-status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

.ai-status-pill.ready {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-accent);
}
.ai-status-pill.running {
  background: rgba(139, 92, 246, 0.15);
  color: var(--brand-primary);
  animation: pulse-glow 1.5s infinite;
}

.ai-content-body {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.ai-content-body strong {
  color: var(--text-primary);
}
.ai-content-body a {
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 600;
}
.ai-content-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-surface-elevated);
  padding: 0.15em 0.35em;
  border-radius: 4px;
  color: #38bdf8;
}

.ai-loading-pulse {
  color: var(--brand-primary);
  font-weight: 500;
  animation: pulse-glow 2s infinite;
}

.ai-sources-wrap {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
}

.ai-sources-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.ai-sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ai-source-card {
  font-size: 0.82rem;
  color: var(--brand-primary);
  text-decoration: none;
  background: var(--bg-surface-elevated);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-fast);
}

.ai-source-card:hover {
  border-color: var(--brand-primary);
  background: rgba(139, 92, 246, 0.15);
}

/* ==========================================================================
   OpenAPI Reference Explorer & Request Tester
   ========================================================================== */
.openapi-explorer {
  margin: 2rem 0;
}

.openapi-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.openapi-meta-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.openapi-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.openapi-badge.spec-version {
  color: var(--emerald-accent);
  border-color: rgba(16, 185, 129, 0.3);
}
.openapi-badge.api-version {
  color: var(--brand-primary);
}
.openapi-badge.base-url {
  color: var(--cyan-accent);
}

.openapi-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.openapi-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.openapi-group {
  margin-bottom: 2.5rem;
}

.openapi-group-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-left: 0.25rem;
}

.openapi-endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.openapi-endpoint-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.openapi-endpoint-card:hover {
  border-color: var(--border-prominent);
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
}

.method-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.method-get {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.method-post {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-accent);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.method-delete {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-accent);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.method-put {
  background: rgba(245, 158, 11, 0.15);
  color: var(--amber-accent);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.endpoint-path {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.endpoint-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-left: auto;
}

.endpoint-chevron {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.endpoint-details {
  padding: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: #080a11;
}

.endpoint-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
}

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

.endpoint-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.25rem 0 0.6rem 0;
}

.params-table td code {
  font-size: 0.82rem;
}
.type-pill,
.in-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
}

.req-yes {
  color: var(--rose-accent);
  font-weight: 700;
  font-size: 0.78rem;
}
.req-no {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.responses-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.response-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.84rem;
}

.response-status-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.status-2xx .response-status-badge {
  background: rgba(16, 185, 129, 0.2);
  color: var(--emerald-accent);
}
.status-4xx .response-status-badge {
  background: rgba(244, 63, 94, 0.2);
  color: var(--rose-accent);
}

/* Try it out Panel */
.tryout-panel {
  background: #05060a;
  border: 1px solid var(--border-prominent);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.tryout-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tryout-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-brand);
  color: #ffffff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.tryout-send-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--brand-glow);
}

.tryout-url-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.tryout-method {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.tryout-url-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-primary);
}

.tryout-body-wrap {
  margin-bottom: 0.85rem;
}

.tryout-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.tryout-body-textarea {
  width: 100%;
  height: 90px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.5rem;
  outline: none;
  resize: vertical;
}

.snippets-tabs {
  margin-top: 1rem;
}

.snippets-tab-bar {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.5rem;
}

.snippet-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.snippet-tab-btn.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
}

.snippet-code {
  margin: 0;
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  color: #c4b5fd;
  overflow-x: auto;
}

.tryout-response-box {
  margin-top: 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #020305;
  overflow: hidden;
}

.tryout-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.tryout-status-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
}

.tryout-status-pill.status-ok {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-accent);
}
.tryout-status-pill.status-err {
  background: rgba(244, 63, 94, 0.15);
  color: var(--rose-accent);
}

.tryout-latency {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.tryout-response-content {
  margin: 0;
  padding: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #38bdf8;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ==========================================================================
   Industry Standard Components: Steps, Tabs, Card Grids, FileTree, Math & AI Copy
   ========================================================================== */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  padding: 0.55rem 1rem;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-to-content:focus {
  top: 0.75rem;
}

.doc-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.copy-page-md-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-page-md-btn:hover {
  background: rgba(124, 58, 237, 0.22);
  border-color: var(--brand-primary);
}

/* Stepper (::: steps) */
.z-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin: 1.5rem 0;
  padding-left: 0.5rem;
}

.z-step-item {
  display: flex;
  gap: 1rem;
  position: relative;
}

.z-step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: -16px;
  width: 2px;
  background: var(--border-subtle);
}

.z-step-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #c4b5fd;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.z-step-content {
  flex: 1;
  min-width: 0;
}

.z-step-title {
  margin: 0.15rem 0 0.45rem 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Content Tabs (::: tabs) */
.z-tabs {
  margin: 1.5rem 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  overflow: hidden;
}

.z-tabs-header {
  display: flex;
  gap: 0.25rem;
  padding: 0.45rem 0.65rem 0;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
}

.z-tab-btn {
  padding: 0.45rem 0.9rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.z-tab-btn.active {
  color: var(--text-primary);
  border-bottom-color: var(--brand-primary);
}

.z-tabs-body {
  padding: 1rem 1.2rem;
}

/* Cards Grid (::: cards) */
.z-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.z-doc-card {
  display: block;
  padding: 1.15rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.z-doc-card:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
}

.z-doc-card-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.4rem;
}

.z-doc-card-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-primary);
}

.z-doc-card-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* File Tree (::: file-tree) */
.z-file-tree {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.z-tree-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.z-tree-name.is-dir {
  color: var(--brand-secondary);
  font-weight: 700;
}

/* Math Blocks (KaTeX) */
.math-block {
  margin: 1.25rem 0;
  padding: 1rem;
  overflow-x: auto;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Print & PDF Export Stylesheet (@media print)
   ========================================================================== */
@media print {
  .site-header,
  .site-sidebar,
  .site-toc,
  .feedback-widget,
  .doc-footer,
  .site-footer,
  .ambient-glow,
  .copy-page-md-btn,
  .doc-edit-link,
  .open-playground-btn,
  .copy-code-btn {
    display: none !important;
  }

  body,
  .site-layout,
  .site-content,
  .doc-container {
    background: #ffffff !important;
    color: #0f172a !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
  }

  .code-block-wrap,
  .callout,
  .z-doc-card,
  .z-tabs,
  .z-file-tree {
    break-inside: avoid;
    border-color: #cbd5e1 !important;
  }
}
