/* ==========================================================================
   Aequora Sync Platform — Minimal Stylesheet (Dark & Light Theme)
   ========================================================================== */

:root {
  --bg-base: #060911;
  --bg-elevated: #0b1120;
  --bg-surface: #10192e;
  --bg-surface-hover: #17233f;
  --bg-glass: rgba(10, 16, 32, 0.88);
  --bg-glass-card: rgba(14, 22, 42, 0.78);
  --bg-card: #0e162a;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-highlight: rgba(0, 240, 255, 0.35);

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

  --primary-cyan: #00f0ff;
  --accent-purple: #a855f7;
  --gradient-brand: linear-gradient(135deg, #00f0ff 0%, #38bdf8 50%, #a855f7 100%);

  --code-bg: #070c17;
  --code-border: rgba(255, 255, 255, 0.1);
  --code-text: #e2e8f0;

  --header-height: 64px;
  --sidebar-width: 280px;
  --toc-width: 230px;
  --content-max-width: 1440px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
}

[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-surface: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-glass: rgba(255, 255, 255, 0.92);
  --bg-glass-card: rgba(255, 255, 255, 0.9);
  --bg-card: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-highlight: rgba(2, 132, 199, 0.4);

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

  --primary-cyan: #0284c7;
  --accent-purple: #7c3aed;
  --gradient-brand: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%);

  --code-bg: #f1f5f9;
  --code-border: #cbd5e1;
  --code-text: #1e293b;
  --shadow-card: 0 10px 25px -10px rgba(0, 0, 0, 0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  color: var(--code-text);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  margin: 1rem 0;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

/* Header */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.reading-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 101;
}

.reading-progress-fill {
  height: 100%;
  width: 0;
  background: var(--gradient-brand);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-primary);
}

.brand-icon-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--gradient-brand);
  color: #060911;
  font-family: var(--font-heading);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.brand-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
}

.brand-badge, .brand-version-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 5px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 240, 255, 0.28);
}

.brand-version-pill {
  background: var(--bg-surface);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.72rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all 0.15s ease;
}

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

.nav-item.active {
  color: var(--primary-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.nav-count-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: var(--bg-surface-hover);
  color: var(--text-muted);
}

.search-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  cursor: pointer;
}

.search-trigger-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

.search-kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9rem;
}

.action-btn:hover {
  border-color: var(--border-highlight);
  color: var(--text-primary);
}

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

@media (max-width: 1024px) {
  .header-nav, .search-btn-text, .search-kbd, .brand-version-pill {
    display: none;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
}

/* Mobile Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.72);
  backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border-medium);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mobile-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
  background: var(--bg-surface);
  color: var(--primary-cyan);
}

/* Layout & Sidebars */
.app-container {
  display: flex;
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
  width: 100%;
}

.app-container.full-width {
  display: block;
}

.main-content {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 2.25rem 2.5rem;
}

.main-content.full-width {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.sidebar-left {
  width: var(--sidebar-width);
  flex-shrink: 0;
  border-right: 1px solid var(--border-subtle);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 1.25rem 1rem;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
}

.sidebar-right-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  border-left: 1px solid var(--border-subtle);
  height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
  overflow-y: auto;
  padding: 1.5rem 1.15rem;
}

@media (max-width: 1120px) {
  .sidebar-right-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar-left {
    display: none;
  }
  .main-content {
    padding: 1.5rem 1.15rem;
  }
}

.sidebar-header {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.35rem 0.5rem 0.15rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

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

.sidebar-link.active {
  background: rgba(0, 240, 255, 0.1);
  color: var(--primary-cyan);
  font-weight: 600;
}

.sidebar-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.sidebar-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.toc-link {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

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

.toc-lvl-3 {
  padding-left: 0.75rem;
  font-size: 0.76rem;
}

/* Overview Hero & Cards */
.hero-section {
  text-align: center;
  padding: 2.5rem 0 2rem;
  max-width: 1080px;
  margin: 0 auto;
}

.hero-badge-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-cyan);
}

.hero-pill.secondary {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--accent-purple);
}

.hero-title {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: clamp(2rem, 1.6rem + 2.2vw, 3.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

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

.hero-subtitle {
  font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.18rem);
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 740px;
  margin: 0 auto 2rem;
}

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

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.72rem 1.35rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #060911;
  font-weight: 700;
  border: none;
}

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

.btn-primary:hover, .btn-secondary:hover {
  transform: translateY(-2px);
  border-color: var(--border-highlight);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .hero-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: inherit;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-highlight);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

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

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.section-block {
  margin: 3rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.section-header h2 {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
}

.section-link {
  font-size: 0.88rem;
  font-weight: 600;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.15rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: inherit;
  min-width: 0;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

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

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.65rem 0 0.45rem;
  line-height: 1.35;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feature-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 240, 255, 0.28);
}

.part-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Doc Article & Markdown */
.doc-article {
  max-width: 860px;
  margin: 0 auto;
}

.doc-meta-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.doc-breadcrumbs {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.doc-meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.meta-pill {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.doc-invariants-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.strip-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.doc-subtitle {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  font-family: var(--font-heading);
  margin: 1.75rem 0 0.75rem;
  line-height: 1.3;
}

.markdown-body h1 { font-size: 2rem; margin-top: 0; }
.markdown-body h2 { font-size: 1.45rem; padding-bottom: 0.35rem; border-bottom: 1px solid var(--border-subtle); }
.markdown-body h3 { font-size: 1.15rem; }
.markdown-body p { margin: 0.75rem 0; color: var(--text-secondary); line-height: 1.7; }
.markdown-body ul, .markdown-body ol { margin: 0.75rem 0 0.75rem 1.5rem; color: var(--text-secondary); }
.markdown-body li { margin: 0.35rem 0; }
.markdown-body table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: 0.88rem; }
.markdown-body th, .markdown-body td { border: 1px solid var(--border-subtle); padding: 0.55rem 0.75rem; text-align: left; }
.markdown-body th { background: var(--bg-surface); font-weight: 600; }
.markdown-body blockquote { border-left: 3px solid var(--primary-cyan); padding: 0.5rem 1rem; margin: 1rem 0; background: var(--bg-surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.doc-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.prev-next-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: inherit;
}

.prev-next-card.next { text-align: right; }
.prev-next-card:hover { border-color: var(--primary-cyan); }
.pn-label { font-size: 0.78rem; color: var(--primary-cyan); }
.pn-title { font-weight: 600; }

/* Catalogs & Filters */
.catalog-header { margin-bottom: 1.75rem; }
.catalog-header h1 { font-family: var(--font-heading); font-size: 1.85rem; margin-bottom: 0.4rem; }
.catalog-header p { color: var(--text-secondary); }

.catalog-controls {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.catalog-search-input {
  width: 100%;
  max-width: 560px;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.filter-pill.active, .filter-pill:has(input:checked), .filter-pill:hover {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
  background: rgba(0, 240, 255, 0.1);
}

.crate-card, .inv-card {
  text-align: left;
  cursor: pointer;
  font: inherit;
  width: 100%;
}

.crate-stats-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.inv-category-tag {
  margin-top: 0.75rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.inv-inline-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 240, 255, 0.12);
  color: var(--primary-cyan);
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 6px;
  padding: 0.12rem 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  cursor: pointer;
  margin: 0.1rem;
}

/* Modals & Search */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 1rem 2rem;
  overflow-y: auto;
}

.search-modal, .detail-modal {
  width: 100%;
  max-width: 780px;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
}

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

.search-filters-bar {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.search-filter-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
}

.search-filter-chip.active, .search-filter-chip:has(input:checked) {
  border-color: var(--primary-cyan);
  color: var(--primary-cyan);
}

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

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: inherit;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.search-result-item:hover { background: var(--bg-surface); }

.search-kind-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.14);
  color: var(--primary-cyan);
  flex-shrink: 0;
}

.search-result-title { font-weight: 600; font-size: 0.9rem; }
.search-result-sub { font-size: 0.8rem; color: var(--text-muted); }
.search-empty-state, .empty-state { padding: 2rem; text-align: center; color: var(--text-muted); }

.detail-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-modal-header h2 { margin: 0.45rem 0 0.25rem; font-size: 1.35rem; }
.detail-modal-body { padding: 1.5rem 1.75rem; max-height: 70vh; overflow-y: auto; }
.modal-badges { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.modal-desc { color: var(--text-secondary); margin-top: 0.25rem; line-height: 1.6; }
.modal-section { margin-top: 1.25rem; }
.modal-section h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--primary-cyan); margin-bottom: 0.5rem; }

.api-item-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.api-item-title { font-weight: 600; margin-bottom: 0.35rem; }
.api-item-docs { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 0.5rem; }
.dep-chips, .variant-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.dep-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.dep-chip:hover { border-color: var(--primary-cyan); color: var(--primary-cyan); }

/* Simulator */
.sim-toolbar { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-bottom: 1.5rem; }

.sim-select {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  font-size: 0.88rem;
}

.sim-stages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.sim-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}

.sim-stage-card.active {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25);
}

.sim-stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.sim-stage-title { font-weight: 600; font-size: 0.92rem; }
.sim-node-status { font-family: var(--font-mono); font-size: 0.72rem; color: var(--primary-cyan); }
.sim-node-status.offline { color: #f87171; }
.sim-json-box { margin: 0; font-size: 0.78rem; overflow-x: auto; }

.sim-logs-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
}

.sim-logs-header { font-weight: 600; margin-bottom: 0.75rem; }
.sim-logs-body { max-height: 280px; overflow-y: auto; font-family: var(--font-mono); font-size: 0.8rem; }
.sim-log-entry { padding: 0.3rem 0; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.sim-log-entry.success { color: #34d399; }
.sim-log-entry.warn { color: #fbbf24; }
.sim-log-entry.error { color: #f87171; }
