/* ─── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
  --ink:     #0d0e10;
  --ink2:    #12141a;
  --surface: #181b24;
  --card:    #1e2230;
  --card2:   #242938;
  --line:    #2a2f3d;
  --line2:   #353c50;
  --muted:   #5a6275;
  --soft:    #8a92a6;
  --body:    #c4cad8;
  --head:    #e8ecf4;
  --white:   #f5f7ff;

  --gold:    #c9a84c;
  --gold2:   #e8c96a;
  --teal:    #3eada8;
  --teal2:   #52cdc8;
  --blue:    #2e5fa3;
  --blue2:   #4d7fc7;
  --green:   #4b7c3e;
  --olive:   #7b8c4e;
  --rust:    #9e4f3a;
  --purple:  #7c5cbf;

  --r: 12px;
  --r2: 20px;
  --tr: cubic-bezier(.25,.8,.25,1);

  --code-bg: #0c0e14;
  --code-border: #232938;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--ink);
  color: var(--body);
  font-family: 'Outfit', sans-serif;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
}

/* Subtle film-grain overlay */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }

h1, h2, h3, h4, h5 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; color: var(--head); line-height: 1.2; }
.mono { font-family: 'DM Mono', ui-monospace, Menlo, Consolas, monospace; }

a { color: var(--teal2); text-decoration: none; transition: color .2s var(--tr); }
a:hover { color: var(--gold2); }

/* ─── NAV ───────────────────────────────────────────────────── */
nav.top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 2.5rem;
  background: rgba(13,14,16,.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; font-weight: 600; letter-spacing: .06em;
  color: var(--gold);
  flex-shrink: 0;
}
.nav-logo span { color: var(--soft); font-weight: 300; font-size: .9em; }

/* On desktop the wrapper is invisible to layout — children flow inside nav.top.
   On mobile the wrapper becomes a slide-in panel (rules in the @media block). */
.nav-panel { display: contents; }
.nav-links { display: flex; gap: .35rem; list-style: none; align-items: center; flex: 1; }
.nav-right { display: flex; gap: .5rem; list-style: none; align-items: center; flex-shrink: 0; }

/* Desktop dropdown menus + standalone nav links share trigger styling. */
.nav-group { position: relative; }
.nav-trigger,
.nav-standalone .nav-link {
  display: inline-flex; align-items: center; gap: .35rem;
  background: transparent; border: 1px solid transparent;
  padding: .5rem .8rem; border-radius: 8px;
  font-family: 'DM Mono', monospace;
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--soft); cursor: pointer;
  transition: all .2s var(--tr);
  text-decoration: none;
}
.nav-standalone .nav-link:hover,
.nav-standalone .nav-link.active {
  color: var(--gold2);
  background: rgba(201,168,76,.06);
  border-color: rgba(201,168,76,.18);
}
.nav-trigger:hover, .nav-group.open .nav-trigger,
.nav-group-active .nav-trigger {
  color: var(--gold2);
  background: rgba(201,168,76,.06);
  border-color: rgba(201,168,76,.18);
}
.nav-chev { transition: transform .2s var(--tr); }
.nav-group.open .nav-chev,
.nav-group:hover .nav-chev { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute; top: calc(100% + .35rem); left: 0;
  min-width: 220px; padding: .5rem;
  list-style: none;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .18s var(--tr), transform .18s var(--tr), visibility .18s;
  z-index: 110;
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown,
.nav-group.open .nav-dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown li { list-style: none; }
.nav-dropdown a {
  display: block;
  padding: .55rem .85rem;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--soft);
  transition: all .15s var(--tr);
}
.nav-dropdown a:hover {
  background: rgba(62,173,168,.08);
  color: var(--teal2);
}
.nav-dropdown a.active {
  background: rgba(201,168,76,.08);
  color: var(--gold2);
}

/* Hamburger — visible on mobile only */
.nav-hamburger {
  display: none;
  width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
  position: relative; flex-shrink: 0;
  transition: border-color .2s var(--tr);
}
.nav-hamburger:hover { border-color: var(--soft); }
.nav-hamburger span {
  display: block; position: absolute; left: 10px;
  width: 20px; height: 2px;
  background: var(--head); border-radius: 2px;
  transition: all .25s var(--tr);
}
.nav-hamburger span:nth-child(1) { top: 13px; }
.nav-hamburger span:nth-child(2) { top: 19px; }
.nav-hamburger span:nth-child(3) { top: 25px; }
body.nav-open .nav-hamburger span:nth-child(1) {
  top: 19px; transform: rotate(45deg);
}
body.nav-open .nav-hamburger span:nth-child(2) {
  opacity: 0;
}
body.nav-open .nav-hamburger span:nth-child(3) {
  top: 19px; transform: rotate(-45deg);
}

.nav-mobile-overlay {
  position: fixed; inset: 0;
  background: rgba(13,14,16,.6);
  backdrop-filter: blur(4px);
  z-index: 95;
  opacity: 0;
  transition: opacity .25s var(--tr);
  pointer-events: none;
}
body.nav-open .nav-mobile-overlay {
  opacity: 1; pointer-events: auto;
}
.nav-mobile-overlay[hidden] { display: block !important; }

.nav-cta {
  padding: .55rem 1.1rem; border-radius: var(--r); border: 1px solid var(--teal);
  color: var(--teal2) !important;
  white-space: nowrap;
}
.nav-cta:hover { background: rgba(62,173,168,.12); color: var(--teal2) !important; }

.user-pill {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .35rem .55rem .35rem .85rem;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--card);
  font-family: 'DM Mono', monospace;
}
.user-pill .user-role {
  font-size: .58rem; letter-spacing: .2em; text-transform: uppercase;
  padding: .15rem .4rem; border-radius: 4px;
}
.user-internal .user-role { background: rgba(201,168,76,.18); color: var(--gold2); }
.user-integrator .user-role { background: rgba(62,173,168,.15); color: var(--teal2); }
.user-pill .user-name {
  font-size: .72rem; letter-spacing: .04em; color: var(--head);
}
.user-pill .user-logout, .user-pill .user-viewas {
  background: transparent; border: none; cursor: pointer;
  font-family: 'DM Mono', monospace; font-size: .62rem;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--soft); padding: .15rem .4rem;
  border-left: 1px solid var(--line); margin-left: .35rem;
  transition: color .2s var(--tr);
}
.user-pill .user-logout:hover { color: var(--rust); }
.user-pill .user-viewas:hover { color: var(--teal2); }
.user-pill.user-viewing-as {
  background: rgba(62,173,168,.08);
  border-color: rgba(62,173,168,.4);
}
.user-pill.user-viewing-as .user-role {
  background: rgba(62,173,168,.25);
}

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .85rem 1.8rem; border-radius: var(--r);
  font-family: 'Outfit', sans-serif;
  font-size: .82rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; border: none;
  transition: all .25s var(--tr);
  text-decoration: none;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(201,168,76,.3); color: var(--ink); }
.btn-teal { background: var(--teal); color: var(--ink); }
.btn-teal:hover { background: var(--teal2); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(62,173,168,.3); color: var(--ink); }
.btn-outline { background: transparent; color: var(--body); border: 1px solid var(--line2); }
.btn-outline:hover { border-color: var(--soft); color: var(--head); transform: translateY(-2px); }
.btn-sm { padding: .5rem 1rem; font-size: .7rem; }

/* ─── LAYOUT PRIMITIVES ─────────────────────────────────────── */
section { padding: 6rem 2rem; }
.container { max-width: 1180px; margin: 0 auto; }
.container-wide { max-width: 1380px; margin: 0 auto; }
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: .65rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
}
.section-title { font-size: clamp(2rem, 4vw, 3rem); color: var(--head); margin-bottom: 1.25rem; }
.section-body { font-size: 1.05rem; color: var(--soft); max-width: 720px; line-height: 1.8; }

.eyebrow {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: .68rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--teal); border: 1px solid rgba(62,173,168,.3);
  padding: .35rem 1rem; border-radius: 999px; margin-bottom: 1.5rem;
}

/* ─── HERO ──────────────────────────────────────────────────── */
#hero {
  min-height: 88vh;
  display: grid; place-items: center;
  position: relative; overflow: hidden;
  padding: 8rem 2rem 4rem;
}
#hero::before {
  content: ''; position: absolute; width: 720px; height: 720px;
  top: -180px; right: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(62,173,168,.18) 0%, transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
#hero::after {
  content: ''; position: absolute; width: 520px; height: 520px;
  bottom: -100px; left: -100px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,76,.12) 0%, transparent 70%);
  animation: drift 18s ease-in-out infinite alternate-reverse;
}
@keyframes drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(40px,60px) scale(1.1); }
}

.hero-inner { position: relative; z-index: 2; max-width: 920px; text-align: center; }
.hero-title {
  font-size: clamp(3rem, 7vw, 5.6rem);
  font-weight: 300; letter-spacing: -.01em; margin-bottom: 1rem;
}
.hero-title .accent { color: var(--teal); display: inline-block; margin: 0 .15em; font-style: italic; }
.hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-style: italic; color: var(--soft); margin-bottom: 1.25rem;
}
.hero-tagline {
  font-family: 'DM Mono', monospace; font-size: .82rem;
  color: var(--gold); letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 2.5rem;
}
.hero-divider {
  width: 60px; height: 2px; margin: 2rem auto;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}
.hero-ctas {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
}
.hero-meta {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  color: var(--muted); letter-spacing: .1em; margin-top: 2.5rem;
}

/* Centerpiece "Learn more" CTA — sits between hero-divider and the four
   action buttons. Single horizontal row, compact but prominent: Step badge
   + label + animated chevron, lives as the visual anchor of the home page
   instead of a tall card at the bottom. */
/* Step 1 - the primary, can't-miss "new here, start here" action. Bold gold
   so it clearly outranks the secondary veteran buttons below it. */
.hero-scroll-cta {
  display: inline-flex; flex-direction: row; align-items: center;
  gap: 1rem; margin: 2rem auto 1.75rem;
  padding: 1rem 1.9rem;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold2) 100%);
  border: none;
  border-radius: 14px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(201,168,76,.30);
  transition: transform .25s var(--tr), box-shadow .25s var(--tr);
  animation: hero-start-breathe 3.2s ease-in-out infinite;
}
.hero-scroll-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 44px rgba(201,168,76,.46);
  animation-play-state: paused;
}
.hero-scroll-step {
  display: inline-block;
  padding: .28rem .7rem;
  background: rgba(13,14,16,.20);
  color: #0d0e10;
  border-radius: 999px;
  font-family: 'DM Mono', monospace;
  font-size: .6rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  white-space: nowrap;
}
.hero-scroll-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.45rem; font-weight: 600; color: #0d0e10;
  line-height: 1.05;
}
.hero-scroll-chev {
  display: inline-flex; align-items: center;
  color: #0d0e10;
  animation: cta-bounce 1.8s ease-in-out infinite;
}
.hero-scroll-cta:hover .hero-scroll-chev { color: #0d0e10; }

/* Framing label above the secondary veteran shortcuts. */
.hero-veteran-label {
  font-family: 'DM Mono', monospace; font-size: .62rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .9rem;
}

@keyframes hero-start-breathe {
  0%, 100% { box-shadow: 0 10px 30px rgba(201,168,76,.30); }
  50%      { box-shadow: 0 12px 40px rgba(201,168,76,.48); }
}

@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(62,173,168,.2); }
  50%      { box-shadow: 0 0 0 8px rgba(62,173,168,0); }
}
@keyframes cta-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cta, .hero-scroll-chev { animation: none; }
}

/* ─── HOME GRIDS ───────────────────────────────────────────── */
.tile-grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2.5rem;
}
.tile {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r2); padding: 1.75rem;
  transition: all .3s var(--tr); position: relative; overflow: hidden;
  text-decoration: none; color: inherit; display: block;
}
.tile::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent, var(--teal));
}
.tile:hover {
  transform: translateY(-4px);
  border-color: var(--accent, var(--teal));
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
  color: inherit;
}
.tile-label {
  font-family: 'DM Mono', monospace; font-size: .6rem;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent, var(--teal)); margin-bottom: .6rem;
}
.tile-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.55rem; color: var(--head); line-height: 1.2; margin-bottom: .4rem;
}
.tile-desc { font-size: .9rem; color: var(--soft); line-height: 1.55; }
.tile-meta {
  font-family: 'DM Mono', monospace; font-size: .68rem; color: var(--muted);
  margin-top: .8rem; letter-spacing: .08em; text-transform: uppercase;
}

#intro { background: var(--ink2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#surfaces { background: var(--surface); }
#bedrock { background: var(--ink); }
#tools { background: var(--ink2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#start { background: var(--ink); }

.split-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: start;
}
.stat-row { display: flex; gap: 2.5rem; margin-top: 2rem; flex-wrap: wrap; }
.stat { border-left: 2px solid var(--gold); padding-left: 1rem; }
.stat-num { font-family: 'Cormorant Garamond', serif; font-size: 2.4rem; color: var(--gold); line-height: 1; }
.stat-lbl { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: .25rem; }

/* ─── DOCS LAYOUT ──────────────────────────────────────────── */
.docs-shell {
  display: grid; grid-template-columns: 280px minmax(0, 1fr) 240px;
  gap: 3rem; max-width: 1380px; margin: 0 auto; padding: 3rem 2rem 5rem;
}
/* Collapsible <details> wrapper around the docs sidebar (see site.js).
   Desktop: <details> IS the grid cell — sticky positioning + scroll
   handled here, the inner <summary> is hidden, the inner <aside>
   flows normally as a block child. (We previously used display:contents
   to pass through, but Chromium strips it on <details> for the
   disclosure semantic, breaking grid column alignment. Owning the cell
   directly is reliable across browsers.) */
.docs-sidebar-wrap {
  position: sticky; top: 5rem; align-self: start;
  max-height: calc(100vh - 6rem); overflow-y: auto;
  font-size: .88rem;
  padding-right: .5rem;
}
.docs-sidebar-toggle { display: none; }

/* Floating back-to-top button is mobile-only — see the @media block
   below for the visible styling. Hide on desktop entirely. */
.docs-back-to-top { display: none; }

.docs-sidebar {
  /* On desktop the <details> wrapper owns sticky + scroll. The aside
     is just a flow child inside the wrapper. Mobile resets these in
     the media query block below. */
}
.docs-sidebar h4 {
  font-family: 'DM Mono', monospace;
  font-size: .65rem; font-weight: 400; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold); margin: 1.5rem 0 .6rem;
}
.docs-sidebar h4:first-child { margin-top: 0; }

/* Per-audience collapsibility. Each audience renders as a <details>
   element with a <summary> header styled like the legacy <h4>. Click
   the header to expand / collapse. Architecture defaults closed. */
.docs-sidebar-group {
  margin: 1rem 0 .25rem;
}
.docs-sidebar-group:first-of-type { margin-top: 0; }
.docs-sidebar-group > summary.docs-sidebar-group-toggle {
  font-family: 'DM Mono', monospace;
  font-size: .65rem; font-weight: 400; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold); padding: .35rem 0; cursor: pointer;
  list-style: none;
  display: flex; align-items: center; gap: .4rem;
  user-select: none;
}
.docs-sidebar-group > summary.docs-sidebar-group-toggle::-webkit-details-marker { display: none; }
.docs-sidebar-group > summary.docs-sidebar-group-toggle::before {
  content: '\25B8';
  font-size: .65rem; opacity: .6;
  transition: transform .15s var(--tr);
}
.docs-sidebar-group[open] > summary.docs-sidebar-group-toggle::before {
  transform: rotate(90deg);
}
.docs-sidebar-group > summary.docs-sidebar-group-toggle:hover {
  color: var(--gold2);
}
.docs-sidebar-group > ul { margin-top: .35rem; }

.docs-sidebar ul { list-style: none; }
.docs-sidebar li a {
  display: block; padding: .35rem .75rem; border-radius: 6px;
  color: var(--soft); font-size: .85rem;
  border-left: 2px solid transparent;
  transition: all .15s var(--tr);
}
.docs-sidebar li a:hover { color: var(--head); background: rgba(255,255,255,.03); }
.docs-sidebar li a.active {
  color: var(--gold2); border-left-color: var(--gold);
  background: rgba(201,168,76,.05);
}

.docs-main {
  min-width: 0;
  font-size: 1rem; line-height: 1.75;
  /* Wide tables + code blocks scroll horizontally inside the main column
     instead of overflowing into the right-side TOC. Normal prose pages
     show no scrollbar; only pages with wide tables (DB-Procs-Catalog etc.)
     get a horizontal scrollbar at the bottom of the main column. */
  overflow-x: auto;
}
.docs-toc {
  position: sticky; top: 5rem; align-self: start;
  max-height: calc(100vh - 6rem); overflow-y: auto;
  font-size: .8rem;
  border-left: 1px solid var(--line); padding-left: 1rem;
  /* Solid background + z-index so the TOC is always opaque even when
     adjacent main-column content overflows into the gutter. */
  background: var(--ink); z-index: 2;
}
.docs-toc h5 {
  font-family: 'DM Mono', monospace;
  font-size: .6rem; font-weight: 400; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .8rem;
}
.docs-toc ul { list-style: none; }
.docs-toc li { padding: .2rem 0; }
.docs-toc li.depth-3 { padding-left: .8rem; }
.docs-toc li.depth-4 { padding-left: 1.6rem; font-size: .9em; }
.docs-toc a { color: var(--soft); }
.docs-toc a:hover { color: var(--gold2); }

.docs-breadcrumbs {
  font-family: 'DM Mono', monospace; font-size: .7rem;
  color: var(--muted); letter-spacing: .12em; text-transform: uppercase;
}
.docs-breadcrumbs a { color: var(--soft); }
.docs-breadcrumbs span { margin: 0 .55rem; }

.docs-breadcrumbs-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .75rem;
  margin-bottom: 1.5rem;
}
.docs-pdf-chip {
  display: inline-flex; align-items: center;
  font-family: 'DM Mono', monospace;
  font-size: .68rem; font-weight: 500; letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); background: rgba(201,168,76,.06);
  padding: .35rem .75rem; border-radius: 999px;
  border: 1px solid rgba(201,168,76,.25);
  text-decoration: none;
  transition: all .2s var(--tr);
}
.docs-pdf-chip:hover {
  background: rgba(201,168,76,.12); color: var(--gold2);
  border-color: var(--gold); transform: translateY(-1px);
}

/* Markdown content */
.md h1 { font-size: 2.4rem; margin: 0 0 1.5rem; color: var(--head); }
.md h1:first-child { margin-top: 0; }
.md h2 {
  font-size: 1.7rem; margin: 2.5rem 0 1rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--line);
  color: var(--head);
}
.md h3 { font-size: 1.3rem; margin: 1.8rem 0 .8rem; color: var(--head); }
.md h4 { font-size: 1.05rem; margin: 1.4rem 0 .6rem; color: var(--head); font-family: 'Outfit', sans-serif; font-weight: 600; }
.md p  { margin: 0 0 1rem; color: var(--body); }
.md ul, .md ol { margin: 0 0 1rem 1.5rem; }
.md li { margin: .35rem 0; color: var(--body); }
.md li > ul, .md li > ol { margin-top: .3rem; margin-bottom: .3rem; }
.md strong { color: var(--head); font-weight: 500; }
.md em { color: var(--head); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.md blockquote {
  margin: 1rem 0; padding: .75rem 1.25rem;
  border-left: 3px solid var(--teal);
  background: rgba(62,173,168,.06);
  color: var(--soft);
  border-radius: 0 var(--r) var(--r) 0;
}

.md code {
  font-family: 'DM Mono', ui-monospace, Menlo, Consolas, monospace;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: .12rem .45rem; border-radius: 5px;
  font-size: .88em; color: var(--gold2);
}
.md pre {
  margin: 1rem 0; padding: 1.25rem 1.4rem;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: var(--r); overflow-x: auto;
  position: relative;
}
.md pre code {
  background: transparent; border: none; padding: 0;
  color: var(--body); font-size: .85rem; line-height: 1.65;
  display: block;
}
.md pre .copy-btn {
  position: absolute; top: .75rem; right: .75rem;
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .12em; text-transform: uppercase;
  background: var(--card); border: 1px solid var(--line);
  color: var(--soft); padding: .25rem .55rem;
  border-radius: 5px; cursor: pointer;
  opacity: 0; transition: all .2s var(--tr);
}
.md pre:hover .copy-btn { opacity: 1; }
.md pre .copy-btn:hover { color: var(--gold2); border-color: var(--gold); }

.md table {
  width: 100%; border-collapse: collapse; margin: 1rem 0;
  font-size: .9rem;
}
.md table th {
  text-align: left; padding: .6rem .8rem;
  font-family: 'DM Mono', monospace; font-size: .68rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal2);
  border-bottom: 2px solid var(--teal);
  background: rgba(62,173,168,.06);
}
.md table td {
  padding: .55rem .8rem; border-bottom: 1px solid var(--line);
  vertical-align: top; color: var(--body);
}
.md table tr:hover { background: rgba(255,255,255,.02); }
.md table td code { font-size: .85em; }

.md h2:hover .anchor, .md h3:hover .anchor, .md h4:hover .anchor { opacity: .6; }
.md .anchor {
  opacity: 0; margin-left: .35rem; color: var(--soft); font-size: .7em;
  text-decoration: none; transition: opacity .15s;
}
.md .anchor:hover { color: var(--gold); opacity: 1 !important; }

/* ─── API REFERENCE ────────────────────────────────────────── */
.api-shell {
  display: grid; grid-template-columns: 320px minmax(0, 1fr);
  gap: 0; max-width: 1480px; margin: 0 auto;
  min-height: calc(100vh - 70px);
}
.api-sidebar {
  background: var(--ink2); border-right: 1px solid var(--line);
  padding: 1.5rem 0; max-height: calc(100vh - 70px); overflow-y: auto;
  position: sticky; top: 0;
}
.api-sidebar .filter {
  padding: 0 1.25rem 1rem;
}
.api-sidebar input[type=search] {
  width: 100%; padding: .55rem .8rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); color: var(--body);
  font-family: 'DM Mono', monospace; font-size: .82rem;
}
.api-sidebar input[type=search]:focus { outline: none; border-color: var(--teal); }
.api-folder {
  padding: .5rem 1.25rem .25rem;
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); cursor: pointer;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.api-folder:hover { background: rgba(255,255,255,.02); }
.api-folder .count { color: var(--muted); font-size: .9em; letter-spacing: .05em; }
.api-folder .chev { font-size: .7em; transition: transform .2s var(--tr); }
.api-folder.collapsed .chev { transform: rotate(-90deg); }
.api-items { padding: 0 0 .75rem; }
.api-folder.collapsed + .api-items { display: none; }
.api-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .35rem 1.25rem; cursor: pointer;
  font-size: .82rem; color: var(--soft);
  border-left: 2px solid transparent;
  transition: all .15s var(--tr);
}
.api-item:hover { background: rgba(255,255,255,.03); color: var(--head); }
.api-item.active {
  background: rgba(62,173,168,.08); color: var(--head);
  border-left-color: var(--teal);
}
.api-method {
  font-family: 'DM Mono', monospace; font-size: .6rem; font-weight: 500;
  padding: .15rem .4rem; border-radius: 4px;
  letter-spacing: .05em; min-width: 48px; text-align: center;
  flex-shrink: 0;
}
.method-GET    { background: rgba(62,173,168,.15);  color: var(--teal2); }
.method-POST   { background: rgba(123,140,78,.15);  color: #b6c280; }
.method-PUT    { background: rgba(201,168,76,.15);  color: var(--gold2); }
.method-DELETE { background: rgba(158,79,58,.18);   color: #d18170; }
.method-PATCH  { background: rgba(124,92,191,.15);  color: #a98fdc; }

.api-detail {
  padding: 2.5rem 3rem; min-width: 0;
}
.api-detail .empty-state {
  text-align: center; color: var(--muted); padding: 6rem 2rem;
}
.api-detail .empty-state h2 { color: var(--soft); margin-bottom: .5rem; }
.api-folderpath {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .5rem;
}
.api-detail h1 {
  font-size: 1.9rem; color: var(--head); margin-bottom: 1rem;
}
.api-endpoint {
  display: flex; align-items: center; gap: .75rem;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: .75rem 1rem; border-radius: var(--r);
  margin: 1rem 0 1.5rem;
  font-family: 'DM Mono', monospace; font-size: .9rem;
  word-break: break-all;
}
.api-endpoint .url { color: var(--body); flex: 1; }

.api-section { margin: 2rem 0; }
.api-section h3 {
  font-family: 'DM Mono', monospace; font-size: .72rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--teal2); margin-bottom: .8rem;
  padding-bottom: .35rem; border-bottom: 1px solid var(--line);
}

.api-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.api-table th, .api-table td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--line); }
.api-table th {
  font-family: 'DM Mono', monospace; font-size: .65rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: var(--soft);
}
.api-table td { color: var(--body); vertical-align: top; }
.api-table td.k { font-family: 'DM Mono', monospace; color: var(--gold2); white-space: nowrap; }

.api-body {
  margin: .5rem 0;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: 1rem 1.2rem; border-radius: var(--r);
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: .82rem; line-height: 1.6;
  color: var(--body); overflow-x: auto;
  white-space: pre;
  position: relative;
}

/* The one-line "Behind the scenes" callout sourced from each proc's
   --&Comment header. Sits between the description and the request tables. */
.api-procnote {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem;
  margin: .5rem 0 1.25rem;
  padding: .55rem .9rem;
  background: rgba(124,92,191,.06);
  border: 1px solid rgba(124,92,191,.2);
  border-radius: var(--r);
  color: var(--body);
  font-size: .88rem;
}
.api-procnote-label {
  font-family: 'DM Mono', monospace; font-size: .58rem;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--purple); flex-shrink: 0;
}
.api-procnote-text { flex: 1 1 280px; line-height: 1.5; }
.api-procnote-tag {
  font-family: 'DM Mono', monospace; font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold2);
  background: rgba(201,168,76,.1);
  padding: .15rem .45rem; border-radius: 4px;
}
.api-procnote-proc {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  color: var(--soft);
}
.api-procnote-proc code {
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: 0 .35em; border-radius: 3px; color: var(--gold2);
}

.api-required-tag {
  display: inline-block;
  font-family: 'DM Mono', monospace;
  font-size: .55rem; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: #d18170;
  background: rgba(158,79,58,.12);
  padding: .1rem .35rem;
  border-radius: 3px;
  margin-left: .35rem;
  vertical-align: middle;
}

/* Enrichment: long-form context block under the title */
.api-longcontext {
  margin: .5rem 0 1.5rem;
  padding: .85rem 1.1rem;
  background: rgba(62,173,168,.05);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--body);
  line-height: 1.7;
  font-size: .92rem;
}
.api-longcontext p { margin: 0 0 .65rem; }
.api-longcontext p:last-child { margin-bottom: 0; }
.api-longcontext code,
.api-description code {
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: .08rem .35rem; border-radius: 4px;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: .85em; color: var(--gold2);
}
.api-longcontext strong,
.api-description strong { color: var(--head); font-weight: 500; }

/* Postman-supplied request descriptions — markdown-rendered (paragraphs,
   bullets, fenced JSON blocks). Lighter than the longContext callout. */
.api-description {
  margin: 0 0 1rem;
  color: var(--soft);
  line-height: 1.7;
  font-size: .95rem;
}
.api-description p { margin: 0 0 .75rem; }
.api-description p:last-child { margin-bottom: 0; }
.api-md-list {
  margin: 0 0 .85rem;
  padding-left: 1.4rem;
}
.api-md-list li { margin: .15rem 0; }
.api-md-pre {
  margin: .65rem 0 1rem;
  padding: .9rem 1.1rem;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: var(--r);
  overflow-x: auto;
  font-family: 'DM Mono', ui-monospace, monospace;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--body);
  white-space: pre;
}
.api-md-pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* Enrichment: Related Documentation chips */
.api-doclinks {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-top: .5rem;
}
.api-doclink {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .85rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--body); font-size: .85rem;
  text-decoration: none;
  transition: all .2s var(--tr);
}
.api-doclink:hover {
  border-color: var(--teal); color: var(--teal2);
  transform: translateY(-1px);
}
.api-doclink.is-internal:hover {
  border-color: var(--gold); color: var(--gold2);
}
.api-doclink-tag {
  font-family: 'DM Mono', monospace; font-size: .58rem;
  letter-spacing: .12em; text-transform: uppercase;
  background: rgba(201,168,76,.18); color: var(--gold2);
  padding: .15rem .4rem; border-radius: 4px;
}

/* Enrichment: Code Examples */
.api-example { margin-bottom: 1rem; }
.api-example-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .35rem; gap: 1rem; flex-wrap: wrap;
}
.api-example-head strong { color: var(--head); font-size: .9rem; font-weight: 500; }
.api-example-source {
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .04em; color: var(--soft);
}
.api-example pre.api-body code {
  background: transparent; border: none; padding: 0;
  color: var(--body); font-size: .82rem; line-height: 1.65;
  white-space: pre; display: block;
}
.api-body[contenteditable=true] { white-space: pre-wrap; }
.api-body[contenteditable=true]:focus { outline: none; border-color: var(--teal); }

.try-it {
  margin-top: 2rem; padding-top: 2rem; border-top: 1px dashed var(--line);
}
.try-it-controls { display: flex; gap: .75rem; margin: 1rem 0; flex-wrap: wrap; align-items: center; }
.try-it-status {
  font-family: 'DM Mono', monospace; font-size: .75rem;
  padding: .25rem .6rem; border-radius: 4px;
  display: inline-block;
}
.status-2 { background: rgba(75,124,62,.18); color: #a4cf94; }
.status-4 { background: rgba(201,168,76,.18); color: var(--gold2); }
.status-5 { background: rgba(158,79,58,.18); color: #d18170; }

.api-creds {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.api-creds h4 {
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
  margin-bottom: .75rem;
}
.api-creds-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.api-creds-row label {
  font-family: 'DM Mono', monospace; font-size: .7rem;
  color: var(--soft); min-width: 70px;
}
.api-creds-row input {
  flex: 1; min-width: 240px; padding: .45rem .7rem;
  background: var(--code-bg); border: 1px solid var(--line);
  border-radius: 6px; color: var(--body);
  font-family: 'DM Mono', monospace; font-size: .82rem;
}
.api-creds-row input:focus { outline: none; border-color: var(--teal); }
.api-creds-hint {
  font-size: .75rem; color: var(--muted); margin-top: .6rem;
  font-family: 'DM Mono', monospace; letter-spacing: .04em;
}

/* ─── DOWNLOADS ─────────────────────────────────────────────── */
.dl-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem; margin-top: 3rem;
}
.dl-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r2); padding: 2rem;
  transition: all .3s var(--tr); position: relative;
}
.dl-card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.dl-os {
  font-family: 'Cormorant Garamond', serif; font-size: 1.6rem;
  color: var(--head); margin-bottom: .35rem;
}
.dl-arch {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .2em; text-transform: uppercase; color: var(--teal2);
  margin-bottom: 1rem;
}
.dl-desc { font-size: .88rem; color: var(--soft); margin-bottom: 1.25rem; line-height: 1.6; }
.dl-cmd {
  font-family: 'DM Mono', monospace; font-size: .75rem;
  background: var(--code-bg); border: 1px solid var(--code-border);
  padding: .55rem .75rem; border-radius: 6px;
  color: var(--gold2); margin-bottom: 1.25rem;
  overflow-x: auto;
}

/* ─── FOOTER ────────────────────────────────────────────────── */
footer.site {
  background: var(--ink); border-top: 1px solid var(--line);
  padding: 3rem 2rem 2rem; margin-top: auto;
}
.footer-inner {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 3rem;
}
.footer-brand-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem; font-weight: 600; color: var(--gold); margin-bottom: .35rem;
}
.footer-brand-tagline {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .15em; color: var(--muted);
}
.footer-col h5 {
  font-family: 'DM Mono', monospace;
  font-size: .65rem; letter-spacing: .25em; text-transform: uppercase;
  color: var(--gold); margin-bottom: .8rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin: .25rem 0; }
.footer-col a { color: var(--soft); font-size: .85rem; }
.footer-col a:hover { color: var(--gold2); }
.footer-copy {
  max-width: 1180px; margin: 2.5rem auto 0; padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-family: 'DM Mono', monospace; font-size: .7rem;
  color: var(--muted); letter-spacing: .08em;
}

/* ─── SCROLL REVEAL ─────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .6s var(--tr), transform .6s var(--tr); }
.reveal.visible { opacity: 1; transform: none; }

/* ─── CLIPBOOK / MANUAL ─────────────────────────────────────────────── */
.clip {
  display: inline-flex; align-items: center; gap: .55rem;
  margin-left: .65rem; padding: .25rem .8rem;
  background: rgba(62,173,168,.08);
  border: 1px solid rgba(62,173,168,.25);
  border-radius: 6px;
  color: var(--teal2);
  font-family: 'DM Mono', monospace;
  font-size: .6rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  line-height: 1;
  cursor: pointer; vertical-align: middle;
  opacity: .65;
  transition: all .2s var(--tr);
  white-space: nowrap;
}
.clip::before {
  content: '+';
  font-size: 1.05rem; line-height: .5;
  font-weight: 600;
  display: inline-block;
  /* Visual breathing room between the + and the label. */
  padding-right: .25rem;
}
.clip::after  { content: 'Clip'; }
.clip.is-clipped { background: rgba(75,124,62,.15); border-color: rgba(75,124,62,.4); color: #a4cf94; }
.clip.is-clipped::before { content: '✓'; font-size: .9rem; padding-right: .3rem; }
.clip.is-clipped::after  { content: 'In binder'; }
.md h2:hover .clip, .md h3:hover .clip, .md h4:hover .clip,
.ex-card:hover .clip, .lib-section-meta h2:hover .clip,
.lib-file:hover .clip,
.clip:hover, .clip:focus, .clip.flash-added, .clip.flash-dup {
  opacity: 1;
}
.clip:hover {
  background: rgba(62,173,168,.18);
  border-color: var(--teal);
  color: var(--teal2);
  transform: translateY(-1px);
}
.clip.is-clipped:hover { background: rgba(75,124,62,.25); border-color: #a4cf94; }
.clip.flash-added {
  background: rgba(75,124,62,.25); color: #a4cf94;
  border-color: #a4cf94;
}
.clip.flash-added::before { content: '✓'; padding-right: .3rem; }
.clip.flash-added::after  { content: 'Added!'; }
.clip.flash-dup {
  background: rgba(201,168,76,.15); color: var(--gold2);
  border-color: rgba(201,168,76,.4);
}
.clip.flash-dup::before { content: '·'; padding-right: .3rem; }
.clip.flash-dup::after  { content: 'Already in binder'; }

/* Cards put the clip in the top-right corner. */
.clip-on-card {
  position: absolute; top: .85rem; right: .85rem;
  opacity: .8;
}
.ex-card:hover .clip-on-card { opacity: 1; }

/* PDF row in Library: clip collapses to just "+" so the filename title
   gets more horizontal room (otherwise the row reads "AuthMM... 90 KB + CLIP"
   which truncates the most useful piece). Hover state still shows "+ Clip"
   for discoverability; flash + clipped states keep their words too. */
.lib-file .clip {
  margin-left: 0;
  flex-shrink: 0;
  padding: .25rem .55rem;
}
.lib-file .clip::before { padding-right: 0; font-size: 1rem; }
.lib-file .clip::after  { content: none; }
.lib-file .clip:hover::after { content: 'Clip'; padding-left: .35rem; }
.lib-file .clip.is-clipped::before { padding-right: 0; }
.lib-file .clip.is-clipped::after  { content: none; }
.lib-file .clip.is-clipped:hover::after { content: 'In binder'; padding-left: .35rem; }
/* Flash states keep their full labels so the success/dup feedback is clear. */
.lib-file .clip.flash-added::after { content: 'Added!'; padding-left: .35rem; }
.lib-file .clip.flash-dup::after   { content: 'Dup'; padding-left: .35rem; }

/* Storage-unavailable: show clip buttons but in a degraded state. */
body.cb-storage-unavailable .clip { opacity: .35; }
body.cb-storage-unavailable .clip:hover::after { content: 'Storage unavailable'; }

/* Floating widget */
.clipbook-widget {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  z-index: 90; pointer-events: none;
}
.clipbook-widget > * { pointer-events: auto; }
.cb-pill {
  display: inline-flex; align-items: center;
  padding: .65rem 1.1rem;
  background: var(--card); color: var(--head);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: 'DM Mono', monospace;
  font-size: .78rem; letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
  transition: all .2s var(--tr);
}
.cb-pill:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(62,173,168,.18);
}
.clipbook-widget.cb-has-clips .cb-pill {
  border-color: var(--teal);
  background: linear-gradient(135deg, var(--card) 0%, rgba(62,173,168,.12) 100%);
}
.cb-binder-name {
  color: var(--soft);
  margin-right: .35rem;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cb-count {
  display: inline-block; min-width: 1.4rem;
  padding: .1rem .45rem; margin-left: .35rem;
  background: var(--teal); color: var(--ink);
  border-radius: 999px;
  font-weight: 500; font-size: .72rem;
  text-align: center;
}
.cb-has-clips .cb-count { background: var(--teal2); }

.cb-panel {
  position: absolute; right: 0; bottom: calc(100% + .65rem);
  width: 360px; max-width: calc(100vw - 2.5rem);
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r2);
  box-shadow: 0 24px 48px rgba(0,0,0,.5);
  overflow: hidden;
}
.cb-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--card2);
}
.cb-panel-title {
  font-family: 'DM Mono', monospace;
  font-size: .65rem; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold);
  display: flex; align-items: center; gap: .55rem;
}
.cb-binder-picker {
  background: var(--code-bg);
  border: 1px solid var(--line);
  color: var(--head);
  font-family: 'DM Mono', monospace;
  font-size: .78rem;
  padding: .25rem .5rem;
  border-radius: 6px;
  text-transform: none; letter-spacing: 0;
  max-width: 200px;
}
.cb-close {
  background: transparent; border: none; color: var(--soft);
  font-size: 1.4rem; line-height: 1; cursor: pointer;
  padding: 0 .25rem;
}
.cb-close:hover { color: var(--head); }
.cb-list { max-height: 380px; overflow-y: auto; }
.cb-empty {
  padding: 2rem 1rem; text-align: center;
  color: var(--soft); font-size: .85rem; line-height: 1.7;
}
.cb-empty-plus {
  display: inline-block; margin: 0 .15rem;
  width: 22px; height: 22px;
  background: rgba(62,173,168,.1); color: var(--teal2);
  border: 1px solid var(--teal);
  border-radius: 6px;
  font-family: 'DM Mono', monospace; font-weight: 500;
  text-align: center; line-height: 20px;
}
.cb-item {
  display: flex; align-items: center; gap: .5rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
}
.cb-item:hover { background: var(--card2); }
.cb-item-link {
  flex: 1; min-width: 0;
  text-decoration: none; color: inherit;
  display: block;
}
.cb-item-section {
  font-family: 'DM Mono', monospace; font-size: .6rem;
  letter-spacing: .12em; text-transform: uppercase; color: var(--soft);
  margin-bottom: .15rem;
}
.cb-item-title {
  font-size: .85rem; color: var(--head); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.cb-item-remove {
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  padding: .15rem .35rem; border-radius: 4px;
  flex-shrink: 0;
}
.cb-item-remove:hover { color: var(--rust); background: rgba(158,79,58,.08); }
.cb-more {
  padding: .5rem 1rem;
  font-family: 'DM Mono', monospace; font-size: .7rem;
  color: var(--muted); text-align: center;
  border-top: 1px dashed var(--line);
}
.cb-actions {
  display: flex; gap: .5rem; padding: .85rem 1rem;
  border-top: 1px solid var(--line); background: var(--card2);
}
.cb-btn {
  flex: 1; padding: .55rem .85rem;
  background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--soft); cursor: pointer;
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  text-align: center; text-decoration: none;
  transition: all .2s var(--tr);
}
.cb-btn:hover { color: var(--head); border-color: var(--soft); }
.cb-btn-primary {
  background: var(--teal); color: var(--ink); border-color: var(--teal);
}
.cb-btn-primary:hover {
  background: var(--teal2); border-color: var(--teal2); color: var(--ink);
}

/* /clipbook page */
#clipbook-root {
  max-width: 1100px; margin: 0 auto;
  padding: 5rem 2rem 4rem;
}
/* Stack the head + toolbar vertically so the title gets full content width
   and the 6 toolbar buttons line up cleanly underneath instead of crowding
   the title into a 140px column. */
.cb-page-head {
  display: flex; flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.cb-page-head h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.5rem; color: var(--head);
  margin-bottom: .5rem;
  line-height: 1.1;
}
.cb-page-desc {
  color: var(--soft); font-size: 1rem; line-height: 1.65;
  max-width: 720px; margin-bottom: .5rem;
}
.cb-page-storage {
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .04em; color: var(--muted); line-height: 1.5;
  max-width: 720px;
}
.cb-toolbar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  justify-content: flex-start;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}
.cb-action {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft); cursor: pointer;
  font-family: 'DM Mono', monospace; font-size: .68rem;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .55rem .85rem;
  transition: all .2s var(--tr);
}
.cb-action:hover { border-color: var(--soft); color: var(--head); }
.cb-action:disabled { opacity: .4; cursor: not-allowed; }
.cb-action-primary {
  background: var(--gold); color: var(--ink); border-color: var(--gold);
}
.cb-action-primary:hover { background: var(--gold2); color: var(--ink); border-color: var(--gold2); }
.cb-action-danger:hover { color: var(--rust); border-color: rgba(158,79,58,.5); }

.cb-binders {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem; margin-bottom: 2.5rem;
  padding: 1rem; background: var(--ink2);
  border: 1px solid var(--line); border-radius: var(--r);
}
.cb-binder-card {
  text-align: left;
  padding: .85rem 1rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all .2s var(--tr);
}
.cb-binder-card:hover { border-color: var(--teal); transform: translateY(-1px); }
.cb-binder-card.active {
  background: rgba(62,173,168,.08);
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px rgba(62,173,168,.15);
}
.cb-binder-card-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem; color: var(--head);
  margin-bottom: .15rem; line-height: 1.2;
}
.cb-binder-card-meta {
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .12em; color: var(--soft);
}
.cb-binder-add { border-style: dashed; }
.cb-binder-add:hover { border-color: var(--gold); }

.cb-entries { display: grid; gap: 1rem; }
.cb-entry {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 1rem; align-items: start;
  padding: 1.1rem 1.4rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r);
}
.cb-entry-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem; color: var(--gold);
  line-height: 1;
}
.cb-entry-body { min-width: 0; }
.cb-entry-section {
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .15em; text-transform: uppercase; color: var(--teal2);
  margin-bottom: .25rem;
}
.cb-entry h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem; color: var(--head); line-height: 1.25;
  margin-bottom: .35rem;
}
.cb-entry h3 a { color: inherit; text-decoration: none; }
.cb-entry h3 a:hover { color: var(--gold2); }
.cb-entry-snippet {
  margin: .25rem 0 .65rem;
  color: var(--body); font-size: .92rem; line-height: 1.6;
  padding: .65rem .85rem;
  border-left: 2px solid var(--accent, var(--teal));
  background: rgba(255,255,255,.02);
  border-radius: 0 6px 6px 0;
}
.cb-entry-url {
  font-family: 'DM Mono', monospace; font-size: .75rem;
  color: var(--soft); word-break: break-all;
}
.cb-item-snippet {
  font-size: .72rem; color: var(--soft); line-height: 1.5;
  margin-top: .2rem;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
}
.cb-entry-remove {
  align-self: center;
  background: transparent; border: 1px solid var(--line);
  border-radius: 6px; color: var(--soft);
  padding: .35rem .65rem;
  font-family: 'DM Mono', monospace; font-size: .65rem;
  letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer;
  transition: all .2s var(--tr);
}
.cb-entry-remove:hover { color: var(--rust); border-color: rgba(158,79,58,.4); }

.cb-page-empty {
  padding: 5rem 2rem; text-align: center;
  color: var(--soft);
}
.cb-page-empty h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; color: var(--soft); margin-bottom: 1rem;
}
.cb-plus-glyph {
  display: inline-block; padding: 0 .5rem;
  background: rgba(62,173,168,.1); color: var(--teal2);
  border: 1px solid var(--teal);
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
}
.cb-shared-banner {
  display: flex; gap: 2rem; justify-content: space-between;
  padding: 1.75rem 2rem;
  background: rgba(62,173,168,.06);
  border: 1px solid rgba(62,173,168,.3);
  border-radius: var(--r2);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.cb-shared-banner h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem; color: var(--head);
  margin-bottom: .35rem;
}

/* Print stylesheet — clean linear layout */
@media print {
  nav.top, footer.site, .clipbook-widget, .cb-toolbar,
  .cb-binders, .cb-page-storage, .cb-entry-remove,
  .docs-sidebar, .docs-toc, .nav-links, .hero-ctas { display: none !important; }
  body { background: white !important; color: black !important; }
  body::before { display: none; }
  #clipbook-root { padding: 1rem !important; max-width: 100% !important; }
  .cb-entry {
    background: white !important; border: none !important;
    border-bottom: 1px solid #ccc !important;
    page-break-inside: avoid;
    color: black !important;
  }
  .cb-entry h3, .cb-page-head h1 { color: black !important; }
  .cb-entry-section { color: #555 !important; }
  .cb-entry-url { color: #333 !important; }
  .cb-entry h3 a { color: black !important; }
  .cb-entry-num { color: #999 !important; }
  .md a { color: black !important; text-decoration: none; }
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */

/* Wide monitors — let the docs shell breathe instead of capping at 1380px.
   Wider main column means tables (especially DB-Procs-Catalog with its
   PROC / PURPOSE / SELECTTYPE / PARAMS / RETURNS columns) fit comfortably
   without horizontal scrollbar. The flexible main column scales while
   sidebars stay anchored at readable widths. */
@media (min-width: 1600px) {
  .docs-shell { max-width: 1700px; grid-template-columns: 300px minmax(0, 1fr) 260px; }
}
@media (min-width: 1920px) {
  .docs-shell { max-width: 1880px; grid-template-columns: 320px minmax(0, 1fr) 280px; }
}

@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 860px) {
  nav.top { padding: .85rem 1.25rem; gap: .75rem; flex-wrap: nowrap; }
  .nav-hamburger {
    display: block;
    margin-left: auto;     /* push to the right edge of the bar */
    order: 99;             /* defensive: stay last regardless of DOM order */
  }

  /* The nav-panel becomes a single slide-in drawer on mobile. */
  .nav-panel {
    display: flex !important;
    flex-direction: column; align-items: stretch;
    position: fixed; top: 0; right: -110%;
    width: 320px; max-width: 90vw;
    height: 100vh; height: 100dvh;
    padding: 5.5rem 1.5rem 1.5rem;
    background: var(--ink2);
    border-left: 1px solid var(--line);
    box-shadow: -16px 0 48px rgba(0,0,0,.5);
    transition: right .35s var(--tr);
    z-index: 100; overflow-y: auto;
    gap: .5rem;
  }
  body.nav-open .nav-panel { right: 0; }
  body.nav-open { overflow: hidden; }

  .nav-links, .nav-right {
    position: static;
    flex-direction: column; align-items: stretch;
    width: 100%; padding: 0;
    background: transparent; border: none; box-shadow: none;
    gap: .25rem;
  }
  .nav-right {
    margin-top: auto;       /* push user pill to the bottom of the panel */
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  /* Each group expands inline on mobile (no hover-dropdowns). */
  .nav-group { width: 100%; border-bottom: 1px solid var(--line); padding: .25rem 0; }
  .nav-group:last-child { border-bottom: none; }
  .nav-trigger {
    width: 100%; justify-content: space-between;
    padding: .85rem .25rem;
    font-size: .7rem; letter-spacing: .2em;
    border: none; border-radius: 0;
    color: var(--gold);
  }
  .nav-trigger:hover, .nav-group.open .nav-trigger {
    background: transparent; border: none; color: var(--gold2);
  }
  .nav-dropdown {
    position: static;
    background: transparent; border: none;
    box-shadow: none; padding: 0 0 .35rem .5rem;
    min-width: 0;
    /* Always visible on mobile — no hover gimmick. */
    opacity: 1; visibility: visible; transform: none;
    transition: none;
  }
  .nav-dropdown a {
    padding: .65rem .5rem;
    font-size: .82rem; letter-spacing: .1em;
  }

  /* User pill in mobile menu — full width with bigger tap targets. */
  .user-pill {
    flex-wrap: wrap; gap: .5rem; padding: .65rem .85rem;
    width: 100%;
  }
  .user-pill .user-logout, .user-pill .user-viewas {
    border-left: none; padding: .35rem .55rem; margin-left: 0;
    font-size: .65rem;
  }
  .nav-cta { width: 100%; text-align: center; }

  section { padding: 4rem 1.25rem; }
  .split-grid { grid-template-columns: 1fr; gap: 2rem; }
  .docs-shell { grid-template-columns: 1fr; padding: 2rem 1.25rem 4rem; }

  /* Mobile docs sidebar: collapse into a tap-to-expand disclosure so
     users land on the actual doc content, not a 35-link wall. Powered
     by <details class="docs-sidebar-wrap"> — site.js auto-collapses it
     on mobile load + on link tap. The summary becomes a styled button.

     IMPORTANT: explicitly OVERRIDE the desktop position:sticky + max-height
     + overflow-y rules. On mobile we want the wrapper to flow naturally in
     the document — when user scrolls, the page scrolls. Internal scrolling
     happens INSIDE the inner aside (capped at 70vh below) so a long link
     list doesn't dominate the viewport, but the wrapper itself doesn't pin
     to top:5rem (which was the bug — sidebar stayed put while page moved
     under it, looked like the page was "fixed"). */
  .docs-sidebar-wrap {
    display: block;
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r);
    background: rgba(255,255,255,.015);
    overflow: hidden;
  }
  .docs-sidebar-toggle {
    display: block;
    padding: .85rem 1rem;
    font-family: 'DM Mono', monospace;
    font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
    color: var(--gold2);
    cursor: pointer;
    list-style: none;
    user-select: none;
    position: relative;
  }
  /* Hide the default disclosure triangle — we'll draw our own caret */
  .docs-sidebar-toggle::-webkit-details-marker { display: none; }
  .docs-sidebar-toggle::marker { display: none; }
  .docs-sidebar-toggle::after {
    content: '▾';
    position: absolute; right: 1rem; top: 50%;
    transform: translateY(-50%);
    transition: transform .2s ease;
    color: var(--soft);
  }
  details[open] .docs-sidebar-toggle::after { transform: translateY(-50%) rotate(180deg); }

  .docs-sidebar {
    position: static;
    /* Cap inner list at ~70% of viewport with internal scroll. Long
       indexes (Integrators + Developers = 35+ links) get a contained
       scrollbar inside the disclosure box; the surrounding page still
       scrolls normally when the user pans outside this box. Combined
       with overscroll-behavior: contain so internal scroll doesn't
       chain to the body when reaching the boundary. */
    max-height: 70vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--line);
    padding: 1rem;
    margin: 0;
  }
  /* Tighten section headers + link rows for mobile-pleasant density */
  .docs-sidebar h4 { margin: .8rem 0 .35rem; }
  .docs-sidebar h4:first-child { margin-top: 0; }
  .docs-sidebar li a { padding: .35rem .6rem; font-size: .85rem; }

  /* Floating "back to top + browse docs" button. Mobile-only — hidden
     on desktop where the sticky left sidebar is always visible. Hidden
     by default; site.js adds .visible once user scrolls past ~600px so
     the button doesn't compete with above-the-fold content. */
  .docs-back-to-top {
    display: flex; align-items: center; gap: .4rem;
    /* Bottom-LEFT placement: the bottom-right corner is occupied by the
       Clipbook floating binder (the "8" badge button). Sit on the opposite
       side with a small indent so the two never collide. */
    position: fixed; bottom: 1.25rem; left: 1rem;
    padding: .65rem .95rem;
    background: var(--ink2);
    color: var(--head);
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-family: 'DM Mono', monospace;
    font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(0,0,0,.45);
    cursor: pointer;
    opacity: 0; pointer-events: none;
    transform: translateY(.5rem);
    transition: opacity .25s ease, transform .25s ease;
    z-index: 50;
  }
  .docs-back-to-top.visible {
    opacity: 1; pointer-events: auto;
    transform: translateY(0);
  }
  .docs-back-to-top:hover { background: var(--card); border-color: var(--gold2); }
  .docs-back-to-top svg { color: var(--gold2); }

  /* Mobile/tablet: shrink table cells to fit viewport. Tradeoff doctrine:
     - Code identifiers (Tools/EntityApiTest, prtl.FooBar) STAY INTACT —
       no character-break in mono. Reading char-by-char is harsher than
       a single horizontal scrollbar.
     - Prose cells wrap naturally on whitespace (default).
     - Tables wider than viewport scroll WITHIN .docs-main (overflow-x:auto
       up at the .docs-main rule), not the whole page.
     The result: most tables fit without scroll; code-heavy tables show a
     compact horizontal scrollbar at the table column level only. */
  .docs-main { font-size: .95rem; }
  .docs-main table { font-size: .82rem; }
  .docs-main table th, .docs-main table td {
    padding: .45rem .55rem;
  }
  .docs-main table code {
    white-space: nowrap; font-size: .9em;
  }
  .docs-main pre { font-size: .78rem; }
  /* API explorer: collapse the 2-pane shell into stacked sections.
     Sidebar becomes a scrollable strip you can flick through, then the
     detail flows below. Credentials inputs stack one-per-row. */
  .api-shell { grid-template-columns: 1fr; min-height: auto; }
  .api-sidebar {
    position: static; max-height: 320px;
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 1rem 0;
  }
  .api-sidebar .filter { padding: 0 1rem .85rem; }
  .api-detail { padding: 1.5rem 1.1rem; }
  .api-creds { padding: .85rem 1rem; }
  .api-creds-row {
    flex-direction: column; align-items: stretch; gap: .65rem;
  }
  .api-creds-row label {
    min-width: 0; margin-left: 0 !important;
    font-size: .65rem;
  }
  .api-creds-row input {
    min-width: 0; width: 100%; flex: none;
  }
  .api-endpoint {
    flex-wrap: wrap; gap: .5rem; padding: .65rem .85rem;
    font-size: .82rem;
  }
  .api-endpoint .url { flex: 1 1 100%; word-break: break-all; min-width: 0; }
  .api-endpoint .btn { font-size: .65rem; padding: .35rem .75rem; }
  .try-it-controls .btn { width: 100%; justify-content: center; }
  .api-table { font-size: .82rem; }
  .api-table th, .api-table td { padding: .4rem .55rem; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2rem; }

  /* Clipbook on small screens */
  .clipbook-widget { right: .75rem; bottom: .75rem; }
  .cb-pill { padding: .55rem .85rem; font-size: .72rem; }
  .cb-binder-name { max-width: 110px; }
  .cb-panel { width: calc(100vw - 1.5rem); right: -.25rem; }
  #clipbook-root { padding: 4rem 1.25rem 3rem; }
  /* .cb-page-head is now flex-column at all sizes; nothing to override on mobile. */
  .cb-entry { grid-template-columns: auto 1fr; }
  .cb-entry-remove { grid-column: 2; justify-self: start; }
  .cb-binders { grid-template-columns: 1fr; padding: .75rem; }

  /* Larger touch targets */
  .clip { width: 28px; height: 28px; opacity: 1; }
  .lib-file { padding: .85rem 1rem; }

  /* User pill wraps gracefully on phones */
  .user-pill { flex-wrap: wrap; gap: .35rem; padding: .35rem .55rem; }
  .user-pill .user-logout, .user-pill .user-viewas {
    border-left: none; padding: .15rem .35rem; margin-left: 0;
  }

  /* Section labels can be tight */
  .lib-section-head { gap: 1rem; }
  .lib-section-actions { width: 100%; }

  /* Hero compactness on phones — title still big, vertical eaten less. */
  #hero { min-height: auto; padding: 5rem 1.25rem 4rem; }
  .hero-title { font-size: clamp(2.6rem, 11vw, 4.5rem); }
  .hero-subtitle { font-size: clamp(1rem, 4vw, 1.3rem); }
  .hero-tagline { margin-bottom: 2rem; }
  .hero-divider { margin: 1.5rem auto; }
  .hero-ctas { gap: .65rem; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .hero-meta { margin-top: 2rem; }
  .hero-scroll-cta { margin: 1.25rem auto 1rem; padding: .65rem 1.15rem; gap: .65rem; }
  .hero-scroll-label { font-size: 1.1rem; }
  .hero-scroll-step { font-size: .55rem; padding: .2rem .55rem; }

  /* Tile grids tighter min so 2-up still works on narrow phones. */
  .tile-grid, .dl-grid { grid-template-columns: 1fr; gap: 1rem; }
  .tile { padding: 1.4rem; }

  /* Section titles tighter */
  .section-title { font-size: clamp(1.6rem, 6vw, 2.4rem); }

  /* Examples cards narrow on phones */
  .ex-card { padding: 1.25rem 1.25rem; }
  .ex-title { font-size: 1.25rem; }
  .ex-body { font-size: .75rem; padding: .65rem .85rem; }

  /* Footer single-column on phones */
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; padding: 0 .25rem; }
  .footer-copy { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* Extra-small phones — 480px and below */
@media (max-width: 480px) {
  nav.top { padding: .75rem 1rem; gap: .5rem; }
  .nav-logo { font-size: 1rem; }
  .nav-logo span { display: none; }
  section { padding: 3rem 1rem; }
  .hero-title { font-size: clamp(2.2rem, 13vw, 3.5rem); }
  #hero { padding: 4rem 1rem 3rem; }
  .docs-shell, .docs-main, #clipbook-root { padding-left: 1rem; padding-right: 1rem; }
  .api-detail { padding: 1.25rem 1rem; }

  /* JSON code blocks scroll horizontally on tiny phones rather than overflow */
  .md pre, .api-body, .ex-body { font-size: .72rem; }

  .stat-row { gap: 1.25rem; }
  .stat-num { font-size: 2rem; }

  /* Even bigger floating clipbook pill so thumbs hit it cleanly */
  .cb-pill { padding: .65rem 1rem; font-size: .68rem; }
  .cb-binder-name { display: none; }   /* just show count + binder icon on tiny screens */
}
