/* tool-gates component + layout styles. */
/* Generated gate, security-floor, hints, security-reminders, and design-lint pages depend on these class names. */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  line-height: 1.65;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
svg {
  display: block;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-2);
}
::selection {
  background: color-mix(in oklab, var(--accent) 30%, transparent);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
  color: var(--text-1);
}

/* Neutralize mdBook's generic content heading margins. general.css ships
 * `h2, h3 { margin-block-start: 2.5em }` and `h4, h5 { margin-block-start: 2em }`
 * (sane for stock prose, wrong here). The design zeroes all heading margins
 * and lets each component own its spacing (.sec-head, .hook-card, .config-block,
 * .tier, .client). Our global `h1,h2,h3 { margin: 0 }` above covers h1-h3, but
 * h4/h5/h6 leaked mdBook's 2em top margin onto compact component titles. Reset the whole range inside
 * content so component spacing is the single source of truth. */
.content :where(h1, h2, h3, h4, h5, h6) {
  margin-block-start: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--r-2);
  font-weight: var(--weight-bold);
  z-index: 200;
}
.skip-link:focus {
  left: var(--s-4);
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* Inline code chip + pre code block treatment lives in theme/highlight.css
 * (officially shadowable; loaded BEFORE additional-css). Per-section chip
 * rules below (.hero .lede code, .client .pathline code, etc.) remain more
 * specific than the chip baseline there and still win in their sections. */

/* Top chrome */
.menu-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 0 var(--s-5);
  background: var(--bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
/* mdBook addresses the bar via #mdbook-menu-bar (id, 1-0-0) which outranks the
 * design's .menu-bar class on shared properties: it forces an opaque
 * background-color and a hairline border in --bg. Re-assert the design's
 * blurred bar and real border at id specificity.
 *
 * Bg is SOLID var(--bg), not the design's 82% alpha. The alpha + backdrop
 * compositing left a faint lighter seam across y=0 on dark themes (oklab
 * round-trip lightens by ~1 lightness step at the bar's top edge where the
 * blur kernel meets the viewport edge). Keeping backdrop-filter so the glass
 * effect still engages when content scrolls under the bar; with a solid bg the
 * blur is a no-op at the top of the page and the seam is gone. */
#mdbook-menu-bar {
  background-color: var(--bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-block-end-color: var(--border);
  align-items: center;
  flex-wrap: nowrap;
  gap: var(--s-2);
  padding: 0 var(--s-5);
  overflow: visible;
}
/* mdBook centers the book title in the bar; the design puts the brand (in
 * .left-buttons) there instead, so the title is redundant. Hide it and let the
 * left/right button groups own the bar. */
#mdbook-menu-bar .menu-title {
  display: none;
}
#mdbook-menu-bar .left-buttons {
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: var(--s-1);
}
#mdbook-menu-bar .right-buttons {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  margin: 0;
}

/* Stock chrome.css gives every .icon-button (and its child .fa-svg) `display:
 * block + line-height: var(--menu-bar-height)`. With the labels' inline
 * whitespace siblings (a real `\n   <span class="fa-svg">...</span>\n` lives
 * inside each button), each text-node line-box and the SVG line-box stack
 * vertically -- inflating each icon-button to ~126px tall when the bar is only
 * 56px. The flex bar then aligns the inflated child to its content height,
 * which spills the brand + version pill below y=56 and visibly mis-aligns them
 * with the sidebar CTA pinned at the bar's bottom edge.
 *
 * Collapse the whitespace: turn the icon-button into a sized flex centre that
 * matches the bar's own height. The internal .fa-svg keeps its 16px SVG, the
 * label is now exactly --menu-bar-height tall, and the bar's `align-items:
 * center` recentres everything inside the 56px stripe. The right-buttons
 * `<a>` GitHub icon gets the same treatment (chrome.css does not class it
 * .icon-button, only the toggles do). */
#mdbook-menu-bar .icon-button:not(#mdbook-search-toggle),
#mdbook-menu-bar .right-buttons > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--menu-bar-height);
  line-height: 1;
}
#mdbook-menu-bar .icon-button > .fa-svg,
#mdbook-menu-bar .right-buttons > a > .fa-svg {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.brand:hover {
  color: var(--text-1);
}
.brand .gate {
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--accent);
  background: currentColor;
  -webkit-mask: url('../../favicon-ced30730.svg') center / contain no-repeat;
  mask: url('../../favicon-ced30730.svg') center / contain no-repeat;
}
.brand b {
  font-weight: var(--weight-emphasis);
}
.brand .dim {
  color: var(--text-3);
}
.ver {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  padding: var(--s-1) var(--s-3);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
  text-decoration: none;
  transition:
    color 160ms var(--ease),
    border-color 160ms var(--ease),
    background 160ms var(--ease);
}
.ver::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--allow);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--allow) 18%, transparent);
}
.ver:hover {
  color: var(--text-1);
  background: var(--surface-2);
  border-color: color-mix(in oklab, var(--allow) 30%, var(--border-2));
}
.ver .ver-num {
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.01em;
}

.bar-spacer {
  flex: 1;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease);
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.menu-toggle {
  display: none;
}

/* Stock mdBook chrome that tool-gates hides.
 * - prev/next chapter arrows (wide + mobile)
 * - the sidebar drag-to-resize handle
 * - the search toggle icon (the inline search box replaces it)
 * - mdBook's paintbrush theme toggle + 6-item theme popup. tool-gates uses a
 *   single binary moon/sun button on the right (#tgThemeToggle). These stay in
 *   the DOM because book.js binds to them unconditionally (removing them throws
 *   and halts book.js init), so hide them instead. */
.nav-wide-wrapper,
.mobile-nav-chapters {
  display: none !important;
}
#mdbook-sidebar-resize-handle {
  display: none !important;
}
#mdbook-search-toggle {
  display: none;
}
#mdbook-theme-toggle,
#mdbook-theme-list {
  display: none !important;
}

/* Binary moon/sun theme toggle on the right, next to the GitHub icon.
 * Both icons ship in the button; show the one matching the action: moon while
 * in light mode (click -> dark), sun while in dark mode (click -> light). */
/* Scoped under #mdbook-menu-bar to carry two IDs. The bar's generic sizing rule
 * `#mdbook-menu-bar .icon-button > .fa-svg { display: inline-flex }` is (1,2,0);
 * a single-ID `#tgThemeToggle .fa-svg` hide rule (1,1,0) loses to it, so BOTH
 * icons showed. Two IDs (2,1,0) beat it; the show rules add a class+element for
 * (2,2,1) so the active-theme icon wins over the hide. */
#tgThemeToggle {
  cursor: pointer;
}
#mdbook-menu-bar #tgThemeToggle .tg-icon-moon,
#mdbook-menu-bar #tgThemeToggle .tg-icon-sun {
  display: none;
}
html.tg-light #mdbook-menu-bar #tgThemeToggle .tg-icon-moon {
  display: inline-flex;
}
html.tg-dark #mdbook-menu-bar #tgThemeToggle .tg-icon-sun {
  display: inline-flex;
}

/* The bar reads: left-buttons (brand + version) | gap | search | right-buttons.
 * left-buttons stays intrinsic-width; the search owns the right gap. */
#mdbook-menu-bar .left-buttons {
  flex: 0 0 auto;
}
/* Push the relocated search (and the right-buttons after it) to the far right. */
#mdbook-menu-bar #mdbook-search-wrapper.inline-search {
  margin-inline-start: auto;
}

/* Inline always-visible search.
 * mdBook ships search as a toggle icon that unhides #mdbook-search-wrapper (a
 * block sibling of the menu bar). tool-gates.js relocates that wrapper INTO the
 * bar (.inline-search) and keeps it shown; searcher.js still drives it by id so
 * the wiring is intact. These rules turn mdBook's stock search markup into a
 * ~340px pill: magnifier inside-left, `/` hint inside-right, results as an
 * absolute dropdown. Under mdBook the hamburger is #mdbook-sidebar-toggle, not
 * a .menu-toggle, so no rule targets the latter. */
.menu-toggle {
  display: none;
}

/* Inline search visibility.
 * At the persistent-sidebar breakpoint it is always displayed flex. Below that,
 * the sidebar and search both use overlay controls so the header never has to
 * share its width with an opened drawer. */
@media (min-width: 1080px) {
  #mdbook-search-wrapper.inline-search {
    display: flex !important;
    align-items: center;
    width: min(340px, 38vw);
    margin: 0;
    position: relative;
  }
}
@media (max-width: 1079px) {
  #mdbook-search-wrapper.inline-search:not(.hidden) {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    position: relative;
  }
}
/* mdBook centers .searchbar-outer at content-max width; reset to fill the pill. */
.inline-search .searchbar-outer {
  margin: 0;
  max-width: none;
  width: 100%;
}
.inline-search .search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
/* Magnifier inside the left edge (the design's svg.s-icon equivalent). */
.inline-search .search-wrapper::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  background-color: var(--text-3);
  -webkit-mask: var(--tg-search-icon) center / contain no-repeat;
  mask: var(--tg-search-icon) center / contain no-repeat;
}
.inline-search #mdbook-searchbar {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 56px 0 34px;
  font: inherit;
  font-size: 14px;
  line-height: 40px;
  color: var(--text-1);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: none;
}
.inline-search #mdbook-searchbar::placeholder {
  color: var(--text-3);
}
.inline-search #mdbook-searchbar:focus,
.inline-search #mdbook-searchbar.active {
  outline: none;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border-2));
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}
/* `/` keyboard hint inside the right edge. */
.inline-search .search-kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  gap: 4px;
  pointer-events: none;
}
.inline-search .search-kbd kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  padding: 1px 5px;
  line-height: 1.4;
}
/* Keep the spinner clear of the `/` hint while a query runs. */
.inline-search .spinner-wrapper {
  right: 28px;
  background-color: transparent;
}
/* Results as an absolute dropdown under the inline box, matching the design's
 * .search-empty popover (panel, border, shadow). */
.inline-search .searchresults-outer {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: min(440px, 80vw);
  max-width: none;
  margin: 0;
  max-height: min(70vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: var(--s-2) var(--s-4) var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  box-shadow: var(--shadow);
  z-index: 80;
}
ul#mdbook-searchresults {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: var(--s-1) 0 0;
}
ul#mdbook-searchresults li {
  min-width: 0;
  margin: 0;
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
ul#mdbook-searchresults li:last-child {
  border-bottom: 0;
}
ul#mdbook-searchresults li.focus,
ul#mdbook-searchresults li:focus-within {
  background: var(--surface-2);
  box-shadow: 0 0 0 var(--s-2) var(--surface-2);
}
ul#mdbook-searchresults li > a {
  display: block;
  min-width: 0;
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-emphasis);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
ul#mdbook-searchresults span.teaser {
  max-width: 100%;
  min-width: 0;
  margin: var(--s-1) 0 0;
  color: var(--text-2);
  font-size: var(--text-label);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}
#mdbook-search-wrapper.hidden #mdbook-searchresults-outer {
  display: none !important;
}

/* Page shell.
 * mdBook owns the structural layout: .sidebar is position:fixed (chrome.css),
 * .page-wrapper gets margin-inline-start: var(--sidebar-width) to clear it, and
 * the #mdbook-sidebar-toggle-anchor checkbox drives show/hide. We do NOT override
 * .page's display here (the design's .page was a flex row holding sidebar +
 * content as children; mdBook's .page is the inner column holding the menu-bar +
 * content, with the sidebar as a fixed sibling). Restyle visuals only. */
.sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.sidebar .sidebar-cta {
  position: relative;
  inset: auto;
  flex: none;
  margin: var(--s-4) var(--s-3) var(--s-2) var(--s-5);
}
.sidebar .sidebar-scrollbox {
  position: static;
  inset: auto;
  flex: 1 1 auto;
  min-height: 0;
  width: auto;
  height: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s-2) var(--s-3) var(--s-7) var(--s-5);
}
.sidebar-close {
  display: none;
}
/* Section labels on mdBook's SUMMARY-built sidebar. The design groups nav
 * links under .nav-label headers ("Start", "Gates", "Reference", "Develop").
 * mdBook renders each `# Heading` line in SUMMARY.md as
 * `<li class="chapter-item"><li class="part-title">Heading</li></li>`. The HTML
 * parser auto-closes the outer <li> at the inner <li> (optional-end-tag rule),
 * so in the real DOM .part-title is a SIBLING of an empty .chapter-item, both
 * direct children of <ol class="chapter">. Style .part-title by descendant
 * match (nesting-agnostic), and collapse the empty wrapper li that would
 * otherwise add a stray blank line via mdBook's .chapter-item top margin. */
#mdbook-sidebar .part-title {
  display: block;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin: var(--s-5) 0 var(--s-2) var(--s-3);
  padding: 0;
}
/* The auto-closed wrapper <li> is genuinely empty in the DOM. Hide it so it
 * contributes no height; every real nav row carries an <a>/<span>, so :empty
 * only ever matches these part-title artifacts. */
#mdbook-sidebar .chapter-item:empty {
  display: none;
}
/* Tight nav rows on mdBook's SUMMARY-built sidebar.
 * mdBook emits `.chapter li a` inside a `.chapter-link-wrapper` span. Its own
 * defaults are loose (.chapter line-height 2.2em, .chapter-item margin-block-start 0.6em), so
 * these rules target the real structure to give EVERY row (Start / Reference /
 * Develop and the gate links) the tight 32px flex row. */
#mdbook-sidebar .chapter {
  line-height: 1.4;
}
#mdbook-sidebar .chapter li.chapter-item {
  margin-block-start: 0;
  line-height: 1.4;
}
#mdbook-sidebar .chapter-link-wrapper {
  width: 100%;
}
#mdbook-sidebar .chapter li a {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  width: 100%;
  min-height: 32px;
  padding: 4px var(--s-3);
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.3;
  border-radius: var(--r-2);
  transition:
    background 140ms var(--ease),
    color 140ms var(--ease);
}
#mdbook-sidebar .chapter li a:hover {
  background: var(--surface-1);
  color: var(--text-1);
}
#mdbook-sidebar .chapter li a.active {
  color: var(--text-1);
  background: linear-gradient(
    to right,
    color-mix(in oklab, var(--accent) 17%, transparent) 0%,
    color-mix(in oklab, var(--accent) 6%, transparent) 55%,
    transparent 100%
  );
  font-weight: var(--weight-emphasis);
}
#mdbook-sidebar .chapter li a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  transform: translate(-1px, -50%);
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--accent) 25%, transparent);
}
/* Sidebar try.html hide */
.sidebar-scrollbox li:has(a[href*="try.html"]) {
  display: none !important;
}

/* Priority badge: margin-inline-start:auto pushes it to the right edge
 * of the flex row. */
.sidebar-scrollbox a[href*="git.html"]::after,
.sidebar-scrollbox a[href*="gh.html"]::after,
.sidebar-scrollbox a[href*="cloud.html"]::after,
.sidebar-scrollbox a[href*="package_managers.html"]::after,
.sidebar-scrollbox a[href*="beads.html"]::after,
.sidebar-scrollbox a[href*="tool_gates.html"]::after,
.sidebar-scrollbox a[href*="devtools.html"]::after,
.sidebar-scrollbox a[href*="runtimes.html"]::after,
.sidebar-scrollbox a[href*="filesystem.html"]::after,
.sidebar-scrollbox a[href*="network.html"]::after,
.sidebar-scrollbox a[href*="system.html"]::after,
.sidebar-scrollbox a[href*="shortcut.html"]::after,
.sidebar-scrollbox a[href*="basics.html"]::after {
  margin-inline-start: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-3);
  padding: 1px 6px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  display: inline-block;
}
.sidebar-scrollbox a.active[href*="git.html"]::after,
.sidebar-scrollbox a.active[href*="gh.html"]::after,
.sidebar-scrollbox a.active[href*="cloud.html"]::after,
.sidebar-scrollbox a.active[href*="package_managers.html"]::after,
.sidebar-scrollbox a.active[href*="beads.html"]::after,
.sidebar-scrollbox a.active[href*="tool_gates.html"]::after,
.sidebar-scrollbox a.active[href*="devtools.html"]::after,
.sidebar-scrollbox a.active[href*="runtimes.html"]::after,
.sidebar-scrollbox a.active[href*="filesystem.html"]::after,
.sidebar-scrollbox a.active[href*="network.html"]::after,
.sidebar-scrollbox a.active[href*="system.html"]::after,
.sidebar-scrollbox a.active[href*="shortcut.html"]::after,
.sidebar-scrollbox a.active[href*="basics.html"]::after {
  color: var(--text-2);
}

.sidebar-scrollbox a[href*="git.html"]::after {
  content: "10";
}
.sidebar-scrollbox a[href*="gh.html"]::after {
  content: "10";
}
.sidebar-scrollbox a[href*="cloud.html"]::after {
  content: "15";
}
.sidebar-scrollbox a[href*="package_managers.html"]::after {
  content: "20";
}
.sidebar-scrollbox a[href*="beads.html"]::after {
  content: "22";
}
.sidebar-scrollbox a[href*="tool_gates.html"]::after {
  content: "23";
}
.sidebar-scrollbox a[href*="devtools.html"]::after {
  content: "25";
}
.sidebar-scrollbox a[href*="runtimes.html"]::after {
  content: "27";
}
.sidebar-scrollbox a[href*="filesystem.html"]::after {
  content: "30";
}
.sidebar-scrollbox a[href*="network.html"]::after {
  content: "35";
}
.sidebar-scrollbox a[href*="system.html"]::after {
  content: "40";
}
.sidebar-scrollbox a[href*="shortcut.html"]::after {
  content: "45";
}
.sidebar-scrollbox a[href*="basics.html"]::after {
  content: "100";
}

/* Content column. mdBook's .content is the scroll/padding wrapper; .content main
 * is the centered column whose width comes from --content-max-width. */
.content {
  min-width: 0;
  padding: var(--s-7) var(--s-7) var(--s-9);
  overflow-y: visible;
}
/* Absolute pixels avoid mdBook's 1rem=10px root changing the intended width. */
.content main {
  max-width: var(--content-max-width);
  margin-inline: auto;
}
/* Hero */
.hero {
  position: relative;
  isolation: isolate;
  padding: var(--s-8) 0 var(--s-7);
  margin-bottom: var(--s-7);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40px -200px auto -200px;
  height: 360px;
  z-index: -1;
  background-image: radial-gradient(var(--grid-dot) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(120% 90% at 30% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 30% 0%, #000 0%, transparent 72%);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  padding: 5px 12px 5px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
}
.eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--allow);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--allow) 22%, transparent);
}
.hero h1 {
  font-size: var(--text-display);
  margin: var(--s-5) 0 var(--s-4);
  max-width: 19ch;
}
.hero h1 .hl {
  color: var(--accent);
}
.hero .lede {
  font-size: var(--text-lead);
  color: var(--text-2);
  max-width: 64ch;
  margin: 0 0 var(--s-6);
}
.hero .lede code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  min-height: 44px;
  padding: 0 var(--s-5);
  font: inherit;
  font-weight: var(--weight-emphasis);
  font-size: 15px;
  border-radius: var(--r-2);
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 160ms var(--ease),
    border-color 160ms var(--ease),
    color 160ms var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent-2);
  color: var(--bg);
}
.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-2);
}
.btn-ghost:hover {
  background: var(--surface-1);
  color: var(--text-1);
}
.btn .sh {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

/* ===== Interceptor panel ===== */
.interceptor {
  margin: var(--s-6) 0 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ix-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.ix-bar .lights {
  display: inline-flex;
  gap: 6px;
}
.ix-bar .lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
}
.ix-bar .label {
  color: var(--text-2);
}
.ix-bar .meta {
  margin-left: auto;
}

.ix-stream {
  display: grid;
  grid-template-columns: 84px auto 1fr auto auto;
  column-gap: var(--s-3);
  row-gap: 0;
  padding: var(--s-3) var(--s-5) var(--s-4);
  font-family: var(--font-mono);
  font-size: 13px;
  align-items: center;
}
.ix-row {
  display: contents;
}
.ix-row > * {
  padding: 10px 0;
  border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
  animation: gate-route-in 360ms var(--ease) both;
  animation-delay: var(--row-delay, 520ms);
}
.ix-row:nth-child(1) {
  --row-delay: 520ms;
}
.ix-row:nth-child(2) {
  --row-delay: 550ms;
}
.ix-row:nth-child(3) {
  --row-delay: 580ms;
}
.ix-row:nth-child(4) {
  --row-delay: 610ms;
}
.ix-row:nth-child(5) {
  --row-delay: 640ms;
}
.ix-row:nth-child(6) {
  --row-delay: 670ms;
}
@keyframes gate-route-in {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}
.ix-row:first-child > * {
  border-top: 0;
  padding-top: 6px;
}
.ix-surface {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  justify-self: start;
  align-self: center;
}
.ix-arrow {
  color: var(--text-3);
  transition:
    color 160ms var(--ease),
    transform 160ms var(--ease);
}
.ix-cmd {
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ix-cmd .prog {
  color: var(--text-3);
}
.ix-cmd .pipe,
.ix-cmd .op {
  color: var(--accent);
}
.ix-note {
  color: var(--text-3);
  font-size: 12px;
  white-space: nowrap;
}
.ix-decision {
  justify-self: end;
  animation-name: gate-decision-settle;
}
.ix-row:hover .ix-arrow {
  color: var(--accent);
  transform: translateX(2px);
}
@keyframes gate-decision-settle {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.ix-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
  align-items: center;
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.ix-foot .legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ix-foot .legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.ix-foot .legend .i-allow {
  background: var(--allow);
}
.ix-foot .legend .i-ask {
  background: var(--ask);
}
.ix-foot .legend .i-block {
  background: var(--block);
}
.ix-foot .sep {
  color: var(--border-2);
}

/* ===== Section heading ===== */
.sec-head {
  margin: var(--s-8) 0 var(--s-4);
}
.sec-head .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sec-head h2 {
  font-size: var(--text-section);
  margin-top: 4px;
}
.sec-head p {
  color: var(--text-2);
  margin: var(--s-2) 0 0;
  max-width: 64ch;
}

/* Triad */
.priority-line {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
  margin-top: var(--s-3);
  padding: 4px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
}
.priority-line b {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}
.priority-line .arrow {
  color: var(--text-3);
}
.priority-line .small {
  color: var(--text-3);
}

.triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  margin-top: var(--s-5);
}
.triad-card {
  position: relative;
  overflow: hidden;
  padding: var(--s-5);
  background:
    radial-gradient(
      ellipse 60% 45% at 0% 0%,
      color-mix(in oklab, var(--c) 8%, transparent),
      transparent 65%
    ),
    var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  transition:
    border-color 160ms var(--ease),
    transform 160ms var(--ease);
}
.triad-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--s-5);
  width: 36px;
  height: 4px;
  background: var(--c);
  border-radius: 0 0 2px 2px;
}
.triad-card:hover {
  border-color: color-mix(in oklab, var(--c) 35%, var(--border));
}
.triad-card.allow {
  --c: var(--allow);
}
.triad-card.ask {
  --c: var(--ask);
}
.triad-card.block {
  --c: var(--block);
}
.triad-card h3 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.triad-card p {
  font-size: var(--text-body);
  color: var(--text-2);
  margin: var(--s-3) 0 0;
}
.triad-card .ex {
  display: inline-block;
  margin-top: var(--s-4);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: var(--r-1);
}
.triad-foot {
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-3);
}
.triad-foot b {
  color: var(--text-2);
  font-weight: var(--weight-emphasis);
}

/* Compound priority strip */
.compound {
  margin-top: var(--s-5);
  padding: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.compound .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.compound .cm-h {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  flex-wrap: wrap;
  margin-top: 4px;
}
.compound .cm-h h2 {
  font-size: 18.4px;
}
.compound .cm-h .hint {
  color: var(--text-3);
  font-size: 13px;
}
.compound .expr {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  margin-top: var(--s-4);
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--surface-2);
}
.compound .tok {
  position: relative;
  padding: var(--s-3) var(--s-4);
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: radial-gradient(
    ellipse 70% 55% at 0% 0%,
    color-mix(in oklab, var(--c) 10%, transparent),
    transparent 70%
  );
}
.compound .tok::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--s-4);
  width: 32px;
  height: 4px;
  background: var(--c);
  border-radius: 0 0 2px 2px;
}
.compound .tok.allow {
  --c: var(--allow);
}
.compound .tok.block {
  --c: var(--block);
}
.compound .tok .cmd {
  color: var(--text-1);
}
.compound .tok .cmd .prog {
  color: var(--text-3);
}
.compound .tok .tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
  font-weight: var(--weight-emphasis);
}
.compound .op {
  align-self: center;
  padding: 0 var(--s-3);
  color: var(--text-3);
  font-size: 16px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--surface-1);
  display: grid;
  place-items: center;
}
.compound .verdict {
  margin-top: var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}
.compound .verdict .arrow {
  color: var(--text-3);
}

/* Surfaces grid (what tool-gates also gates) */
.surfaces {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.surf {
  padding: var(--s-4) var(--s-4) var(--s-4) var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.surf .ic {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 10%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--accent) 25%, var(--border));
  border-radius: var(--r-2);
}
.surf h3 {
  font-family: var(--font-mono);
  font-size: var(--text-card);
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.02em;
  color: var(--text-1);
  margin: 0;
}
.surf p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
}
.surf .ex {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--r-1);
  align-self: start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clients (two-by-two grid) */
.clients {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.client {
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.client h3 {
  font-family: var(--font-mono);
  font-size: var(--text-card);
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.02em;
  color: var(--text-1);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.client h3 .count {
  color: var(--text-3);
  font-weight: var(--weight-regular);
  font-size: 11px;
}
.client ul {
  list-style: none;
  padding: 0;
  margin: var(--s-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.client li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.client li i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.client .client-note {
  display: block;
  margin-top: var(--s-3);
  padding: var(--s-3);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
}
.client .client-note code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  color: var(--text-1);
  background: var(--surface-1);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.client .pathline {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}
.client .pathline code {
  color: var(--text-2);
}
.clients-foot {
  margin-top: var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--text-3);
}
.clients-foot b {
  color: var(--text-2);
  font-weight: var(--weight-emphasis);
}
.clients-foot code {
  white-space: nowrap;
  color: var(--text-2);
}

/* TOML proof panel */
.proof {
  margin-top: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  background: var(--surface-1);
}
.proof header {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.proof header h3 {
  font-size: var(--text-card);
}
.proof header p {
  margin: 0;
  color: var(--text-3);
  font-size: 13px;
}
.proof .pf-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.proof .pf-col {
  padding: var(--s-4) var(--s-5);
}
.proof .pf-col + .pf-col {
  border-left: 1px solid var(--border);
}
.proof .pf-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-3);
}
.proof .pf-tab .file {
  color: var(--text-2);
}
.proof pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-1);
  white-space: pre-wrap;
  background: transparent;
  border: 0;
  padding: 0;
}
.proof .k {
  color: var(--accent);
}
.proof .s {
  color: var(--text-1);
}
.proof .c {
  color: var(--text-3);
}
.proof .sec {
  color: var(--text-2);
}
.proof .out-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-3) 0;
  border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
}
.proof .out-row:first-of-type {
  border-top: 0;
}
.proof .out-row .ocmd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-1);
}
.proof .out-row .ocmd .prog {
  color: var(--text-3);
}
.proof .out-row .oreason {
  font-size: var(--text-body);
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.55;
}
.proof footer {
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
}
.proof footer .pf-flow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.proof footer code {
  color: var(--text-1);
  background: var(--surface-1);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}

/* Modern CLI hints */
.hints {
  margin-top: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
}
.hints header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  flex-wrap: wrap;
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.hints header h2 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
}
.hints header .note {
  font-size: var(--text-label);
  color: var(--text-3);
}
.hint-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  font-family: var(--font-mono);
  font-size: 13px;
}
.hint-row + .hint-row {
  border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
}
.hint-row .old {
  color: var(--text-2);
}
.hint-row .new {
  color: var(--text-1);
}
.hint-row .old s {
  color: var(--text-3);
  text-decoration: none;
}
.hint-row .arrow {
  color: var(--text-3);
  font-size: 14px;
  padding: 0 4px;
}
.hint-row .why {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-size: var(--text-body);
  color: var(--text-3);
  margin-top: -2px;
}
.hint-row .why b {
  color: var(--text-2);
  font-weight: var(--weight-emphasis);
}

/* Security tiers */
.tiers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.tier {
  position: relative;
  overflow: hidden;
  padding: var(--s-4);
  background:
    radial-gradient(
      ellipse 60% 45% at 0% 0%,
      color-mix(in oklab, var(--c) 8%, transparent),
      transparent 65%
    ),
    var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  transition: border-color 160ms var(--ease);
}
.tier::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--s-4);
  width: 36px;
  height: 4px;
  background: var(--c);
  border-radius: 0 0 2px 2px;
}
.tier:hover {
  border-color: color-mix(in oklab, var(--c) 35%, var(--border));
}
.tier.t1 {
  --c: var(--block);
}
.tier.t2 {
  --c: var(--ask);
}
.tier.t3 {
  --c: var(--allow);
}
.tier .row1 {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier .tname {
  color: var(--c);
  font-weight: var(--weight-emphasis);
}
.tier .when {
  color: var(--text-3);
}
.tier h3 {
  font-family: var(--font-display);
  font-size: var(--text-card);
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin: 0;
}
.tier p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
}
.tier .examples {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.tier .examples span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}

/* ===== Gate reference page ===== */
.gate-head {
  margin-bottom: var(--s-5);
}
.breadcrumb {
  font-family: var(--font-mono);
  font-size: var(--text-meta);
  color: var(--text-3);
  margin-bottom: var(--s-3);
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}
.breadcrumb li + li::before {
  content: "/";
  margin-inline-end: var(--s-2);
  color: var(--text-3);
}
.breadcrumb a {
  color: var(--text-3);
}
.breadcrumb a:hover {
  color: var(--accent);
}
.gate-head h1 {
  font-size: var(--text-page);
}
.gate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-4);
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
}
.tag b {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}
.gate-lede {
  color: var(--text-2);
  margin-top: var(--s-4);
  max-width: 68ch;
  font-size: var(--text-body);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: var(--s-5) 0 var(--s-3);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: var(--s-1) var(--s-3);
  cursor: pointer;
  transition:
    background 140ms var(--ease),
    border-color 140ms var(--ease),
    color 140ms var(--ease);
}
.chip:hover {
  color: var(--text-1);
  background: var(--surface-2);
}
.chip[aria-pressed="true"] {
  color: var(--text-1);
  background: color-mix(in oklab, var(--accent) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}
.chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c, var(--text-3));
}
.chip.all i {
  background: var(--text-2);
}
.chip.allow i {
  background: var(--allow);
}
.chip.ask i {
  background: var(--ask);
}
.chip.block i {
  background: var(--block);
}
.chip .n {
  color: var(--text-3);
}
.chip[aria-pressed="true"] .n {
  color: var(--text-2);
}

.rule-filter-status {
  margin: 0 0 var(--s-4);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-meta);
}
.rule-filter-status.is-empty {
  padding: var(--s-4) var(--s-5);
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}

.rule-card {
  margin-top: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
}
.rule-card > header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.rule-card > header h2 {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
}
.rule-card > header .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.rule-card > header .src {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  padding: 1px 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rule-card > header .src:hover {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}

.rule-row {
  display: grid;
  grid-template-columns: 208px 120px 1fr;
  gap: var(--s-4);
  align-items: start;
  padding: var(--s-4) var(--s-5);
}
.rule-row + .rule-row {
  border-top: 1px solid var(--border);
}
.rule-row:hover {
  background: color-mix(in oklab, var(--surface-2) 55%, transparent);
}
.rule-row.is-hidden {
  display: none;
}
.rule-cmd {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-1);
  word-break: break-word;
}
.rule-cmd .prog {
  color: var(--text-3);
}
.rule-cmd .flag {
  color: var(--accent-2);
}
.sub-note {
  color: var(--text-3);
  font-weight: var(--weight-regular);
}
.rule-reason {
  font-size: var(--text-body);
  color: var(--text-2);
}
.rule-reason code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: var(--weight-emphasis);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-1);
  padding: 3px 9px 3px 7px;
  border-radius: var(--r-1);
  background: color-mix(in oklab, var(--c) 16%, var(--surface-2));
  border: 1px solid color-mix(in oklab, var(--c) 38%, transparent);
  white-space: nowrap;
}
.pill svg {
  width: 12px;
  height: 12px;
  color: var(--c);
}
.pill.allow {
  --c: var(--allow);
}
.pill.ask {
  --c: var(--ask);
}
.pill.nudge {
  --c: var(--nudge);
}
.pill.block {
  --c: var(--block);
}
.pill.defer {
  --c: var(--defer);
}

.note {
  display: flex;
  gap: var(--s-3);
  align-items: flex-start;
  margin-top: var(--s-6);
  padding: var(--s-4) var(--s-5);
  background: color-mix(in oklab, var(--ask) 7%, var(--surface-1));
  border: 1px solid color-mix(in oklab, var(--ask) 22%, var(--border));
  border-radius: var(--r-2);
  font-size: var(--text-body);
  color: var(--text-2);
}
.note svg.alert {
  color: var(--ask);
  flex: none;
  margin-top: 2px;
}
.note b {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}

.empty {
  margin-top: var(--s-7);
  padding: var(--s-8) var(--s-5);
  text-align: center;
  border: 1px dashed var(--border-2);
  border-radius: var(--r-3);
  color: var(--text-2);
}
.empty .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
}

/* Footer */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: var(--s-9);
  padding: var(--s-6) 0;
  color: var(--text-3);
  font-size: 13px;
}
footer.site .row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: baseline;
  justify-content: space-between;
}
footer.site .row p {
  margin: 0;
}
footer.site .stamp {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}

/* Hero reveal */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 620ms var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 75ms);
}
@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .ix-stream {
    grid-template-columns: 76px auto 1fr auto;
  }
  .ix-row .ix-note {
    display: none;
  }
  .proof .pf-cols {
    grid-template-columns: 1fr;
  }
  .proof .pf-col + .pf-col {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
  .surfaces {
    grid-template-columns: repeat(2, 1fr);
  }
  .clients {
    grid-template-columns: 1fr;
  }
  .tiers {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 900px) {
  .content {
    padding: var(--s-6) var(--s-5) var(--s-8);
  }
  .triad {
    grid-template-columns: 1fr;
  }
  .compound .expr {
    grid-template-columns: 1fr;
  }
  .compound .op {
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: var(--s-2);
  }
  .surfaces {
    grid-template-columns: 1fr;
  }
  .hint-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .hint-row .arrow {
    display: none;
  }
  .rule-row {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }
  .rule-row .pill {
    justify-self: start;
  }
}
@media (max-width: 1079px) {
  /* Keep mdBook's hidden checkbox as the drawer state, but make the sidebar an
   * overlay until the same 1080px breakpoint used by initial sidebar state.
   * This avoids mdBook's 620px push-layout rule compressing the tablet header. */
  #mdbook-sidebar-toggle-anchor:checked ~ .page-wrapper {
    margin-inline-start: 0;
    transform: none;
  }
  .sidebar {
    z-index: 220;
    box-shadow: var(--shadow);
  }
  #mdbook-menu-bar {
    gap: var(--s-1);
    padding-inline: var(--s-2);
  }
  #mdbook-menu-bar .right-buttons {
    gap: 0;
  }
  #mdbook-menu-bar .brand {
    flex: 0 1 auto;
    gap: var(--s-2);
  }
  .ver {
    display: none !important;
  }
  #mdbook-sidebar .chapter li a,
  #mdbook-menu-bar .brand {
    min-height: 44px;
  }
  /* No inline search box while the sidebar is an overlay. Restore mdBook's
   * search toggle so the header remains compact at phone and tablet widths, and
   * collapse the inline box to its natural full-width panel when toggled open
   * (the 340px inline pill is too wide once the shell enters drawer mode). */
  #mdbook-search-toggle {
    display: inline-flex;
  }
  #mdbook-sidebar-toggle,
  #mdbook-search-toggle,
  #tgThemeToggle,
  #mdbook-menu-bar .right-buttons > a {
    min-width: 44px;
    height: var(--menu-bar-height);
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  .sidebar-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    flex: none;
    width: 44px;
    height: 44px;
    margin: var(--s-2) var(--s-3) 0;
    padding: 0;
    color: var(--text-2);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-2);
    cursor: pointer;
  }
  .sidebar-close:hover {
    color: var(--text-1);
    background: var(--surface-1);
    border-color: var(--border);
  }
  .sidebar .sidebar-cta {
    margin-top: var(--s-1);
  }
  #mdbook-search-wrapper.inline-search:not(.hidden) {
    position: absolute;
    inset: calc(100% + var(--s-2)) var(--s-2) auto;
    width: auto;
    z-index: 90;
  }
  .inline-search .searchresults-outer {
    width: 100%;
    max-height: calc(100vh - 132px);
  }
  .inline-search #mdbook-searchbar {
    height: 44px;
    font-size: 16px;
    line-height: 44px;
  }
}

@media (max-width: 760px) {
  .chip,
  .sim-chip,
  .tab,
  .sim-custom-run {
    min-height: 44px;
  }
  .hero {
    padding-top: var(--s-5);
  }
  .eyebrow {
    align-items: flex-start;
  }
  .eyebrow .dot {
    margin-top: 0.45em;
  }
  .ix-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .ix-bar .meta {
    flex-basis: 100%;
    margin-left: 28px;
  }
  .ix-stream {
    display: block;
    padding: var(--s-2) var(--s-4) var(--s-3);
  }
  .ix-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--s-2) var(--s-3);
    padding: var(--s-3) 0;
    border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
  }
  .ix-row:first-child {
    border-top: 0;
  }
  .ix-row > *,
  .ix-row:first-child > * {
    padding: 0;
    border-top: 0;
  }
  .ix-surface {
    grid-column: 1;
  }
  .ix-arrow {
    grid-column: 2;
    justify-self: start;
  }
  .ix-decision {
    grid-column: 3;
  }
  .ix-cmd {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }
  .ix-foot {
    padding-inline: var(--s-4);
  }
  .ix-foot .sep {
    display: none;
  }
}

@media (max-width: 360px) {
  #mdbook-menu-bar .right-buttons > a {
    display: none;
  }
  #mdbook-menu-bar .brand {
    gap: var(--s-2);
    font-size: 14px;
  }
  #mdbook-menu-bar .brand .gate {
    width: 18px;
    height: 18px;
  }
}

/* ===== Info-page shared bits (Installation / Hook model) ===== */
.page-lede {
  font-size: var(--text-lead);
  color: var(--text-2);
  max-width: 66ch;
  margin: var(--s-3) 0 var(--s-7);
}
.step {
  margin-top: var(--s-7);
}
.step:first-of-type {
  margin-top: 0;
}
.step-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 var(--s-3);
}
.step-prose {
  color: var(--text-2);
  margin: var(--s-3) 0;
  max-width: 66ch;
  line-height: 1.65;
}
.step-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}

pre.code-block {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-1);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  margin: 0 0 var(--s-3);
  white-space: pre-wrap;
  word-break: break-word;
}
pre.code-block .prompt {
  color: var(--text-3);
  user-select: none;
  padding-right: 4px;
}
pre.code-block .comment {
  color: var(--text-3);
}
pre.code-block .flag {
  color: var(--accent-2);
}

/* Tabs */
.tabs {
  margin-top: var(--s-3);
}
.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-4);
}
.tab {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 13px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 10px 14px;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    background 160ms var(--ease),
    color 160ms var(--ease),
    border-color 160ms var(--ease);
}
.tab:hover {
  color: var(--text-2);
  background: var(--surface-1);
}
.tab[aria-selected="true"] {
  color: var(--text-1);
  background: color-mix(in oklab, var(--accent) 7%, var(--surface-1));
  border-bottom-color: var(--accent);
}
.tab-panel {
  display: none;
}
.tab-panel.is-active {
  display: block;
  animation: tab-panel-in 220ms var(--ease) both;
}
.tab-panel:focus-visible {
  outline-offset: var(--s-2);
}
@keyframes tab-panel-in {
  from {
    opacity: 0;
    filter: blur(2px);
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}
@media (max-width: 360px) {
  .tablist {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .tab {
    padding-inline: var(--s-1);
    line-height: 1.3;
    white-space: normal;
  }
}

/* Install client cards (Installation page) */
.install-clients {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.install-client {
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.install-client > header {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
}
.install-client > header h3 {
  font-family: var(--font-display);
  font-size: var(--text-card);
  letter-spacing: -0.01em;
}
.install-client .hooks-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  padding: 2px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}
.install-client > p {
  margin: 0;
  font-size: 16px;
  color: var(--text-2);
  line-height: 1.55;
}
.install-client > p code,
.install-client li code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.install-client .hook-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.install-client .hook-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.45;
}
.install-client .hook-list li::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  transform: translateY(-1px);
}
.install-client .hook-list code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
  background: transparent;
  padding: 0;
  border-radius: 0;
}
.install-client .settings-path {
  margin: var(--s-2) 0 0;
  padding-top: var(--s-3);
  border-top: 1px dashed color-mix(in oklab, var(--border) 60%, transparent);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

/* Lifecycle diagram */
.lifecycle {
  margin: var(--s-3) 0 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lc-bar {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.lc-bar .lights {
  display: inline-flex;
  gap: 6px;
}
.lc-bar .lights i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
}
.lc-bar .lc-label {
  color: var(--text-2);
}

.lc-track {
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
}
.lc-node {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: var(--s-3);
  row-gap: 2px;
  padding: var(--s-3) var(--s-4);
  background:
    linear-gradient(
      to right,
      color-mix(in oklab, var(--accent) 7%, transparent) 0%,
      transparent 32%
    ),
    var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  align-items: baseline;
}
.lc-node.exec {
  background:
    linear-gradient(to right, color-mix(in oklab, var(--allow) 8%, transparent) 0%, transparent 32%),
    var(--surface-2);
}
.lc-node.conditional {
  background:
    linear-gradient(
      to right,
      color-mix(in oklab, var(--accent) 5%, transparent) 0%,
      transparent 32%
    ),
    color-mix(in oklab, var(--surface-2) 70%, var(--surface-1));
}
.lc-node .lc-icon {
  grid-row: 1 / 5;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in oklab, var(--accent) 14%, var(--surface-1));
  border: 1px solid color-mix(in oklab, var(--accent) 38%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}
.lc-node.exec .lc-icon {
  background: color-mix(in oklab, var(--allow) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--allow) 38%, transparent);
  color: var(--allow);
}
.lc-tag {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1px 6px;
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
  border-radius: var(--r-1);
  justify-self: start;
}
.lc-when {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.lc-title {
  grid-column: 2;
  font-family: var(--font-display);
  font-size: 16.3px;
  font-weight: var(--weight-emphasis);
  color: var(--text-1);
  letter-spacing: -0.01em;
  margin-top: 3px;
}
.lc-sub {
  grid-column: 2;
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
  margin-top: 2px;
}
.lc-sub code,
.lc-when code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-1);
  background: var(--surface-1);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.lc-edge {
  width: 2px;
  height: 14px;
  margin-left: calc(var(--s-4) + 14px);
  background: linear-gradient(
    to bottom,
    var(--border) 0%,
    color-mix(in oklab, var(--border) 40%, transparent) 100%
  );
}

/* Hook reference cards */
.hook-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-4);
}
.hook-card {
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}
.hook-card h3 {
  font-family: var(--font-mono);
  font-size: var(--text-card);
  font-weight: var(--weight-emphasis);
  color: var(--accent);
  letter-spacing: 0.02em;
}
.hook-card p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
}
.hook-card .hook-detail {
  color: var(--text-3);
  font-size: var(--text-label);
}
.hook-card code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}

/* Gate summary mini-bar */
.summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-4);
  align-items: center;
  padding: var(--s-3) var(--s-4);
  margin: var(--s-4) 0 0;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.summary .seg-bar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
.summary .seg {
  height: 100%;
  background: var(--c, var(--text-3));
}
.summary .seg.allow {
  --c: var(--allow);
}
.summary .seg.ask {
  --c: var(--ask);
}
.summary .seg.block {
  --c: var(--block);
}
.summary .counts {
  display: inline-flex;
  gap: var(--s-3);
  font-family: var(--font-mono);
  font-size: 12px;
  flex-wrap: wrap;
}
.summary .counts span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}
.summary .counts span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c);
}
.summary .counts .ca {
  --c: var(--allow);
}
.summary .counts .cas {
  --c: var(--ask);
}
.summary .counts .cb {
  --c: var(--block);
}
.summary .counts b {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}

/* Warn marker on ask rules */
.warn-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ask);
  padding: 1px 5px;
  background: color-mix(in oklab, var(--ask) 10%, transparent);
  border: 1px solid color-mix(in oklab, var(--ask) 30%, transparent);
  border-radius: var(--r-1);
  vertical-align: 2px;
}

@media (max-width: 1100px) {
  .hook-cards {
    grid-template-columns: 1fr;
  }
  .summary {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .install-clients {
    grid-template-columns: 1fr;
  }
}

/* ===== Configuration page ===== */
.config-block {
  margin-top: var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  overflow: hidden;
}
.config-block > header {
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.config-block > header :is(h2, h3) {
  font-family: var(--font-display);
  font-size: var(--text-card);
  letter-spacing: -0.01em;
}
.config-block > header .src-tag {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  padding: 2px 7px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}
.config-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.config-body .config-toml {
  padding: var(--s-4) var(--s-5);
}
.config-body .config-prose {
  padding: var(--s-4) var(--s-5);
  border-left: 1px solid var(--border);
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.6;
}
.config-body .config-prose p {
  margin: 0 0 var(--s-3);
}
.config-body .config-prose p:last-child {
  margin-bottom: 0;
}
.config-body .config-prose code,
.config-body .config-toml code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.config-body pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-1);
  white-space: pre-wrap;
  background: transparent;
  border: 0;
  padding: 0;
}
.config-body .k {
  color: var(--accent);
}
.config-body .s {
  color: var(--text-1);
}
.config-body .c {
  color: var(--text-3);
}
.config-body .sec {
  color: var(--text-2);
}
.config-body .sec.added,
.config-body .sec.fixed,
.config-body .sec.other {
  display: inline-block;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  margin-top: 12px;
  margin-bottom: 2px;
}
.config-body pre > .sec.added:first-child,
.config-body pre > .sec.fixed:first-child,
.config-body pre > .sec.other:first-child {
  margin-top: 0;
}
.config-body .sec.added {
  color: var(--allow);
}
.config-body .sec.fixed {
  color: var(--ask);
}
.config-body .sec.other {
  color: var(--defer);
}
.config-body .b {
  color: var(--accent-2);
}

.config-path {
  margin-top: var(--s-7);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-1);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-2);
  display: flex;
  gap: var(--s-3);
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-2);
}
.config-path code {
  color: var(--text-1);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--r-1);
}
.config-path .lbl {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.config-path .right {
  margin-left: auto;
  color: var(--text-3);
}

@media (max-width: 1100px) {
  .config-body {
    grid-template-columns: 1fr;
  }
  .config-body .config-prose {
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

/* Recent Releases: foreground the active window and retain the full history
 * behind one native, keyboard-operable disclosure. */
.release-current,
.release-archive {
  margin-top: var(--s-7);
}
.release-section-head {
  margin: 0 0 var(--s-4);
  padding-bottom: var(--s-4);
  border-bottom: 1px dashed var(--border-2);
}
.release-summary-kicker,
.release-summary-range {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.release-current > .config-block:first-of-type {
  margin-top: var(--s-4);
}
.release-current .config-prose,
.release-archive .config-prose {
  font-size: 16px;
}
.release-archive {
  border-block: 1px dashed var(--border-2);
}
.release-archive > summary {
  padding: var(--s-4) 0;
  cursor: pointer;
  list-style: none;
}
.release-archive > summary::-webkit-details-marker {
  display: none;
}
.release-archive > summary::marker {
  content: "";
}
.release-archive > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: var(--s-1);
}
.release-summary {
  min-height: 72px;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 44px;
  gap: var(--s-1) var(--s-4);
  align-items: center;
  min-width: 0;
}
.release-summary-kicker {
  grid-column: 1;
  grid-row: 1;
}
.release-summary-title {
  grid-column: 1;
  grid-row: 2;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: var(--text-section);
  line-height: 1.2;
  letter-spacing: -0.02em;
  transition: color 180ms var(--ease);
}
.release-archive > summary:hover .release-summary-title {
  color: var(--accent);
}
.release-summary-range {
  grid-column: 2;
  grid-row: 1 / 3;
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
}
.release-summary-icon {
  grid-column: 3;
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 22px;
  line-height: 1;
  position: relative;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease);
}
.release-summary-icon::before,
.release-summary-icon::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  border-radius: var(--r-1);
  background: currentColor;
}
.release-summary-icon::after {
  transform: rotate(90deg);
}
.release-archive[open] .release-summary-icon {
  transform: rotate(45deg);
  border-color: var(--border-2);
  background: var(--surface-3);
}
.release-archive-list {
  padding: 0 0 var(--s-5);
  border-top: 1px solid var(--border);
}
.release-archive-list > .config-block:first-child {
  margin-top: var(--s-5);
}
@media (max-width: 760px) {
  .release-archive > summary {
    padding: var(--s-4) 0;
  }
  .release-summary {
    min-height: 88px;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: var(--s-1) var(--s-3);
  }
  .release-summary-kicker {
    grid-column: 1;
    grid-row: 1;
  }
  .release-summary-title {
    grid-column: 1;
    grid-row: 2;
    font-size: var(--text-lead);
  }
  .release-summary-range {
    grid-column: 1;
    grid-row: 3;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .release-summary-icon {
    grid-column: 2;
    grid-row: 1 / 4;
  }
  .release-current .config-block > header,
  .release-archive .config-block > header,
  .release-current .config-body .config-toml,
  .release-current .config-body .config-prose,
  .release-archive .config-body .config-toml,
  .release-archive .config-body .config-prose {
    padding-inline: var(--s-4);
  }
}

/* Per-page "Edit on GitHub" link */
.edit-page {
  margin-top: var(--s-7);
  padding-top: var(--s-4);
  border-top: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-align: right;
}
.edit-page a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.edit-page a:hover {
  color: var(--accent);
}
.edit-page a svg {
  width: 13px;
  height: 13px;
  opacity: 0.65;
}
.edit-page a:hover svg {
  opacity: 1;
}
.edit-page code {
  font-family: var(--font-mono);
  color: var(--text-2);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}

/* Mini gate tag inside rule-row (security floor cross-cut) */
.rule-gate {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--r-1);
  border: 1px solid var(--border);
  margin-right: 6px;
  vertical-align: 1px;
}

/* Responsive data tables */
.data-table-frame {
  position: relative;
  max-width: 100%;
  margin-top: var(--s-3);
  border-radius: var(--r-3);
}
.data-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border-radius: var(--r-3);
}
.data-table-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: var(--s-1);
}
.data-table-frame::before,
.data-table-frame::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 1px;
  bottom: 1px;
  width: var(--s-5);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms var(--ease);
}
.data-table-frame::before {
  left: 1px;
  background: linear-gradient(to right, var(--surface-1), transparent);
}
.data-table-frame::after {
  right: 1px;
  background: linear-gradient(to left, var(--surface-1), transparent);
}
.data-table-frame.can-scroll-start::before,
.data-table-frame.can-scroll-end::after {
  opacity: 1;
}
.data-table {
  width: 100%;
  min-width: 800px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.data-table thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-weight: var(--weight-emphasis);
}
.data-table tbody tr + tr td {
  border-top: 1px solid var(--border);
}
.data-table td {
  padding: var(--s-3) var(--s-4);
  vertical-align: top;
  color: var(--text-2);
  line-height: 1.55;
}
.data-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-1);
  white-space: nowrap;
}
.data-table td code,
.data-table th code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.data-table .level-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
}
.data-table .level-badge .n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
  font-size: 11px;
}
.data-table .level-badge.top .n {
  background: color-mix(in oklab, var(--accent) 14%, var(--surface-2));
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border-2));
  color: var(--accent);
}

/* 404 / page-not-built */
.notfound {
  margin-top: var(--s-6);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-9) var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
}
.notfound .nf-big {
  font-family: var(--font-display);
  font-size: clamp(41.6px, 7vw, 70.4px);
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-1);
  margin: var(--s-2) 0 0;
}
.notfound .nf-msg {
  font-size: 16.3px;
  color: var(--text-2);
  max-width: 52ch;
  margin: var(--s-2) 0 0;
}
.notfound .nf-msg code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
.notfound .nf-cta {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: var(--s-4);
}

/* basics gate command-chip grid */
.cmd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
  margin-top: var(--s-5);
}
.cmd-grid .cat {
  padding: var(--s-4);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
}
.cmd-grid .cat h2 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--s-3);
}
.cmd-grid .cat .chips-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cmd-grid .cat span {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
}
@media (max-width: 900px) {
  .cmd-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Command simulator (Try a command) ===== */
.sim-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: var(--s-4) 0 var(--s-5);
}
.sim-chip {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: 6px 11px;
  cursor: pointer;
  transition:
    color 160ms var(--ease),
    background 160ms var(--ease),
    border-color 160ms var(--ease);
}
.sim-chip:hover {
  color: var(--text-1);
  background: var(--surface-2);
  border-color: var(--border-2);
}
.sim-chip[aria-pressed="true"] {
  color: var(--text-1);
  background: color-mix(in oklab, var(--accent) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}
.sim-input {
  margin: 0 0 var(--s-4);
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.sim-input .prompt {
  color: var(--text-3);
  margin-right: 8px;
  user-select: none;
}

/* Auto-loading WASM engine indicator + custom-command input (Try page).
 * The status pill replaces the prior "Load engine" button: the engine streams
 * in the background, the pill shows live state (loading -> ready / error). */
.sim-engine {
  margin: 0 0 var(--s-5);
}
.sim-engine-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.sim-engine-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  transition:
    border-color 240ms var(--ease),
    background 240ms var(--ease);
}
.sim-engine-status .sim-engine-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--defer);
  flex: none;
  transition:
    background 240ms var(--ease),
    box-shadow 240ms var(--ease);
}
.sim-engine-status .sim-engine-label {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}
.sim-engine-status .sim-engine-meta {
  color: var(--text-3);
  letter-spacing: 0.01em;
}
.sim-engine-status .sim-engine-meta::before {
  content: "·";
  margin: 0 6px 0 2px;
  color: var(--text-3);
}

/* Loading: amber-ish (re-using --ask color), gentle pulse while wasm streams. */
.sim-engine-status[data-state="loading"] {
  border-color: color-mix(in oklab, var(--ask) 30%, var(--border));
}
.sim-engine-status[data-state="loading"] .sim-engine-dot {
  background: var(--ask);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--ask) 18%, transparent);
  animation: sim-engine-dot-pulse 1400ms var(--ease) infinite;
}
@keyframes sim-engine-dot-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}
/* Honour reduced-motion: hold the dot steady. */
@media (prefers-reduced-motion: reduce) {
  .sim-engine-status[data-state="loading"] .sim-engine-dot {
    animation: none;
  }
}

/* Ready: green, mirroring the --allow indicator in the version pill. */
.sim-engine-status[data-state="ready"] {
  border-color: color-mix(in oklab, var(--allow) 30%, var(--border-2));
  background: color-mix(in oklab, var(--allow) 5%, var(--surface-1));
}
.sim-engine-status[data-state="ready"] .sim-engine-dot {
  background: var(--allow);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--allow) 18%, transparent);
}

/* Error: --block red, no pulse (the failure is steady-state). */
.sim-engine-status[data-state="error"] {
  border-color: color-mix(in oklab, var(--block) 35%, var(--border-2));
  background: color-mix(in oklab, var(--block) 5%, var(--surface-1));
}
.sim-engine-status[data-state="error"] .sim-engine-dot {
  background: var(--block);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--block) 16%, transparent);
}
.sim-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: var(--s-3) var(--s-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  transition:
    border-color 160ms var(--ease),
    opacity 160ms var(--ease);
  opacity: 0.6;
}
.sim-custom.is-armed {
  opacity: 1;
  border-color: var(--border-2);
}
.sim-custom:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}
.sim-custom .prompt {
  color: var(--text-3);
  user-select: none;
}
.sim-custom-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-1);
  background: transparent;
  border: 0;
  outline: none;
}
.sim-custom-input::placeholder {
  color: var(--text-3);
}
.sim-custom-input:disabled {
  cursor: not-allowed;
}
.sim-custom-run {
  flex: 0 0 auto;
}
.sim-custom-run:disabled,
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.sim-custom-status {
  min-height: 1.5em;
  margin: var(--s-2) 0 0;
  color: var(--text-3);
  font-size: var(--text-label);
}
.sim-custom-status[data-state="error"] {
  color: var(--block);
}

/* sim-stage extends .lc-node */
.lc-node.sim-stage {
  opacity: 0.45;
  transition:
    opacity 240ms var(--ease),
    background 240ms var(--ease);
}
.lc-node.sim-stage.active {
  opacity: 1;
}
.lc-node.sim-stage.passed {
  opacity: 1;
  background:
    linear-gradient(to right, color-mix(in oklab, var(--allow) 7%, transparent) 0%, transparent 32%),
    var(--surface-2);
}
.lc-node.sim-stage.passed .lc-icon {
  color: var(--allow);
  background: color-mix(in oklab, var(--allow) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--allow) 38%, transparent);
}
.lc-node.sim-stage.tripped[data-final="ask"] {
  opacity: 1;
  background:
    linear-gradient(to right, color-mix(in oklab, var(--ask) 9%, transparent) 0%, transparent 32%),
    var(--surface-2);
}
.lc-node.sim-stage.tripped[data-final="ask"] .lc-icon {
  color: var(--ask);
  background: color-mix(in oklab, var(--ask) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--ask) 38%, transparent);
}
.lc-node.sim-stage.tripped[data-final="block"] {
  opacity: 1;
  background:
    linear-gradient(
      to right,
      color-mix(in oklab, var(--block) 10%, transparent) 0%,
      transparent 32%
    ),
    var(--surface-2);
}
.lc-node.sim-stage.tripped[data-final="block"] .lc-icon {
  color: var(--block);
  background: color-mix(in oklab, var(--block) 14%, var(--surface-1));
  border-color: color-mix(in oklab, var(--block) 38%, transparent);
}
.lc-node.sim-stage.skipped {
  opacity: 0.3;
}

.sim-stage-note {
  grid-column: 2;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
  min-height: 1.4em;
}
.lc-node.sim-stage.passed .sim-stage-note {
  color: var(--allow);
}
.lc-node.sim-stage.tripped[data-final="ask"] .sim-stage-note {
  color: var(--ask);
}
.lc-node.sim-stage.tripped[data-final="block"] .sim-stage-note {
  color: var(--block);
}

.sim-result {
  margin-top: var(--s-5);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s-4);
  align-items: center;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 300ms var(--ease),
    transform 300ms var(--ease);
}
.sim-result.shown {
  opacity: 1;
  transform: none;
}
.sim-result .sim-pill-host {
  display: inline-flex;
}
.sim-result .sim-reason {
  font-size: var(--text-body);
  color: var(--text-2);
  line-height: 1.55;
}
.sim-result .sim-reason b {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}
.sim-result .sim-reason code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--text-1);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: var(--r-1);
}
@media (max-width: 900px) {
  .sim-result {
    grid-template-columns: 1fr;
  }
}

/* ===== Featured CTA in sidebar ===== */
.sidebar-cta {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin: 0 0 var(--s-5);
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--accent) 22%, transparent) 0%,
    color-mix(in oklab, var(--accent) 6%, transparent) 100%
  );
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border));
  border-radius: var(--r-2);
  text-decoration: none;
  transition:
    border-color 160ms var(--ease),
    background 160ms var(--ease);
  position: relative;
  overflow: hidden;
}
.sidebar-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    color-mix(in oklab, var(--accent) 25%, transparent) 100%
  );
}
.sidebar-cta:hover {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--border-2));
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--accent) 28%, transparent) 0%,
    color-mix(in oklab, var(--accent) 10%, transparent) 100%
  );
}
.sidebar-cta[aria-current="page"] {
  border-color: color-mix(in oklab, var(--accent) 60%, var(--border-2));
}
.sidebar-cta .cta-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: color-mix(in oklab, var(--accent) 28%, var(--surface-1));
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: var(--r-2);
  color: var(--accent);
}
.sidebar-cta .cta-icon svg {
  width: 14px;
  height: 14px;
}
.sidebar-cta .cta-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sidebar-cta .cta-title {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: var(--weight-emphasis);
  color: var(--text-1);
  letter-spacing: -0.005em;
}
.sidebar-cta .cta-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* ===== Content link-color reclaim =====
 * mdBook's chrome.css sets `.content a:link, a:visited { color: var(--links) }`
 * (specificity 0-2-1). That outranks the design's bare `a` and `.btn-*`/
 * `.breadcrumb` color rules, so without this block every in-content link (hero
 * buttons, breadcrumbs, inline prose links) renders accent-on-accent or wrong.
 * These selectors match mdBook's specificity and load afterward, so the design
 * colors win on the tie. Pills are <span>, so they are unaffected. */
.content a:link,
.content a:visited {
  color: var(--accent);
}
.content a:hover {
  color: var(--accent-2);
}

.content a.btn-primary:link,
.content a.btn-primary:visited {
  color: var(--bg);
}
.content a.btn-primary:hover {
  color: var(--bg);
}
.content a.btn-ghost:link,
.content a.btn-ghost:visited {
  color: var(--text-1);
}
.content a.btn-ghost:hover {
  color: var(--text-1);
}

.content .breadcrumb a:link,
.content .breadcrumb a:visited {
  color: var(--text-3);
}
.content .breadcrumb a:hover {
  color: var(--accent);
}

/* Featured CTA is an <a> in the fixed sidebar (outside .content), but guard its
 * inner label colors against any inherited link color regardless. */
.sidebar-cta:link .cta-title,
.sidebar-cta:visited .cta-title {
  color: var(--text-1);
}
.sidebar-cta:link .cta-sub,
.sidebar-cta:visited .cta-sub {
  color: var(--text-3);
}

/* Custom Try Page Redesigns and Drag-Drop */
.try-title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--s-3);
}

.sim-settings-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
  border-radius: var(--r-3);
  padding: var(--s-4) var(--s-5);
  background: var(--surface-1);
  cursor: pointer;
  margin-top: var(--s-4);
  margin-bottom: var(--s-2);
  text-align: center;
  transition:
    border-color 200ms var(--ease),
    background 200ms var(--ease);
}

.sim-settings-upload .drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.sim-settings-upload:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 16%, transparent);
}

.settings-file-input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.sim-settings-upload:hover,
.sim-settings-upload.is-dragover {
  border-color: color-mix(in oklab, var(--accent) 50%, var(--border));
  background: color-mix(in oklab, var(--accent) 4%, var(--surface-2));
}

.sim-settings-upload .icon-upload {
  color: var(--text-3);
  margin-bottom: 8px;
  transition: color 200ms var(--ease);
}

.sim-settings-upload:hover .icon-upload,
.sim-settings-upload.is-dragover .icon-upload {
  color: var(--accent);
}

.sim-settings-upload .drop-zone-text {
  font-size: var(--text-body);
  color: var(--text-2);
  margin-bottom: 4px;
}

.sim-settings-upload .drop-zone-text .highlight {
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}

.sim-settings-upload .drop-zone-sub {
  font-size: var(--text-label);
  color: var(--text-3);
}

.settings-upload-status,
.settings-upload-error {
  min-height: 1.5em;
  margin: 0 0 var(--s-3);
  font-size: var(--text-label);
}
.settings-upload-status {
  color: var(--text-3);
}
.settings-upload-error {
  color: var(--block);
}

.active-settings-panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  padding: var(--s-3) var(--s-4);
  margin-bottom: var(--s-5);
}
.active-settings-panel[hidden] {
  display: none;
}

.active-settings-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s-3);
}

.active-settings-panel .panel-title {
  font-size: 13px;
  font-weight: var(--weight-emphasis);
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.active-settings-panel .panel-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-file-badge {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
  padding: 4px 8px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-1);
  font-size: 12px;
}

.settings-file-badge .file-name {
  min-width: 0;
  font-family: var(--font-mono);
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
  overflow-wrap: anywhere;
}

.settings-file-badge .file-meta {
  flex: none;
  color: var(--text-3);
  font-size: 11px;
}

.settings-file-badge .remove-file-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-file-badge .remove-file-btn:hover {
  color: var(--block);
}

@media (max-width: 760px) {
  .settings-file-badge {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }
  .settings-file-badge .file-name {
    grid-column: 1 / -1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .settings-file-badge .remove-file-btn {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Ensure line-breaks show up in the simulator reason output box */
.sim-result .sim-reason {
  white-space: pre-wrap;
}

/* Styles for the clipboard copy interface on code blocks. Coordinates with JS-driven success indicator transitions. */
pre.code-block {
  position: relative;
}

.config-toml {
  position: relative;
}

.tg-copy-btn {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-3);
  border-radius: var(--r-1);
  cursor: pointer;
  transition:
    transform 0.1s var(--ease),
    background 0.1s var(--ease),
    color 0.1s var(--ease),
    border-color 0.1s var(--ease);
  user-select: none;
  z-index: 10;
}

.tg-copy-btn:focus {
  outline: none;
}

.tg-copy-btn:focus-visible {
  outline: 2px solid var(--accent);
}

.tg-copy-btn:hover {
  background: var(--surface-3);
  color: var(--text-1);
  border-color: var(--border-2);
  transform: scale(1.06);
}

.tg-copy-btn:active {
  background: var(--surface-1);
  transform: scale(0.96);
}

/* Active success feedback: switches background and border to the brand accent color for clear visual confirmation. */
.tg-copy-btn.is-success {
  background: var(--accent);
  color: var(--surface-1);
  border-color: var(--accent);
}
.tg-copy-btn.is-error {
  background: color-mix(in oklab, var(--block) 12%, var(--surface-2));
  color: var(--block);
  border-color: color-mix(in oklab, var(--block) 45%, var(--border));
}

@media (max-width: 760px) {
  .tg-copy-btn {
    top: var(--s-1);
    right: var(--s-1);
    width: 44px;
    height: 44px;
  }
  pre.code-block,
  .config-body .config-toml {
    padding-right: calc(44px + var(--s-3));
  }
}

/* Clipboard and checkmark SVG layout bounds. */
.tg-copy-btn svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
}

/* Responsive CSS mockup of the review dashboard. Replicates the column sections, item lists, and highlighted selection states of the actual Ratatui terminal application. */
.tui-mockup {
  display: flex;
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  overflow: hidden;
  margin: var(--s-4) 0;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 600px) {
  .tui-mockup {
    flex-direction: column;
  }
}

.tui-panel {
  flex: 1;
  padding: var(--s-3);
  border-right: 1px solid var(--border);
  min-width: 0;
}

@media (max-width: 600px) {
  .tui-panel {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tui-panel:last-child {
    border-bottom: none;
  }
}

.tui-panel:last-child {
  border-right: none;
}

.tui-panel-title {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-3);
  border-bottom: 1px dashed var(--border);
  padding-bottom: var(--s-2);
  margin-bottom: var(--s-3);
  letter-spacing: 0.05em;
}

.tui-row {
  display: flex;
  align-items: center;
  padding: 4px var(--s-2);
  border-radius: var(--r-1);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tui-row.is-selected {
  background: var(--surface-2);
  color: var(--text-1);
  font-weight: var(--weight-emphasis);
}

.tui-indicator {
  color: var(--accent);
  margin-right: var(--s-2);
  width: 8px;
  font-weight: bold;
}

.tui-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tui-count {
  color: var(--text-3);
  margin-left: var(--s-2);
}

.tui-cmd {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tui-detail-content {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.tui-detail-item {
  color: var(--text-2);
}

.tui-detail-item strong {
  color: var(--text-3);
  font-weight: normal;
  display: inline-block;
  width: 70px;
}

.tui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-3);
}

.tui-btn {
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 6px;
  border-radius: var(--r-1);
  user-select: none;
}

.tui-btn-approve {
  color: var(--allow);
  border-color: color-mix(in oklab, var(--allow) 30%, var(--border));
}

.tui-btn-skip {
  color: var(--text-3);
}

.tui-btn-deny {
  color: var(--block);
  border-color: color-mix(in oklab, var(--block) 30%, var(--border));
}

/* OS-like terminal frame wrapper that encapsulates the TUI mockup to visually group CLI components. */
.terminal-window {
  border: 1px solid var(--border);
  border-radius: var(--r-2);
  background: var(--surface-1);
  overflow: hidden;
  margin: var(--s-5) 0;
  box-shadow: var(--shadow-sm);
}

.terminal-header {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--s-3);
  position: relative;
}

.terminal-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.terminal-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-close {
  background: var(--block);
}

.dot-minimize {
  background: var(--ask);
}

.dot-maximize {
  background: var(--allow);
}

.terminal-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  font-weight: var(--weight-emphasis);
  pointer-events: none;
}

.terminal-body {
  padding: var(--s-2);
  background: var(--surface-1);
}

/* Remove redundant mockup borders, shadows, and margins so they blend cleanly inside the outer terminal frame. */
.terminal-body .tui-mockup {
  border: none;
  box-shadow: none;
  margin: 0;
  background: transparent;
}

/* Faithful monospace render of an actual TUI frame. Box-drawing alignment must
   be preserved, so this never wraps; on narrow viewports it scrolls sideways.
   It deliberately does NOT use the brand --font-mono: that JetBrains Mono
   @font-face is a Latin-only subset (its unicode-range excludes U+2500 box-
   drawing, U+25xx block/geometric shapes like the blast meter, and the U+2190/
   U+2192 arrows), so those glyphs fall back to a system font whose advance width
   differs from the ASCII cells and the column grid shears. A single full-
   coverage monospace renders every cell at one width, keeping the borders
   square. */
.tui-screen {
  display: block;
  margin: 0;
  padding: var(--s-2) var(--s-3);
  font-family:
    "DejaVu Sans Mono", "Cascadia Mono", "Liberation Mono", ui-monospace, "Menlo", "Consolas",
    monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--surface-1);
  white-space: pre;
  overflow-x: auto;
  tab-size: 2;
}

/* Semantic encoding from the TUI, mirrored into the docs render. Spans never
   change a cell's width, so the box art stays aligned. */
.tui-screen .a {
  color: var(--allow);
}
.tui-screen .k {
  color: var(--ask);
}
.tui-screen .b {
  color: var(--block);
}
.tui-screen .c {
  color: var(--accent);
  font-weight: var(--weight-emphasis);
}
.tui-screen .dim {
  color: var(--text-3);
}
.tui-screen .danger {
  color: var(--block);
  font-weight: var(--weight-bold);
}
.tui-screen .ok {
  color: var(--allow);
  font-weight: var(--weight-emphasis);
}

/* Inline glyphs + risk chips for legend tables on the Review TUI page. */
.gly {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
}
.gly-allow {
  color: var(--allow);
}
.gly-ask {
  color: var(--ask);
}
.gly-block {
  color: var(--block);
}
.risk-chip {
  display: inline-block;
  padding: 1px var(--s-2);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--weight-emphasis);
  border: 1px solid;
}
.risk-safe {
  color: var(--allow);
  border-color: color-mix(in oklab, var(--allow) 45%, transparent);
  background: color-mix(in oklab, var(--allow) 12%, transparent);
}
.risk-caution {
  color: var(--ask);
  border-color: color-mix(in oklab, var(--ask) 45%, transparent);
  background: color-mix(in oklab, var(--ask) 12%, transparent);
}
.risk-danger {
  color: var(--block);
  border-color: color-mix(in oklab, var(--block) 50%, transparent);
  background: color-mix(in oklab, var(--block) 14%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .ix-row > *,
  .tab-panel.is-active {
    animation: none !important;
  }
  .ix-arrow,
  .tab,
  .release-summary-title,
  .release-summary-icon {
    transition: none !important;
  }
}
