/* =================== VARIABLES =================== */
:root {
  --header-h: 60px;
  --toc-w: 224px;

  /* dark */
  --bg:           #07070a;
  --bg-alt:       #0d0d12;
  --bg-surface:   #111118;
  --bg-surface2:  #18181f;
  --bg-overlay:   #1e1e28;

  --border:       rgba(255,255,255,0.10);
  --border-2:     rgba(255,255,255,0.15);
  --border-3:     rgba(255,255,255,0.25);

  --brand:        #8b5cf6;
  --brand-dark:   #7c3aed;
  --brand-faint:  rgba(139,92,246,0.08);
  --brand-faint2: rgba(139,92,246,0.15);

  --text:         #ededed;
  --text-2:       #a0a0a0;
  --text-3:       #636363;
  --text-muted:   #484848;

  --red:          #f87171;
  --amber:        #fbbf24;
  --blue:         #60a5fa;
  --purple:       #a78bfa;
  --orange:       #fb923c;

  --font-sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Bricolage Grotesque', 'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 4px;
  --radius:    6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow:    0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);

  --transition: 150ms ease;
}

[data-theme="light"] {
  --bg:           #f9f9f9;
  --bg-alt:       #ffffff;
  --bg-surface:   #f1f1f1;
  --bg-surface2:  #e8e8e8;
  --bg-overlay:   #e0e0e0;
  --border:       rgba(0,0,0,0.07);
  --border-2:     rgba(0,0,0,0.13);
  --border-3:     rgba(0,0,0,0.22);
  --text:         #171717;
  --text-2:       #525252;
  --text-3:       #8a8a8a;
  --text-muted:   #b0b0b0;
  --brand-faint:  rgba(139,92,246,0.07);
  --brand-faint2: rgba(139,92,246,0.14);
}

/* =================== BASE =================== */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;overflow-x:hidden;}
body{
  background:var(--bg);
  color:var(--text-2);
  font-family:var(--font-sans);
  font-size:15px;
  line-height:1.75;
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
  transition:background var(--transition),color var(--transition);
}

/* =================== PROGRESS =================== */
#progress{
  position:fixed;top:0;left:0;
  height:1px;width:0%;
  background:var(--brand);
  z-index:9999;
  box-shadow:0 0 8px var(--brand);
  transition:width 0.1s linear;
}

/* =================== SCROLL ANIMATIONS =================== */
.reveal{opacity:0;transform:translateY(8px);transition:opacity 0.35s ease,transform 0.35s ease;}
.reveal.visible{opacity:1;transform:none;}

/* =================== HEADER =================== */
.header{
  position:fixed;top:0;left:0;right:0;
  height:var(--header-h);
  background:rgba(7,7,10,0.92);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  z-index:500;
}
[data-theme="light"] .header{background:rgba(249,249,249,0.95);}
.header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:0 1.5rem;
  display:flex;align-items:center;gap:0.75rem;
  height:100%;
}
.header-logo{
  display:flex;align-items:center;gap:0.5rem;
  text-decoration:none;flex-shrink:0;
}
.header-logo-mark{
  width:24px;height:24px;
  background:linear-gradient(135deg,#7c3aed 0%,#a78bfa 100%);
  border-radius:5px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  box-shadow:0 0 12px rgba(139,92,246,0.3);
}
.header-logo-mark svg{width:14px;height:14px;color:#fff;stroke:#fff;}
.header-logo-text{font-weight:600;font-size:0.9rem;color:var(--text);letter-spacing:-0.01em;}
.header-sep{width:1px;height:20px;background:var(--border);flex-shrink:0;}
.header-nav{display:flex;align-items:center;gap:0.1rem;flex:1;}
.header-nav-btn{
  display:flex;align-items:center;gap:0.3rem;
  padding:0.35rem 0.65rem;background:none;border:none;
  color:var(--text-3);font-size:0.82rem;font-family:var(--font-sans);
  cursor:pointer;border-radius:var(--radius);
  transition:color var(--transition),background var(--transition);
  white-space:nowrap;position:relative;
}
.header-nav-btn:hover,.header-nav-btn.open{color:var(--text);background:var(--bg-surface);}
.header-nav-btn svg{width:12px;height:12px;flex-shrink:0;transition:transform 0.15s ease;}
.header-nav-btn.open svg{transform:rotate(180deg);}
.header-nav-link{
  display:flex;align-items:center;gap:0.3rem;
  padding:0.35rem 0.65rem;
  color:var(--text-3);font-size:0.82rem;
  text-decoration:none;border-radius:var(--radius);
  transition:color var(--transition),background var(--transition);
}
.header-nav-link:hover{color:var(--text);background:var(--bg-surface);text-decoration:none;}
.header-right{display:flex;align-items:center;gap:0.5rem;margin-left:auto;}
.header-search{
  display:flex;align-items:center;gap:0.5rem;
  padding:0.3rem 0.75rem;
  background:var(--bg-surface);border:1px solid var(--border);
  border-radius:var(--radius-md);cursor:pointer;
  color:var(--text-3);font-size:0.8rem;font-family:var(--font-sans);
  transition:border-color var(--transition),background var(--transition);
  min-width:200px;
}
.header-search:hover{border-color:var(--border-2);background:var(--bg-surface2);}
.header-search svg{width:13px;height:13px;flex-shrink:0;}
.header-search kbd{
  font-family:var(--font-mono);font-size:0.6rem;
  background:var(--bg-overlay);border:1px solid var(--border-2);
  padding:0.05rem 0.3rem;border-radius:4px;color:var(--text-3);
  margin-left:auto;
}
.header-icon-btn{
  width:30px;height:30px;display:flex;align-items:center;justify-content:center;
  background:none;border:1px solid var(--border);border-radius:var(--radius);
  color:var(--text-3);cursor:pointer;
  transition:all var(--transition);text-decoration:none;flex-shrink:0;
}
.header-icon-btn:hover{color:var(--text);border-color:var(--border-2);background:var(--bg-surface);text-decoration:none;}
.header-icon-btn svg{width:14px;height:14px;}
.header-hamburger{
  display:none;width:30px;height:30px;
  align-items:center;justify-content:center;
  background:none;border:1px solid var(--border);border-radius:var(--radius);
  color:var(--text-2);cursor:pointer;
  transition:all var(--transition);
}
@media(max-width:900px){
  .header-nav{display:none;}
  .header-hamburger{display:flex;}
}

/* =================== DROPDOWNS =================== */
.header-group{position:relative;}
.header-dropdown{
  position:absolute;top:calc(100% + 8px);left:0;
  background:var(--bg-alt);border:1px solid var(--border-2);
  border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);
  min-width:200px;padding:0.4rem;
  display:none;z-index:600;
}
.header-dropdown.open{display:block;}
.dd-item{
  display:flex;align-items:center;gap:0.5rem;
  padding:0.45rem 0.7rem;
  color:var(--text-2);font-size:0.82rem;
  text-decoration:none;border-radius:var(--radius);
  transition:background var(--transition),color var(--transition);
}
.dd-item:hover{background:var(--bg-surface2);color:var(--text);text-decoration:none;}
.dd-divider{height:1px;background:var(--border);margin:0.3rem 0;}

/* =================== LAYOUT (index.html) =================== */
.layout{
  display:block;
  padding-top:var(--header-h);
  min-height:100vh;
}
.main{
  min-width:0;
  padding:3rem 4rem 6rem;
  width:100%;
}
@media(max-width:900px){
  .main{padding:2rem 1.5rem 5rem;}
}

/* =================== TOC =================== */
.toc{
  display:none;
  position:sticky;
  top:calc(var(--header-h) + 2rem);
  width:var(--toc-w);
  flex-shrink:0;
  padding:0 1rem;
  max-height:calc(100vh - var(--header-h) - 4rem);
  overflow-y:auto;
}
@media(min-width:1280px){.toc{display:block;}}
.toc::-webkit-scrollbar{width:2px;}
.toc::-webkit-scrollbar-thumb{background:var(--border);}
.toc-label{
  font-family:var(--font-mono);font-size:0.6rem;
  text-transform:uppercase;letter-spacing:0.1em;
  color:var(--text-muted);font-weight:600;margin-bottom:0.65rem;
}
.toc-item{
  display:block;
  padding:0.22rem 0.5rem;font-size:0.78rem;color:var(--text-3);
  text-decoration:none;cursor:pointer;
  border-left:2px solid transparent;
  transition:color var(--transition),border-color var(--transition);
  line-height:1.4;
}
.toc-item:hover{color:var(--text-2);}
.toc-item.active{color:var(--brand);border-left-color:var(--brand);}

/* =================== SUBPAGE TOC (right-side, inside shell) =================== */
.subpage-toc{
  display:none;
  position:sticky;
  top:calc(var(--topnav-h) + 2rem);
  width:200px;
  flex-shrink:0;
  align-self:flex-start;
  max-height:calc(100vh - var(--topnav-h) - 4rem);
  overflow-y:auto;
  padding:0 0.5rem 0 1rem;
}
@media(min-width:1280px){.subpage-toc{display:block;}}
.subpage-toc .toc-label{
  font-family:var(--font-mono);font-size:0.6rem;
  text-transform:uppercase;letter-spacing:0.1em;
  color:var(--text-muted);font-weight:600;margin-bottom:0.65rem;
}
.subpage-toc .toc-item{
  display:block;
  padding:0.22rem 0.5rem;font-size:0.78rem;color:var(--text-3);
  text-decoration:none;cursor:pointer;
  border-left:2px solid transparent;
  transition:color var(--transition),border-color var(--transition);
  line-height:1.4;
}
.subpage-toc .toc-item:hover{color:var(--text-2);}
.subpage-toc .toc-item.active{color:var(--brand);border-left-color:var(--brand);}

/* =================== HERO =================== */
.hero{
  background:var(--bg);
  border-bottom:1px solid var(--border);
  padding:3.5rem 2rem 0;
  position:relative;
  overflow:clip;
}
.hero-inner{
  max-width:1200px;margin:0 auto;
  display:grid;
  grid-template-columns:1fr 460px;
  gap:3rem;
  align-items:start;
  padding-bottom:3rem;
}
@media(max-width:1040px){
  .hero-inner{grid-template-columns:1fr;padding-bottom:2rem;}
  .hero-getting-started{display:none;}
}
.hero-left{max-width:540px;}
.hero-eyebrow{
  font-family:var(--font-mono);font-size:0.65rem;
  text-transform:uppercase;letter-spacing:0.1em;
  color:var(--brand);margin-bottom:0.75rem;font-weight:600;
}
.hero-title{
  font-family:var(--font-display);
  font-size:2.8rem;font-weight:700;color:var(--text);
  letter-spacing:-0.04em;line-height:1.1;margin-bottom:1.1rem;
}
.hero-lead{
  font-size:0.92rem;color:var(--text-2);
  line-height:1.8;margin-bottom:1.75rem;max-width:480px;
}
.hero-actions{display:flex;gap:0.5rem;flex-wrap:wrap;margin-bottom:2rem;}

/* Getting Started panel */
.hero-getting-started{
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius-xl);
  padding:1.75rem;
}
.hgs-header{
  display:flex;align-items:center;gap:0.6rem;
  margin-bottom:0.5rem;
}
.hgs-icon{
  width:28px;height:28px;
  background:var(--brand);
  border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.hgs-icon svg{width:14px;height:14px;fill:#fff;stroke:none;}
.hgs-title{font-size:1.05rem;font-weight:600;color:var(--text);}
.hgs-desc{font-size:0.82rem;color:var(--text-2);margin-bottom:1.25rem;line-height:1.6;}
.hgs-grid{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:0.5rem;
  margin-bottom:1rem;
}
.hgs-item{
  display:flex;align-items:center;justify-content:center;
  background:var(--bg-surface);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:0.8rem 0.4rem;
  text-decoration:none;
  transition:all var(--transition);
  aspect-ratio:1;
}
.hgs-item:hover{border-color:var(--border-2);background:var(--bg-surface2);transform:translateY(-1px);text-decoration:none;}

/* Products grid */
.hero-products{
  max-width:1200px;margin:0 auto;
  padding:2.5rem 0;
  border-bottom:1px solid var(--border);
}
.hero-products-title{
  font-size:1.3rem;font-weight:600;color:var(--text);
  margin-bottom:1.25rem;
}
.products-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0.75rem;
  margin-bottom:0.75rem;
}
.products-grid-3{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:0.75rem;
}
@media(max-width:900px){
  .products-grid{grid-template-columns:1fr;}
  .products-grid-3{grid-template-columns:1fr;}
}
.product-card{
  background:var(--bg-alt);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:1.5rem 1.75rem;
  text-decoration:none;
  display:block;
  transition:all var(--transition);
}
.product-card:hover{border-color:var(--brand-faint2);background:var(--bg-surface);text-decoration:none;transform:translateY(-1px);}
.product-card-header{
  display:flex;align-items:center;gap:0.6rem;
  margin-bottom:0.75rem;
}
.product-card-header svg{width:18px;height:18px;color:var(--brand);flex-shrink:0;}
.product-card-title{font-size:0.95rem;font-weight:600;color:var(--text);}
.product-card-desc{font-size:0.82rem;color:var(--text-2);line-height:1.65;}

.btn{
  display:inline-flex;align-items:center;gap:0.5rem;
  padding:0.55rem 1.1rem;border-radius:var(--radius);
  font-size:0.84rem;font-weight:500;font-family:var(--font-sans);
  text-decoration:none;cursor:pointer;transition:all 0.2s ease;
  border:1px solid transparent;
}
.btn-brand{background:var(--brand);color:#000;border-color:var(--brand);}
.btn-brand:hover{background:var(--brand-dark);color:#000;transform:translateY(-1px);box-shadow:0 4px 16px rgba(139,92,246,0.3);text-decoration:none;}
.btn-outline{background:transparent;color:var(--text-2);border-color:var(--border-2);}
.btn-outline:hover{border-color:var(--border-3);color:var(--text);transform:translateY(-1px);text-decoration:none;}
.btn svg{width:13px;height:13px;flex-shrink:0;}

/* =================== CONTENT AREA =================== */
.content-wrapper{
  display:flex;
  max-width:1200px;
  margin:0 auto;
  padding:3rem 2rem 6rem;
  gap:3rem;
}
.content{flex:1;min-width:0;overflow-x:auto;}
@media(max-width:768px){.content-wrapper{padding:2rem 1.25rem 5rem;}}

/* =================== SECTION =================== */
.doc-section{margin-bottom:4rem;scroll-margin-top:calc(var(--header-h) + 1.5rem);}
.section-label{
  font-family:var(--font-mono);font-size:0.62rem;
  text-transform:uppercase;letter-spacing:0.1em;
  color:var(--brand);margin-bottom:0.4rem;font-weight:600;
}
.section-title{
  font-family:var(--font-display);
  font-size:1.2rem;font-weight:700;color:var(--text);
  letter-spacing:-0.03em;margin-bottom:0.4rem;
  display:flex;align-items:center;gap:0.5rem;line-height:1.2;
}
.section-title a.permalink{
  opacity:0;color:var(--text-3);font-size:0.85rem;text-decoration:none;
  transition:opacity var(--transition);
}
.section-title:hover a.permalink{opacity:1;}
.section-desc{font-size:0.87rem;color:var(--text-2);margin-bottom:1.25rem;line-height:1.75;}
.doc-divider{height:1px;background:var(--border);margin:0 0 4rem;}
.divider{height:1px;background:var(--border);margin:2.5rem 0;}

/* =================== LISTS =================== */
.shell .main ol,
.shell .main ul{
  padding-left:1.5rem;
  margin:0.75rem 0 1.1rem;
  display:flex;flex-direction:column;gap:0.35rem;
}
.shell .main li{
  color:var(--text-2);font-size:0.855rem;line-height:1.7;
}
.shell .main ol li::marker{color:var(--brand);font-family:var(--font-mono);font-size:0.78rem;font-weight:600;}
.shell .main ul li::marker{color:var(--brand);}

/* inline code */
code{
  font-family:var(--font-mono);font-size:0.8em;
  background:var(--bg-surface2);border:1px solid var(--border);
  padding:0.1em 0.38em;border-radius:4px;color:var(--text);
  word-break:normal;
  overflow-wrap:anywhere;
}
[data-theme="light"] code{background:rgba(0,0,0,0.05);}
a{color:var(--brand);text-decoration:none;}
a:hover{text-decoration:underline;}
p{color:var(--text-2);line-height:1.75;}

/* =================== BADGES =================== */
.badge{
  display:inline-flex;align-items:center;
  font-family:var(--font-mono);font-size:0.62rem;
  padding:0.14rem 0.44rem;font-weight:500;
  letter-spacing:0.02em;border-radius:4px;border:1px solid;
  white-space:nowrap;
}
.badge-green {background:rgba(139,92,246,0.1);color:#a78bfa;border-color:rgba(139,92,246,0.3);}
.badge-amber {background:rgba(251,191,36,0.08);color:var(--amber);border-color:rgba(251,191,36,0.3);}
.badge-red   {background:rgba(248,113,113,0.08);color:var(--red);border-color:rgba(248,113,113,0.3);}
.badge-blue  {background:rgba(96,165,250,0.08);color:var(--blue);border-color:rgba(96,165,250,0.3);}
.badge-purple{background:rgba(167,139,250,0.08);color:var(--purple);border-color:rgba(167,139,250,0.3);}

/* Tags (inline status) */
.tag{
  display:inline-flex;align-items:center;
  font-family:var(--font-mono);font-size:0.6rem;
  padding:0.1rem 0.4rem;font-weight:600;
  letter-spacing:0.03em;border-radius:4px;border:1px solid;
  white-space:nowrap;
}
.tag-new   {background:rgba(139,92,246,0.12);color:#a78bfa;border-color:rgba(139,92,246,0.3);}
.tag-green {background:rgba(52,211,153,0.1); color:#34d399;border-color:rgba(52,211,153,0.3);}
.tag-amber {background:rgba(251,191,36,0.1); color:var(--amber);border-color:rgba(251,191,36,0.3);}
.tag-red   {background:rgba(248,113,113,0.1);color:var(--red);border-color:rgba(248,113,113,0.3);}
.tag-blue  {background:rgba(96,165,250,0.1); color:var(--blue);border-color:rgba(96,165,250,0.3);}

/* =================== ENDPOINT CARD =================== */
.endpoint-card{border:1px solid var(--border);border-radius:var(--radius-md);margin:1.25rem 0;overflow:hidden;}
.endpoint-header{
  display:flex;align-items:center;gap:0.7rem;
  padding:0.65rem 1rem;background:var(--bg-surface);
  border-bottom:1px solid var(--border);
}
.method-badge{
  font-family:var(--font-mono);font-size:0.65rem;
  font-weight:700;padding:0.15rem 0.5rem;
  text-transform:uppercase;letter-spacing:0.06em;border-radius:4px;
  white-space:nowrap;
}
.method-post{background:rgba(167,139,250,0.15);color:#a78bfa;}
.method-get {background:rgba(139,92,246,0.12);color:#a78bfa;}
.endpoint-path{font-family:var(--font-mono);font-size:0.82rem;color:var(--text);}
.endpoint-note{margin-left:auto;font-size:0.72rem;color:var(--text-3);font-family:var(--font-mono);white-space:nowrap;}

/* =================== CODE BLOCKS =================== */
.codeblock{border:1px solid var(--border);border-radius:var(--radius-md);margin:1.25rem 0;overflow:hidden;background:var(--bg-alt);}
.codeblock-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:0 0.875rem;background:var(--bg-surface);
  border-bottom:1px solid var(--border);min-height:38px;
}
.lang-tabs{display:flex;height:100%;overflow-x:auto;gap:0;}
.lang-tab{
  display:flex;align-items:center;gap:0.4rem;
  background:none;border:none;
  color:var(--text-3);font-family:var(--font-mono);font-size:0.68rem;
  padding:0 0.75rem;cursor:pointer;
  transition:color var(--transition);
  border-bottom:2px solid transparent;white-space:nowrap;height:38px;
}
.lang-tab img{width:14px;height:14px;object-fit:contain;}
.lang-tab:hover{color:var(--text-2);}
.lang-tab.active{color:var(--text);border-bottom-color:var(--brand);}
.codeblock-actions{display:flex;align-items:center;gap:0.4rem;flex-shrink:0;}
.copy-btn{
  background:none;border:1px solid var(--border);
  color:var(--text-3);font-family:var(--font-mono);font-size:0.63rem;
  padding:0.15rem 0.5rem;cursor:pointer;
  transition:all var(--transition);border-radius:4px;
  white-space:nowrap;
}
.copy-btn:hover{color:var(--text-2);border-color:var(--border-2);}
.copy-btn.copied{color:var(--brand);border-color:rgba(139,92,246,0.4);}
.run-btn{
  display:flex;align-items:center;gap:0.35rem;
  background:rgba(139,92,246,0.1);border:1px solid rgba(139,92,246,0.25);
  color:var(--brand);font-family:var(--font-mono);font-size:0.63rem;
  padding:0.15rem 0.6rem;cursor:pointer;
  transition:all var(--transition);border-radius:4px;
  white-space:nowrap;
}
.run-btn:hover{background:rgba(139,92,246,0.18);border-color:rgba(139,92,246,0.4);}
.run-btn svg{width:9px;height:9px;}
.codeblock-body{
  padding:1.1rem 1.25rem;overflow-x:auto;
  line-height:1.9;color:#b0aac8;
  font-family:var(--font-mono);font-size:0.77rem;
}
.tab-pane{display:none;white-space:pre;}
.tab-pane.active{display:block;}

/* Syntax tokens */
.t-key{color:#a78bfa;}.t-str{color:#fbbf24;}.t-num{color:#60a5fa;}.t-nil{color:#f87171;}
.t-comment{color:#4a4565;font-style:italic;}.t-method{color:#8b5cf6;font-weight:500;}
.t-flag{color:#818cf8;}.t-url{color:#c4b5fd;}.t-punct{color:#4a4565;}
.t-ok{color:#8b5cf6;font-weight:600;}.t-err{color:#f87171;font-weight:600;}
.t-header{color:#8b5cf6;}.t-bool{color:#f87171;}

/* Sandbox result */
.sandbox-result{
  border:1px solid var(--border);border-top:none;
  border-radius:0 0 var(--radius-md) var(--radius-md);
  background:var(--bg-alt);display:none;
  margin-top:-1px;
}
.sandbox-result.visible{display:block;}
.sandbox-result-header{
  display:flex;align-items:center;gap:0.5rem;
  padding:0.5rem 1rem;background:var(--bg-surface);
  border-bottom:1px solid var(--border);
  font-family:var(--font-mono);font-size:0.66rem;
}
.sandbox-result-body{
  padding:1rem 1.25rem;font-family:var(--font-mono);font-size:0.77rem;
  line-height:1.9;color:#b0aac8;white-space:pre;overflow-x:auto;
}
@keyframes blink{0%,100%{opacity:1}50%{opacity:0.3}}
.dot-live{
  display:inline-block;width:6px;height:6px;border-radius:50%;
  background:var(--brand);box-shadow:0 0 5px var(--brand);
  animation:blink 2s ease infinite;
}

/* =================== PARAMS TABLE =================== */
.params-table{
  border:1px solid var(--border);border-radius:var(--radius-md);
  margin:1.25rem 0;overflow-x:auto;
  width:100%;display:block;
}
.params-head{
  display:grid;grid-template-columns:140px 48px minmax(420px,1fr);gap:0.75rem;
  padding:0.45rem 1rem;background:var(--bg-surface);
  border-bottom:1px solid var(--border);
  min-width:760px;
}
.params-head span{
  font-family:var(--font-mono);font-size:0.6rem;
  text-transform:uppercase;letter-spacing:0.08em;
  color:var(--text-muted);font-weight:600;
}
.param-row{
  display:grid;grid-template-columns:140px 48px minmax(420px,1fr);gap:0.75rem;
  padding:0.75rem 1rem;border-bottom:1px solid var(--border);
  align-items:start;transition:background var(--transition);
  min-width:760px;
}
.param-row:last-child{border-bottom:none;}
.param-row:hover{background:rgba(255,255,255,0.02);}
.param-name{
  font-family:var(--font-mono);font-size:0.72rem;color:var(--brand);
  word-break:break-all;overflow-wrap:anywhere;min-width:0;
}
.param-req{font-family:var(--font-mono);font-size:0.64rem;color:var(--red);font-weight:600;}
.param-opt{font-family:var(--font-mono);font-size:0.64rem;color:var(--text-3);}
.param-desc{
  color:var(--text-2);font-size:0.82rem;line-height:1.65;
  min-width:0;word-break:break-word;overflow-wrap:break-word;
}

@media(max-width:700px){
  .params-head,.param-row{grid-template-columns:1fr 48px;}
  .params-head span:first-child,.param-name{grid-column:1;}
  .params-head span:nth-child(3),.param-desc{grid-column:1/-1;}
}

/* =================== DOC TABLE =================== */
.doc-table{
  width:max-content;
  min-width:100%;
  border-collapse:collapse;
  margin:1.25rem 0;
  font-size:0.82rem;
  table-layout:auto;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  overflow:hidden;
}
.doc-table thead th{
  text-align:left;padding:0.45rem 1rem;
  font-family:var(--font-mono);font-size:0.6rem;
  text-transform:uppercase;letter-spacing:0.08em;
  color:var(--text-muted);font-weight:600;
  border-bottom:1px solid var(--border);background:var(--bg-surface);
}
.doc-table thead th:first-child{border-radius:var(--radius-md) 0 0 0;}
.doc-table thead th:last-child{border-radius:0 var(--radius-md) 0 0;}
.doc-table tbody tr{border-bottom:1px solid var(--border);}
.doc-table tbody tr:last-child{border-bottom:none;}
.doc-table tbody tr:hover{background:rgba(255,255,255,0.02);}
.doc-table td{
  padding:0.6rem 1rem;color:var(--text-2);vertical-align:top;
  white-space:normal;word-break:normal;overflow-wrap:anywhere;
}
.doc-table td:first-child{color:var(--text);font-weight:500;}

/* Mobile table: shrink instead of hiding columns */
@media(max-width:768px){
  .doc-table{font-size:0.74rem;}
  .doc-table td,.doc-table th{padding:0.45rem 0.6rem;}
  .doc-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;}
}

/* =================== CALLOUTS =================== */
.callout{
  display:block;
  padding:0.9rem 1rem;margin:1.25rem 0;
  font-size:0.84rem;line-height:1.65;
  border-radius:var(--radius-md);border:1px solid;
}
.callout:has(.callout-icon){
  display:flex;
  gap:0.75rem;
}
.callout-info   {background:rgba(167,139,250,0.06);border-color:rgba(167,139,250,0.25);}
.callout-warning{background:rgba(251,191,36,0.06); border-color:rgba(251,191,36,0.25);}
.callout-success{background:rgba(139,92,246,0.06); border-color:rgba(139,92,246,0.25);}
.callout-tip    {background:rgba(96,165,250,0.06); border-color:rgba(96,165,250,0.25);}
.callout-danger {background:rgba(248,113,113,0.06);border-color:rgba(248,113,113,0.25);}
.callout-code   {background:rgba(139,92,246,0.04); border-color:rgba(139,92,246,0.18);font-family:var(--font-mono);font-size:0.78rem;}

/* ── NEW: planned / wip callout ── */
.callout-planned{
  background:rgba(99,102,241,0.04);
  border-color:rgba(99,102,241,0.2);
  border-style:dashed;
  opacity:0.85;
}
.callout-planned .callout-body{color:var(--text-3);}
.callout-planned strong{color:var(--text-2)!important;}

.callout-icon{flex-shrink:0;margin-top:1px;}
.callout-icon svg{width:14px;height:14px;}
.callout-body{color:var(--text-2);min-width:0;word-break:break-word;overflow-wrap:break-word;flex:1;}
.callout-body strong{color:var(--text);font-weight:600;}

/* =================== STATUS TABLE =================== */
.status-table{border:1px solid var(--border);border-radius:var(--radius-md);margin:1.25rem 0;overflow:hidden;}
.status-group-header{
  display:flex;align-items:center;gap:0.5rem;
  padding:0.4rem 1rem;background:var(--bg-surface2);
  border-bottom:1px solid var(--border);
  font-family:var(--font-mono);font-size:0.62rem;
  text-transform:uppercase;letter-spacing:0.08em;font-weight:600;
}
.sg-2xx{color:#a78bfa;}.sg-4xx{color:var(--red);}.sg-5xx{color:var(--amber);}
.status-row{
  display:grid;grid-template-columns:52px 130px 1fr;gap:0.75rem;
  padding:0.6rem 1rem;border-bottom:1px solid var(--border);
  font-size:0.82rem;align-items:start;min-width:0;
}
.status-row:last-child{border-bottom:none;}
.status-code{font-family:var(--font-mono);font-size:0.68rem;font-weight:700;padding:0.12rem 0.4rem;text-align:center;border-radius:4px;white-space:nowrap;}
.s-2xx{background:rgba(139,92,246,0.1);color:#a78bfa;border:1px solid rgba(139,92,246,0.25);}
.s-4xx{background:rgba(248,113,113,0.1);color:var(--red);border:1px solid rgba(248,113,113,0.25);}
.s-5xx{background:rgba(251,191,36,0.08);color:var(--amber);border:1px solid rgba(251,191,36,0.25);}
.status-name{color:var(--text);font-family:var(--font-mono);font-size:0.74rem;font-weight:500;word-break:break-word;min-width:0;}
.status-desc{color:var(--text-2);word-break:break-word;overflow-wrap:break-word;min-width:0;}

@media(max-width:600px){
  .status-row{grid-template-columns:48px 1fr;}
  .status-name{display:none;}
}

/* =================== FEATURE GRID =================== */
.feature-grid{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1.5rem 0;}
.feature-card{
  background:var(--bg-alt);padding:1.4rem;
  transition:transform 0.2s ease,box-shadow 0.2s ease,border-color 0.2s ease;
  display:block;text-decoration:none;
  border:1px solid var(--border);border-radius:var(--radius-lg);color:inherit;
}
.feature-card:hover{transform:translateY(-2px);box-shadow:0 8px 28px rgba(0,0,0,0.2);border-color:var(--border-2);text-decoration:none;}
.feature-card-icon{
  width:32px;height:32px;
  border:1px solid var(--border-2);background:var(--brand-faint);
  display:flex;align-items:center;justify-content:center;
  margin-bottom:0.875rem;border-radius:var(--radius-md);
}
.feature-card-icon svg{width:15px;height:15px;}
.feature-card-title{font-size:0.9rem;font-weight:600;color:var(--text);margin-bottom:0.4rem;display:flex;align-items:center;gap:0.4rem;}
.feature-card-desc{font-size:0.82rem;color:var(--text-2);line-height:1.65;}
@media(max-width:640px){.feature-grid{grid-template-columns:1fr;}}

/* =================== GATEWAY ROW =================== */
.gateway-row{border:1px solid var(--border);border-radius:var(--radius-md);margin:1.25rem 0;overflow:hidden;}
.gateway-item{
  display:grid;grid-template-columns:140px 80px 70px 1fr;
  align-items:center;gap:0.75rem;
  padding:0.7rem 1rem;border-bottom:1px solid var(--border);font-size:0.82rem;
  min-width:0;
}
.gateway-item:last-child{border-bottom:none;}
.gateway-item:hover{background:rgba(255,255,255,0.02);}
.gateway-name{font-family:var(--font-mono);font-size:0.72rem;color:var(--brand);font-weight:600;word-break:break-all;min-width:0;}
.gateway-status{display:flex;align-items:center;gap:0.35rem;min-width:0;}
.dot{width:5px;height:5px;border-radius:50%;display:inline-block;}
.dot-green{background:#a78bfa;box-shadow:0 0 4px #a78bfa;}
.dot-amber{background:var(--amber);box-shadow:0 0 4px var(--amber);}

/* =================== FLOW / MERMAID =================== */
.mermaid-wrap{
  border:1px solid var(--border-2);
  border-radius:var(--radius-lg);
  background:var(--bg-alt);
  padding:2rem 1.5rem;
  margin:1.5rem 0;
  overflow-x:auto;
  position:relative;
}
.mermaid-wrap::before{
  content:'diagram';
  position:absolute;top:0.5rem;right:0.75rem;
  font-family:var(--font-mono);font-size:0.55rem;
  text-transform:uppercase;letter-spacing:0.1em;
  color:var(--text-muted);
}
.mermaid-wrap .mermaid{display:flex;justify-content:center;min-height:80px;}
.mermaid-wrap svg{max-width:100%;height:auto;}

/* =================== GLOSSARY =================== */
.glossary-item{
  padding:0.85rem 0;border-bottom:1px solid var(--border);
  display:grid;grid-template-columns:140px 1fr;gap:1rem;align-items:baseline;
}
.glossary-item:last-child{border-bottom:none;}
.glossary-term{font-family:var(--font-mono);font-size:0.78rem;color:var(--brand);font-weight:500;word-break:break-word;min-width:0;}
.glossary-def{font-size:0.84rem;color:var(--text-2);line-height:1.65;word-break:break-word;min-width:0;}

/* =================== TIMELINE =================== */
.timeline{padding-left:1rem;border-left:2px solid var(--border);margin:1.25rem 0;}
.timeline-entry{position:relative;padding:0 0 1.5rem 1.25rem;}
.timeline-entry:last-child{padding-bottom:0;}
.timeline-entry::before{
  content:'';position:absolute;left:-7px;top:6px;
  width:10px;height:10px;border-radius:50%;
  background:var(--bg-surface2);border:2px solid var(--border-2);
}
.timeline-entry.current::before{background:var(--brand);border-color:var(--brand);box-shadow:0 0 7px var(--brand);}
.timeline-version{
  font-family:var(--font-mono);font-size:0.74rem;font-weight:600;
  color:var(--text);margin-bottom:0.2rem;
  display:flex;align-items:center;gap:0.5rem;
}
.timeline-date{font-family:var(--font-mono);font-size:0.63rem;color:var(--text-3);margin-bottom:0.5rem;}
.timeline-items{display:flex;flex-direction:column;gap:0.25rem;}
.timeline-item{font-size:0.82rem;color:var(--text-2);display:flex;align-items:baseline;gap:0.5rem;}
.timeline-item::before{content:'→';color:var(--text-3);font-size:0.72rem;flex-shrink:0;}

/* =================== HELPFUL =================== */
.helpful-widget{
  display:flex;align-items:center;gap:1rem;
  margin-top:2rem;padding:0.875rem 1rem;
  background:var(--bg-alt);border:1px solid var(--border);
  border-radius:var(--radius-md);font-size:0.82rem;flex-wrap:wrap;
}
.helpful-label{color:var(--text-2);}
.helpful-btns{display:flex;gap:0.4rem;}
.helpful-btn{
  display:flex;align-items:center;gap:0.3rem;
  padding:0.25rem 0.65rem;background:var(--bg-surface);
  border:1px solid var(--border);cursor:pointer;
  font-family:var(--font-mono);font-size:0.7rem;color:var(--text-3);
  transition:all var(--transition);border-radius:var(--radius);
}
.helpful-btn:hover.yes{color:#a78bfa;border-color:rgba(139,92,246,0.3);background:rgba(139,92,246,0.07);}
.helpful-btn:hover.no{color:var(--red);border-color:rgba(248,113,113,0.3);background:rgba(248,113,113,0.07);}
.helpful-btn.voted{pointer-events:none;}
.helpful-github{margin-left:auto;font-family:var(--font-mono);font-size:0.7rem;color:var(--text-3);}
.helpful-github a{color:var(--text-3);}
.helpful-github a:hover{color:var(--brand);}

/* =================== FOOTER =================== */
.doc-footer{
  margin-top:4rem;padding-top:1.5rem;
  border-top:1px solid var(--border);
  display:flex;align-items:center;justify-content:space-between;
  font-family:var(--font-mono);font-size:0.7rem;color:var(--text-3);
  flex-wrap:wrap;gap:0.5rem;
}
.doc-footer a{color:var(--brand);}

/* =================== LAST UPDATED =================== */
.last-updated{
  font-family:var(--font-mono);font-size:0.63rem;color:var(--text-3);
  margin-top:1.5rem;padding-top:0.75rem;
  border-top:1px solid var(--border);
  display:flex;align-items:center;gap:0.4rem;
}

/* =================== PREV/NEXT NAVIGATION =================== */
.page-nav{
  display:flex;
  justify-content:space-between;
  gap:1rem;
  margin-top:3rem;
  padding-top:1.5rem;
  border-top:1px solid var(--border);
  flex-wrap:wrap;
}
.page-nav-btn{
  display:flex;align-items:center;gap:0.65rem;
  padding:0.875rem 1.1rem;
  background:var(--bg-alt);border:1px solid var(--border);
  border-radius:var(--radius-md);text-decoration:none;
  transition:all var(--transition);min-width:160px;max-width:260px;flex:1;
  color:var(--text-2);
}
.page-nav-btn:hover{border-color:var(--border-2);background:var(--bg-surface);color:var(--text);text-decoration:none;transform:translateY(-1px);}
.page-nav-btn svg{width:16px;height:16px;flex-shrink:0;color:var(--text-3);}
.page-nav-btn span{display:flex;flex-direction:column;gap:0.1rem;min-width:0;}
.page-nav-label{font-family:var(--font-mono);font-size:0.6rem;text-transform:uppercase;letter-spacing:0.08em;color:var(--text-3);}
.page-nav-title{font-size:0.84rem;font-weight:500;color:var(--text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.page-nav-next{justify-content:flex-end;text-align:right;}
.page-nav-next span{align-items:flex-end;}
@media(max-width:600px){
  .page-nav-btn{min-width:0;max-width:none;flex:1 1 45%;}
}

/* =================== CMD PALETTE =================== */
.cmd-overlay{
  display:none;position:fixed;inset:0;
  background:rgba(0,0,0,0.7);backdrop-filter:blur(6px);
  z-index:1000;align-items:flex-start;justify-content:center;
  padding-top:14vh;
}
.cmd-overlay.open{display:flex;}
.cmd-modal{
  width:580px;max-width:calc(100vw - 2rem);
  background:var(--bg-alt);border:1px solid var(--border-2);
  border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);overflow:hidden;
}
.cmd-search{
  display:flex;align-items:center;gap:0.65rem;
  padding:0.875rem 1rem;border-bottom:1px solid var(--border);
}
.cmd-search svg{width:14px;height:14px;color:var(--text-3);flex-shrink:0;}
.cmd-input{
  flex:1;background:none;border:none;outline:none;
  color:var(--text);font-family:var(--font-sans);font-size:0.9rem;
  caret-color:var(--brand);
}
.cmd-input::placeholder{color:var(--text-3);}
.cmd-esc{
  font-family:var(--font-mono);font-size:0.62rem;
  background:var(--bg-surface);border:1px solid var(--border-2);
  padding:0.08rem 0.35rem;border-radius:4px;color:var(--text-3);cursor:pointer;flex-shrink:0;
}
.cmd-results{max-height:380px;overflow-y:auto;}
.cmd-section-label{
  font-family:var(--font-mono);font-size:0.6rem;text-transform:uppercase;
  letter-spacing:0.1em;color:var(--text-muted);padding:0.6rem 1rem 0.25rem;
}
.cmd-item{
  display:flex;align-items:center;gap:0.65rem;
  padding:0.5rem 1rem;cursor:pointer;
  transition:background var(--transition);border-left:2px solid transparent;
}
.cmd-item:hover,.cmd-item.focused{background:var(--brand-faint);border-left-color:var(--brand);}
.cmd-item-label{font-size:0.84rem;color:var(--text);font-weight:500;}
.cmd-item-sub{font-size:0.7rem;color:var(--text-3);font-family:var(--font-mono);margin-left:auto;flex-shrink:0;}
.cmd-footer{
  display:flex;align-items:center;gap:0.875rem;
  padding:0.5rem 1rem;border-top:1px solid var(--border);background:var(--bg-surface);
}
.cmd-hint{display:flex;align-items:center;gap:0.3rem;font-size:0.66rem;color:var(--text-3);}
.cmd-hint kbd{font-family:var(--font-mono);font-size:0.58rem;background:var(--bg-overlay);border:1px solid var(--border-2);padding:0.04rem 0.3rem;border-radius:3px;}

/* Search btn in topnav */
.topnav-search-btn{order:-1;}

/* =================== VERSION FLOAT =================== */
/* Hidden on mobile — it's decorative and clutters small screens */
.version-float{
  position:fixed;bottom:1.5rem;right:1.5rem;z-index:100;
  display:none; /* hidden by default, show on large screens */
}
@media(min-width:1024px){.version-float{display:block;}}
.version-btn{
  display:flex;align-items:center;gap:0.4rem;
  padding:0.4rem 0.75rem;background:var(--bg-alt);border:1px solid var(--border-2);
  border-radius:var(--radius-md);font-family:var(--font-mono);font-size:0.7rem;
  color:var(--text-2);cursor:pointer;transition:all var(--transition);box-shadow:var(--shadow);
}
.version-btn:hover{border-color:var(--border-3);color:var(--brand);}
.version-btn svg{width:10px;height:10px;transition:transform var(--transition);}
.version-btn.open svg{transform:rotate(180deg);}
.version-dropdown{
  position:absolute;bottom:calc(100% + 8px);right:0;
  background:var(--bg-alt);border:1px solid var(--border-2);
  border-radius:var(--radius-md);box-shadow:var(--shadow-lg);
  min-width:170px;display:none;overflow:hidden;
}
.version-float.open .version-dropdown{display:block;}
.version-dd-item{
  display:flex;align-items:center;justify-content:space-between;
  padding:0.45rem 0.8rem;font-family:var(--font-mono);font-size:0.72rem;
  color:var(--text-2);cursor:pointer;transition:background var(--transition);gap:0.5rem;
}
.version-dd-item:hover{background:var(--bg-surface2);}
.version-dd-item.current{color:var(--brand);}

/* =================== MOBILE DRAWER =================== */
.mobile-drawer{
  position:fixed;top:var(--header-h);left:0;bottom:0;
  width:280px;background:var(--bg);
  border-right:1px solid var(--border);
  overflow-y:auto;
  transform:translateX(-100%);
  transition:transform 0.25s ease;
  z-index:490;
  padding:1rem 0.75rem 2rem;
}
.mobile-drawer.open{transform:translateX(0);}
.mobile-drawer-overlay{
  display:none;position:fixed;inset:0;top:var(--header-h);
  background:rgba(0,0,0,0.55);backdrop-filter:blur(3px);z-index:489;
}
.mobile-drawer-overlay.open{display:block;}

/* =================== RESPONSIVE =================== */
@media(max-width:768px){
  .hero-title{font-size:1.8rem;}
}

/* =================== SECTION HEADER META =================== */
.section-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:0.35rem;gap:1rem;}
.reading-time{font-family:var(--font-mono);font-size:0.63rem;color:var(--text-3);display:flex;align-items:center;gap:0.3rem;flex-shrink:0;margin-top:0.1rem;}

.reading-time svg { width: 12px; height: 12px; }
/* =================== LIB GRID =================== */
.lib-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:0.875rem;margin:1.5rem 0;}
.lib-card{
  display:flex;flex-direction:column;align-items:center;gap:0.5rem;
  padding:1.25rem 0.75rem;
  background:var(--bg-alt);border:1px solid var(--border);border-radius:var(--radius-lg);
  text-decoration:none;color:inherit;
  transition:transform 0.2s ease,box-shadow 0.2s ease,border-color 0.2s ease;
}
.lib-card:hover{transform:translateY(-2px);box-shadow:0 6px 22px rgba(0,0,0,0.25);border-color:var(--border-2);text-decoration:none;}
.lib-card-icon{width:44px;height:44px;display:flex;align-items:center;justify-content:center;border-radius:50%;background:var(--bg-surface);border:1px solid var(--border);}
.lib-card-icon img,.lib-card-icon svg{width:24px;height:24px;}
.lib-card-name{font-family:var(--font-mono);font-size:0.72rem;font-weight:600;color:var(--text);}
.lib-card-desc{font-size:0.7rem;color:var(--text-3);text-align:center;line-height:1.4;}
@media(max-width:640px){.lib-grid{grid-template-columns:repeat(2,1fr);}}

/* =================== DOC PAGE COMPAT VARS =================== */
:root {
  --topnav-h:     var(--header-h);
  --sidebar-w:    244px;
  --bg-1:         var(--bg-alt);
  --bg-2:         var(--bg-surface);
  --bg-3:         var(--bg-surface2);
  --purple-light: var(--purple);
  --purple-mid:   var(--brand-dark);
  --purple-faint: var(--brand-faint);
  --indigo:       #818cf8;
  --emerald:      #34d399;
}
[data-theme="light"] {
  --bg-1: var(--bg-alt);
  --bg-2: var(--bg-surface);
  --bg-3: var(--bg-surface2);
}

/* =================== TOPNAV (doc pages) =================== */
.topnav{
  position:fixed;top:0;left:0;right:0;
  height:var(--topnav-h);
  background:rgba(7,7,10,0.92);
  backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);
  border-bottom:1px solid var(--border);
  z-index:500;
  transition:background var(--transition);
}
[data-theme="light"] .topnav{background:rgba(249,249,249,0.92);}
.topnav-inner{
  max-width:1200px;margin:0 auto;
  display:flex;align-items:center;
  height:100%;padding:0 1.5rem;gap:1rem;
}
.topnav-logo{
  display:flex;align-items:center;gap:0.5rem;
  text-decoration:none;flex-shrink:0;
}
.topnav-logo:hover{text-decoration:none;}
.topnav-logo-mark{
  width:26px;height:26px;
  background:linear-gradient(135deg,#7c3aed 0%,#a78bfa 100%);
  border-radius:6px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
  box-shadow:0 0 14px rgba(139,92,246,0.35);
}
.topnav-logo-mark svg{width:14px;height:14px;}
.topnav-logo-text{font-family:var(--font-mono);font-weight:600;font-size:0.85rem;color:var(--text);letter-spacing:0.02em;}
.topnav-version{font-family:var(--font-mono);font-size:0.6rem;color:var(--text-3);border:1px solid var(--border);padding:0.05rem 0.3rem;border-radius:3px;margin-left:0.1rem;}
.topnav-right{display:flex;align-items:center;gap:0.5rem;margin-left:auto;}
.topnav-icon-btn{
  width:32px;height:32px;display:flex;align-items:center;justify-content:center;
  background:none;border:1px solid var(--border);border-radius:var(--radius);
  color:var(--text-3);cursor:pointer;
  transition:all var(--transition);text-decoration:none;
  flex-shrink:0;
}
.topnav-icon-btn:hover{color:var(--brand);border-color:var(--border-2);text-decoration:none;}
.topnav-icon-btn svg{width:14px;height:14px;}

/* =================== SIDEBAR (doc pages) =================== */
.sidebar{
  position:fixed;
  top:var(--topnav-h);
  left:0;
  bottom:0;
  width:var(--sidebar-w);
  background:var(--bg);
  border-right:1px solid var(--border);
  overflow-y:auto;
  overflow-x:hidden;
  padding:1rem 0 3rem;
  z-index:400;
}
.sidebar::-webkit-scrollbar{width:3px;}
.sidebar::-webkit-scrollbar-thumb{background:var(--border-2);}
.sidebar-section{margin-bottom:0.25rem;}
.sidebar-section-label{
  font-family:var(--font-mono);font-size:0.58rem;
  text-transform:uppercase;letter-spacing:0.12em;
  color:var(--text-3);font-weight:600;
  padding:0.6rem 1rem 0.25rem;
}
.sidebar-item{
  display:flex;align-items:center;gap:0.45rem;
  padding:0.26rem 1rem;color:var(--text-3);
  font-size:0.78rem;text-decoration:none;cursor:pointer;
  transition:color var(--transition),background var(--transition);
  border-left:2px solid transparent;font-weight:400;
}
.sidebar-item:hover{color:var(--text-2);}
.sidebar-item.active{color:var(--brand);border-left-color:var(--brand);background:var(--brand-faint);font-weight:500;}
@media(max-width:900px){
  .sidebar{display:none;}
}

/* =================== DOC SHELL LAYOUT =================== */
.shell{
  display:flex;
  min-height:100vh;
  position:relative;z-index:1;
  padding-left:var(--sidebar-w);
}
.shell .main{
  flex:1;
  min-width:0;
  padding:calc(var(--topnav-h) + 2.5rem) 2.5rem 6rem;
  overflow-x:auto;
  word-break:break-word;
  max-width:860px;
}
.shell .subpage-toc{
  flex-shrink:0;
}
@media(max-width:900px){
  .shell{padding-left:0;display:block;}
  .shell .main{padding:calc(var(--topnav-h) + 1.5rem) 1.25rem 5rem;max-width:none;}
}

/* Títulos dentro do shell main */
.shell .main h1.section-title{
  font-family:var(--font-display);
  font-size:1.85rem;font-weight:700;
  letter-spacing:-0.03em;line-height:1.15;
  margin-bottom:0.75rem;
}
.shell .main h2{
  font-family:var(--font-display);
  font-size:1.05rem;font-weight:600;color:var(--text);
  margin:2.25rem 0 0.75rem;letter-spacing:-0.02em;
}
.shell .main h3{
  font-size:0.88rem;font-weight:600;color:var(--text);
  margin:1.5rem 0 0.5rem;letter-spacing:-0.01em;
}

/* =================== READING TIME BADGE =================== */
.reading-time-badge{
  display:inline-flex;align-items:center;gap:0.3rem;
  font-family:var(--font-mono);font-size:0.63rem;color:var(--text-3);
  margin-bottom:1rem;
}
.reading-time-badge svg{width:11px;height:11px;}
