/* ══════════════════════════════════════════
   TenantsDB Docs - Shared Styles (Jet Theme)
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #000000;
  --bg-surface: #0a0a0a;
  --bg-card: #111111;
  --bg-code: #0a0a0a;
  --border: #1e1e1e;
  --border-subtle: #161616;
  --border-card: #1a1a1a;
  --text: #f0f0f0;
  --text-secondary: #888888;
  --text-muted: #848484;
  --accent: #00d4a1;
  --accent-dim: rgba(0, 212, 161, 0.10);
  --accent-glow: rgba(0, 212, 161, 0.08);
  --green: #00d4a1;
  --green-dim: rgba(0, 212, 161, 0.10);
  --orange: #f0a050;
  --orange-dim: rgba(240, 160, 80, 0.10);
  --red: #f06060;
  --red-dim: rgba(240, 96, 96, 0.10);
  --blue: #60b0f0;
  --blue-dim: rgba(96, 176, 240, 0.10);
  --yellow: #f0d060;
  --yellow-dim: rgba(255, 217, 61, 0.10);
  --pink: #f080a0;
  --sidebar-w: 280px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


/* ══════════════════════════════════════════
   Sidebar
   ══════════════════════════════════════════ */

.note-warn a {
  color: #9b9b9b;
  text-decoration: underline;
}

.note-info a {
  color: #9b9b9b;
  text-decoration: underline;
}

.db-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.sidebar-logo {
  padding: 24px 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}

.sidebar-logo .badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-left: auto;
}

.sidebar-logo img {
  height: 40px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-nav {
  padding: 16px 0;
  flex: 1;
  overflow-y: auto;
}

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

.nav-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 16px 24px 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  border-right: 2px solid transparent;
}

.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.nav-link.active { color: var(--accent); background: var(--accent-glow); border-right-color: var(--accent); }

.nav-link .icon-sm {
  font-size: 14px;
  opacity: 0.5;
  width: 18px;
  text-align: center;
}

.nav-link .method {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  min-width: 36px;
  text-align: center;
  flex-shrink: 0;
}

.method-get { background: var(--green-dim); color: var(--green); }
.method-post { background: var(--blue-dim); color: var(--blue); }
.method-patch { background: var(--orange-dim); color: var(--orange); }
.method-delete { background: var(--red-dim); color: var(--red); }


/* ══════════════════════════════════════════
   Main & Header
   ══════════════════════════════════════════ */

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 14px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  gap: 12px;
}

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

.header-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.header-tabs::-webkit-scrollbar { display: none; }

.header-tab {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-tab:hover { color: var(--text-secondary); }
.header-tab.active { color: var(--text); background: var(--bg-card); }

.header-base-url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  padding: 5px 14px;
  background: var(--bg-card);
  border-radius: 6px;
  border: 1px solid var(--border);
}


/* ══════════════════════════════════════════
   Content & Typography
   ══════════════════════════════════════════ */

.content {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 48px 120px;
  min-width: 0;
}

.section {
  margin-bottom: 56px;
  scroll-margin-top: 80px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title .icon { font-size: 18px; opacity: 0.5; }

.section-desc {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* Page-level titles (Quick Start) */
.page-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.page-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 48px;
}

/* Prose paragraphs */
.prose {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}

.prose strong { color: var(--text); font-weight: 600; }

.prose a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 212, 161, 0.3);
  transition: border-color 0.15s;
}

.prose a:hover { border-bottom-color: var(--accent); }


/* ══════════════════════════════════════════
   API - Endpoints
   ══════════════════════════════════════════ */

.endpoint {
  margin-bottom: 48px;
  scroll-margin-top: 80px;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.endpoint-method {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  letter-spacing: 0.5px;
}

.endpoint-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.endpoint-path .param { color: var(--orange); }

.endpoint-desc {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

.endpoint-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 20px;
}


/* ══════════════════════════════════════════
   Code Blocks
   ══════════════════════════════════════════ */

.code-block {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 16px;
  overflow: hidden;
}

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

.code-block-lang {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.code-block-copy {
  font-size: 10px;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  transition: all 0.15s;
}

.code-block-copy:hover { color: var(--text-secondary); border-color: var(--text-muted); }

.code-block pre {
  padding: 16px 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text);
}

.code-block pre::-webkit-scrollbar { height: 3px; }
.code-block pre::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Syntax highlighting */
.hl-key { color: #60b0f0; }
.hl-str { color: var(--accent); }
.hl-num { color: var(--orange); }
.hl-bool { color: #f080a0; }
.hl-null { color: var(--text-muted); }
.hl-comment { color: var(--text-muted); font-style: italic; }
.hl-cmd { color: var(--accent); }
.hl-flag { color: var(--orange); }
.hl-sql { color: #60b0f0; }
.hl-sql-str { color: var(--accent); }
.hl-sql-num { color: var(--orange); }
.hl-sql-kw { color: #60b0f0; font-weight: 600; }


/* ══════════════════════════════════════════
   Params Table
   ══════════════════════════════════════════ */

.params-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.params-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.params-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

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

.param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
}

.param-type {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
}

.param-required {
  font-size: 10px;
  font-weight: 700;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.param-optional {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.param-desc { color: var(--text-secondary); font-size: 13px; }


/* ══════════════════════════════════════════
   Divider
   ══════════════════════════════════════════ */

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}


/* ══════════════════════════════════════════
   Auth Banner & Inline Code
   ══════════════════════════════════════════ */

.auth-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.auth-banner .ab-icon { font-size: 16px; margin-top: 2px; }

.auth-banner .text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.auth-banner code,
code.inline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--bg-code);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text);
  border: 1px solid var(--border);
}


/* ══════════════════════════════════════════
   Notes
   ══════════════════════════════════════════ */

.note {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.note-info {
  background: rgba(0, 212, 161, 0.06);
  border-left: 2px solid var(--accent);
  color: var(--accent);
}

.note-warn {
  background: var(--orange-dim);
  border-left: 2px solid var(--orange);
  color: var(--orange);
}

.note code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}


/* ══════════════════════════════════════════
   Isolation Cards (API tenants section)
   ══════════════════════════════════════════ */

.isolation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.isolation-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 18px;
}

.isolation-card .level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.isolation-card .label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.isolation-card .desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}


/* ══════════════════════════════════════════
   CLI Command Card
   ══════════════════════════════════════════ */

.cmd-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  margin-bottom: 40px;
  scroll-margin-top: 80px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.cmd-card:hover { border-color: #252525; }

.cmd-card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.cmd-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.cmd-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.cmd-body { padding: 22px; }
.cmd-body .endpoint-label:first-child { margin-top: 0; }


/* ══════════════════════════════════════════
   Tabs (Connections page)
   ══════════════════════════════════════════ */

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }


/* ══════════════════════════════════════════
   Endpoint Table (Connections)
   ══════════════════════════════════════════ */

.endpoint-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
}

.endpoint-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.endpoint-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

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


/* ══════════════════════════════════════════
   Connection Format (Connections)
   ══════════════════════════════════════════ */

.conn-format {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
}

.conn-format .label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.conn-format code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}


/* ══════════════════════════════════════════
   Quick Start - Concept Cards
   ══════════════════════════════════════════ */

.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.concept-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 20px;
}

.concept-card .label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 8px;
}

.concept-card .title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.concept-card .desc { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }


/* ══════════════════════════════════════════
   Quick Start - Isolation Cards
   ══════════════════════════════════════════ */

.iso-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.iso-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 22px;
}

.iso-card .level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px; font-weight: 700; margin-bottom: 4px;
}

.iso-card .name { font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.iso-card .desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.iso-card .tags { display: flex; flex-wrap: wrap; gap: 6px; }

.iso-tag {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 4px;
  background: rgba(255,255,255,0.04); color: var(--text-secondary);
}


/* ══════════════════════════════════════════
   Quick Start - DB Grid
   ══════════════════════════════════════════ */

.db-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.db-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}

.db-card .db-icon { font-size: 24px; margin-bottom: 8px; }
.db-card .db-name { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.db-card .db-use { font-size: 11px; color: var(--text-muted); line-height: 1.5; }


/* ══════════════════════════════════════════
   Quick Start - Steps
   ══════════════════════════════════════════ */

.steps { margin-bottom: 24px; }

.step {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
}

.step-num {
  width: 32px; height: 32px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: var(--accent-dim);
  border-radius: 8px;
  margin-top: 2px;
}

.step-content { flex: 1; }
.step-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }


/* ══════════════════════════════════════════
   Quick Start - Next Steps
   ══════════════════════════════════════════ */

.next-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.next-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.next-card:hover { border-color: #2a2a2a; transform: translateY(-1px); }
.next-card .next-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.next-card .next-title { font-size: 14px; font-weight: 700; }
.next-card .next-arrow { color: var(--text-muted); font-size: 13px; margin-top: 8px; display: block; transition: transform 0.15s; }
.next-card:hover .next-arrow { transform: translateX(3px); color: var(--accent); }


/* ══════════════════════════════════════════
   Docs Hub (index.html) - Grid Layout
   ══════════════════════════════════════════ */

.hub-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px 24px;
  box-sizing: border-box;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto auto auto auto;
  gap: 10px;
  max-width: 1200px;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Row 1: Hero cell (3 cols) */
.hub-hero-cell {
  grid-column: 1 / 4;
  grid-row: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hub-hero-cell img {
  height: auto;
  width: 250px;
  margin-bottom: 8px;
}

.hub-hero-cell .badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  width: fit-content;
}

.hub-hero-cell p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
  max-width: 520px;
}

/* Row 1: Stacked cards (1 col) */
.hub-stack {
  grid-column: 4;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-stack .hub-card { flex: 1; }

/* Cards */
.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.hub-card:hover {
  border-color: var(--accent);
  transform: none;
  box-shadow: none;
}

.hub-card .card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin-bottom: 8px;
}

.hub-card .card-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.hub-card .card-icon img {
  width: 18px;
  height: 18px;
}

.hub-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 3px 0;
  letter-spacing: 0;
  color: var(--text);
}

.hub-card p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.hub-card .card-arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 16px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
}

.hub-card:hover .card-arrow { opacity: 1; }

.hub-card.featured {
  border-color: var(--border-card);
  background: var(--bg-card);
}

.hub-card.featured:hover {
  border-color: var(--accent);
  box-shadow: none;
}

.hub-card.featured h3 { color: var(--text); }

/* Row 3: Connections cell (2 cols) */
.hub-conn-cell {
  grid-column: 1 / 3;
  grid-row: 5;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.hub-conn-cell:hover { border-color: var(--accent); }

.hub-conn-cell .card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-dim);
  border-radius: 9px;
  margin-bottom: 8px;
}

.hub-conn-cell .card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--green);
  stroke-width: 2;
}

.hub-conn-cell h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px 0;
}

.hub-conn-cell p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Row 3: Database 2x2 grid */
.hub-db-grid {
  grid-column: 3 / 5;
  grid-row: 5;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

/* Icon colors */
.icon-accent { background: var(--accent-dim); }
.icon-accent svg { stroke: var(--accent); }
.icon-blue { background: var(--blue-dim); }
.icon-blue svg { stroke: var(--blue); }
.icon-orange { background: var(--orange-dim); }
.icon-orange svg { stroke: var(--orange); }
.icon-purple { background: rgba(168, 85, 247, 0.1); }
.icon-purple svg { stroke: #a855f7; }
.icon-pink { background: rgba(236, 72, 153, 0.1); }
.icon-pink svg { stroke: #ec4899; }
.icon-pg { background: rgba(96, 165, 250, 0.1); }
.icon-mysql { background: rgba(251, 191, 36, 0.1); }
.icon-mongo { background: rgba(74, 222, 128, 0.1); }
.icon-redis { background: rgba(248, 113, 113, 0.1); }

/* Row labels */
.hub-row-label {
  grid-column: 1 / -1;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 4px 0 0 4px;
}

/* Hub footer */
.hub-foot {
  text-align: center;
  margin-top: 10px;
}

.hub-foot a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.hub-foot a:hover { color: var(--accent); }


/* ══════════════════════════════════════════
   Search Trigger (Header)
   ══════════════════════════════════════════ */

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.search-trigger:hover {
  border-color: var(--text-muted);
  color: var(--text-secondary);
}

.search-trigger svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  flex-shrink: 0;
}

.search-trigger .search-shortcut {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.3px;
}


/* ══════════════════════════════════════════
   Search Modal
   ══════════════════════════════════════════ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.search-modal.open { display: block; }

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-dialog {
  position: relative;
  max-width: 560px;
  margin: 15vh auto 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.03);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 480px;
  animation: search-in 0.15s ease-out;
}

@keyframes search-in {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.search-input::placeholder { color: var(--text-muted); }

.search-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  min-height: 120px;
  max-height: 340px;
}

.search-results::-webkit-scrollbar { width: 3px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.search-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 10px 12px 4px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
}

.search-result:hover,
.search-result.active {
  background: rgba(255,255,255,0.04);
}

.search-result.active {
  background: var(--accent-dim);
}

.search-result-icon {
  font-size: 14px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-title mark {
  background: rgba(0, 212, 161, 0.2);
  color: var(--accent);
  border-radius: 2px;
  padding: 0 1px;
}

.search-result-section {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  font-weight: 500;
}

.search-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.search-empty span { color: var(--text-secondary); }

.search-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.search-footer kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  margin-right: 2px;
}


/* ══════════════════════════════════════════
   Table of Contents (right column)
   ══════════════════════════════════════════ */

.toc-aside {
  display: none;
}

@media (min-width: 1280px) {
  .has-toc .sidebar {
    position: fixed;
  }

  .has-toc .main {
    display: grid;
    grid-template-columns: 1fr 220px;
    grid-template-rows: auto 1fr;
  }

  .has-toc .header {
    grid-column: 1 / -1;
  }

  .has-toc .content {
    grid-column: 1;
    max-width: 880px;
    min-width: 0;
    margin: 0 auto;
  }

  .toc-aside {
    display: block;
    grid-column: 2;
    grid-row: 2;
    padding: 48px 16px 48px 20px;
    position: sticky;
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    border-left: 1px solid var(--border-subtle);
  }

  .toc-aside::-webkit-scrollbar { width: 2px; }
  .toc-aside::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
}

.toc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

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

.toc-item {
  margin-bottom: 1px;
}

.toc-h3 {
  padding-left: 12px;
}

.toc-link {
  display: block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 0 4px 4px 0;
}

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

.toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-glow);
}


/* ══════════════════════════════════════════
   Mobile
   ══════════════════════════════════════════ */

.mobile-menu { display: none; }

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .content { padding: 32px 20px 100px; }

  .header {
    padding: 14px 16px;
    gap: 8px;
  }

  .mobile-menu {
    display: block;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 4px;
  }

  .header-tabs {
    gap: 0;
  }

  .header-tab {
    padding: 7px 12px;
    font-size: 12px;
  }

  .search-trigger .search-label,
  .search-trigger .search-shortcut {
    display: none;
  }

  .search-trigger {
    padding: 6px 10px;
  }

  .search-dialog {
    margin: 8vh 16px 0;
    max-height: 70vh;
  }

  .isolation-grid { grid-template-columns: 1fr; }
  .concept-grid { grid-template-columns: 1fr; }
  .iso-grid { grid-template-columns: 1fr; }
  .db-grid { grid-template-columns: repeat(2, 1fr); }
  .next-grid { grid-template-columns: 1fr; }
  .endpoint-path { word-break: break-all; }
  .params-table, .endpoint-table { display: block; overflow-x: auto; }
  .flow-diagram { flex-direction: column; }
  .flow-diagram > div[style*="flex-shrink"] { display: none; }

  /* Hub grid responsive */
  .hub-page { height: auto; min-height: 100vh; padding: 24px 16px; }
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    max-width: 100%;
    padding: 0;
  }
  .hub-hero-cell { grid-column: 1 / -1; grid-row: auto; }
  .hub-stack { grid-column: 1 / -1; grid-row: auto; flex-direction: row; }
  .hub-row-label { grid-column: 1 / -1; }
  .hub-card { grid-column: auto; grid-row: auto; }
  .hub-conn-cell { grid-column: 1 / -1; grid-row: auto; }
  .hub-db-grid { grid-column: 1 / -1; grid-row: auto; }
}

.sidebar.open::after {
  content: '';
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

@media (max-width: 520px) {
  /* Hub mobile */
  .hub-page { padding: 16px 12px; }
  .hub-grid { grid-template-columns: 1fr; }
  .hub-stack { flex-direction: column; }
  .hub-db-grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .hub-hero-cell { padding: 20px 24px; }
  .hub-hero-cell img { width: 180px; }
}

@media (max-width: 380px) {
  /* Narrow phones (Z Fold cover, SE) */
  .hub-page { padding: 12px 8px; }
  .hub-grid { gap: 8px; }
  .hub-hero-cell { padding: 16px 16px; }
  .hub-hero-cell img { width: 150px; }
  .hub-card { padding: 12px 14px; }
  .hub-conn-cell { padding: 16px 16px; }
  .hub-db-grid { gap: 8px; }
}