/* ============================================================================
   BundleBee Docs - shared GitBook-style stylesheet
   Owned by the Overview docs agent. Reused by every docs page + both sibling
   agents. Gold / cream / near-black honeycomb identity. Light + dark.
   No em/en dashes anywhere in content. Token-driven so themes stay consistent.
   ========================================================================== */

/* House font: Inter (same as the terminal + PolyOrb). Must precede @font-face. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---- Sora headings (retained but unused; the vars below use Inter) --------- */
@font-face {
  font-family: "Sora";
  font-weight: 300;
  font-display: swap;
  src: url("../../cdn.prod.website-files.com/678bd24828627be671173403/678fd03912339016685b51ce_Sora-Light.ttf") format("truetype");
}
@font-face {
  font-family: "Sora";
  font-weight: 400;
  font-display: swap;
  src: url("../../cdn.prod.website-files.com/678bd24828627be671173403/678fd02f682a1ba2ff3fb5ae_Sora-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "Sora";
  font-weight: 500;
  font-display: swap;
  src: url("../../cdn.prod.website-files.com/678bd24828627be671173403/678fd036a98979ff5f15b8b1_Sora-Medium.ttf") format("truetype");
}
@font-face {
  font-family: "Sora";
  font-weight: 700;
  font-display: swap;
  src: url("../../cdn.prod.website-files.com/678bd24828627be671173403/678fd033a27724e06ad17df0_Sora-Bold.ttf") format("truetype");
}

/* ---- Design tokens: LIGHT (default) -------------------------------------- */
:root {
  --gold:        #F5B301;
  --gold-2:      #FFBE2E;
  --gold-deep:   #E08A00;
  --ink:         #1a1206;

  --bg:          #ffffff;
  --bg-2:        #fbf7ee;         /* app frame / body ground */
  --sidebar-bg:  #fdfaf3;
  --surface:     #ffffff;
  --surface-2:   #fbf6ea;
  --surface-3:   #f6efdf;

  --text:        #241a0b;
  --text-soft:   #4d4331;
  --text-muted:  #7a6f59;
  --text-dim:    #9c927c;

  --line:        #ece3cf;
  --line-strong: #d9cdae;

  --accent:      #E79B00;         /* readable gold for links/text on light */
  --accent-soft: #fdf1d2;
  --accent-line: #f4d68a;

  --code-bg:     #fbf5e7;
  --code-line:   #eaddc0;
  --code-text:   #6b4e12;
  --kbd-bg:      #fff;

  --shadow-sm:   0 1px 2px rgba(60,44,10,.06), 0 1px 1px rgba(60,44,10,.04);
  --shadow-md:   0 6px 20px rgba(70,52,12,.10), 0 2px 6px rgba(70,52,12,.06);
  --shadow-lg:   0 20px 50px rgba(60,44,10,.16);

  /* callouts */
  --info:   #2f80c9;  --info-bg:   #eaf4fd;  --info-line:   #bfdcf6;
  --tip:    #1f9d64;  --tip-bg:    #e8f8ef;  --tip-line:    #bfe9d1;
  --warn:   #C77800;  --warn-bg:   #fdf1d8;  --warn-line:   #f3d79a;
  --danger: #d0453b;  --danger-bg: #fceceb;  --danger-line: #f4c6c2;

  --r-sm: 7px;
  --r:    11px;
  --r-lg: 16px;

  --topbar-h: 60px;
  --side-w:   282px;
  --toc-w:    236px;
  --maxw:     1560px;

  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --head: "Inter", var(--sans);
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;

  color-scheme: light;
}

/* ---- Design tokens: DARK -------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:          #12100b;
    --bg-2:        #0d0b07;
    --sidebar-bg:  #14110b;
    --surface:     #191510;
    --surface-2:   #1f1a12;
    --surface-3:   #251f15;

    --text:        #f3ead6;
    --text-soft:   #d7cbb1;
    --text-muted:  #a99d82;
    --text-dim:    #857a63;

    --line:        #2b2417;
    --line-strong: #3a3120;

    --accent:      #FFC53D;
    --accent-soft: #2a2110;
    --accent-line: #4a3a16;

    --code-bg:     #17130c;
    --code-line:   #302716;
    --code-text:   #f0cf86;
    --kbd-bg:      #241d12;

    --shadow-sm:   0 1px 2px rgba(0,0,0,.4);
    --shadow-md:   0 8px 26px rgba(0,0,0,.5);
    --shadow-lg:   0 24px 60px rgba(0,0,0,.6);

    --info:   #63b1f0;  --info-bg:   #14202c;  --info-line:   #274257;
    --tip:    #57d497;  --tip-bg:    #10241a;  --tip-line:    #234c38;
    --warn:   #FFC53D;  --warn-bg:   #241c0c;  --warn-line:   #4a3915;
    --danger: #ff7a6e;  --danger-bg: #2a1512;  --danger-line: #522722;

    color-scheme: dark;
  }
}

/* explicit dark toggle wins in both directions */
:root[data-theme="dark"] {
  --bg:          #12100b;
  --bg-2:        #0d0b07;
  --sidebar-bg:  #14110b;
  --surface:     #191510;
  --surface-2:   #1f1a12;
  --surface-3:   #251f15;
  --text:        #f3ead6;
  --text-soft:   #d7cbb1;
  --text-muted:  #a99d82;
  --text-dim:    #857a63;
  --line:        #2b2417;
  --line-strong: #3a3120;
  --accent:      #FFC53D;
  --accent-soft: #2a2110;
  --accent-line: #4a3a16;
  --code-bg:     #17130c;
  --code-line:   #302716;
  --code-text:   #f0cf86;
  --kbd-bg:      #241d12;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.4);
  --shadow-md:   0 8px 26px rgba(0,0,0,.5);
  --shadow-lg:   0 24px 60px rgba(0,0,0,.6);
  --info:   #63b1f0;  --info-bg:   #14202c;  --info-line:   #274257;
  --tip:    #57d497;  --tip-bg:    #10241a;  --tip-line:    #234c38;
  --warn:   #FFC53D;  --warn-bg:   #241c0c;  --warn-line:   #4a3915;
  --danger: #ff7a6e;  --danger-bg: #2a1512;  --danger-line: #522722;
  color-scheme: dark;
}

/* ---- Reset / base -------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 18px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--text);
  background: var(--bg-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--gold) 34%, transparent); }

/* ============================================================================
   TOP BAR
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
/* Gold brand accent ribbon pinned across the very top of every page */
.topbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-2) 16%, var(--gold) 50%, var(--gold-2) 84%, transparent);
  opacity: .85; pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0,0,0,.28)); }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 19px; letter-spacing: -.02em; color: var(--text); }
.brand-name em { font-style: normal; font-weight: 500; color: var(--accent); }
.brand-badge {
  font-family: var(--head); font-weight: 700; font-size: 9.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  padding: 2px 7px; border-radius: 999px; margin-left: 2px;
}

.topbar-search { position: relative; flex: 1; max-width: 460px; margin-left: 6px; }
.topbar-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-dim); pointer-events: none; }
#doc-search {
  width: 100%; height: 38px; padding: 0 40px 0 36px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font: inherit; font-size: 13.5px; outline: none;
  transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
#doc-search::placeholder { color: var(--text-dim); }
#doc-search:focus { border-color: var(--gold); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 10.5px; color: var(--text-dim);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 6px; background: var(--kbd-bg);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.theme-toggle, .hamburger {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-muted);
  cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.theme-toggle:hover, .hamburger:hover { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun { }
.hamburger { display: none; }
.hamburger svg { width: 22px; height: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 16px; border-radius: 999px;
  font-family: var(--head); font-weight: 600; font-size: 13.5px; line-height: 1;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: transform .1s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  color: var(--ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--gold) 45%, transparent);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 55%, transparent); }
.btn-ghost { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--accent); }
.btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .btn .btn-label-lg { display: none; } .topbar-actions .btn { padding: 0 12px; } }

/* ============================================================================
   LAYOUT
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  max-width: var(--maxw);
  margin: 0 auto;
  align-items: start;
}

/* ---- Sidebar ------------------------------------------------------------- */
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 20px 14px 40px;
}
.sidebar::-webkit-scrollbar { width: 9px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--sidebar-bg); }
.sidebar::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

.nav-group { margin-bottom: 20px; }
.nav-group-label {
  font-family: var(--head); font-weight: 700; font-size: 10.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--text-dim);
  display: flex; align-items: center; gap: 7px;
  padding: 4px 12px 8px; cursor: pointer; user-select: none;
}
.nav-group-label .chev { margin-left: auto; width: 13px; height: 13px; transition: transform .18s ease; color: var(--text-dim); }
.nav-group.collapsed .chev { transform: rotate(-90deg); }
.nav-group.collapsed .nav-list { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; margin: 1px 0; border-radius: 9px;
  color: var(--text-soft); font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  transition: background .1s ease, color .1s ease;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link .nav-ico { width: 17px; height: 17px; flex: none; color: var(--text-dim); transition: color .1s; }
.nav-link:hover .nav-ico { color: var(--accent); }
.nav-link.active {
  background: var(--accent-soft);
  color: var(--gold-deep); font-weight: 650;
  border-color: var(--accent-line);
  box-shadow: inset 3px 0 0 var(--gold);
}
:root[data-theme="dark"] .nav-link.active,
:root:not([data-theme="light"]) .nav-link.active { color: var(--gold-2); }
.nav-link.active .nav-ico { color: var(--gold); }
.nav-empty { padding: 10px 14px; font-size: 12.5px; color: var(--text-dim); }

.sidebar-foot { margin-top: 26px; padding: 14px 12px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-dim); }
.sidebar-foot a { color: var(--text-muted); }

/* ---- Content ------------------------------------------------------------- */
.content { min-width: 0; padding: 34px clamp(20px, 4vw, 60px) 90px; }
.doc { max-width: 820px; margin: 0 auto; }

.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); margin-bottom: 18px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb .sep { color: var(--line-strong); }
.breadcrumb .here { color: var(--text-soft); }

.doc h1 {
  font-family: var(--head); font-weight: 700; font-size: clamp(30px, 4.4vw, 42px);
  line-height: 1.1; letter-spacing: -.025em; margin: 6px 0 12px; color: var(--text);
}
.doc h2 {
  font-family: var(--head); font-weight: 700; font-size: 25px; letter-spacing: -.02em;
  margin: 52px 0 14px; padding-top: 10px; color: var(--text); scroll-margin-top: 80px;
}
.doc h2::before {
  content: ""; display: block; width: 34px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2)); margin-bottom: 14px;
}
.doc h3 {
  font-family: var(--head); font-weight: 600; font-size: 18.5px; letter-spacing: -.01em;
  margin: 34px 0 10px; color: var(--text); scroll-margin-top: 80px;
}
.doc h4 { font-family: var(--head); font-weight: 600; font-size: 15px; margin: 24px 0 8px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .05em; }
.doc p { margin: 0 0 15px; color: var(--text-soft); }
.doc strong { color: var(--text); font-weight: 650; }
.doc .lead { font-size: 18.5px; line-height: 1.6; color: var(--text-muted); margin-bottom: 24px; }
.doc ul, .doc ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-soft); }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--gold-deep); }
.doc a.inline, .doc p a, .doc li a { font-weight: 550; border-bottom: 1px solid var(--accent-line); }
.doc a.inline:hover, .doc p a:hover, .doc li a:hover { text-decoration: none; border-bottom-color: var(--gold); }
.doc hr {
  border: none; height: 1px; margin: 40px 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 14%, var(--accent-line) 50%, var(--line-strong) 86%, transparent);
}

.anchor-h { position: relative; }
.anchor-h .anchor {
  position: absolute; left: -24px; top: 50%; transform: translateY(-50%);
  opacity: 0; color: var(--text-dim); font-weight: 400; transition: opacity .12s;
}
.anchor-h:hover .anchor { opacity: 1; text-decoration: none; }

/* Inline code + keyboard */
code {
  font-family: var(--mono); font-size: .86em;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--code-line); border-radius: 6px; padding: .1em .4em;
}
kbd {
  font-family: var(--mono); font-size: .82em; color: var(--text);
  background: var(--kbd-bg); border: 1px solid var(--line-strong);
  border-bottom-width: 2px; border-radius: 6px; padding: .1em .5em;
}

/* Code blocks */
.doc pre {
  position: relative; margin: 0 0 20px; padding: 16px 18px;
  background: var(--code-bg); border: 1px solid var(--code-line); border-radius: var(--r);
  overflow-x: auto; box-shadow: var(--shadow-sm);
}
.doc pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 13px; line-height: 1.7; }
.code-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--head); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-dim); margin: 0 0 8px;
}
.tok-key { color: var(--accent); } .tok-str { color: var(--tip); } .tok-com { color: var(--text-dim); font-style: italic; } .tok-num { color: var(--info); }

/* ============================================================================
   COMPONENTS
   ========================================================================== */

/* Callouts / hints */
.callout {
  display: grid; grid-template-columns: 26px 1fr; gap: 13px; align-items: start;
  margin: 22px 0; padding: 15px 17px;
  border: 1px solid var(--info-line); border-left-width: 4px;
  background: var(--info-bg); border-radius: var(--r); color: var(--text-soft);
}
.callout .c-ico { width: 22px; height: 22px; color: var(--info); margin-top: 1px; }
.callout p { margin: 0 0 6px; }
.callout p:last-child { margin: 0; }
.callout .c-title { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--info); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 4px; }
.callout.tip    { border-color: var(--tip-line);    background: var(--tip-bg); }
.callout.tip    .c-ico, .callout.tip .c-title { color: var(--tip); }
.callout.warn   { border-color: var(--warn-line);   background: var(--warn-bg); }
.callout.warn   .c-ico, .callout.warn .c-title { color: var(--warn); }
.callout.danger { border-color: var(--danger-line); background: var(--danger-bg); }
.callout.danger .c-ico, .callout.danger .c-title { color: var(--danger); }

/* Figure + caption */
figure.fig { margin: 26px 0; }
figure.fig img, figure.fig video, figure.fig .diagram {
  width: 100%; display: block; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-md);
}
figure.fig.plain img, figure.fig.plain .diagram { box-shadow: var(--shadow-sm); }
figure.fig.shot img, figure.fig.shot video { background: #0d1117; }
figure.fig.tel img { max-width: 400px; margin: 0 auto; }
figure.fig figcaption { margin-top: 10px; font-size: 12.8px; color: var(--text-dim); text-align: center; }
figure.fig figcaption b { color: var(--text-muted); }
.diagram-wrap { padding: 20px 18px; }
figure.fig.diagram-fig .diagram { padding: 18px; }

/* two-up media row */
.media-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0; }
.media-row figure.fig { margin: 0; }
@media (max-width: 720px) { .media-row { grid-template-columns: 1fr; } }

/* Hero (home + page tops) */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); border: 1px solid var(--accent-line);
  background:
    radial-gradient(1200px 420px at 82% -30%, color-mix(in srgb, var(--gold-2) 34%, transparent), transparent 60%),
    linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  padding: 40px clamp(24px, 4vw, 48px);
  margin: 0 0 34px; box-shadow: var(--shadow-md);
}
.hero::after {
  content: ""; position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='96' viewBox='0 0 56 96'><g fill='none' stroke='%23F5B301' stroke-opacity='0.14' stroke-width='2'><path d='M28 0l24 14v28L28 56 4 42V14z'/><path d='M28 56l24 14v28M28 56L4 70v28M52 42l24-14M4 42l-24-14'/></g></svg>");
}
.hero > * { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1fr 210px; gap: 28px; align-items: center; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--head); font-weight: 600; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gold-deep); background: var(--accent-soft); border: 1px solid var(--accent-line);
  padding: 4px 11px; border-radius: 999px; margin-bottom: 14px;
}
:root[data-theme="dark"] .hero-eyebrow, :root:not([data-theme="light"]) .hero-eyebrow { color: var(--gold-2); }
.hero h1 { font-family: var(--head); font-weight: 700; font-size: clamp(30px, 5vw, 46px); line-height: 1.06; letter-spacing: -.03em; margin: 0 0 14px; color: var(--text); }
.hero h1 .gold { background: linear-gradient(120deg, var(--gold-deep), var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: 17px; color: var(--text-muted); margin: 0 0 22px; max-width: 54ch; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-bee { width: 100%; max-width: 210px; filter: drop-shadow(0 12px 26px rgba(180,120,0,.35)); animation: beeFloat 5s ease-in-out infinite; }
@keyframes beeFloat { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) { .hero-bee, .hero-bee { animation: none; } }
@media (max-width: 720px) { .hero-grid { grid-template-columns: 1fr; } .hero-bee { display: none; } }

/* Feature grid cards */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 24px 0 8px; }
.feature-card {
  display: block; padding: 20px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .12s ease, box-shadow .14s ease, border-color .14s ease;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-line); text-decoration: none; }
.feature-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  margin-bottom: 13px; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--gold-deep);
}
:root[data-theme="dark"] .feature-ico, :root:not([data-theme="light"]) .feature-ico { color: var(--gold-2); }
.feature-ico svg { width: 24px; height: 24px; }
.feature-card h3 { font-family: var(--head); font-weight: 650; font-size: 16.5px; margin: 0 0 6px; color: var(--text); }
.feature-card p { font-size: 13.6px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.feature-card .fc-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-family: var(--head); font-weight: 600; font-size: 12.5px; color: var(--accent); }
.feature-card .fc-more svg { width: 13px; height: 13px; transition: transform .12s; }
.feature-card:hover .fc-more svg { transform: translateX(3px); }

/* Numbered steps */
.steps { list-style: none; counter-reset: step; margin: 26px 0; padding: 0; }
.steps > li {
  position: relative; counter-increment: step;
  padding: 2px 0 24px 54px; margin: 0;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--head); font-weight: 700; font-size: 15px; color: var(--ink);
  background: linear-gradient(135deg, var(--gold-2), var(--gold));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--gold) 45%, transparent);
}
.steps > li::after {
  content: ""; position: absolute; left: 16.5px; top: 38px; bottom: 4px; width: 2px;
  background: var(--accent-line);
}
.steps > li:last-child::after { display: none; }
.steps > li h3 { margin: 4px 0 6px; font-size: 17px; }
.steps > li p { margin: 0 0 8px; }
.steps > li p:last-child { margin: 0; }

/* Stat / metric row */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 24px 0; }
.stat {
  padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.stat .stat-val { font-family: var(--head); font-weight: 700; font-size: 26px; letter-spacing: -.02em; color: var(--text); line-height: 1; }
.stat .stat-val .u { font-size: 15px; color: var(--gold-deep); }
:root[data-theme="dark"] .stat .stat-val .u, :root:not([data-theme="light"]) .stat .stat-val .u { color: var(--gold-2); }
.stat .stat-lab { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 22px 0; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); }
table.doc-table { width: 100%; border-collapse: collapse; font-size: 13.8px; background: var(--surface); }
table.doc-table th, table.doc-table td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line); }
table.doc-table thead th {
  font-family: var(--head); font-weight: 650; font-size: 12px; letter-spacing: .03em; text-transform: uppercase;
  color: var(--text-muted); background: var(--surface-2);
}
table.doc-table tbody tr:last-child td { border-bottom: none; }
table.doc-table tbody tr:hover { background: var(--surface-2); }
table.doc-table td strong { color: var(--text); }
table.doc-table code { white-space: nowrap; }

/* Pills / badges */
.pill { display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-weight: 600; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-muted); background: var(--surface-2); vertical-align: middle; }
.pill.gold { color: var(--gold-deep); background: var(--accent-soft); border-color: var(--accent-line); }
:root[data-theme="dark"] .pill.gold, :root:not([data-theme="light"]) .pill.gold { color: var(--gold-2); }
.pill.green { color: var(--tip); background: var(--tip-bg); border-color: var(--tip-line); }
.pill.blue { color: var(--info); background: var(--info-bg); border-color: var(--info-line); }
.pill-logo { width: 14px; height: 14px; border-radius: 4px; object-fit: cover; }

/* Definition cards / role cards */
.card-list { display: grid; gap: 14px; margin: 22px 0; }
.rcard {
  display: grid; grid-template-columns: 46px 1fr; gap: 15px;
  padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.rcard .rcard-ico { width: 46px; height: 46px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--gold-deep); }
:root[data-theme="dark"] .rcard .rcard-ico, :root:not([data-theme="light"]) .rcard .rcard-ico { color: var(--gold-2); }
.rcard .rcard-ico svg { width: 24px; height: 24px; }
.rcard h4 { margin: 0 0 4px; font-family: var(--head); font-weight: 650; font-size: 15.5px; color: var(--text); text-transform: none; letter-spacing: 0; }
.rcard p { margin: 0; font-size: 13.6px; color: var(--text-muted); }

/* Logo chip row */
.logo-strip { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.logo-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--head); font-weight: 600; font-size: 13px; color: var(--text-soft); box-shadow: var(--shadow-sm);
}
.logo-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; }

/* Prev / next pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 54px 0 10px; }
.pager a {
  display: block; padding: 15px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.pager a:hover { border-color: var(--gold); box-shadow: var(--shadow-sm); text-decoration: none; }
.pager .pg-dir { font-size: 12px; color: var(--text-dim); font-family: var(--head); font-weight: 600; letter-spacing: .04em; }
.pager .pg-title { font-family: var(--head); font-weight: 650; color: var(--text); margin-top: 3px; }
.pager a.next { text-align: right; }
.pager a.only { grid-column: 2; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager a.only { grid-column: 1; } }

/* On-this-page TOC */
.toc { position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 34px 20px 40px 6px; }
.toc-title { font-family: var(--head); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); margin: 0 0 12px; padding-left: 12px; }
#toc-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
#toc-list a { display: block; padding: 5px 12px; margin-left: -2px; font-size: 12.8px; color: var(--text-muted); border-left: 2px solid transparent; line-height: 1.4; }
#toc-list a:hover { color: var(--text); text-decoration: none; }
#toc-list a.lvl-3 { padding-left: 24px; font-size: 12.3px; }
#toc-list a.active { color: var(--accent); border-left-color: var(--gold); font-weight: 600; }
.toc-foot { margin-top: 22px; padding: 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-muted); }
.toc-foot a { font-weight: 600; }

/* ---- Diagram theming (inline SVG) ---------------------------------------- */
.diagram { display: block; width: 100%; height: auto; font-family: var(--head); }
.diagram .d-box { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .d-box-2 { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.5; }
.diagram .d-box-gold { fill: var(--accent-soft); stroke: var(--gold); stroke-width: 1.75; }
.diagram .d-fill-gold { fill: var(--gold); }
.diagram .d-fill-gold2 { fill: var(--gold-2); }
.diagram .d-stroke-gold { stroke: var(--gold); fill: none; }
.diagram .d-line { stroke: var(--line-strong); stroke-width: 1.5; fill: none; }
.diagram .d-flow { stroke: var(--gold); stroke-width: 2.25; fill: none; }
.diagram .d-flow-dash { stroke: var(--gold); stroke-width: 2; fill: none; stroke-dasharray: 5 5; }
.diagram .d-title { fill: var(--text); font-weight: 700; font-size: 14px; }
.diagram .d-text { fill: var(--text); font-weight: 600; font-size: 12.5px; }
.diagram .d-sub { fill: var(--text-muted); font-weight: 500; font-size: 10.5px; }
.diagram .d-mono { font-family: var(--mono); fill: var(--text-soft); font-size: 10.5px; font-weight: 400; }
.diagram .d-accent-t { fill: var(--gold-deep); font-weight: 700; }
:root[data-theme="dark"] .diagram .d-accent-t, :root:not([data-theme="light"]) .diagram .d-accent-t { fill: var(--gold-2); }
.diagram .d-chip { fill: var(--surface-3); stroke: var(--line); stroke-width: 1; }
.diagram .d-good { fill: var(--tip); } .diagram .d-bad { fill: var(--danger); }
.diagram .d-good-box { fill: var(--tip-bg); stroke: var(--tip-line); stroke-width: 1.5; }
.diagram .d-bad-box { fill: var(--danger-bg); stroke: var(--danger-line); stroke-width: 1.5; }
.diagram .d-info-box { fill: var(--info-bg); stroke: var(--info-line); stroke-width: 1.5; }

/* scrim for mobile drawer */
.scrim { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(20,14,4,.5); backdrop-filter: blur(2px); }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .hamburger { display: grid; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; z-index: 58;
    width: min(310px, 86vw); height: calc(100vh - var(--topbar-h));
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  body.nav-open .scrim { display: block; }
  .content { padding: 26px 20px 80px; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand-name { font-size: 17px; }
  .search-kbd { display: none; }
  .doc h1 { font-size: 28px; }
  .hero { padding: 28px 22px; }
}

/* print-ish / focus a11y */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
