/* ========================================================
   Patch Docs Site — self-contained stylesheet
   Hosted on the docs. subdomain. Matches the marketing
   site's design tokens (web/css/main.css) exactly, but is
   independent — nothing here depends on web/.
   ======================================================== */

/* ---- Design tokens (mirror web/css/main.css) ---- */
:root {
  --bg: #fbfbfb;
  --paper: #fff;
  --ink: #2a2d33;
  --sub: #5b6066;
  --faint: #9aa0a7;
  --line: #ededee;
  --line2: #e2e2e4;

  /* Brand blue (called "orange" in the marketing handoff for legacy reasons) */
  --orange: #0a7aff;
  --orange-d: #0a61cf;
  --orange-soft: #e8f1ff;
  --orange-line: #cfe0fb;

  --green: #1f9d57;
  --green-soft: #e7f4ed;
  --gray: #aeb2b8;
  --gray-soft: #f1f2f3;

  --sans: "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ui: "Geist", system-ui, -apple-system, sans-serif;
  --disp: "Instrument Sans", "Geist", system-ui, sans-serif;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--disp); }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
svg { display: block; }
::selection { background: var(--orange-soft); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 40px; }
.mono { font-family: var(--mono); letter-spacing: 0; }

/* ---- Buttons (pill) ---- */
.btn {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: 100px;
  padding: 12px 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: 0.16s;
  white-space: nowrap;
}
.btn-pri { background: var(--orange); color: #fff; }
.btn-pri:hover { background: var(--orange-d); }
.btn-gho { background: var(--paper); color: var(--ink); border-color: var(--line2); }
.btn-gho:hover { border-color: var(--ink); }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.arrow { transition: transform 0.16s; }
.btn:hover .arrow { transform: translateX(3px); }

/* ---- Navigation (sticky frosted) ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 251, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  font-family: var(--ui);
}
.nav-in {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--ui);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.brand .m {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(10, 97, 207, 0.3);
}
.brand .docs-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-d);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  border-radius: 6px;
  padding: 2px 7px;
  letter-spacing: 0;
}
.nlinks { display: flex; gap: 2px; align-items: center; }
.nlink {
  font-size: 14.5px;
  color: var(--sub);
  padding: 8px 13px;
  border-radius: 8px;
  font-weight: 500;
  white-space: nowrap;
}
.nlink:hover { color: var(--ink); }
.nact { display: flex; align-items: center; gap: 12px; }

/* ---- Docs search box (client-side anchor filter) ---- */
.docs-search { position: relative; }
.docs-search input {
  font-family: var(--ui);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 100px;
  padding: 8px 14px 8px 32px;
  width: 190px;
  transition: border-color 0.15s, width 0.2s;
  outline: none;
}
.docs-search input:focus { border-color: var(--orange); width: 220px; }
.docs-search svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 14px; height: 14px;
  color: var(--faint);
  pointer-events: none;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: 0 24px 56px -28px rgba(16, 18, 22, 0.3);
  padding: 6px;
  display: none;
  z-index: 80;
}
.search-results.open { display: block; }
.search-results a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-family: var(--ui);
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.4;
}
.search-results a small {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  margin-top: 2px;
}
.search-results a:hover, .search-results a.active { background: var(--orange-soft); color: var(--orange-d); }
.search-results .empty { padding: 12px; font-size: 13.5px; color: var(--faint); font-family: var(--ui); }

/* ---- Docs shell: sticky sidebar + content ---- */
.docs-wrap {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ---- Sidebar / nav ---- */
.docs-side {
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 32px 0 60px;
  font-family: var(--ui);
}
.docs-side .toc-h {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 24px 0 8px;
  padding-left: 14px;
}
.docs-side .toc-h:first-child { margin-top: 0; }
.docs-nav { display: flex; flex-direction: column; gap: 1px; }
.docs-nav a {
  font-size: 14px;
  color: var(--sub);
  padding: 7px 14px;
  border-left: 2px solid var(--line);
  font-weight: 500;
  line-height: 1.35;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.docs-nav a:hover { color: var(--ink); }
.docs-nav a.on {
  color: var(--orange-d);
  border-left-color: var(--orange);
  background: var(--orange-soft);
}
.docs-nav a.sub { padding-left: 26px; font-size: 13px; }

/* ---- Mobile sidebar toggle (hidden on desktop) ---- */
.docs-side-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
}
.docs-side-toggle .chev {
  width: 16px; height: 16px;
  transition: transform 0.2s;
  color: var(--faint);
}
.docs-side-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }

/* ---- Content column ---- */
.docs-main { padding: 40px 0 100px; min-width: 0; }
.docs-hero { padding: 8px 0 12px; }
.docs-hero .kick {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 12px;
}
.docs-hero h1 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.docs-hero h1 .o { color: var(--orange); }
.docs-hero p {
  margin-top: 16px;
  font-size: 18px;
  color: var(--sub);
  max-width: 62ch;
}
.docs-hero-cta { margin-top: 24px; display: flex; gap: 11px; flex-wrap: wrap; }

/* ---- Section structure ---- */
.docs-sec { padding-top: 60px; scroll-margin-top: 80px; }
.docs-sec > h2 {
  font-family: var(--disp);
  font-size: clamp(24px, 3vw, 33px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.12;
  padding-bottom: 6px;
}
.docs-sec h3 {
  font-family: var(--disp);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 38px;
  scroll-margin-top: 80px;
}
.docs-sec h4 {
  font-family: var(--ui);
  font-size: 15.5px;
  font-weight: 600;
  margin-top: 26px;
  color: var(--ink);
}
.docs-sec p {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--sub);
  line-height: 1.62;
  max-width: 72ch;
}
.docs-sec ul, .docs-sec ol {
  margin-top: 14px;
  padding-left: 22px;
  max-width: 72ch;
}
.docs-sec li {
  font-size: 16.5px;
  color: var(--sub);
  line-height: 1.6;
  margin-top: 7px;
}
.docs-sec li b, .docs-sec p b { color: var(--ink); font-weight: 600; }
.docs-sec a.ilink { color: var(--orange-d); font-weight: 500; }
.docs-sec a.ilink:hover { text-decoration: underline; }

/* Anchor link affordance on hover over headings */
.docs-sec h2, .docs-sec h3 { position: relative; }
.anchor-link {
  opacity: 0;
  margin-left: 8px;
  font-size: 0.8em;
  color: var(--faint);
  transition: opacity 0.15s, color 0.15s;
  font-family: var(--mono);
}
.docs-sec h2:hover .anchor-link,
.docs-sec h3:hover .anchor-link { opacity: 1; }
.anchor-link:hover { color: var(--orange-d); }

/* Inline code chip — only real inline code (direct child of a non-pre element),
   never the <code> inside a .cb pre block (which must stay multi-line, unstyled). */
.docs-sec :not(pre) > code:not([class]),
.ic {
  font-family: var(--mono);
  font-size: 13.5px;
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  color: var(--ink);
  white-space: nowrap;
}

.docs-rule { height: 1px; background: var(--line); margin: 8px 0; }

/* ---- Note / callout boxes ----
   DESIGN INTENT: every callout is a plain grey box — light grey fill, thin
   neutral border, rounded corners, neutral (grey/ink) title. NO colored left
   stripe and NO colored title for ANY variant (.note, .note.safe, .note.warn).
   The variant classes (.safe / .warn) are kept in the markup for semantics only
   and must NOT introduce color. Do not re-add a coloured border-left here. */
.note,
.note.safe,
.note.warn {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line); /* explicit: never a coloured accent stripe */
  background: var(--gray-soft);
  border-radius: 12px;
  padding: 16px 20px;
}
.note .nt,
.note.safe .nt,
.note.warn .nt {
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sub); /* neutral grey title — never a brand/green/amber colour */
  margin-bottom: 6px;
}
.note p { margin-top: 4px; font-size: 15.5px; max-width: none; }
.note p:first-of-type { margin-top: 0; }
.note ul { margin-top: 8px; }
.note li { font-size: 15px; }

/* ---- Code blocks (dark terminal style) ---- */
.cb {
  position: relative;
  margin-top: 20px;
  background: #15171c;
  border: 1px solid #15171c;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 30px 70px -42px rgba(16, 18, 22, 0.5);
}
.cb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid #24272f;
  background: #1b1e25;
}
.cb-bar i { width: 11px; height: 11px; border-radius: 50%; display: block; }
.cb-bar i:nth-child(1) { background: #ff5f57; }
.cb-bar i:nth-child(2) { background: #febc2e; }
.cb-bar i:nth-child(3) { background: #28c840; }
.cb-bar .nm { margin-left: 8px; font-family: var(--mono); font-size: 12px; color: #7c828c; }
/* CODE blocks (swift / yaml) read as a source file, NOT a terminal: drop the
   macOS traffic-light dots and show a language tag instead. */
.cb[data-lang="swift"] .cb-bar i,
.cb[data-lang="yaml"] .cb-bar i { display: none; }
.cb[data-lang="swift"] .cb-bar,
.cb[data-lang="yaml"] .cb-bar { background: #1b1e25; padding-left: 14px; }
.cb[data-lang="swift"] .cb-bar .nm,
.cb[data-lang="yaml"] .cb-bar .nm { margin-left: 0; color: #aab2c0; }
.cb[data-lang="swift"] .cb-bar::before { content: "Swift"; }
.cb[data-lang="yaml"] .cb-bar::before { content: "YAML"; }
.cb[data-lang="swift"] .cb-bar::before,
.cb[data-lang="yaml"] .cb-bar::before {
  font-family: var(--ui); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: #8b93a7; background: #2a2e38;
  padding: 2px 7px; border-radius: 5px; margin-right: 2px;
}
.cb pre {
  margin: 0;
  padding: 18px 18px 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.85;
  color: #e4e8ee;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.cb pre code { font: inherit; color: inherit; background: none; border: 0; padding: 0; white-space: pre; }

/* Token colors */
.cb .dp { color: #5aa6ff; }    /* prompt $ */
.cb .dc { color: #fff; font-weight: 600; } /* command */
.cb .ddim { color: #7c828c; }  /* comment / dim */
.cb .dok { color: #5fd38d; }   /* success */
.cb .dwarn { color: #d8b06a; } /* values / strings */
.cb .yk { color: #5aa6ff; }    /* yaml key */
.cb .ys { color: #7fd99a; }    /* yaml string */
.cb .yc { color: #7c828c; }    /* yaml comment */
.cb .yt { color: #d8b06a; }    /* yaml template / secret */
.cb .yp { color: #9aa0a7; }    /* yaml punctuation */
.cb .ckw { color: #c792ea; }   /* swift keyword */
.cb .cty { color: #7cc5e0; }   /* swift type */
.cb .cat { color: #5aa6ff; }   /* swift attribute */
.cb .cst { color: #7fd99a; }   /* swift string */
.cb .cfn { color: #82aaff; }   /* swift function name */
.cb .cnum { color: #f78c6c; }  /* swift number */

/* ---- Swift code callouts: Xcode stock theme (theme-aware) ----
   The docs site has no in-app theme toggle, so the Swift blocks follow
   the OS appearance: Xcode "Default (Light)" on a light editor by
   default, Xcode "Default (Dark)" under prefers-color-scheme: dark.
   Scoped to [data-lang="swift"] so the terminal/YAML blocks (which stay
   dark) are untouched. */
.cb[data-lang="swift"] {
  background: #fbfbfd;
  border-color: #e2e2e4;
  box-shadow: 0 30px 70px -42px rgba(16, 18, 22, 0.2);
}
.cb[data-lang="swift"] .cb-bar {
  background: #f2f2f5;
  border-bottom-color: #e2e2e4;
}
.cb[data-lang="swift"] .cb-bar .nm { color: #6c727a; }
.cb[data-lang="swift"] .cb-bar::before {
  color: #5b6066;
  background: #e6e6ea;
}
.cb[data-lang="swift"] pre { color: #1d1d1f; }   /* plain text */
/* Xcode "Default (Light)" token palette */
.cb[data-lang="swift"] .ddim { color: #707f8c; } /* comment */
.cb[data-lang="swift"] .ckw  { color: #ad3da4; } /* keyword */
.cb[data-lang="swift"] .cty  { color: #3f6e75; } /* type / class */
.cb[data-lang="swift"] .cat  { color: #0f68a0; } /* attribute */
.cb[data-lang="swift"] .cst  { color: #d12f1b; } /* string */
.cb[data-lang="swift"] .cfn  { color: #0f68a0; } /* function / method */
.cb[data-lang="swift"] .cnum { color: #272ad8; } /* number */
/* Light-mode copy button on the light Swift editor */
.cb[data-lang="swift"] .cb-copy {
  color: #5b6066;
  background: #ececef;
  border-color: #d8d8dc;
}
.cb[data-lang="swift"] .cb-copy:hover { color: #1d1d1f; border-color: #c4c4c9; }
.cb[data-lang="swift"] .cb-copy.ok { color: #1f9d57; border-color: #bfe4cf; }

@media (prefers-color-scheme: dark) {
  .cb[data-lang="swift"] {
    background: #1f1f24;
    border-color: #1f1f24;
    box-shadow: 0 30px 70px -42px rgba(16, 18, 22, 0.5);
  }
  .cb[data-lang="swift"] .cb-bar {
    background: #1b1e25;
    border-bottom-color: #24272f;
  }
  .cb[data-lang="swift"] .cb-bar .nm { color: #aab2c0; }
  .cb[data-lang="swift"] .cb-bar::before {
    color: #8b93a7;
    background: #2a2e38;
  }
  .cb[data-lang="swift"] pre { color: #e7e7ea; } /* plain text */
  /* Xcode "Default (Dark)" token palette */
  .cb[data-lang="swift"] .ddim { color: #7f8c98; } /* comment */
  .cb[data-lang="swift"] .ckw  { color: #ff7ab2; } /* keyword */
  .cb[data-lang="swift"] .cty  { color: #6bdfff; } /* type / class */
  .cb[data-lang="swift"] .cat  { color: #67b7a4; } /* attribute */
  .cb[data-lang="swift"] .cst  { color: #fc6a5d; } /* string */
  .cb[data-lang="swift"] .cfn  { color: #67b7a4; } /* function / method */
  .cb[data-lang="swift"] .cnum { color: #d0bf69; } /* number */
  /* Restore the original dark copy button */
  .cb[data-lang="swift"] .cb-copy {
    color: #aeb6c2;
    background: #24272f;
    border-color: #31353e;
  }
  .cb[data-lang="swift"] .cb-copy:hover { color: #fff; border-color: #444a55; }
  .cb[data-lang="swift"] .cb-copy.ok { color: #5fd38d; border-color: #2c5a3d; }
}

/* Copy button */
.cb-copy {
  position: absolute;
  top: 9px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 600;
  color: #aeb6c2;
  background: #24272f;
  border: 1px solid #31353e;
  border-radius: 7px;
  padding: 5px 9px;
  cursor: pointer;
  transition: 0.15s;
}
.cb-copy:hover { color: #fff; border-color: #444a55; }
.cb-copy.ok { color: #5fd38d; border-color: #2c5a3d; }
.cb-copy svg { width: 13px; height: 13px; }

/* ---- Reference tables ---- */
.docs-table-wrap { margin-top: 22px; overflow-x: auto; border: 1px solid var(--line2); border-radius: 14px; }
table.docs-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
table.docs-table thead th {
  text-align: left;
  font-family: var(--ui);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--faint);
  padding: 13px 18px;
  background: #fafafb;
  border-bottom: 1px solid var(--line2);
}
table.docs-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--sub);
  vertical-align: top;
  line-height: 1.5;
}
table.docs-table tr:last-child td { border-bottom: 0; }
table.docs-table td:first-child { white-space: nowrap; }
table.docs-table code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
}
table.docs-table td .flag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--orange-d);
  margin: 1px 0;
}

/* ---- Tier cards ---- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.tier-card {
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 22px 20px;
}
.tier-card .tg {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--orange-d);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
  border-radius: 100px;
  padding: 3px 10px;
  display: inline-block;
}
.tier-card h4 { margin-top: 12px; font-size: 16px; font-weight: 600; }
.tier-card .sz {
  margin-top: 4px;
  font-family: var(--disp);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.tier-card p { margin-top: 8px; font-size: 14px; color: var(--sub); line-height: 1.5; max-width: none; }

/* ---- Flow diagram ---- */
.flow {
  margin-top: 24px;
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.flow-step {
  flex: 1 1 0;
  min-width: 150px;
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}
.flow-step .fi {
  width: 34px; height: 34px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--orange-soft);
  color: var(--orange-d);
}
.flow-step .fi svg { width: 18px; height: 18px; }
.flow-step h4 { margin-top: 0; font-size: 14px; font-weight: 600; }
.flow-step p { margin-top: 5px; font-size: 12.5px; color: var(--faint); max-width: none; line-height: 1.45; }
.flow-arrow {
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  color: var(--gray);
}
.flow-arrow svg { width: 20px; height: 20px; }

/* ---- Classification legend pills ---- */
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--sub);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 5px 12px 5px 8px;
}
.pill { font-family: var(--mono); font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 5px; }
.pill.w { background: var(--green-soft); color: var(--green); }
.pill.b { background: var(--orange-soft); color: var(--orange-d); }
.pill.s { background: var(--orange-soft); color: var(--orange-d); }
.pill.n { background: var(--gray-soft); color: #7c7468; }

/* ---- Steps (numbered quick-start path) ---- */
.steps { margin-top: 22px; display: flex; flex-direction: column; }
.step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.step:first-child { border-top: 0; padding-top: 4px; }
.step .n {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 100px;
  background: var(--orange-soft);
  color: var(--orange-d);
  font-family: var(--ui);
  font-size: 14px;
  font-weight: 700;
}
.step .sc { min-width: 0; }
.step h4 { margin-top: 2px; font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; }
.step p { margin-top: 6px; font-size: 15.5px; }
.step .cb { margin-top: 14px; }

/* ---- Role / generic two-col cards ---- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}
.role-card {
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 16px;
  padding: 20px;
}
.role-card .rh {
  font-family: var(--ui);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-card .rh .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.role-card.admin .rh .dot { background: var(--green); }
.role-card.member .rh .dot { background: var(--gray); }
.role-card p { margin-top: 8px; font-size: 14px; color: var(--sub); line-height: 1.5; max-width: none; }

/* ---- "On this page" footer CTA ---- */
.docs-foot-cta {
  margin-top: 64px;
  padding: 30px 28px;
  background: var(--gray-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.docs-foot-cta h3 { font-family: var(--disp); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 0; }
.docs-foot-cta p { margin-top: 4px; font-size: 14.5px; color: var(--sub); max-width: none; }

/* ---- FAQ accordion ---- */
.faq { margin: 22px 0 0; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 4px;
  font-family: var(--disp);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  transition: color 0.15s;
}
.faq-q:hover { color: var(--orange-d); }
.faq-ico { flex: none; width: 18px; height: 18px; position: relative; }
.faq-ico::before, .faq-ico::after {
  content: "";
  position: absolute;
  background: var(--orange);
  border-radius: 2px;
}
.faq-ico::before { top: 8px; left: 0; right: 0; height: 2px; }
.faq-ico::after { left: 8px; top: 0; bottom: 0; width: 2px; transition: opacity 0.25s, transform 0.25s; }
.faq-item.open .faq-ico::after { opacity: 0; transform: scaleY(0); }
.faq-a { overflow: hidden; max-height: 0; transition: max-height 0.32s ease; }
.faq-a p { padding: 0 4px 24px; font-size: 16px; color: var(--sub); line-height: 1.6; max-width: 72ch; }
.faq-a p:first-of-type { margin-top: 0; }

/* ---- Footer ---- */
.foot { border-top: 1px solid var(--line); padding: 42px 0 36px; font-family: var(--ui); }
.foot .wrap { max-width: 1300px; }
.foot-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 32px; }
.foot p { font-size: 14.5px; color: var(--sub); max-width: 30ch; margin-top: 14px; }
.foot h5 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); margin-bottom: 14px; }
.foot a { display: block; font-size: 14.5px; color: var(--sub); padding: 4px 0; }
.foot a:hover { color: var(--orange-d); }
.foot-bot {
  display: flex;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--faint);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---- Responsive ---- */
@media (max-width: 980px) {
  .docs-wrap { grid-template-columns: 1fr; gap: 0; padding: 0 32px; }
  .docs-side {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 18px 0 0;
    border-bottom: 1px solid var(--line);
  }
  .docs-side-toggle { display: flex; }
  .docs-side .toc-h:first-child { margin-top: 18px; }
  .docs-side .toc-body { display: none; }
  .docs-side.open .toc-body { display: block; padding-bottom: 18px; }
  .docs-main { padding-top: 24px; }
  .tier-grid, .role-grid { grid-template-columns: 1fr; }
  .flow-arrow { flex-basis: 100%; transform: rotate(90deg); height: 26px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .docs-search { display: none; }
  .nlinks .nlink.hide-sm { display: none; }
  /* Keep the remaining in-bar links from forcing the nav wider than the
     viewport; the full section list still lives in the mobile sidebar TOC. */
  .nav-in { gap: 12px; }
  .nlinks { min-width: 0; overflow: hidden; }
  .nlinks .nlink { padding: 8px 9px; }
}
@media (max-width: 560px) {
  /* On small phones the section links would overflow the bar — drop them and
     rely on the sidebar TOC (which is always visible on mobile) for navigation.
     The brand + Dashboard button stay on one tidy row. */
  .nlinks { display: none; }
  .nav-in { justify-content: space-between; }
}
@media (max-width: 600px) {
  .nav-in { padding: 0 22px; }
  .docs-wrap { padding: 0 22px; }
  .docs-sec p, .docs-sec li { font-size: 15.5px; }
  .foot-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
