/* ═══════════════════════════════════════════════════════════════════════
   BlastCAD Docs — Design System
   Mirrors blastcad.com CSS tokens exactly (from LandingPage.tsx).
   Dark/light mode controlled via html.light-mode class + cookie
   shared across *.blastcad.com.
═══════════════════════════════════════════════════════════════════════ */

/* ─── 1. CSS Variables ──────────────────────────────────────────────── */
:root {
  /* Dark mode (default) */
  --bc-bg:          #0d1117;
  --bc-bg-sidebar:  #161b22;
  --bc-nav-bg:      rgba(1, 4, 9, 0.90);
  --bc-bg-hover:    #21262d;
  --bc-border:      #30363d;
  --bc-text:        #e6edf3;
  --bc-text-muted:  #8b949e;
  --bc-text-faint:  #484f58;
  --bc-accent:      #0094c6;
  --bc-accent-h:    #007aa3;
  --bc-code-bg:     #161b22;
  --bc-success:     #2ea043;
  --bc-warning:     #d29922;
  --bc-danger:      #f85149;

  /* Layout */
  --bc-topnav-h:    64px;
  --bc-sidebar-w:   260px;
  --bc-toc-w:       212px;
  --bc-radius:      6px;
  --bc-content-max: 840px;
}

html.light-mode {
  --bc-bg:          #ffffff;
  --bc-bg-sidebar:  #f6f8fa;
  --bc-nav-bg:      rgba(255, 255, 255, 0.90);
  --bc-bg-hover:    #eaeef2;
  --bc-border:      #d0d7de;
  --bc-text:        #1f2328;
  --bc-text-muted:  #636c76;
  --bc-text-faint:  #a8b3bc;
  --bc-accent:      #0094c6;
  --bc-accent-h:    #007aa3;
  --bc-code-bg:     #f6f8fa;
  --bc-success:     #1a7f37;
  --bc-warning:     #9a6700;
  --bc-danger:      #cf222e;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bc-bg);
  color: var(--bc-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mirror styles.css base — prevents browser-default text-decoration on all links */
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

img { max-width: 100%; height: auto; display: block; }

/* ─── 3. Top Navbar ─────────────────────────────────────────────────── */
.bc-topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--bc-topnav-h);
  z-index: 500;
  background-color: var(--bc-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

.bc-topnav.scrolled { border-bottom-color: var(--bc-border); }

.bc-topnav-inner {
  max-width: 1320px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

/* Brand — exact copy of tb-brand* from blastcad-web/assets/css/styles.css */
.tb-brand {
  display: flex;
  align-items: center;
  height: 100%;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  gap: 0;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.tb-brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.tb-brand-logo img {
  width: 36px;
  height: 36px;
  display: block;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tb-brand:hover .tb-brand-logo img,
.tb-brand:active .tb-brand-logo img { transform: rotate(-8deg) scale(1.12); }

.tb-brand-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
  overflow: hidden;
  max-width: 140px;
  opacity: 1;
  transform: translateX(0);
  margin-left: 9px;
  white-space: nowrap;
}

.tb-brand-blast { font-size: 18px; font-weight: 800; color: var(--bc-text); letter-spacing: -0.3px; }
.tb-brand-cad   { font-size: 18px; font-weight: 800; color: var(--bc-accent); letter-spacing: -0.3px; }
.tb-brand-tag   { font-size: 9px; font-weight: 700; color: var(--bc-text-muted); text-transform: uppercase; margin-left: 4px; align-self: flex-end; margin-bottom: 2px; }

/* Centre nav links — mirrors .nav-links in blastcad-web */
.bc-topnav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.bc-topnav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--bc-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.bc-topnav-links a:hover    { color: var(--bc-text); }
.bc-topnav-links .bc-topnav-active { color: var(--bc-text); }

/* Right actions — mirrors .nav-cta in blastcad-web */
.bc-topnav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Theme toggle — mirrors .theme-toggle in blastcad-web */
.bc-theme-btn {
  width: 38px; height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--bc-border);
  border-radius: 50%;
  color: var(--bc-text-muted);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.bc-theme-btn:hover {
  color: var(--bc-text);
  border-color: var(--bc-text-muted);
  background: var(--bc-bg-hover);
}

/* CTA button — exact copy of .btn-primary from blastcad-web/assets/css/styles.css */
.bc-topnav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  background-color: var(--bc-success);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  flex-shrink: 0;
}

.bc-topnav-cta:hover { background-color: #2c973e; }

/* Mobile controls (hamburger + theme toggle for mobile) */
.bc-topnav-mobile {
  display: none;
  align-items: center;
  gap: 8px;
}

.bc-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 20px; height: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.bc-hamburger span {
  width: 100%; height: 2px;
  background: var(--bc-text);
  border-radius: 2px;
  transition: all 0.15s ease;
  display: block;
}

/* Mobile dropdown menu */
.bc-mobile-menu {
  display: none;
  position: fixed;
  top: var(--bc-topnav-h);
  left: 0; right: 0;
  background: var(--bc-bg-sidebar);
  border-bottom: 1px solid var(--bc-border);
  z-index: 490;
  flex-direction: column;
  padding: 1rem 24px 1.25rem;
  gap: 0;
}

.bc-mobile-menu.open { display: flex; }

.bc-mobile-menu a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--bc-text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--bc-border);
  transition: color 0.12s;
}

.bc-mobile-menu a:last-of-type { border-bottom: none; }
.bc-mobile-menu a:hover { color: var(--bc-text); }
.bc-mobile-menu .bc-topnav-active { color: var(--bc-accent); }

.bc-mobile-menu-cta {
  padding-top: 1rem;
}

/* Docs-page mobile nav toggle button */
.bc-mob-nav-btn {
  display: none;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  color: var(--bc-text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 7px 12px;
  cursor: pointer;
  margin-bottom: 1.5rem;
  transition: all 0.12s;
}

.bc-mob-nav-btn:hover {
  border-color: var(--bc-text-muted);
  color: var(--bc-text);
}

/* ─── 4. Page Layout ────────────────────────────────────────────────── */
.bc-layout {
  display: grid;
  grid-template-columns: var(--bc-sidebar-w) 1fr var(--bc-toc-w);
  grid-template-areas: "sidebar main toc";
  min-height: calc(100vh - var(--bc-topnav-h));
  margin-top: var(--bc-topnav-h);
  align-items: start;
}

/* ─── 5. Sidebar ────────────────────────────────────────────────────── */
.bc-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--bc-topnav-h);
  height: calc(100vh - var(--bc-topnav-h));
  overflow-y: auto;
  background-color: var(--bc-bg-sidebar);
  border-right: 1px solid var(--bc-border);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--bc-border) transparent;
}

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

/* Search */
.bc-search-wrap {
  padding: 14px 12px 10px;
  border-bottom: 1px solid var(--bc-border);
  position: relative;
}

.bc-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bc-bg-hover);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 0 10px;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.bc-search-box:focus-within {
  border-color: var(--bc-accent);
  box-shadow: 0 0 0 3px rgba(0, 148, 198, 0.15);
}

.bc-search-icon { color: var(--bc-text-faint); flex-shrink: 0; }

.bc-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--bc-text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 0;
  width: 100%;
}

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

/* Search results dropdown */
.bc-search-results {
  position: absolute;
  top: calc(100% - 2px);
  left: 8px; right: 8px;
  background: var(--bc-bg-sidebar);
  border: 1px solid var(--bc-border);
  border-top: none;
  border-radius: 0 0 var(--bc-radius) var(--bc-radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-height: 340px;
  overflow-y: auto;
}

.bc-search-result {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  border-bottom: 1px solid var(--bc-border);
  transition: background 0.1s;
}

.bc-search-result:last-child { border-bottom: none; }
.bc-search-result:hover { background: var(--bc-bg-hover); }

.bc-search-result-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-text);
  margin-bottom: 3px;
}

.bc-search-result-excerpt {
  display: block;
  font-size: 12px;
  color: var(--bc-text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.bc-search-no-results {
  padding: 12px;
  font-size: 13px;
  color: var(--bc-text-muted);
  text-align: center;
}

/* Navigation tree */
.bc-nav { flex: 1; padding: 10px 8px; }

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

.bc-nav-item { position: relative; }

.bc-nav-row {
  display: flex;
  align-items: center;
}

.bc-nav-link {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--bc-radius);
  color: var(--bc-text-muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
  flex: 1;
  line-height: 1.3;
}

.bc-nav-link:hover {
  background: var(--bc-bg-hover);
  color: var(--bc-text);
  text-decoration: none;
}

.bc-nav-link.active {
  background: rgba(0, 148, 198, 0.12);
  color: var(--bc-accent);
  font-weight: 600;
  border-left: 3px solid var(--bc-accent);
  padding-left: 7px;
}

.bc-nav-expand {
  background: transparent;
  border: none;
  color: var(--bc-text-muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--bc-radius);
  display: flex;
  align-items: center;
  transition: background 0.1s, transform 0.2s;
  flex-shrink: 0;
}

.bc-nav-expand:hover {
  background: var(--bc-bg-hover);
  color: var(--bc-text);
}

.bc-nav-item.is-open > .bc-nav-row .bc-nav-expand { transform: rotate(180deg); }
/* When item has no row wrapper (simple link) */
.bc-nav-item.is-open > .bc-nav-expand { transform: rotate(180deg); }

/* Child nav items */
.bc-nav-children {
  list-style: none;
  margin-left: 10px;
  margin-top: 2px;
  border-left: 1px solid var(--bc-border);
  padding-left: 8px;
  display: none;
  gap: 1px;
  flex-direction: column;
}

.bc-nav-item.is-open > .bc-nav-children { display: flex; }

.bc-nav-children .bc-nav-link {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--bc-text-muted);
  padding: 5px 10px;
}

.bc-nav-children .bc-nav-link.active {
  background: rgba(0, 148, 198, 0.10);
  color: var(--bc-accent);
  font-weight: 600;
  border-left: 2px solid var(--bc-accent);
  padding-left: 8px;
}

/* Sidebar footer */
.bc-sidebar-footer {
  padding: 12px 12px;
  border-top: 1px solid var(--bc-border);
  font-size: 11px;
  color: var(--bc-text-muted);
  margin-top: auto;
}

.bc-sidebar-footer a {
  color: var(--bc-text-muted);
  text-decoration: none;
  transition: color 0.12s;
}

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

/* ─── 6. Main Content ───────────────────────────────────────────────── */
.bc-main {
  grid-area: main;
  min-width: 0;
  padding: 2.5rem 3rem 4rem 3rem;
}

/* Breadcrumb */
.bc-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--bc-text-muted);
  margin-bottom: 0.6rem;
}

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

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

.bc-bc-sep {
  color: var(--bc-text-faint);
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.bc-bc-current {
  color: var(--bc-text);
  font-weight: 500;
}

/* Page title */
.bc-page-title {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--bc-text);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  border-bottom: 1px solid var(--bc-border);
  padding-bottom: 0.75rem;
}

/* ─── 7. Content Typography ─────────────────────────────────────────── */
.bc-content {
  max-width: var(--bc-content-max);
  color: var(--bc-text);
  line-height: 1.7;
}

.bc-content h1,
.bc-content h2,
.bc-content h3,
.bc-content h4,
.bc-content h5,
.bc-content h6 {
  color: var(--bc-text);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
}

.bc-content h1 { font-size: 1.6rem; }
.bc-content h2 {
  font-size: 1.25rem;
  border-bottom: 1px solid var(--bc-border);
  padding-bottom: 0.35rem;
  margin-top: 2.5rem;
}
.bc-content h3 { font-size: 1.05rem; }
.bc-content h4 { font-size: 0.95rem; color: var(--bc-text-muted); }

.bc-content p { margin-bottom: 1rem; }
.bc-content ul, .bc-content ol { padding-left: 1.4rem; margin-bottom: 1rem; }
.bc-content li { margin-bottom: 0.3rem; }

/* Links */
.bc-content a {
  color: var(--bc-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 148, 198, 0.30);
  transition: border-color 0.12s, color 0.12s;
}

.bc-content a:hover {
  color: var(--bc-accent-h);
  border-bottom-color: var(--bc-accent);
}

/* Button links (from Kramdown {: .btn .btn-primary }) */
.bc-content .bc-btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: var(--bc-radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
  transition: background 0.15s, transform 0.1s;
  margin-right: 8px;
  margin-bottom: 8px;
  background: var(--bc-bg-hover);
  color: var(--bc-text);
  border: 1px solid var(--bc-border);
}

.bc-content .bc-btn:hover {
  transform: translateY(-1px);
  border-color: var(--bc-text-muted);
  color: var(--bc-text);
}

.bc-content .bc-btn-primary {
  background: var(--bc-accent);
  color: #fff;
  border-color: var(--bc-accent);
}

.bc-content .bc-btn-primary:hover {
  background: var(--bc-accent-h);
  border-color: var(--bc-accent-h);
  color: #fff;
}

/* Code */
.bc-content code {
  font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
  font-size: 0.875em;
  background: var(--bc-code-bg);
  border: 1px solid var(--bc-border);
  border-radius: 4px;
  padding: 1px 6px;
  color: #a5d6ff;
  white-space: nowrap;
}

html.light-mode .bc-content code { color: #0550ae; }

.bc-content pre {
  background: var(--bc-code-bg);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.bc-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--bc-text);
  white-space: pre;
}

/* Highlight.js override for dark mode */
.hljs { background: var(--bc-code-bg) !important; }

/* Tables */
.bc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.bc-content th {
  background: var(--bc-bg-sidebar);
  color: var(--bc-text);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 8px 12px;
  border-bottom: 2px solid var(--bc-border);
  text-align: left;
  white-space: nowrap;
}

.bc-content td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--bc-border);
  color: var(--bc-text);
  vertical-align: top;
}

.bc-content tr:last-child td { border-bottom: none; }
.bc-content tr:hover td { background: var(--bc-bg-hover); }
.bc-content table { border: 1px solid var(--bc-border); border-radius: var(--bc-radius); overflow: hidden; }

/* Blockquotes */
.bc-content blockquote {
  background: var(--bc-bg-sidebar);
  border-left: 4px solid var(--bc-accent);
  border-radius: 0 var(--bc-radius) var(--bc-radius) 0;
  color: var(--bc-text-muted);
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.25rem;
}

.bc-content blockquote p { margin-bottom: 0; }

/* Strong / Emphasis */
.bc-content strong { font-weight: 700; color: var(--bc-text); }

/* Horizontal rule */
.bc-content hr {
  border: none;
  border-top: 1px solid var(--bc-border);
  margin: 2rem 0;
}

/* Keyboard shortcuts */
.bc-content kbd {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.78em;
  background: var(--bc-bg-hover);
  border: 1px solid var(--bc-border);
  border-bottom: 3px solid var(--bc-border);
  border-radius: 4px;
  color: var(--bc-text);
  padding: 1px 6px;
}

/* ─── 8. Custom Content Components ──────────────────────────────────── */
/* hero-banner (used in index.md) */
.bc-content .hero-banner {
  background: linear-gradient(135deg, var(--bc-bg-sidebar) 0%, rgba(0,148,198,0.07) 100%);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 1.5rem;
  margin: 1rem 0 1.75rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--bc-text-muted);
}

.bc-content .hero-banner strong { color: var(--bc-text); }

/* feature-grid (used in index.md) */
.bc-content .feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.75rem;
}

.bc-content .feature-card {
  background: var(--bc-bg-sidebar);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  padding: 1.1rem 1.25rem;
  transition: border-color 0.15s, transform 0.15s;
}

.bc-content .feature-card:hover {
  border-color: var(--bc-accent);
  transform: translateY(-2px);
}

.bc-content .feature-card h3 {
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.bc-content .feature-card p {
  font-size: 0.85rem;
  color: var(--bc-text-muted);
  margin-bottom: 0;
  line-height: 1.55;
}

/* callout classes */
.bc-content .callout-accent,
.bc-content .callout-info {
  background: rgba(0,148,198,0.08);
  border-left: 4px solid var(--bc-accent);
  border-radius: 0 var(--bc-radius) var(--bc-radius) 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  color: var(--bc-text-muted);
}

.bc-content .callout-warning {
  background: rgba(210,153,34,0.08);
  border-left: 4px solid var(--bc-warning);
  border-radius: 0 var(--bc-radius) var(--bc-radius) 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

.bc-content .callout-danger {
  background: rgba(248,81,73,0.08);
  border-left: 4px solid var(--bc-danger);
  border-radius: 0 var(--bc-radius) var(--bc-radius) 0;
  padding: 0.75rem 1rem;
  margin: 1rem 0;
}

/* ─── 9. Table of Contents (right column) ───────────────────────────── */
.bc-toc-col {
  grid-area: toc;
  position: sticky;
  top: calc(var(--bc-topnav-h) + 2rem);
  height: fit-content;
  padding: 2.5rem 1.5rem 2rem 0;
  align-self: start;
}

.bc-toc { font-size: 12.5px; }

.bc-toc-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bc-text-muted);
  margin-bottom: 0.6rem;
}

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

.bc-toc a {
  display: block;
  color: var(--bc-text-muted);
  text-decoration: none;
  padding: 2px 0;
  transition: color 0.12s;
  line-height: 1.4;
}

.bc-toc a:hover  { color: var(--bc-accent); }
.bc-toc a.active { color: var(--bc-accent); font-weight: 600; }

.bc-toc .toc-h3 { padding-left: 0.75rem; }
.bc-toc .toc-h3 a { font-size: 12px; }

/* ─── 10. Page Footer ───────────────────────────────────────────────── */
.bc-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 0;
  margin-top: 3rem;
  border-top: 1px solid var(--bc-border);
  font-size: 12.5px;
  color: var(--bc-text-muted);
  max-width: var(--bc-content-max);
}

.bc-page-footer a {
  color: var(--bc-text-muted);
  text-decoration: none;
  transition: color 0.12s;
}

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

/* ─── 11. Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bc-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bc-text-muted); }

/* ─── 12. Mobile overlay ────────────────────────────────────────────── */
.bc-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  opacity: 0;
  transition: opacity 0.25s;
}

.bc-overlay.visible {
  display: block;
  opacity: 1;
}

/* ─── 13. Responsive ────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  :root { --bc-toc-w: 0px; }
  .bc-toc-col { display: none; }
  .bc-layout { grid-template-columns: var(--bc-sidebar-w) 1fr; grid-template-areas: "sidebar main"; }
}

@media (max-width: 960px) {
  .bc-topnav-links,
  .bc-topnav-actions { display: none; }
  .bc-topnav-mobile { display: flex; }
}

@media (max-width: 820px) {
  :root { --bc-sidebar-w: 0px; }

  .bc-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "main";
  }

  .bc-sidebar {
    position: fixed;
    top: var(--bc-topnav-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--bc-topnav-h));
    z-index: 450;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --bc-sidebar-w: 280px; /* reset for sidebar itself */
  }

  .bc-sidebar.open { transform: translateX(0); }

  .bc-mob-nav-btn { display: inline-flex; }

  .bc-main { padding: 1.5rem 1.25rem 3rem; }
}

@media (max-width: 640px) {
  .bc-topnav-cta { display: none; }
  .bc-page-footer { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

@media (max-width: 400px) {
  .bc-brand span { display: none; }
}
