/* ═══════════════════════════════════════════════════════════════════════════
   SERVICEPROOF DEVELOPERS - dev.riproka.com (alias dev.serviceproof.net)

   🛑 THE PALETTE IS NOT HERE. rk-tokens.css is the product's own token file,
   staged in by the csproj and linked AHEAD of this sheet, so the developer site
   wears exactly the portal's light theme and follows it when it changes.

   Do not paste token values into this file. The first cut did, and
   DesignSystemTests failed it on the spot - a literal colour is a control that
   will not flip with the theme, and a pasted palette drifts silently.

   What IS declared below is site-only: layout rhythm and the per-group accent
   rails. None of it is a colour the product also has a name for.

   Two rules inherited from the product and worth restating where somebody edits
   this file:
     - NEVER pair background: var(--rk-ink) with color: var(--rk-white). In the
       dark theme both resolve to #e9e4d8 - invisible text. Permanent dark chrome
       uses --rk-chrome-bg / --rk-chrome-ink, which do not flip.
     - Small text uses --rk-accent-ink, never --rk-accent. The raw accent is
       3.5:1 on a card and fails the 4.5:1 floor.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Rhythm - site-only. */
  --wrap:   1180px;
  --gutter: 1.5rem;
  --radius: 3px;

  /* Per-group accent rails, named by DocCatalog.Accent. These are ALIASES onto
     product tokens rather than new colours; --theme-warn is the one exception
     and is a darkened amber because the product's warn doubles as the accent,
     which would make two groups identical. */
  --theme-accent: var(--rk-accent);
  --theme-steel:  var(--rk-steel);
  --theme-ok:     var(--rk-ok);
  --theme-warn:   var(--rk-warn-ink);
  --theme-danger: var(--rk-danger);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--rk-paper);
  color: var(--rk-ink);
  font-family: var(--rk-font-body);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* text-wrap: balance on every heading. Display type at clamp() sizes changes its
   line count across the viewport range, and a break that reads well at one width
   orphans a two-word line at another. Balancing lets the browser even them out
   per reader instead of us guessing - which is what the hard <br> in the hero
   headline was doing wrong. */
h1, h2, h3, h4 { font-family: var(--rk-font-display); font-weight: 700; line-height: 1.08; letter-spacing: .005em; margin: 0 0 .6rem; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); text-transform: uppercase; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }
a { color: var(--rk-accent-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rk-ink); }

code, kbd, pre, .mono { font-family: var(--rk-font-mono); font-variant-ligatures: none; }
code { font-size: .875em; background: var(--rk-accent-soft); color: var(--rk-accent-ink); padding: .1em .38em; border-radius: 2px; }
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 999; background: var(--rk-accent); color: var(--rk-on-fill); padding: .6rem 1rem; }

:focus-visible { outline: 2px solid var(--rk-accent); outline-offset: 2px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ─── Header ─────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky; top: 0; z-index: 100;
  background: var(--rk-chrome-bg);
  color: var(--rk-chrome-ink);
  border-bottom: 3px solid var(--rk-accent);
}

.head-inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 2rem; min-height: 60px;
}

.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--rk-accent); color: var(--rk-on-fill);
  font-family: var(--rk-font-display); font-weight: 700; font-size: 1.2rem;
  /* Cut corner - the house shape. */
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text b { font-family: var(--rk-font-display); font-size: 1.15rem; letter-spacing: .06em; }
.brand-text i { font-style: normal; font-size: .64rem; letter-spacing: .22em; text-transform: uppercase; color: var(--rk-chrome-mute); }

.site-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; align-items: center; gap: .25rem; margin: 0; padding: 0; }

.nav-link, .nav-list a, .nav-trigger {
  font-family: var(--rk-font-display); font-size: .95rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--rk-chrome-ink); text-decoration: none;
  padding: .45rem .7rem; border-radius: var(--radius);
  background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
}
.nav-link:hover, .nav-list a:hover, .nav-trigger:hover { background: rgba(255,255,255,.1); color: var(--rk-chrome-ink); }
/* 🛑 THE ACTIVE COLOUR IS SCOPED TO THE BAR, AND THE `>` IS THE WHOLE POINT.
   This was `.nav-list a.active`, which also matched links INSIDE the dropdown -
   and the dropdown is a light card, so the active item rendered #fdeee3 on
   #fffdf7, about 1.05:1. Invisible. It read as a disabled menu item.
   That is the invisible-text trap the token file warns about, arrived at from
   the other direction: not ink-on-ink, but a pale chrome colour used on paper. */
.nav-link.active,
.nav-list > li > a.active { color: var(--rk-warn-soft); }

/* The same state on the light dropdown needs an on-paper colour. */
.nav-dropdown a.active { color: var(--rk-accent-ink); font-weight: 600; }

.nav-group { position: relative; }
.nav-dropdown {
  display: none; position: absolute; right: 0; top: 100%; min-width: 210px;
  background: var(--rk-card); border: 1px solid var(--rk-line-hard);
  border-top: 3px solid var(--rk-accent);
  list-style: none; margin: 0; padding: .4rem; box-shadow: 0 10px 28px rgba(22,35,45,.22);
}
/* site.js toggles `.open` on click - which is what makes these reachable on a
   touch screen and from the keyboard. Hover alone is a desktop-mouse assumption. */
.nav-group.open .nav-dropdown, .nav-group:hover .nav-dropdown { display: block; }
.nav-dropdown a { color: var(--rk-ink); display: block; text-transform: none; font-family: var(--rk-font-body); font-size: .9rem; letter-spacing: 0; font-weight: 500; }
.nav-dropdown a:hover { background: var(--rk-accent-soft); color: var(--rk-accent-ink); }
.nav-chev { opacity: .55; }

.nav-search-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: var(--rk-chrome-mute); padding: .35rem .6rem; border-radius: var(--radius);
  font-family: var(--rk-font-body); font-size: .82rem; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.nav-search-btn:hover { background: rgba(255,255,255,.14); color: var(--rk-chrome-ink); }
.nav-search-kbd { font-size: .68rem; padding: .05em .3em; border: 1px solid rgba(255,255,255,.22); border-radius: 2px; }

.nav-account { display: flex; align-items: center; gap: .4rem; margin-left: .5rem; padding-left: .75rem; border-left: 1px solid rgba(255,255,255,.18); }
.nav-who {
  width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--rk-steel); color: var(--rk-on-fill);
  font-family: var(--rk-font-mono); font-size: .68rem; font-weight: 700; border-radius: 50%;
}
.nav-signout { margin: 0; }
.nav-link-quiet { color: var(--rk-chrome-mute); font-size: .78rem; }

/* 🛑 .nav-hamburger, NOT .nav-burger - site.js queries it by that name, and the
   name it queried never existed, so the click handler bound to nothing and the
   whole navigation was unreachable on a phone. */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: .6rem; margin-left: auto;
  /* 44px is the accessible minimum touch target, and this is the one control a
     phone user cannot do without. */
  min-width: 44px; min-height: 44px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--rk-chrome-ink);
  transition: transform .18s ease, opacity .18s ease;
}
/* The bars become an X while the panel is open, so the button says what it does. */
body.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; }
body.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* The backdrop. site.js closes the panel when this is clicked, so it is the
   tap-anywhere-to-dismiss affordance as well as the dimmer. */
.nav-mobile-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(11, 19, 25, .5);
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
body.nav-open .nav-mobile-overlay { opacity: 1; visibility: visible; }

/* ─── Hero ───────────────────────────────────────────────────────────────── */

.hero {
  background:
    linear-gradient(180deg, var(--rk-card) 0%, var(--rk-paper) 100%);
  border-bottom: 1px solid var(--rk-line);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem);
  position: relative; overflow: hidden;
}
.hero::before {
  /* Blueprint grid, very faint - the job-ticket texture. */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(var(--rk-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--rk-line) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, rgba(0,0,0,1) 0%, transparent 72%);
}
.hero > .wrap { position: relative; }
.hero-tight { padding-bottom: 2.5rem; }

.eyebrow {
  font-family: var(--rk-font-mono); font-size: .74rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--rk-accent-ink);
  margin-bottom: 1rem;
}
.eyebrow::before { content: "▚ "; opacity: .5; }

/* No hard line breaks in the headline. A <br> orphaned "IS A" on its own line
   at most widths, and a break that is right at 1280px is wrong at 900px and on
   a phone. text-wrap: balance evens the lines out at whatever width the reader
   actually has; the measure just stops it running too long on a wide screen. */
.hero h1 { max-width: 24ch; text-wrap: balance; }
.hero h1 .hl { color: var(--rk-accent-ink); }

.lede { font-size: clamp(1.05rem, 1.7vw, 1.22rem); color: var(--rk-ink-soft); max-width: 68ch; margin-top: 1.25rem; }

.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.hero-stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; padding-top: 1.75rem; border-top: 1px dashed var(--rk-line-hard); }
.stat { display: flex; flex-direction: column; }
.stat b { font-family: var(--rk-font-mono); font-size: 2.1rem; font-weight: 700; line-height: 1; color: var(--rk-ink); }
.stat span { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); margin-top: .35rem; }

/* ─── Buttons ────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--rk-font-display); font-size: 1rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  padding: .62rem 1.3rem; border-radius: var(--radius);
  border: 1.5px solid var(--rk-ink); background: transparent; color: var(--rk-ink);
  text-decoration: none; cursor: pointer; transition: transform .08s ease, background .12s ease;
}
.btn:hover { background: var(--rk-ink); color: var(--rk-on-fill); transform: translateY(-1px); }
.btn-primary { background: var(--rk-accent); border-color: var(--rk-accent); color: var(--rk-on-fill); box-shadow: 0 2px 0 var(--rk-accent-deep); }
.btn-primary:hover { background: var(--rk-accent-deep); border-color: var(--rk-accent-deep); color: var(--rk-on-fill); }
.btn-quiet { border-color: var(--rk-line-hard); color: var(--rk-ink-soft); }
.btn-sm { font-size: .88rem; padding: .45rem 1rem; }
.btn-onink { border-color: var(--rk-accent); color: var(--rk-warn-soft); margin-top: 1.5rem; }
.btn-onink:hover { background: var(--rk-accent); color: var(--rk-on-fill); }

/* ─── Bands ──────────────────────────────────────────────────────────────── */

.band { padding: clamp(3rem, 7vw, 5rem) 0; }
.band-soft { background: var(--rk-card); border-block: 1px solid var(--rk-line); }
.band-ink { background: var(--rk-chrome-bg); color: var(--rk-chrome-ink); }
.band-ink h2, .band-ink h3, .band-ink h4 { color: var(--rk-chrome-ink); }
.band-ink .sec-lede, .band-ink .sec-note, .band-ink p { color: var(--rk-chrome-mute); }
.band-ink code { background: rgba(232,89,12,.18); color: var(--rk-chrome-ink); }
.band-ink a { color: var(--rk-chrome-ink); }

.sec-title { margin-bottom: .75rem; }
.sec-title::after { content: ""; display: block; width: 46px; height: 3px; background: var(--rk-accent); margin-top: .7rem; }
.sec-lede { font-size: 1.08rem; color: var(--rk-ink-soft); max-width: 70ch; margin-bottom: 2rem; }
.sec-note { font-size: .95rem; color: var(--rk-ink-soft); max-width: 72ch; }

/* ─── Cards, doors, tiles ────────────────────────────────────────────────── */

.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin-bottom: 2.5rem; }
.door {
  background: var(--rk-card); border: 1px solid var(--rk-line-hard);
  border-top: 3px solid var(--rk-accent); padding: 1.25rem;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}
.door-k { font-family: var(--rk-font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rk-steel); }
.door h3 { margin: .3rem 0 .6rem; }
.door code { display: block; background: var(--rk-paper); color: var(--rk-ink); padding: .45rem .55rem; font-size: .78rem; word-break: break-all; margin-bottom: .6rem; }
.door p { font-size: .9rem; color: var(--rk-ink-soft); margin: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; }
.tile { background: var(--rk-card); border: 1px solid var(--rk-line-hard); padding: 1.75rem; position: relative; }
.tile-stamp {
  position: absolute; top: -10px; right: 1.25rem;
  font-family: var(--rk-font-mono); font-size: .66rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  background: var(--rk-ok-soft); color: var(--rk-ok-ink);
  border: 1.5px solid var(--rk-ok); padding: .15rem .5rem; transform: rotate(-1.5deg);
}
.stamp-danger { background: var(--rk-danger-soft); color: var(--rk-danger-ink); border-color: var(--rk-danger); }

.tick { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.tick li { padding-left: 1.4rem; position: relative; font-size: .92rem; color: var(--rk-ink-soft); margin-bottom: .3rem; }
.tick li::before { content: "✓"; position: absolute; left: 0; color: var(--rk-ok); font-weight: 700; }

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem 2rem; }
.mini h4 { color: var(--rk-ink); margin-bottom: .35rem; }
.mini h4::before { content: "■ "; color: var(--rk-accent-ink); font-size: .7em; vertical-align: middle; }
.mini p { font-size: .93rem; color: var(--rk-ink-soft); margin: 0; }
.mini-onink h4 { color: var(--rk-chrome-ink); }

/* The one-line payoff. Display type, centred, with orange rules top and bottom -
   it is a statement rather than a paragraph, so it is set like one. */
.big-line {
  font-family: var(--rk-font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  font-weight: 600;
  line-height: 1.16;
  text-align: center;
  color: var(--rk-ink);
  max-width: 28ch;
  text-wrap: balance;
  margin: 3rem auto 0;
  padding: 1.75rem 1rem;
  border-top: 3px solid var(--rk-accent);
  border-bottom: 3px solid var(--rk-accent);
}

.callout {
  background: var(--rk-card); border: 1px solid var(--rk-line-hard);
  border-left: 4px solid var(--rk-steel); padding: 1.35rem 1.5rem; margin: 2rem 0;
}
.callout-accent { border-left-color: var(--rk-accent); background: var(--rk-accent-soft); }
.callout h4 { margin-bottom: .5rem; }
.callout p:last-child { margin-bottom: 0; }

/* ─── Code ───────────────────────────────────────────────────────────────── */

.code, pre {
  background: var(--rk-chrome-bg); color: var(--rk-chrome-ink);
  border: 1px solid var(--rk-line-hard); border-radius: var(--radius);
  padding: 1.1rem 1.25rem; overflow-x: auto; font-size: .85rem; line-height: 1.6;
  position: relative; margin: 0 0 1rem;
}
.code code, pre code { color: inherit; }

.copy-btn {
  position: absolute; top: .5rem; right: .5rem;
  font-family: var(--rk-font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(255,255,255,.1); color: var(--rk-chrome-mute); border: 1px solid rgba(255,255,255,.2);
  padding: .25rem .55rem; border-radius: 2px; cursor: pointer; opacity: 0; transition: opacity .12s;
}
pre:hover .copy-btn, .code:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--rk-accent); color: var(--rk-on-fill); border-color: var(--rk-accent); }

/* ─── Wire table (MCP) ───────────────────────────────────────────────────── */

.wire { border: 1px solid var(--rk-line-hard); background: var(--rk-card); margin-bottom: 1.5rem; }
.wire-row { display: flex; gap: 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--rk-line); flex-wrap: wrap; }
.wire-row:last-child { border-bottom: 0; }
.wire-k { font-family: var(--rk-font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); min-width: 110px; padding-top: .18rem; }
.wire-row code { background: none; color: var(--rk-ink); font-size: .85rem; padding: 0; word-break: break-all; }

.cook { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.cook-card { background: var(--rk-paper); border: 1px solid var(--rk-line-hard); padding: 1.25rem; }
.cook-card h3 { margin-bottom: .75rem; }
.cook-note { font-size: .88rem; color: var(--rk-ink-soft); }
.cook-card .code { font-size: .76rem; }

.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.tool { border-left: 3px solid var(--rk-steel); padding-left: 1.1rem; }
.tool-name { display: inline-block; background: var(--rk-ink); color: var(--rk-chrome-ink); font-size: .82rem; padding: .18rem .5rem; margin-bottom: .5rem; }
.tool h4 { margin-bottom: .4rem; }
.tool p { font-size: .92rem; color: var(--rk-ink-soft); margin: 0; }

/* ─── Steps / paths ──────────────────────────────────────────────────────── */

.steps { display: flex; flex-direction: column; gap: 2.25rem; }
.step { display: flex; gap: 1.5rem; align-items: flex-start; }
.step-n {
  flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center;
  background: var(--rk-ink); color: var(--rk-on-fill);
  font-family: var(--rk-font-mono); font-size: 1.15rem; font-weight: 700;
  clip-path: polygon(0 0, 100% 0, 100% 74%, 74% 100%, 0 100%);
}
.step-body { flex: 1; min-width: 0; }
.step-body h2 { font-size: 1.5rem; }
.step-note { font-size: .9rem; color: var(--rk-ink-soft); }

.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.path {
  display: block; background: var(--rk-card); border: 1px solid var(--rk-line-hard);
  padding: 1.35rem; text-decoration: none; color: inherit; transition: transform .1s, border-color .1s;
}
.path:hover { transform: translateY(-3px); border-color: var(--rk-accent); color: inherit; }
.path-n { font-family: var(--rk-font-mono); font-size: .72rem; letter-spacing: .16em; color: var(--rk-accent-ink); }
.path h3 { margin: .4rem 0 .4rem; font-size: 1.15rem; }
.path p { font-size: .9rem; color: var(--rk-ink-soft); margin: 0; }

/* ─── Docs: two-tier sidebar + article ───────────────────────────────────── */

.docs-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 2.5rem; max-width: 1400px; margin: 0 auto; padding: 2rem var(--gutter) 4rem; }

.docs-sidebar { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: .9rem; }
.docs-sidebar-home { display: block; font-family: var(--rk-font-display); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; padding: .4rem 0; margin-bottom: .75rem; border-bottom: 1px solid var(--rk-line); text-decoration: none; color: var(--rk-ink); }
.docs-sidebar-tier { font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rk-steel); margin: 1.5rem 0 .5rem; }
.docs-sidebar-group { margin-bottom: .3rem; border-left: 2px solid var(--theme, var(--rk-line)); padding-left: .65rem; }
.docs-sidebar-group > button,
.docs-sidebar-group-toggle {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: var(--rk-font-body); font-weight: 600; font-size: .88rem; color: var(--rk-ink);
  padding: .3rem 0; display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  list-style: none;
}
.docs-sidebar-group-toggle::-webkit-details-marker { display: none; }
.docs-sidebar-group-toggle::marker { content: ""; }

/* The count is a nested <span> with no separator in the markup. Without the
   flex row above and this padding it renders as "Start here6". Same shape as
   the .dir-tab counts - one collision, two places that emit it. */
.docs-sidebar-count {
  font-family: var(--rk-font-mono); font-size: .68rem; color: var(--rk-placeholder);
  padding-left: .5rem; flex-shrink: 0;
}
.docs-sidebar-tier-quiet span {
  font-family: var(--rk-font-mono); font-size: .6rem; letter-spacing: .12em;
  background: var(--rk-accent-soft); color: var(--rk-accent-ink);
  border: 1px solid var(--rk-accent); padding: .05rem .3rem; margin-left: .4rem;
}
.docs-sidebar-internal-note { font-size: .78rem; color: var(--rk-steel); margin: .4rem 0 .75rem; }
.docs-sidebar-group[open] > .docs-sidebar-group-toggle { color: var(--rk-accent-ink); }
.docs-breadcrumbs { font-family: var(--rk-font-mono); font-size: .76rem; color: var(--rk-steel); margin-bottom: 1.25rem; }
.docs-breadcrumbs a { color: var(--rk-steel); text-decoration: none; }
.docs-breadcrumbs a:hover { color: var(--rk-accent-ink); }
.docs-breadcrumbs span { padding: 0 .35rem; opacity: .5; }
.docs-crumb-internal { color: var(--rk-accent-ink); opacity: 1; }
.docs-sidebar ul { list-style: none; margin: 0 0 .5rem; padding: 0; }
.docs-sidebar li a { display: block; padding: .22rem 0; color: var(--rk-ink-soft); text-decoration: none; font-size: .86rem; }
.docs-sidebar li a:hover { color: var(--rk-accent-ink); }
.docs-sidebar li a.active { color: var(--rk-accent-ink); font-weight: 600; }
.docs-sidebar-internal { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--rk-line-hard); }

.docs-article { min-width: 0; }
.docs-crumbs { font-size: .8rem; color: var(--rk-steel); margin-bottom: 1.25rem; font-family: var(--rk-font-mono); }
.docs-crumbs a { color: var(--rk-steel); text-decoration: none; }
.docs-crumbs a:hover { color: var(--rk-accent-ink); }

.docs-toc { position: sticky; top: 76px; align-self: start; font-size: .82rem; max-height: calc(100vh - 96px); overflow-y: auto; }
.docs-toc h5 { font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rk-steel); margin: 0 0 .6rem; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rk-line); }
.docs-toc li a { display: block; padding: .2rem 0 .2rem .75rem; color: var(--rk-ink-soft); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; }
.docs-toc li a:hover, .docs-toc li a.active { color: var(--rk-accent-ink); border-left-color: var(--rk-accent); }
.docs-toc .toc-h3 { padding-left: 1.5rem; }
.docs-toc .toc-h4 { padding-left: 2.2rem; font-size: .95em; }

/* Rendered markdown */
.md h1 { font-size: clamp(2rem, 4vw, 2.9rem); margin-bottom: 1rem; }
.md h2 { font-size: 1.7rem; margin: 2.5rem 0 .75rem; padding-top: .75rem; border-top: 1px solid var(--rk-line); }
.md h3 { font-size: 1.25rem; margin: 1.75rem 0 .5rem; }
.md h4 { font-size: 1.02rem; margin: 1.4rem 0 .4rem; }
.md p, .md li { font-size: .97rem; }
.md ul, .md ol { padding-left: 1.3rem; }
.md li { margin-bottom: .3rem; }
.md blockquote { margin: 1.25rem 0; padding: .85rem 1.2rem; background: var(--rk-accent-soft); border-left: 4px solid var(--rk-accent); }
.md blockquote p:last-child { margin-bottom: 0; }
.md img { max-width: 100%; height: auto; border: 1px solid var(--rk-line-hard); }
.md hr { border: 0; border-top: 1px dashed var(--rk-line-hard); margin: 2rem 0; }

.md table, table.data { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .89rem; }
.md th, table.data th {
  text-align: left; background: var(--rk-ink); color: var(--rk-chrome-ink);
  font-family: var(--rk-font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .55rem .7rem; font-weight: 500;
}
.md td, table.data td { padding: .5rem .7rem; border-bottom: 1px solid var(--rk-line); vertical-align: top; }
.md tbody tr:nth-child(even), table.data tbody tr:nth-child(even) { background: var(--rk-card); }
.table-wrap { overflow-x: auto; }

/* ─── Docs directory (/docs) ─────────────────────────────────────────────── */

/* /docs — the directory. Class names here mirror what Pages/DocsDirectory.cs
   actually emits; they are not a parallel vocabulary. */

.container { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.dir-hero { padding: 2.5rem 0 1.5rem; }
.section-label { font-family: var(--rk-font-mono); font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--rk-accent-ink); margin-bottom: .75rem; }
.dir-hero-title { font-size: clamp(2rem, 5vw, 3.4rem); max-width: 18ch; }
.accent-in { color: var(--rk-accent-ink); }
.dir-hero-lede { font-size: 1.05rem; color: var(--rk-ink-soft); max-width: 68ch; margin-top: 1rem; }

.dir-filter-row { display: flex; align-items: center; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.dir-filter { flex: 1 1 320px; max-width: 480px; padding: .65rem .9rem; border: 1.5px solid var(--rk-line-hard); background: var(--rk-field); font-family: var(--rk-font-body); font-size: .95rem; border-radius: var(--radius); }
.dir-filter::placeholder { color: var(--rk-placeholder); }
.dir-filter:focus { border-color: var(--rk-accent); outline: none; }
.dir-filter-count { font-family: var(--rk-font-mono); font-size: .78rem; color: var(--rk-steel); }
.dir-filter-clear { background: none; border: 0; cursor: pointer; font-family: var(--rk-font-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rk-accent-ink); }

.dir-tabs-wrap { border-bottom: 2px solid var(--rk-line-hard); margin-bottom: 2rem; }
.dir-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.dir-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  font-family: var(--rk-font-display); font-size: 1.05rem; font-weight: 600;
  letter-spacing: .05em; text-transform: uppercase; line-height: 1.1;
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px;
  padding: .55rem 1rem; cursor: pointer; color: var(--rk-ink-soft);
}
/* The count/hint is a nested <span> on its own line — without this it runs
   straight into the label and reads as "BY TOPIC6 AREAS". */
.dir-tab span {
  font-family: var(--rk-font-mono); font-size: .66rem; font-weight: 400;
  letter-spacing: .12em; text-transform: none; color: var(--rk-placeholder);
}
.dir-tab:hover { color: var(--rk-ink); }
.dir-tab.active, .dir-tab[aria-selected="true"] { color: var(--rk-accent-ink); border-bottom-color: var(--rk-accent); }
.dir-tab.active span, .dir-tab[aria-selected="true"] span { color: var(--rk-accent-ink); }

.dir-lens { margin-bottom: 3rem; }
.dir-lens-head { margin-bottom: 1.5rem; }
.dir-lens-title { font-size: 1.6rem; margin-bottom: .3rem; }
.dir-lens-lede { font-size: .95rem; color: var(--rk-ink-soft); margin: 0; }

/* By task */
.dir-task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1.75rem 2rem; }
.dir-task-colhead { font-family: var(--rk-font-display); font-size: 1.1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-bottom: .4rem; margin-bottom: .5rem; border-bottom: 2px solid var(--theme, var(--rk-accent)); }
.dir-task-list { list-style: none; margin: 0; padding: 0; }
.dir-task-list li { border-bottom: 1px solid var(--rk-line); }
.dir-task-list li:last-child { border-bottom: 0; }
.dir-task-list a { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; padding: .42rem 0; text-decoration: none; color: var(--rk-ink); }
.dir-task-list a:hover { color: var(--rk-accent-ink); }
.dir-task-want { font-size: .92rem; }
/* The destination slug is a quiet right-hand hint, not part of the sentence. */
.dir-task-target { font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .06em; color: var(--rk-placeholder); white-space: nowrap; flex-shrink: 0; }
.dir-task-list a:hover .dir-task-target { color: var(--rk-accent-ink); }

/* By topic */
.dir-rail-grid, .dir-rails { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; }
.dir-rail-card { background: var(--rk-card); border: 1px solid var(--rk-line-hard); border-top: 3px solid var(--theme, var(--rk-accent)); padding: 1.35rem; }
.dir-rail-internal { border-top-color: var(--rk-steel); background: var(--rk-paper); }
.dir-rail-label { font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rk-steel); }
.dir-rail-title, .dir-topic-head { font-family: var(--rk-font-display); font-size: 1.25rem; font-weight: 700; margin: .25rem 0 .3rem; }
.dir-rail-desc, .dir-topic-lede { font-size: .88rem; color: var(--rk-ink-soft); margin-bottom: .9rem; }
.dir-doc-list { list-style: none; margin: 0; padding: 0; }
.dir-doc-list li, .dir-item { padding: .34rem 0; border-top: 1px solid var(--rk-line); }
.dir-doc-list a, .dir-item a { text-decoration: none; color: var(--rk-ink); display: block; }
.dir-doc-list a:hover, .dir-item a:hover { color: var(--rk-accent-ink); }
.dir-doc-name, .dir-topic-name { display: block; font-weight: 600; font-size: .92rem; }
.dir-doc-list span:not(.dir-doc-name), .dir-item span:not(.dir-topic-name) { display: block; font-size: .82rem; color: var(--rk-ink-soft); }

/* THE TOPIC VIEW'S OWN PIECES (2026-11-04, Kirk: "Start here6Playbooks4Connect your assistant5..."). The markup has
   always emitted .dir-jump, .dir-jump-chip, .dir-topic-grid and .dir-topic, and none of them had a rule - the jump
   row rendered as one run-on line of links with the counts glued on, and each group was bare text on the page.
   The group's colour arrives as --theme (an alias from :root's --theme-*), the same rail the task view uses. */
.dir-jump { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.75rem; }
.dir-jump-chip {
  display: inline-flex; align-items: baseline; gap: .45rem;
  padding: .38rem .75rem;
  background: var(--rk-card);
  border: 1px solid var(--rk-line-hard);
  border-left: 3px solid var(--theme, var(--rk-accent));
  border-radius: var(--radius);
  font-family: var(--rk-font-display); font-size: .85rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  color: var(--rk-ink); text-decoration: none;
}
.dir-jump-chip span { font-family: var(--rk-font-mono); font-size: .7rem; font-weight: 400; color: var(--rk-steel); }
.dir-jump-chip:hover { color: var(--rk-accent-ink); border-color: var(--theme, var(--rk-accent)); }

.dir-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; align-items: start; }
.dir-topic {
  background: var(--rk-card);
  border: 1px solid var(--rk-line-hard);
  border-top: 3px solid var(--theme, var(--rk-accent));
  padding: 1.1rem 1.25rem .6rem;
  scroll-margin-top: 5rem;
}
.dir-topic-uncurated { background: var(--rk-paper); border-top-style: dashed; }
/* The shared rail rule above sets .dir-topic-head in display type, which made each group's description bold; inside a
   topic card the head is a wrapper and its two children carry the type. */
.dir-topic .dir-topic-head { font: inherit; margin: 0 0 .6rem; }
.dir-topic .dir-topic-name {
  font-family: var(--rk-font-display); font-size: 1.15rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; margin: 0 0 .2rem;
}
.dir-topic .dir-topic-lede { font-size: .85rem; font-weight: 400; color: var(--rk-ink-soft); margin: 0; }
.dir-doc-blurb { display: block; font-size: .8rem; font-weight: 400; color: var(--rk-ink-soft); }

/* A–Z */
.dir-az-grid { columns: 3 230px; column-gap: 2rem; }
.dir-az-grid a, .dir-az-grid li { break-inside: avoid; }
.dir-az-grid a { display: block; padding: .3rem 0; text-decoration: none; color: var(--rk-ink); }
.dir-az-grid a:hover { color: var(--rk-accent-ink); }
.dir-az-name { font-weight: 600; font-size: .92rem; }
/* Which group a doc belongs to - a small mono label on its group's colour rail. */
.dir-item .dir-az-tag {
  display: inline-block; margin-top: .15rem; padding-left: .4rem;
  border-left: 2px solid var(--theme, var(--rk-accent));
  font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--rk-steel);
}

.empty { color: var(--rk-placeholder); font-style: italic; }

/* ─── Login ──────────────────────────────────────────────────────────────── */

.login-shell { max-width: 400px; margin: 5rem auto; padding: 0 var(--gutter); }
.login-card { background: var(--rk-card); border: 1px solid var(--rk-line-hard); border-top: 4px solid var(--rk-accent); padding: 2rem; }
.login-card h1 { font-size: 1.9rem; margin-bottom: .4rem; }
.login-card label { display: block; font-family: var(--rk-font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); margin: 1rem 0 .3rem; }
.login-card input {
  width: 100%; padding: .6rem .75rem; border: 1.5px solid var(--rk-line-hard);
  background: var(--rk-field); color: var(--rk-ink); font-family: var(--rk-font-body); font-size: .98rem; border-radius: var(--radius);
}
.login-card input:focus { border-color: var(--rk-accent); outline: none; }
.login-card button { width: 100%; margin-top: 1.5rem; justify-content: center; }
.login-error { background: var(--rk-danger-soft); border-left: 4px solid var(--rk-danger); color: var(--rk-danger-ink); padding: .65rem .85rem; font-size: .88rem; margin-top: 1rem; }
.login-lede { font-size: .92rem; color: var(--rk-ink-soft); }
.login-note { font-size: .8rem; color: var(--rk-steel); margin: 1rem 0 0; padding-top: .85rem; border-top: 1px dashed var(--rk-line); }
.login-note + .login-note { border-top: 0; padding-top: 0; margin-top: .5rem; }

/* ─── API explorer ───────────────────────────────────────────────────────────
   The tree and the detail pane are built at runtime by wwwroot/js/api-explorer.js,
   so these class names mirror what THAT FILE emits. Changing one without the
   other produces an unstyled page that still works, which is the worst way to
   find out. */

/* Compatibility shims. The explorer's markup carries a handful of custom
   properties from the design system it was written against. Mapping them onto
   Riproka tokens is a few lines; hunting every reference through 33 KB of
   generated DOM is not, and a missed one renders as invisible text. */
.page-explorer {
  --muted:    var(--rk-steel);
  --code-bg:  var(--rk-chrome-bg);
  --gold2:    var(--rk-accent);
  --head:     var(--rk-ink);
}

.api-shell {
  display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem;
  max-width: 1500px; margin: 0 auto; padding: 1.5rem var(--gutter) 3rem;
  align-items: start;
}

.api-sidebar {
  border: 1px solid var(--rk-line-hard); background: var(--rk-card);
  position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto;
}
.api-sidebar .filter { padding: .8rem; border-bottom: 1px solid var(--rk-line); position: sticky; top: 0; background: var(--rk-card); z-index: 2; }
.api-sidebar .filter input { width: 100%; padding: .5rem .65rem; border: 1.5px solid var(--rk-line-hard); background: var(--rk-field); font-family: var(--rk-font-body); font-size: .86rem; border-radius: var(--radius); }
.api-sidebar .filter input:focus { border-color: var(--rk-accent); outline: none; }
.api-loading { padding: 2rem 1.25rem; color: var(--rk-placeholder); font-family: var(--rk-font-mono); font-size: .8rem; }

.api-folder {
  display: flex; align-items: center; gap: .4rem; width: 100%; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--rk-line);
  padding: .5rem .8rem; cursor: pointer; color: var(--rk-ink);
  font-family: var(--rk-font-display); font-size: .92rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}
.api-folder:hover { background: var(--rk-accent-soft); color: var(--rk-accent-ink); }
.api-folder .count { margin-left: auto; font-family: var(--rk-font-mono); font-size: .68rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--rk-placeholder); }
.api-folder .chev { font-size: .6rem; opacity: .5; transition: transform .12s; }
.api-folder.collapsed .chev { transform: rotate(-90deg); }
.api-items { list-style: none; margin: 0; padding: 0; }
.api-items.collapsed { display: none; }

.api-item {
  display: flex; align-items: baseline; gap: .45rem; width: 100%; text-align: left;
  background: none; border: 0; padding: .3rem .8rem .3rem 1.5rem; cursor: pointer;
  font-family: var(--rk-font-mono); font-size: .75rem; color: var(--rk-ink-soft);
}
.api-item:hover { background: var(--rk-accent-soft); color: var(--rk-accent-ink); }
.api-item.active { background: var(--rk-accent); color: var(--rk-on-fill); }
.api-item .method, .api-item .api-name { font-family: inherit; }
.api-item .method { font-size: .6rem; font-weight: 700; letter-spacing: .06em; color: var(--rk-accent-ink); flex-shrink: 0; }
.api-item.active .method { color: var(--rk-on-fill); }

.api-detail { min-width: 0; }
.api-creds { background: var(--rk-card); border: 1px solid var(--rk-line-hard); border-top: 3px solid var(--rk-accent); padding: 1.1rem 1.25rem; margin-bottom: 1.5rem; }
.api-creds h4 { margin-bottom: .75rem; }
.api-creds-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.api-creds-row label { display: block; font-family: var(--rk-font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); margin-bottom: .25rem; }
.api-creds-row input { width: 100%; padding: .5rem .65rem; border: 1.5px solid var(--rk-line-hard); background: var(--rk-field); font-family: var(--rk-font-mono); font-size: .82rem; border-radius: var(--radius); }
.api-creds-row input:focus { border-color: var(--rk-accent); outline: none; }
.api-creds-hint { font-size: .82rem; color: var(--rk-ink-soft); margin: .9rem 0 0; }

.empty-state { padding: 3rem 1rem; text-align: center; }
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--rk-ink-soft); max-width: 60ch; margin-inline: auto; }
.api-empty-note { font-size: .88rem; margin-top: 1.5rem; }

.api-endpoint > h2, .api-endpoint > h3 { margin-bottom: .5rem; }
.api-section { margin: 1.5rem 0; }
.api-section > h4 { font-family: var(--rk-font-mono); font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--rk-steel); margin-bottom: .5rem; }
.api-folderpath { font-family: var(--rk-font-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rk-steel); }
.api-description { font-size: .95rem; color: var(--rk-ink-soft); max-width: 72ch; }
.api-description strong { color: var(--rk-ink); }

.api-body, .api-example, .api-md-pre { background: var(--rk-chrome-bg); color: var(--rk-chrome-ink); border: 1px solid var(--rk-line-hard); border-radius: var(--radius); padding: 1rem; font-family: var(--rk-font-mono); font-size: .8rem; overflow-x: auto; }
textarea.api-body { width: 100%; min-height: 190px; resize: vertical; }
.api-example-head { font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); margin-bottom: .35rem; }
.api-example-source { font-size: .74rem; color: var(--rk-placeholder); }

.api-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.api-table th { text-align: left; background: var(--rk-ink); color: var(--rk-chrome-ink); font-family: var(--rk-font-mono); font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; padding: .45rem .6rem; font-weight: 500; }
.api-table td { padding: .42rem .6rem; border-bottom: 1px solid var(--rk-line); vertical-align: top; }
.api-required-tag { font-family: var(--rk-font-mono); font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; background: var(--rk-danger-soft); color: var(--rk-danger-ink); border: 1px solid var(--rk-danger); padding: .04rem .3rem; }

.api-doclinks { display: flex; gap: .4rem; flex-wrap: wrap; margin: .75rem 0; }
.api-doclink-tag { font-family: var(--rk-font-mono); font-size: .68rem; background: var(--rk-accent-soft); color: var(--rk-accent-ink); border: 1px solid var(--rk-accent); padding: .1rem .45rem; text-decoration: none; }

.api-procnote { background: var(--rk-card); border-left: 4px solid var(--rk-steel); padding: .75rem 1rem; margin: 1rem 0; font-size: .86rem; }
.api-procnote-label { font-family: var(--rk-font-mono); font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--rk-steel); }
.api-procnote-proc { font-family: var(--rk-font-mono); color: var(--rk-accent-ink); }
.api-md-list { padding-left: 1.2rem; font-size: .9rem; }
.api-longcontext { font-size: .88rem; color: var(--rk-ink-soft); }

.try-it-controls { display: flex; gap: .6rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.try-it, .btn-teal { background: var(--rk-accent); border: 1.5px solid var(--rk-accent); color: var(--rk-on-fill); font-family: var(--rk-font-display); font-size: .95rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .5rem 1.15rem; border-radius: var(--radius); cursor: pointer; }
.try-it:hover, .btn-teal:hover { background: var(--rk-accent-deep); border-color: var(--rk-accent-deep); }
.btn-outline { background: transparent; border: 1.5px solid var(--rk-line-hard); color: var(--rk-ink); font-family: var(--rk-font-display); font-size: .95rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: .5rem 1.15rem; border-radius: var(--radius); cursor: pointer; }
.btn-outline:hover { background: var(--rk-ink); color: var(--rk-on-fill); border-color: var(--rk-ink); }

.try-it-status { font-family: var(--rk-font-mono); font-size: .78rem; font-weight: 700; padding: .18rem .55rem; }
.try-it-status.status-2, .try-it-status[class*="status-2"] { background: var(--rk-ok-soft); color: var(--rk-ok-ink); border: 1px solid var(--rk-ok); }
.try-it-status[class*="status-4"], .try-it-status[class*="status-5"] { background: var(--rk-danger-soft); color: var(--rk-danger-ink); border: 1px solid var(--rk-danger); }

/* ─── Search ─────────────────────────────────────────────────────────────────
   Two surfaces, one vocabulary each, and BOTH are driven by files this project
   did not author - wwwroot/js/search.js builds the palette's result list and
   Pages/SearchPage.cs renders the full page. The class names below are theirs.
   ─────────────────────────────────────────────────────────────────────────── */

/* The command palette. search.js toggles the `hidden` attribute, so that - not
   a class - is what must control display. */
.search-modal { position: fixed; inset: 0; z-index: 500; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 1rem 1rem; }
.search-modal[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgba(11,19,25,.55); }
body.search-open { overflow: hidden; }

.search-box {
  position: relative; width: 100%; max-width: 640px;
  background: var(--rk-card); border: 1px solid var(--rk-line-hard);
  border-top: 4px solid var(--rk-accent);
  box-shadow: 0 24px 60px rgba(0,0,0,.34);
  display: flex; flex-direction: column; max-height: 76vh;
}
.search-field { display: flex; align-items: center; gap: .65rem; padding: 0 1rem; border-bottom: 1px solid var(--rk-line); color: var(--rk-steel); }
.search-field input {
  flex: 1; min-width: 0;
  padding: 1rem 0; border: 0; background: none;
  font-family: var(--rk-font-body); font-size: 1.1rem; color: var(--rk-ink);
}
.search-field input:focus { outline: none; }
.search-field input::placeholder { color: var(--rk-placeholder); }
.search-esc { flex-shrink: 0; background: var(--rk-paper); border: 1px solid var(--rk-line-hard); color: var(--rk-steel); font-family: var(--rk-font-mono); font-size: .68rem; padding: .2rem .45rem; border-radius: 2px; cursor: pointer; }
.search-esc:hover { background: var(--rk-accent-soft); color: var(--rk-accent-ink); }

.search-results { overflow-y: auto; flex: 1; }
.search-msg { padding: 1.5rem 1.1rem; color: var(--rk-placeholder); font-size: .9rem; }

.search-grp { border-bottom: 1px solid var(--rk-line); }
.search-grp-label { font-family: var(--rk-font-mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rk-steel); padding: .7rem 1.1rem .3rem; }
.search-grp-more { display: block; padding: .45rem 1.1rem .8rem; font-size: .8rem; color: var(--rk-accent-ink); text-decoration: none; }

.search-hit { display: block; padding: .6rem 1.1rem; text-decoration: none; color: var(--rk-ink); border-left: 3px solid transparent; }
.search-hit:hover, .search-hit.sel, .search-hit[aria-selected="true"] { background: var(--rk-accent-soft); border-left-color: var(--rk-accent); color: var(--rk-ink); }
.search-hit-title { display: block; font-weight: 600; font-size: .94rem; }
.search-hit-snippet, .search-sec-snip { display: block; font-size: .82rem; color: var(--rk-ink-soft); margin-top: .12rem; }
.search-hit-snippet mark, .search-sec-snip mark, .search-hit-title mark { background: var(--rk-warn-soft); color: var(--rk-accent-ink); padding: 0 .1em; }
.search-hit-toggle { background: none; border: 0; cursor: pointer; font-family: var(--rk-font-mono); font-size: .7rem; color: var(--rk-steel); padding: .2rem 1.1rem .5rem; }
.search-hit-toggle:hover { color: var(--rk-accent-ink); }
.search-hit-sections { list-style: none; margin: 0; padding: 0 0 .4rem; }
.search-sec { display: block; padding: .35rem 1.1rem .35rem 2rem; text-decoration: none; color: var(--rk-ink-soft); font-size: .86rem; }
.search-sec:hover { background: var(--rk-accent-soft); color: var(--rk-accent-ink); }
.search-sec-heading { font-weight: 600; }

.search-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1.1rem; border-top: 1px solid var(--rk-line); background: var(--rk-paper); font-size: .74rem; color: var(--rk-steel); flex-wrap: wrap; }
.search-foot kbd { font-family: var(--rk-font-mono); font-size: .68rem; background: var(--rk-card); border: 1px solid var(--rk-line-hard); border-radius: 2px; padding: .05rem .3rem; margin-right: .15rem; }
.search-foot a { color: var(--rk-accent-ink); text-decoration: none; }

/* The full page at /search. It rendered as a raw input and a bare list because
   none of these existed. */
.search-page-form { display: flex; gap: .6rem; margin: 1.25rem 0 2rem; flex-wrap: wrap; }
.search-page-form input {
  flex: 1 1 340px; min-width: 0;
  padding: .75rem .9rem;
  border: 1.5px solid var(--rk-line-hard); border-radius: var(--radius);
  background: var(--rk-field); color: var(--rk-ink);
  font-family: var(--rk-font-body); font-size: 1rem;
}
.search-page-form input:focus { border-color: var(--rk-accent); outline: none; }
/* btn-gold is the source design system's name for the primary button. Mapped
   rather than renamed, because SearchPage.cs is a ported file. */
.btn-gold { background: var(--rk-accent); border: 1.5px solid var(--rk-accent); color: var(--rk-on-fill); box-shadow: 0 2px 0 var(--rk-accent-deep); }
.btn-gold:hover { background: var(--rk-accent-deep); border-color: var(--rk-accent-deep); color: var(--rk-on-fill); }

/* The result rows are <li>s and were carrying default bullets. */
.search-docs, .search-doc ul { list-style: none; margin: 0; padding: 0; }
.search-doc { padding: 0; }
.search-doc ul { padding-left: 1.5rem; }
.search-doc ul li { padding: .2rem 0; font-size: .86rem; }

.search-doc-main { display: block; padding: .7rem 0; border-top: 1px solid var(--rk-line); text-decoration: none; color: var(--rk-ink); }
.search-doc-main:hover { color: var(--rk-accent-ink); }
.search-doc-title { display: block; font-weight: 600; font-size: 1rem; }
.search-doc-snippet { display: block; font-size: .88rem; color: var(--rk-ink-soft); margin-top: .15rem; }
.search-doc-snippet mark, .search-doc-title mark, .sec-snip mark { background: var(--rk-warn-soft); color: var(--rk-accent-ink); padding: 0 .1em; }
.sec-heading { font-weight: 600; font-size: .9rem; }
.sec-snip { display: block; font-size: .84rem; color: var(--rk-ink-soft); }


/* ─── Downloads ──────────────────────────────────────────────────────────── */

.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.dl-card { background: var(--rk-card); border: 1px solid var(--rk-line-hard); border-top: 3px solid var(--rk-steel); padding: 1.35rem; }
.dl-card h3 { margin-bottom: .3rem; }
.dl-meta { font-family: var(--rk-font-mono); font-size: .74rem; color: var(--rk-steel); margin-bottom: .75rem; }
.dl-pending { font-family: var(--rk-font-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--rk-placeholder); border: 1px dashed var(--rk-line-hard); padding: .4rem .7rem; display: inline-block; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */

.site-foot { background: var(--rk-chrome-bg); color: var(--rk-chrome-mute); padding: 3rem 0 0; margin-top: 4rem; }
.foot-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(220px, 1fr) 2fr; gap: 2.5rem; }
.foot-brand p { font-size: .9rem; margin-top: .9rem; max-width: 34ch; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1.5rem; }
.foot-cols h4 { font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--rk-chrome-ink); font-family: var(--rk-font-mono); font-weight: 500; margin-bottom: .6rem; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li a { display: block; padding: .18rem 0; font-size: .89rem; color: var(--rk-chrome-mute); text-decoration: none; }
.foot-cols li a:hover { color: var(--rk-ink); }
.foot-legal-links {
  max-width: var(--wrap); margin: 2.5rem auto 0; padding: 1.1rem var(--gutter) 0;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; flex-wrap: wrap; gap: 1.4rem;
}
.foot-legal-links a {
  font-family: var(--rk-font-mono); font-size: .72rem; letter-spacing: .13em;
  text-transform: uppercase; color: var(--rk-chrome-mute); text-decoration: none;
}
.foot-legal-links a:hover { color: var(--rk-chrome-ink); }

.foot-legal {
  max-width: var(--wrap); margin: 1.1rem auto 0; padding: 0 var(--gutter);
  display: flex; align-items: flex-start; gap: 1.25rem; flex-wrap: wrap;
}
.foot-publisher { flex-shrink: 0; display: inline-flex; align-items: center; opacity: .85; }
.foot-publisher:hover { opacity: 1; }
.foot-publisher img { display: block; height: 20px; width: auto; }
.foot-legal p { font-size: .78rem; line-height: 1.6; color: var(--rk-chrome-mute); margin: 0; flex: 1 1 340px; }
.foot-legal p a { color: var(--rk-chrome-ink); text-decoration: underline; text-underline-offset: 2px; }
.foot-legal { padding-bottom: 2.25rem; }



/* ─── Responsive ─────────────────────────────────────────────────────────── */

/* THE COMPACT BAR (2026-11-15). The Training, Brochures and Business groups made the bar wider than a laptop
   screen between the phone breakpoint and ~1320px, and the last group and the account fell off the right
   edge. In that range the bar tightens and the search button keeps its icon only. */
@media (min-width: 861px) and (max-width: 1320px) {
  .nav-list { gap: 0; }
  .nav-link, .nav-list > li > a, .nav-trigger { padding: .4rem .42rem; font-size: .82rem; letter-spacing: .03em; }
  .nav-search-label, .nav-search-kbd { display: none; }
  .brand-text i { display: none; }
}

@media (max-width: 1080px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 860px) {
  /* The page behind the panel must not scroll under the finger. */
  body.nav-open { overflow: hidden; }

  .nav-hamburger { display: flex; }

  /* The panel drops out of the header and is keyed off BODY.NAV-OPEN, which is
     the class site.js actually sets. Laid out as a real column with room to
     tap: this is the ONLY way in on a phone, so every row is a 44px target
     rather than a 28px desktop row shrunk down. */
  .site-nav {
    /* ABSOLUTE against the sticky header, at top:100% - so it sits exactly
       under the bar whatever height the bar turns out to be. A hard-coded
       `top` was 2px out the moment the header gained its 3px accent border,
       and would be wrong again the next time the chrome changes. */
    position: absolute; top: 100%; left: 0; right: 0; z-index: 95;
    margin-left: 0;
    background: var(--rk-chrome-bg);
    border-top: 1px solid rgba(255,255,255,.14);
    border-bottom: 3px solid var(--rk-accent);
    max-height: 80dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Hidden by TRANSFORM rather than display, so it animates; `visibility` is
       what keeps the links untabbable while it is shut. */
    transform: translateY(-8px);
    opacity: 0; visibility: hidden;
    transition: transform .18s ease, opacity .18s ease, visibility .18s ease;
  }
  body.nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }

  .nav-list {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem .5rem 1.25rem;
  }
  .nav-list > li { width: 100%; }
  .nav-link, .nav-list > li > a, .nav-trigger {
    display: flex; align-items: center; width: 100%;
    padding: .85rem 1rem; font-size: 1.05rem;
    border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .nav-trigger { justify-content: space-between; }

  /* On a phone a dropdown is not a dropdown - it is a labelled section of the
     one list, always open. Nothing should need two taps to reach. */
  .nav-dropdown {
    position: static; display: block; border: 0;
    background: rgba(255,255,255,.04); box-shadow: none; padding: .25rem 0 .5rem;
  }
  .nav-dropdown a { padding: .7rem 1rem .7rem 2rem; border-bottom: 1px solid rgba(255,255,255,.06); }

  /* The search pill becomes a full-width row like everything else. */
  .nav-search-li { width: 100%; }
  .nav-search-btn { width: 100%; justify-content: flex-start; padding: .85rem 1rem; font-size: 1.05rem; }
  /* Below this breakpoint the dropdown is no longer a light card - it collapses
     into the dark bar. So the two colours above swap back: the ordinary link
     goes muted-on-chrome, and the ACTIVE one takes the pale accent again.
     Leaving it as --rk-accent-ink would be #b23e00 on #16232d, about 2.5:1. */
  .nav-dropdown a { color: var(--rk-chrome-mute); }
  .nav-dropdown a.active { color: var(--rk-warn-soft); }
  .nav-search-kbd { display: none; }
  .nav-account { border-left: 0; padding-left: 0; margin-left: 0; }

  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; max-height: none; border-bottom: 1px solid var(--rk-line); padding-bottom: 1rem; margin-bottom: 1rem; }

  .explorer { grid-template-columns: 1fr; }
  .ex-side { max-height: 300px; }

  .foot-inner { grid-template-columns: 1fr; }
  .dir-az { columns: 1; }
  .step { gap: 1rem; }
  .hero-stats { gap: 1.5rem; }
}

/* ─── PRINT OR SAVE AS PDF, AND THE CATALOG (2026-11-15) ─────────────────
   Every doc page carries a Print or save as PDF button beside its breadcrumbs
   (Kirk: "Download everything as PDF"); /catalog lists everything the site holds. */
.docs-breadcrumbs-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.docs-chip-row { display: inline-flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.docs-pdf-chip { display: inline-flex; align-items: center; padding: .3rem .75rem; font-family: var(--rk-font-mono); font-size: .74rem; color: var(--rk-ink); background: var(--rk-card); border: 1px solid var(--rk-line-hard); text-decoration: none; cursor: pointer; }
.docs-pdf-chip:hover { color: var(--rk-accent-ink); border-color: var(--rk-accent); }
.dl-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.cat-facts, .cat-jump { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; font-family: var(--rk-font-mono); font-size: .8rem; color: var(--rk-steel); }
.cat-jump a { color: var(--rk-accent-ink); }
.cat-set { background: var(--rk-card); border: 1px solid var(--rk-line-hard); margin-bottom: .6rem; }
.cat-set > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; padding: .7rem 1rem; cursor: pointer; }
.cat-set-name { font-family: var(--rk-font-display); font-weight: 700; font-size: 1.05rem; color: var(--rk-ink); }
.cat-count, .cat-note { font-family: var(--rk-font-mono); font-size: .74rem; color: var(--rk-steel); }
.cat-tag { font-family: var(--rk-font-mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rk-accent-ink); border: 1px solid var(--rk-accent); padding: 0 .35rem; }
.cat-set-lede, .cat-set-actions { padding: 0 1rem; margin: .25rem 0 .75rem; }
.cat-list { margin: .25rem 0 1rem; padding: 0 1rem 0 2.5rem; columns: 2 22rem; column-gap: 2rem; }
.cat-list li { break-inside: avoid; padding: .15rem 0; font-size: .9rem; }
.cat-pdf { margin-left: .4rem; font-family: var(--rk-font-mono); font-size: .72rem; color: var(--rk-accent-ink); }
.cat-subhead { margin: 1.25rem 0 .35rem; font-size: 1rem; }
.cat-scripts { display: grid; grid-template-columns: minmax(12rem, 22rem) 1fr; gap: .35rem 1.25rem; margin: 0 0 1rem; font-size: .86rem; }
.cat-scripts dt { overflow-wrap: anywhere; }
.cat-scripts dd { margin: 0; color: var(--rk-ink-soft); }
@media (max-width: 720px) {
  .cat-scripts { grid-template-columns: 1fr; }
  .cat-scripts dd { margin-bottom: .5rem; }
  .cat-list { columns: 1; }
}

@media print {
  .site-head, .site-foot, .docs-sidebar, .docs-sidebar-wrap, .docs-toc, .copy-btn, .docs-chip-row { display: none; }
  body { background: var(--rk-field); }
  .docs-shell { grid-template-columns: 1fr; }
}
