/* UNIBOXAPI Documentation - Warm Cream / Editorial Light Theme
 * R-31 Design Decision: Consistent Geist & Inter typography across every single element,
 * buttons, inputs, tables, headers, and modals.
 */

@import url('https://fonts.googleapis.com/css2?family=Geist:ital,wght@0,100..900;1,100..900&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  /* Warm Cream Palette */
  --bg-canvas: #faf8f5;        /* Base page cream background */
  --bg-sidebar: #f5f0e6;       /* Warm sand sidebar */
  --bg-surface: #ffffff;       /* Pure crisp white for cards and modals */
  --bg-surface-hover: #f9f6f0; /* Gentle warm hover */
  --bg-subtle: #efe9dc;        /* Elevated cream containers */
  --bg-code: #1c1917;          /* Warm espresso dark block for high-contrast syntax code */
  --bg-code-header: #292524;

  /* Stone Borders */
  --border-subtle: #e7e0d3;
  --border-strong: #d3c8b6;
  --border-focus: #0d766e;

  /* Typography Colors (Stone / Charcoal) */
  --text-primary: #1c1917;     /* High contrast charcoal stone */
  --text-secondary: #44403c;   /* Readable mid-stone text (WCAG AA > 7:1) */
  --text-muted: #78716c;       /* Muted captions (WCAG AA > 4.6:1) */
  --text-inverse: #fafaf9;

  /* Accent Color: Deep Forest Teal (Warm, scholarly, distinctive) */
  --accent: #0d766e;
  --accent-hover: #115e59;
  --accent-subtle: rgba(13, 118, 110, 0.08);
  --accent-border: rgba(13, 118, 110, 0.25);
  --accent-text: #0f766e;

  /* HTTP Method Badges */
  --badge-get-bg: #e6f4ea;
  --badge-get-text: #0d766e;
  --badge-get-border: #bbf7d0;

  --badge-post-bg: #e0f2fe;
  --badge-post-text: #0369a1;
  --badge-post-border: #bae6fd;

  /* Status Badges */
  --status-success: #059669;
  --status-error: #dc2626;
  --status-warning: #d97706;

  /* Typography Stack with Geist & Inter (User Request) */
  --font-sans: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Dimensions & Spacing */
  --header-height: 64px;
  --sidebar-width: 300px;
  --toc-width: 250px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Subtle Warm Shadows */
  --shadow-sm: 0 1px 3px rgba(44, 38, 30, 0.04), 0 1px 2px rgba(44, 38, 30, 0.03);
  --shadow-md: 0 4px 10px -1px rgba(44, 38, 30, 0.06), 0 2px 4px -1px rgba(44, 38, 30, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(44, 38, 30, 0.1), 0 4px 8px -2px rgba(44, 38, 30, 0.05);
}

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

html, body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Ensure all typography across the entire page strictly uses Geist & Inter */
body,
h1, h2, h3, h4, h5, h6,
p, span, a, li, ul, ol, label,
button, input, select, textarea, optgroup,
table, thead, tbody, th, td, tr,
.btn, .nav-link, .category-header, .search-trigger, .meta-tag,
.info-box-title, .info-box-content, .toast, .search-modal,
.explorer-drawer, .sidebar, .main-content, .toc-sidebar {
  font-family: var(--font-sans);
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em;
}

pre, code, kbd, samp, .param-name, .param-type, .method-tag, .version-badge, .nav-link-badge, .status-badge, .endpoint-url {
  font-family: var(--font-mono);
}

/* Accessibility Focus States (R-32) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Interactive elements pointer affordance (R-39) */
a, button, summary, select, input, label[for] {
  cursor: pointer;
}
button:disabled, input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Reduced Motion (R-39) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Header & Top Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-height);
  background-color: rgba(245, 240, 230, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand-logo-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 4px 10px;
  background: #1c1917;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.header-idlix-logo {
  height: 20px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  display: block;
}

.logo-icon-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background-color: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

.version-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  background-color: var(--bg-surface);
  color: var(--accent-text);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-success);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Search Trigger Button */
.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: all 0.15s ease;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

.search-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background-color: #ffffff;
}

.kbd-shortcut {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
}

/* Icon Buttons (Min 44px tap target per R-03) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.icon-btn:hover {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

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

/* Page Layout (3 Columns) */
.docs-layout {
  display: flex;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  position: relative;
  flex: 1;
}

/* Left Sidebar */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 24px 16px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* Sidebar Brand Card with IDLIX Logo */
.sidebar-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-bottom: 18px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.sidebar-brand-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.sidebar-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1c1917;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #292524;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.sidebar-idlix-img {
  height: 22px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  display: block;
}

.sidebar-brand-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-brand-name {
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.sidebar-brand-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 3px;
}

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

.sidebar-search-input {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

.sidebar-search-input:focus {
  border-color: var(--accent);
  outline: none;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 10px;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  min-height: 40px;
  transition: all 0.15s ease;
}

.nav-link-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

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

.nav-link.active {
  background-color: #ffffff;
  color: var(--accent);
  font-weight: 700;
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-sm);
  padding-left: 10px;
}

.nav-link.active .nav-link-icon {
  color: var(--accent);
}

.nav-link-badge {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-get {
  background-color: var(--badge-get-bg);
  color: var(--badge-get-text);
  border: 1px solid var(--badge-get-border);
}

/* Category Accordion Header in Sidebar */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  min-height: 44px;
  text-align: left;
}

/* Single Collapsible Group for All IDLIX Endpoints */
.nav-group-collapsible {
  margin-bottom: 24px;
}

.idlix-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.idlix-group-toggle:hover {
  background-color: #ffffff;
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.idlix-group-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.idlix-toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1c1917;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #292524;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.toggle-idlix-icon {
  height: 16px;
  width: auto;
  max-width: 55px;
  object-fit: contain;
  display: block;
}

.idlix-toggle-label {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* IDLIX Endpoints Group Divider Banner */
.endpoints-group-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  margin-top: 48px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.endpoints-banner-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.endpoint-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #1c1917;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #292524;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.banner-idlix-logo {
  height: 24px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  display: block;
}

.endpoints-banner-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 2px;
}

.endpoints-banner-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.endpoints-count-badge {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent-text);
  background-color: var(--accent-subtle);
  border: 1px solid var(--accent-border);
  padding: 4px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}

.category-actions-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.group-toggle-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Open/Close toggle behavior */
.nav-group-collapsible.open .group-toggle-chevron {
  transform: rotate(0deg);
}

.nav-group-collapsible:not(.open) .group-toggle-chevron {
  transform: rotate(-90deg);
}

.nav-group-collapsible:not(.open) .collapsible-group-content {
  display: none;
}

.collapsible-group-content {
  padding-left: 6px;
  border-left: 2px solid var(--border-subtle);
  margin-left: 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.25s ease;
}

/* Subgroups inside the main IDLIX group */
.sidebar-subgroup {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-subgroup-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.subgroup-title-text {
  display: flex;
  align-items: center;
  gap: 6px;
}

.subgroup-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: 9999px;
  font-family: var(--font-mono);
}

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
}

/* Center Content */
.main-content {
  flex: 1;
  min-width: 0;
  padding: 44px 48px 80px;
  max-width: 980px;
}

/* Hero Section */
.docs-hero {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 36px;
  margin-bottom: 44px;
}

.docs-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.docs-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 780px;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  padding: 6px 14px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

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

/* Section Containers */
.doc-section {
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--header-height) + 32px);
}

.section-header {
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.section-desc {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* Cards & Info Boxes */
.info-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.info-box.accent-box {
  border-left: 4px solid var(--accent);
  background-color: #f6fbf9;
}

.info-box-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-box-content {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Endpoint Card (Pure White against Warm Cream Background) */
.endpoint-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.endpoint-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.endpoint-header {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  gap: 16px;
  background-color: #ffffff;
}

.endpoint-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.endpoint-target {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.method-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.method-get {
  background-color: var(--badge-get-bg);
  color: var(--badge-get-text);
  border: 1px solid var(--badge-get-border);
}

.method-post {
  background-color: var(--badge-post-bg);
  color: var(--badge-post-text);
  border: 1px solid var(--badge-post-border);
}

.endpoint-url {
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.endpoint-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  min-height: 44px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-secondary {
  background-color: var(--bg-canvas);
  border-color: var(--border-subtle);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background-color: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-accent {
  background-color: var(--accent);
  color: #ffffff;
}

.btn-accent:hover {
  background-color: var(--accent-hover);
}

.endpoint-body {
  padding: 24px;
  background-color: #ffffff;
}

/* Parameters Table */
.param-table-container {
  margin-top: 16px;
  margin-bottom: 24px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background-color: #ffffff;
}

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

.param-table th {
  background-color: var(--bg-subtle);
  padding: 10px 14px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.param-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

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

.param-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.8125rem;
}

.param-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-text);
  font-weight: 600;
}

.param-required {
  color: var(--status-error);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-left: 6px;
}

.param-optional {
  color: var(--text-muted);
  font-size: 0.6875rem;
  margin-left: 6px;
}

/* Code Snippet Tabs */
.code-wrapper {
  margin-top: 16px;
  background-color: var(--bg-code);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background-color: var(--bg-code-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-tabs {
  display: flex;
  gap: 4px;
}

.code-tab {
  background: transparent;
  border: none;
  color: #a8a29e;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.code-tab.active {
  background-color: rgba(255, 255, 255, 0.12);
  color: #fafaf9;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e7e5e4;
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.code-block {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #f5f5f4;
}

.code-block pre {
  margin: 0;
}

/* Syntax Highlighting Tokens (High Contrast) */
.token-key { color: #38bdf8; font-weight: 600; }
.token-string { color: #86efac; }
.token-number { color: #fde047; }
.token-boolean { color: #f472b6; }
.token-null { color: #a8a29e; }
.token-comment { color: #78716c; font-style: italic; }

/* Right Sidebar (On This Page / Table of Contents) */
.toc-sidebar {
  width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 44px 16px;
  flex-shrink: 0;
}

.toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--border-subtle);
  padding-left: 14px;
}

.toc-link {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 4px 0;
  transition: color 0.15s ease;
}

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

.toc-link.active {
  color: var(--accent);
  font-weight: 700;
}

/* Interactive API Explorer Drawer */
.explorer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.explorer-overlay.open {
  display: flex;
}

.explorer-drawer {
  width: 100%;
  max-width: 650px;
  height: 100vh;
  background-color: var(--bg-canvas);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
}

.explorer-header {
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.explorer-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.form-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

.form-input:focus {
  border-color: var(--accent);
  outline: none;
}

.explorer-url-bar {
  display: flex;
  gap: 8px;
}

.method-select {
  padding: 8px 14px;
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--badge-get-text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.875rem;
  min-height: 44px;
  box-shadow: var(--shadow-sm);
}

.response-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.status-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
}

.status-2xx {
  background-color: #e6f4ea;
  color: var(--status-success);
  border: 1px solid #bbf7d0;
}

.status-4xx, .status-5xx {
  background-color: #fee2e2;
  color: var(--status-error);
  border: 1px solid #fecaca;
}

/* Global Search Modal */
.search-modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(28, 25, 23, 0.45);
  backdrop-filter: blur(4px);
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}

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

.search-modal {
  width: 100%;
  max-width: 580px;
  background-color: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

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

.search-results {
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  list-style: none;
  background-color: #ffffff;
}

.search-result-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.15s ease;
  min-height: 44px;
}

.search-result-item:hover, .search-result-item.selected {
  background-color: var(--bg-subtle);
  color: var(--text-primary);
}

.search-result-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
}

.search-result-url {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #ffffff;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
  align-items: center;
  gap: 10px;
}

.toast.show {
  display: flex;
}

/* Responsive Media Queries (R-03) */
@media (max-width: 1200px) {
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: var(--header-height);
    left: -100%;
    z-index: 45;
    width: 290px;
    transition: left 0.25s ease;
    background-color: var(--bg-sidebar);
    box-shadow: var(--shadow-lg);
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .mobile-menu-btn {
    display: inline-flex;
  }
  
  .main-content {
    padding: 24px 20px 60px;
  }
  
  .header {
    padding: 0 16px;
  }
  
  .explorer-drawer {
    max-width: 100%;
  }
}

/* API Key Badge and Header Integration */
.apikey-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  background-color: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.apikey-badge.tier-master {
  background-color: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.apikey-badge.tier-pro {
  background-color: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.apikey-badge.tier-free {
  background-color: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

/* API Key Modal Dialog */
.apikey-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 92%;
  max-width: 560px;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  opacity: 0;
}

.apikey-modal.open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.apikey-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-canvas);
}

.apikey-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.apikey-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.apikey-preset-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.apikey-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 600px) {
  .apikey-preset-grid {
    grid-template-columns: 1fr;
  }
}

.apikey-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.apikey-preset-btn:hover {
  border-color: var(--accent);
  background-color: var(--bg-surface-hover);
}

.apikey-preset-btn.active {
  border-color: var(--accent);
  background-color: var(--accent-subtle);
}

.apikey-preset-name {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
}

.apikey-preset-rate {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Cache Dashboard Widget Styles */
.cache-dashboard {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cache-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.cache-dashboard-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cache-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

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

.cache-stat-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cache-stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cache-stat-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.cache-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cache-progress-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cache-progress-label-wrap {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cache-progress-track {
  height: 8px;
  background-color: var(--border-subtle);
  border-radius: 9999px;
  overflow: hidden;
}

.cache-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #14b8a6 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.cache-namespaces-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}

.cache-ns-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.cache-ns-count {
  background-color: var(--accent);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Video Player Modal & Container Styles */
.player-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 94%;
  max-width: 900px;
  background-color: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  opacity: 0;
}

.player-modal.open {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.player-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-canvas);
}

.player-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-modal-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #ffffff;
}

.player-video-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0c0a09;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

#docs-hls-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000000;
  outline: none;
}

.player-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #fafaf9;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(12, 10, 9, 0.75);
  padding: 16px 24px;
  border-radius: var(--radius-md);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.player-controls-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 14px;
  background-color: var(--bg-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.player-control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Telegram Notifier Card Styles */
.telegram-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid #0284c7;
  border-radius: var(--radius-md);
  padding: 20px;
  margin: 16px 0 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.telegram-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.telegram-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}


