/* openwop subpage stylesheet — layers prose + spec-doc rules on top of
 * the marketing /styles.css. Design tokens (--paper, --ink, --clay,
 * --serif, --sans, --mono, --rule, --paper-2, etc.) and the .topbar /
 * .wrap / .foot components come from /styles.css, which is loaded
 * before this file in the page template. Anything generic enough to
 * also belong on the marketing landing should live there, not here.
 */

/* ─── Subpage active-nav state ─────────────────────────────────────── */
/* The marketing topnav uses hash anchors that don't have an active
 * state. Subpages have first-class doc routes, so highlight the active
 * section with a clay underline — matches the link-hover color and
 * stays subtle on the paper background. */
.topnav a.active {
  color: var(--clay);
  border-bottom: 2px solid var(--clay);
  padding-bottom: 2px;
}

/* ─── Main column ───────────────────────────────────────────────────── */
.site-main {
  padding: clamp(32px, 5vw, 56px) 0 clamp(48px, 6vw, 80px);
}
/* The API explorer needs to start immediately below the topbar; the
 * default .site-main padding pushes Redoc down for no good reason. */
.site-main:has(.api-explorer) {
  padding: 0;
}
/* Subpage prose lives inside a max-width column so long-form text stays
 * readable even though the marketing .wrap goes to 1240px. */
.site-main .wrap > * {
  max-width: 920px;
  margin-inline: auto;
}
/* The .page-header lede + meta look best slightly wider than the prose
 * column when paired with hero-style index pages. */
.site-main .wrap > .page-header,
.site-main .wrap > .hero,
.site-main .wrap > .breadcrumbs {
  max-width: 1040px;
}
/* The Redoc explorer (/api/rest/) needs the FULL viewport width for
 * its two-column layout to breathe. Use a negative-margin trick to
 * escape the .wrap padding + .site-main max-width without touching
 * the template. The compact .api-explorer-head sits above the Scalar
 * container; both go full-bleed. */
.site-main .wrap > .api-explorer {
  max-width: none;
  margin-inline: calc(50% - 50vw);
  width: 100vw;
}
.api-explorer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 4vw, 40px);
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  flex-wrap: wrap;
}
.api-explorer-title { display: flex; align-items: baseline; gap: 14px; }
.api-explorer-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
}
.api-explorer-title h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}
.api-explorer-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.api-explorer-base {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.api-explorer-base:hover { border-color: var(--clay); }
.api-explorer-base-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.api-explorer-base code {
  font-family: var(--mono);
  font-size: 13px;
  background: none;
  padding: 0;
  border: 0;
}
.api-explorer-base-hint {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  transition: color .15s ease;
}
.api-explorer-base:hover .api-explorer-base-hint { color: var(--clay); }
/* Specificity escalated to win against `.site-main a { color: clay;
 * text-decoration: underline }` which would otherwise paint the button
 * label orange + underlined inside the dark pill. */
.site-main .api-explorer-download,
.api-explorer-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.site-main .api-explorer-download:hover,
.api-explorer-download:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--paper);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px var(--clay-soft);
}
.site-main .api-explorer-download:active,
.api-explorer-download:active {
  transform: translateY(0);
  box-shadow: none;
}
.site-main .api-explorer-download:focus-visible,
.api-explorer-download:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 3px;
}
#redoc-container {
  min-height: calc(100vh - 56px - 64px);
}

/* ─── Redoc UI overrides (right panel on cream surface) ───────────────
 *
 * Targeted fixes for elements that Redoc renders inside #redoc-container.
 * Class names are emotion-hashed and not stable across Redoc versions,
 * so we target by HTML tag + descendant selectors where possible. */

/* Global font reset for the explorer: everything is sans by default;
 * code-sample blocks opt back into mono via the more specific selectors
 * below. Heading-font (Instrument Serif) was leaking into form labels
 * like "Content type" via Redoc's heading-style classes — this kills
 * that, and we don't lose anything since "Response samples" / operation
 * titles stay serif via the `[class*="Heading"]` opt-in further down. */
#redoc-container,
#redoc-container * {
  font-family: var(--sans) !important;
  font-style: normal !important;
}
/* Code areas opt back into mono. */
#redoc-container pre,
#redoc-container pre *,
#redoc-container code,
#redoc-container .token,
#redoc-container [class*="code-sample"],
#redoc-container [class*="code-sample"] *,
#redoc-container [class*="JsonViewer"],
#redoc-container [class*="JsonViewer"] *,
#redoc-container [class*="SampleBlock"],
#redoc-container [class*="SampleBlock"] * {
  font-family: var(--mono) !important;
}
/* HTTP path stays mono (Redoc's MiddlePanel renders it). */
#redoc-container [class*="OperationEndpoint"] *,
#redoc-container [class*="Endpoint"] * {
  font-family: var(--mono) !important;
}
/* Real H1/H2/H3 headings stay serif so titles like "Response samples"
 * and the API root title still read editorially. */
#redoc-container h1,
#redoc-container h2,
#redoc-container h3,
#redoc-container [class*="ApiHeader"] h1,
#redoc-container [class*="ApiInfo"] h1 {
  font-family: var(--serif) !important;
}

/* Content-type label + value on one line.
 * Redoc renders "Content type" + "application/json" as two stacked
 * elements (label above, dropdown/value below). Flex-row the parent
 * via wildcard matching — covers DropdownSelector / ContentType /
 * MimeMap patterns Redoc has used across recent versions. */
#redoc-container [class*="DropdownSelector"],
#redoc-container [class*="ContentType"],
#redoc-container [class*="MimeMap"] {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  gap: 10px !important;
}
/* Label inside the now-inline container: tighten + uppercase mini-label
 * style so it visually attaches to the value rather than competing. */
#redoc-container [class*="DropdownSelector"] > label,
#redoc-container [class*="DropdownSelector"] [class*="Label"],
#redoc-container [class*="ContentType"] [class*="Label"],
#redoc-container [class*="MimeMap"] [class*="Label"] {
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
  color: var(--ink-3) !important;
  margin: 0 !important;
}

/* (1) GET / POST / PUT / DELETE / PATCH method pills — Redoc renders
 *     them with an inherited font; force mono so the verb labels match
 *     the path (which is already mono). */
#redoc-container [class*="HttpVerb"],
#redoc-container [class*="http-verb"],
#redoc-container [class*="OperationType"] {
  font-family: var(--mono) !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}

/* (2) "Content type" label + dropdown — Redoc styles it with the
 *     heading font (Instrument Serif via our typography.headings setting),
 *     which reads as a "title" instead of a "form label." Pull it back
 *     to sans + smaller size. */
#redoc-container label,
#redoc-container [class*="DropdownLabel"],
#redoc-container [class*="Dropdown__Label"],
#redoc-container .dropdown-label {
  font-family: var(--sans) !important;
  font-style: normal !important;
  font-weight: 500 !important;
  font-size: 11px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--ink-3) !important;
}
#redoc-container [class*="DropdownSelector"] select,
#redoc-container select {
  font-family: var(--sans) !important;
  font-size: 13px !important;
}

/* (3) The opening `{` chip — Redoc wraps the outermost JSON brace
 *     in a "JsonSampleWrap"/"collapser" element with its own background
 *     and font. Strip the background, make it inherit the mono font of
 *     the surrounding JSON. */
#redoc-container [class*="JsonViewer"] > div:first-child,
#redoc-container [class*="SampleBlock"] > div:first-child > span:first-child,
#redoc-container [class*="collapser"] {
  background: transparent !important;
  border: none !important;
  font-family: var(--mono) !important;
}

/* (4) Copy / Expand all / Collapse all controls — Redoc renders them
 *     as plain text. Add a button affordance: subtle border, padding,
 *     hover state. */
#redoc-container [class*="CopyButton"],
#redoc-container [class*="ExpandAll"],
#redoc-container [class*="CollapseAll"],
#redoc-container button[class*="copy"],
#redoc-container button[class*="expand"],
#redoc-container button[class*="collapse"] {
  font-family: var(--sans) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  padding: 5px 12px !important;
  border: 1px solid var(--rule) !important;
  border-radius: 4px !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
  cursor: pointer !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  margin-right: 4px !important;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
#redoc-container [class*="CopyButton"]:hover,
#redoc-container [class*="ExpandAll"]:hover,
#redoc-container [class*="CollapseAll"]:hover,
#redoc-container button[class*="copy"]:hover,
#redoc-container button[class*="expand"]:hover,
#redoc-container button[class*="collapse"]:hover {
  background: var(--clay-wash) !important;
  border-color: var(--clay) !important;
  color: var(--clay) !important;
}

/* ─── Redoc syntax-highlighter token colors (cream code-block) ────── */
#redoc-container .token.punctuation,
#redoc-container .token.operator,
#redoc-container .token.delimiter {
  color: rgba(26, 26, 23, 0.7) !important;
}
#redoc-container .token.property {
  color: var(--ink) !important;
}
#redoc-container .token.string {
  color: oklch(48% 0.14 145) !important;
}
#redoc-container .token.number,
#redoc-container .token.boolean,
#redoc-container .token.null {
  color: oklch(48% 0.14 240) !important;
}

/* ─── Payload / sample-tab labels (dark-bg pills) ─────────────────────
 *
 * Redoc renders the "Payload" tab + media-type switcher buttons + any
 * sample-section header as dark-background pills. Their text color is
 * tuned for Redoc's default white-text-on-slate; with our overrides
 * the text was ending up dark-on-dark. Force the visible text inside
 * any darker-than-page element to cream. */
#redoc-container [class*="Payload"],
#redoc-container [class*="payload"],
#redoc-container [class*="MediaTypesSwitcher"],
#redoc-container [class*="HeaderItem"],
#redoc-container [class*="OperationTag"],
#redoc-container [class*="SectionHeader"],
#redoc-container [class*="RequestSamples"] > [class*="Tab"],
#redoc-container [class*="ResponseSamples"] > [class*="Tab"],
#redoc-container [role="tab"][aria-selected="true"],
#redoc-container [class*="Tab"][class*="active"] {
  color: var(--paper) !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}

/* Non-active tabs / pills (still on dark surface, but inactive) */
#redoc-container [role="tab"]:not([aria-selected="true"]),
#redoc-container [class*="Tab"]:not([class*="active"]) {
  color: var(--ink) !important;
  background: var(--paper-2) !important;
  border: 1px solid var(--rule) !important;
}
@media (max-width: 760px) {
  .api-explorer-head { gap: 12px; }
  .api-explorer-meta { width: 100%; justify-content: flex-end; }
}

/* AsyncAPI + gRPC explorers: simple raw-source view. The `.api-raw`
 * block is the embedded YAML or .proto, rendered as a code block. Keep
 * it inside the .wrap (no full-bleed escape) — there is no two-column
 * Redoc layout here, so the standard reading width is correct. */
.site-main .wrap > .api-explorer:has(.api-raw) {
  max-width: 880px;
  margin-inline: auto;
  width: auto;
}
.api-explorer .api-raw {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 24px 0 0;
  overflow-x: auto;
  font-family: var(--mono, "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
  max-height: 70vh;
}
.api-explorer .api-raw code { font: inherit; color: inherit; background: transparent; padding: 0; }
.api-explorer p.lede { margin-top: 20px; }
.api-explorer p.meta { margin-top: 12px; font-size: 13px; color: var(--ink-3, #837f72); }
/* Spec/RFC pages render a sticky left-rail ToC inside .spec-page-grid;
 * give the grid more room than pure prose so sidebar + article both fit. */
.site-main .wrap > .spec-page-grid {
  max-width: none;
}

/* ─── Prose typography (markdown-rendered content) ─────────────────── */
.site-main h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  color: var(--ink);
}
.site-main h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 2.4em 0 0.5em;
  color: var(--ink);
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 88px;
}
.site-main h3 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 2em 0 0.5em;
  color: var(--ink);
  scroll-margin-top: 88px;
}
.site-main h4 {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin: 1.8em 0 0.4em;
}
.site-main h5, .site-main h6 {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.4em 0 0.3em;
  color: var(--ink-2);
}

.site-main p {
  margin: 0.85em 0;
  font-family: var(--sans);
  color: var(--ink);
}
.site-main p,
.site-main li {
  font-size: 16px;
  line-height: 1.65;
}
.site-main ul, .site-main ol {
  padding-left: 1.5em;
  margin: 0.85em 0;
}
.site-main li { margin: 0.3em 0; }

.site-main a {
  color: var(--clay);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 0.5px;
}
.site-main a:hover {
  text-decoration-thickness: 1.5px;
}

/* ─── Code + pre ────────────────────────────────────────────────────── */
.site-main code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink);
  /* Inline code chips carry long unbreakable identifiers (dotted
   * capability paths like `multiAgent.executionModel.replayDeterminism…`)
   * that otherwise overflow narrow viewports. Break them mid-token rather
   * than push the column wide. `pre code` is exempt below — fenced blocks
   * keep their own horizontal scroll. */
  overflow-wrap: anywhere;
}
.site-main pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.2em 0;
}
.site-main pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  /* Fenced blocks keep their own horizontal scroll (the parent `pre` is
   * `overflow-x: auto`); don't inherit the inline-chip break-anywhere. */
  overflow-wrap: normal;
}

/* ─── Blockquote (status banners + callouts) ────────────────────────── */
.site-main blockquote {
  border-left: 3px solid var(--clay-rule);
  background: var(--clay-wash);
  padding: 14px 18px;
  margin: 1.2em 0;
  color: var(--ink-2);
  border-radius: 0 4px 4px 0;
}
.site-main blockquote p { margin: 0.4em 0; }

/* ─── Tables (markdown GFM tables, interop matrix, RFC index) ───────── */
.site-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 14px;
  font-family: var(--sans);
}
.site-main th, .site-main td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.site-main thead th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  border-bottom: 1px solid var(--ink);
  background: transparent;
}
.site-main tbody tr:hover {
  background: var(--clay-wash);
}

.site-main hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.4em 0;
}

/* ─── Hero (index page) ─────────────────────────────────────────────── */
/* Spec corpus / changelog / etc. index pages reuse the marketing .hero
 * shell, but as a center-aligned text hero rather than the two-column
 * landing hero. */
.site-main .hero {
  text-align: center;
  padding: clamp(24px, 4vw, 56px) 0 clamp(16px, 3vw, 32px);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2em;
}
.site-main .hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 0 0 0.4em;
}
.site-main .hero .lede {
  font-family: var(--sans);
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  max-width: 64ch;
  margin: 0 auto 1em;
  text-wrap: balance;
  line-height: 1.55;
}
.site-main .hero .status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 1em auto;
  letter-spacing: 0.04em;
}
.site-main .hero .cta {
  margin: 1.6em 0 0;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.site-main .hero .cta-primary,
.site-main .hero .cta-secondary {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.02em;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.site-main .hero .cta-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.site-main .hero .cta-primary:hover {
  background: var(--clay);
  border-color: var(--clay);
  color: var(--paper);
}
.site-main .hero .cta-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-2);
}
.site-main .hero .cta-secondary:hover {
  border-color: var(--clay);
  color: var(--clay);
}

.site-main .hero-recent {
  max-width: 760px;
  margin: 1.8em auto 0;
  padding: 18px 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-2);
  text-align: left;
}
.site-main .hero-recent-h {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 8px;
}
.site-main .hero-recent ul {
  margin: 0;
  padding-left: 1.2em;
  font-size: 14px;
  line-height: 1.55;
}
.site-main .hero-recent li { margin: 6px 0; }

/* ─── Page header (sub-page intro) ──────────────────────────────────── */
.page-header {
  padding-bottom: 1.4em;
  margin-bottom: 2em;
  border-bottom: 1px solid var(--rule);
}
.page-header h1 { margin-top: 0; }
.page-header .lede {
  font-family: var(--sans);
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  margin: 0.4em 0;
  line-height: 1.55;
  max-width: 70ch;
}
.page-header .meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin: 0.6em 0;
  letter-spacing: 0.02em;
}

/* ─── Spec article + index helpers ──────────────────────────────────── */
.spec-doc {
  font-family: var(--sans);
  /* The article is a grid item inside .spec-page-grid; without an explicit
   * `min-width: 0` it refuses to shrink below its widest unbreakable child
   * (a long `pre` line), which is what pushed narrow viewports into
   * horizontal scroll. Lets the column contain overflow to scrollable
   * descendants instead of inflating the track. */
  min-width: 0;
}
.spec-doc:first-child > h1:first-child {
  margin-top: 0;
}

.spec-index td:first-child a {
  font-weight: 500;
}

/* ─── /spec/v1/ thematically grouped index ──────────────────────────── */
.spec-group {
  margin: 3em 0;
  padding-top: 1.5em;
  border-top: 1px solid var(--rule);
}
.spec-group h2 {
  font-size: clamp(22px, 2.5vw, 28px);
  margin: 0 0 0.4em;
  scroll-margin-top: 88px;
  border-bottom: none;
  padding-bottom: 0;
}
.spec-group-lede {
  color: var(--ink-2);
  margin: 0 0 1.2em;
  font-size: 0.95rem;
}
.spec-group-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.spec-group-list > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.spec-group-list > li:last-child {
  border-bottom: none;
}
.spec-group-list > li a {
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
}
.spec-group-list > li a strong {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  transition: border-color .15s ease, color .15s ease;
}
.spec-group-list > li a:hover strong {
  color: var(--clay);
  border-bottom-color: var(--clay);
}
.spec-item-status {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-left: 10px;
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  vertical-align: middle;
  text-transform: uppercase;
}
.spec-item-desc {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

/* Phase 3.1: Start-here reading-order card on /spec/v1/. Uses the same
 * .spec-group container so it inherits margin/typography, but a tighter
 * accent border + numbered ordered-list pattern make it visually
 * distinct from the thematic groups beneath it. */
.spec-group.start-here {
  border-left: 3px solid var(--clay);
  padding-left: 18px;
  background: color-mix(in srgb, var(--paper-2, #fafaf7) 60%, transparent);
  border-radius: 4px;
  padding-block: 14px 18px;
}
.start-here-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.start-here-list > li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
}
.start-here-step {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--clay);
  line-height: 1.4;
  padding-top: 2px;
  letter-spacing: 0.04em;
}
.start-here-body a {
  text-decoration: none;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}
.start-here-body a:hover strong { text-decoration: underline; }
.start-here-why {
  margin: 4px 0 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

/* Phase 3.1: per-doc "Edit this page on GitHub" footer. Lives at the
 * bottom of every spec/v1/ + RFC article column. Subtle so it doesn't
 * compete with the prose, but discoverable for contributors. */
.doc-edit {
  margin: 56px 0 0;
  padding-top: 18px;
  border-top: 1px dashed var(--rule, #e5e5e0);
  font-size: 13px;
}
.doc-edit a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px dotted var(--rule-2, #ccc);
  transition: color .15s ease, border-color .15s ease;
}
.doc-edit a:hover {
  color: var(--clay);
  border-bottom-color: var(--clay);
}
.doc-edit .arrow {
  font-size: 11px;
  color: inherit;
}

/* Phase 3.2: /rfcs/ index filter UI — status chips + search input that
 * client-side toggles row visibility via data-* attributes. No JS deps;
 * the inline <script> at the bottom of the index page wires it up. */
.rfc-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 24px 0 18px;
}
.rfc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rfc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper, #fff);
  border: 1px solid var(--rule, #e5e5e0);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.rfc-chip:hover {
  color: var(--ink);
  border-color: var(--rule-2, #ccc);
}
.rfc-chip.is-active {
  background: var(--ink, #1a1a1a);
  color: var(--paper, #fff);
  border-color: var(--ink, #1a1a1a);
}
.rfc-chip-count {
  font-family: var(--mono);
  font-size: 10.5px;
  opacity: 0.75;
}
.rfc-search-wrap {
  flex: 1 1 220px;
  min-width: 200px;
  max-width: 320px;
  margin-left: auto;
}
.rfc-search {
  width: 100%;
  padding: 8px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  background: var(--paper, #fff);
  border: 1px solid var(--rule, #e5e5e0);
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
}
.rfc-search:focus-visible {
  outline: 2px solid var(--clay);
  outline-offset: 2px;
}
.rfc-topic-tag {
  display: inline-block;
  padding: 1px 8px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: var(--paper-2, #f6f6f1);
  border: 1px solid var(--rule, #e5e5e0);
  border-radius: 3px;
  white-space: nowrap;
}
.rfc-empty {
  margin: 24px 0;
  padding: 24px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-3);
  background: var(--paper-2, #f6f6f1);
  border: 1px dashed var(--rule, #e5e5e0);
  border-radius: 4px;
  text-align: center;
}
table.rfc-index td:nth-child(2) {
  width: 1%;
  white-space: nowrap;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Phase 3.3: changelog per-version chunking. Each release is a card; the
 * latest-release callout sits above the version list as a sticky-ish
 * summary. The version-rail (sticky left ToC) is unchanged — handled by
 * the generic .spec-toc treatment. */
.changelog-page .changelog-latest {
  margin: 0 0 36px;
  padding: 18px 22px 22px;
  background: color-mix(in srgb, var(--clay) 6%, var(--paper-2, #fafaf7));
  border: 1px solid color-mix(in srgb, var(--clay) 35%, var(--rule, #e5e5e0));
  border-left: 3px solid var(--clay);
  border-radius: 4px;
}
.changelog-latest-tag {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clay);
  background: var(--paper, #fff);
  border: 1px solid var(--clay);
  border-radius: 3px;
}
.changelog-latest h2 {
  margin: 12px 0 4px;
  font-size: 26px;
}
.changelog-latest h2 a {
  color: var(--ink);
  text-decoration: none;
}
.changelog-latest h2 a:hover { color: var(--clay); }
.changelog-latest-date {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
}
.changelog-latest-headline {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-2);
  line-height: 1.5;
}

.changelog-version {
  margin: 0 0 48px;
  padding-top: 24px;
  border-top: 1px solid var(--rule, #e5e5e0);
}
.changelog-version:first-of-type { border-top: 0; padding-top: 0; }
.changelog-version-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
}
.changelog-version-head h2 {
  margin: 0;
  font-size: 22px;
}
.changelog-version-head h2 a {
  color: var(--ink);
  text-decoration: none;
}
.changelog-version-head h2 a:hover { color: var(--clay); }
.changelog-version-date {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  padding: 2px 8px;
  border: 1px solid var(--rule, #e5e5e0);
  border-radius: 3px;
}
.changelog-version-date.is-unreleased {
  color: var(--clay);
  border-color: var(--clay);
}
.changelog-version-headline {
  flex-basis: 100%;
  margin: 4px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-2);
  line-height: 1.5;
}
/* Release bodies have h3 subheadings; tighten their top spacing so
 * the rhythm inside a card matches the rest of the prose surface. */
.changelog-version-body h3:first-child { margin-top: 0; }

/* ─── Responsive tweaks ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .site-main {
    padding: 24px 0 48px;
  }
  .site-main h1 {
    font-size: 32px;
  }
  .site-main h2 {
    font-size: 24px;
  }
}

/* ─── Sticky left-rail ToC for spec docs + RFCs + markdown surfaces ── */
.spec-page-grid {
  display: grid;
  /* Left ToC rail: 288px (was 240px — bumped 20% wider per user request).
   * Wider rail lets longer "On this page" link text wrap less. */
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

/* When a .page-header sits ABOVE the spec-page-grid (every long-form
 * page now does this — buildSpecDocs, buildRfcs, buildContentDir, and
 * buildMarkdownDoc all emit it), the article's own H1 inside the grid
 * column duplicates the header's H1. Hide the inline H1 so the page
 * has a single canonical title at the top. The H1's `id` is preserved
 * for in-page anchor links (the ToC observer still finds it). */
.page-header + .spec-page-grid .spec-doc > h1:first-of-type {
  display: none;
}
.spec-toc {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 1rem;
  border-right: 1px solid var(--rule, #d9d4c5);
  font-size: 0.85rem;
  line-height: 1.5;
}
.spec-toc h4 {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3, #837f72);
  margin: 0 0 0.75rem;
  font-weight: 500;
}
.spec-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.spec-toc li { margin: 0; }
.spec-toc li.toc-sub { padding-left: 1rem; }
.spec-toc a {
  display: block;
  /* Active indicator sits on the RIGHT edge of each link so it points
   * toward the article on the right side of the page. */
  padding: 4px 8px 4px 0;
  margin-right: -10px;
  color: var(--ink-2, #4a4842);
  text-decoration: none;
  border-right: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.spec-toc a:hover { color: var(--clay, #b05a3b); }
.spec-toc a.is-active {
  color: var(--ink, #1a1a17);
  border-right-color: var(--clay, #b05a3b);
  font-weight: 500;
}
@media (max-width: 920px) {
  /* `minmax(0, 1fr)` — NOT a bare `1fr`. A `1fr` track has an implied
   * minimum of `auto`, which is the column's MIN-CONTENT width; the
   * article holds wide unbreakable strings (long `pre` code lines, dotted
   * capability paths) whose min-content runs ~1100px, so a `1fr` track
   * inflates to that and drags the whole page into horizontal scroll on
   * every viewport below this breakpoint. `minmax(0, …)` lets the track
   * shrink past its content and contains the overflow to the scrollable
   * `pre`/table instead. Pairs with `.spec-doc { min-width: 0 }`. */
  .spec-page-grid { grid-template-columns: minmax(0, 1fr); }
  /* Wide markdown tables (multi-column field references) have a min-content
   * floor of ~460px+; below this breakpoint give them their own horizontal
   * scroll instead of letting them widen the column — the same treatment
   * `.comparison-doc table` already gets. `display: block` is what makes
   * `overflow-x` take effect on a table box. */
  .spec-doc table { display: block; overflow-x: auto; max-width: 100%; }
  .spec-toc {
    position: static;
    max-height: none;
    border-right: none;
    border-top: 1px solid var(--rule, #d9d4c5);
    padding-right: 0;
    padding-top: 1.5rem;
    margin-top: 2rem;
    /* Source order is ToC first (for desktop left rail); push ToC
     * below the article on mobile so primary content reads first. */
    order: 2;
  }
}

/* Long-form pages (anything with the spec-page-grid ToC rail) get a wider
 * canvas on desktop. Widening EVERY .wrap on the page — topbar, main, and
 * footer share the .wrap container — keeps their left edges aligned (the
 * old `.site-main:has(...) { max-width: 1180px }` clamp had no auto
 * margins, so the whole content column pinned LEFT while the topbar
 * centered). Browsers without :has() fall back to the 1240px default,
 * still centered. */
body:has(.spec-page-grid) .wrap {
  max-width: 1400px;
}
/* The page-header above the grid shares the grid's full width so the
 * title's left edge lines up with the ToC rail below it. The breadcrumb
 * trail above the header follows the same width so all three left edges
 * align (crumbs › title › rail). */
.site-main:has(.spec-page-grid) .wrap > .page-header,
.site-main:has(.spec-page-grid) .wrap > .breadcrumbs {
  max-width: none;
}

/* ─── Protocol comparison page (/comparisons/a2a-openwop-mcp/) ────────
 * Bespoke "wire schematic" layout rendered by buildComparisonA2aMcp().
 * Three page-scoped protocol hues sit on the same OKLCH band as the app's
 * category tokens (DESIGN.md family): A2A → indigo 285, MCP → teal 200,
 * OpenWOP → clay. Dark mode lifts luminance like the app's functional
 * tokens (DESIGN.md §9.2 invariant 4); everything else rides the shared
 * paper/ink/rule tokens, so the page flips with the theme for free. */
.comparison-page {
  --cmp-a2a:      oklch(50% 0.11 285);
  --cmp-a2a-rule: oklch(50% 0.11 285 / 0.40);
  --cmp-a2a-wash: oklch(50% 0.11 285 / 0.07);
  --cmp-mcp:      oklch(50% 0.10 200);
  --cmp-mcp-rule: oklch(50% 0.10 200 / 0.40);
  --cmp-mcp-wash: oklch(50% 0.10 200 / 0.07);
  --cmp-owp:      var(--clay);
  --cmp-owp-rule: var(--clay-rule);
  --cmp-owp-wash: var(--clay-soft);
}
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .comparison-page {
    --cmp-a2a:      oklch(74% 0.11 285);
    --cmp-a2a-rule: oklch(74% 0.11 285 / 0.45);
    --cmp-a2a-wash: oklch(74% 0.11 285 / 0.10);
    --cmp-mcp:      oklch(74% 0.10 200);
    --cmp-mcp-rule: oklch(74% 0.10 200 / 0.45);
    --cmp-mcp-wash: oklch(74% 0.10 200 / 0.10);
  }
}
:root.theme-dark .comparison-page {
  --cmp-a2a:      oklch(74% 0.11 285);
  --cmp-a2a-rule: oklch(74% 0.11 285 / 0.45);
  --cmp-a2a-wash: oklch(74% 0.11 285 / 0.10);
  --cmp-mcp:      oklch(74% 0.10 200);
  --cmp-mcp-rule: oklch(74% 0.10 200 / 0.45);
  --cmp-mcp-wash: oklch(74% 0.10 200 / 0.10);
}

.site-main .wrap > .comparison-page {
  max-width: none;
}

/* Hero */
.cmp-hero {
  padding: clamp(8px, 2vw, 24px) 0 2.4em;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2em;
}
.cmp-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  margin: 0 0 0.9em;
}
.cmp-eyebrow span { color: var(--ink-3); text-transform: none; letter-spacing: 0.04em; }
.cmp-title {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.02;
  margin: 0 0 0.25em;
  font-weight: 400;
  letter-spacing: -0.01em;
}
.cmp-title em {
  font-style: italic;
  font-size: 0.45em;
  color: var(--ink-3);
  vertical-align: 0.22em;
  margin: 0 0.25em;
}
.cmp-name-a2a { color: var(--cmp-a2a); }
.cmp-name-mcp { color: var(--cmp-mcp); }
.cmp-name-owp { color: var(--cmp-owp); }
.cmp-hero .lede {
  font-family: var(--sans);
  font-size: clamp(17px, 1.6vw, 19px);
  color: var(--ink-2);
  line-height: 1.55;
  max-width: 70ch;
  margin: 0 0 2em;
}

/* Page-load reveal — one orchestrated stagger, CSS-only. */
@keyframes cmp-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.cmp-hero > *, .cmp-card { animation: cmp-rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.cmp-hero > :nth-child(2) { animation-delay: 60ms; }
.cmp-hero > :nth-child(3) { animation-delay: 120ms; }
.cmp-hero > :nth-child(4) { animation-delay: 180ms; }
.cmp-hero > :nth-child(5) { animation-delay: 320ms; }
.cmp-card { animation-delay: calc(180ms + var(--cmp-stagger, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  .cmp-hero > *, .cmp-card { animation: none; }
}

/* Identity cards */
.cmp-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 2em;
  max-width: 1100px;
}
.cmp-card {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--cmp-c, var(--rule));
  border-radius: 8px;
  background: var(--paper);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmp-card-a2a { --cmp-c: var(--cmp-a2a); --cmp-c-rule: var(--cmp-a2a-rule); --cmp-c-wash: var(--cmp-a2a-wash); }
.cmp-card-mcp { --cmp-c: var(--cmp-mcp); --cmp-c-rule: var(--cmp-mcp-rule); --cmp-c-wash: var(--cmp-mcp-wash); }
.cmp-card-owp { --cmp-c: var(--cmp-owp); --cmp-c-rule: var(--cmp-owp-rule); --cmp-c-wash: var(--cmp-owp-wash); }
.cmp-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.cmp-card-abbr {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--cmp-c);
}
.cmp-card-plane {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.cmp-card-full {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.15;
  margin: 0;
}
.cmp-card-role {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 0;
}
.cmp-card-facts {
  margin: 2px 0 0;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--rule);
  padding-top: 8px;
}
.cmp-card-facts > div { display: flex; gap: 8px; align-items: baseline; }
.cmp-card-facts dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  flex: 0 0 72px;
}
.cmp-card-facts dd {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
  margin: 0;
}
.cmp-card-model {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-2);
  margin: auto 0 0;
  padding-top: 6px;
}

/* Wire schematic */
.cmp-schematic { margin: 0; max-width: 1100px; }
.cmp-diagram {
  display: grid;
  grid-template-columns: 1fr minmax(120px, 200px) 1fr;
  align-items: stretch;
  padding: clamp(20px, 3.5vw, 40px);
  border: 1px solid var(--rule);
  border-radius: 8px;
  background-image:
    linear-gradient(color-mix(in oklab, var(--rule) 40%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in oklab, var(--rule) 40%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: center;
  background-color: var(--paper);
}
.cmp-node {
  position: relative;
  z-index: 1;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 3px 3px 0 0 var(--rule);
  padding: 14px 16px;
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.2;
}
.cmp-node-sub {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 4px;
}
.cmp-node-tool {
  border: 1px dashed var(--rule-2);
  border-radius: 6px;
  box-shadow: none;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--ink-2);
  padding: 12px 10px;
}
/* Horizontal A2A link */
.cmp-hlink {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-hlink::before {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 1.5px;
  background: var(--cmp-a2a);
}
.cmp-hlink i {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-block: 4px solid transparent;
}
.cmp-hlink i:first-of-type { left: -1px; border-right: 6px solid var(--cmp-a2a); }
.cmp-hlink i:last-of-type  { right: -1px; border-left: 6px solid var(--cmp-a2a); }
.cmp-hlink span,
.cmp-vlink span {
  position: relative;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: var(--paper);
  border: 1px solid var(--cmp-a2a-rule);
  color: var(--cmp-a2a);
  border-radius: 999px;
  padding: 3px 9px;
}
/* Vertical MCP links */
.cmp-vlink {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-vlink::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 50%;
  width: 1.5px;
  background: var(--cmp-mcp);
}
.cmp-vlink::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-inline: 4px solid transparent;
  border-top: 6px solid var(--cmp-mcp);
}
.cmp-vlink span {
  border-color: var(--cmp-mcp-rule);
  color: var(--cmp-mcp);
}
.cmp-vgap { min-height: 64px; }
/* OpenWOP substrate band — the tool nodes sit half-embedded in it. */
.cmp-substrate {
  grid-column: 1 / -1;
  position: relative;
  margin-top: -14px;
  border: 1px solid var(--cmp-owp-rule);
  border-radius: 6px;
  padding: 28px 20px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  justify-content: center;
  background:
    repeating-linear-gradient(-45deg, var(--cmp-owp-wash) 0 10px, transparent 10px 20px),
    var(--paper);
}
.cmp-substrate-name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--cmp-owp);
}
.cmp-substrate-desc {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.cmp-schematic figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 12px;
  max-width: 64ch;
  margin-inline: auto;
}

/* Protocol chips (table headers + decision-checklist answers) */
.cmp-chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  border: 1px solid;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.cmp-chip-a2a { color: var(--cmp-a2a); border-color: var(--cmp-a2a-rule); background: var(--cmp-a2a-wash); }
.cmp-chip-mcp { color: var(--cmp-mcp); border-color: var(--cmp-mcp-rule); background: var(--cmp-mcp-wash); }
.cmp-chip-owp { color: var(--cmp-owp); border-color: var(--cmp-owp-rule); background: var(--cmp-owp-wash); }
.cmp-answer .cmp-chip { margin: 1px 0; }
.cmp-plus {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  margin: 0 4px;
}

/* Article upgrades — numbered section heads + callout blockquotes. */
.comparison-doc { counter-reset: cmp-section; }
/* On phones, wide GFM tables scroll inside their own box instead of
 * stretching the page (the decision matrix is 4 chips wide at 390px).
 * Desktop keeps real table layout so columns share the full column width. */
@media (max-width: 760px) {
  .comparison-doc table { display: block; overflow-x: auto; }
}
.comparison-doc > h2 {
  counter-increment: cmp-section;
  border-top: 1px solid var(--rule);
  padding-top: 1.2em;
  margin-top: 2.2em;
}
.comparison-doc > h2::before {
  content: counter(cmp-section, decimal-leading-zero);
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.5em;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--clay);
  vertical-align: 0.5em;
  margin-right: 0.9em;
}
.comparison-doc blockquote {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--clay);
  border-radius: 0 8px 8px 0;
  background: var(--paper-2);
  padding: 14px 18px;
  margin: 1.6em 0;
}
.comparison-doc blockquote strong { color: var(--clay); }

@media (max-width: 760px) {
  .cmp-cards { grid-template-columns: 1fr; }
  .cmp-diagram {
    grid-template-columns: 1fr minmax(72px, 110px) 1fr;
    padding: 16px 12px;
  }
  .cmp-hlink span { font-size: 8.5px; padding: 2px 6px; }
  .cmp-node { font-size: 15px; padding: 10px 8px; }
  .cmp-node-tool { font-size: 9.5px; }
  .cmp-vlink, .cmp-vgap { height: 48px; min-height: 48px; }
}

/* ─── Flow / tree / legend graphics (A2A vs MCP vs OpenWOP page) ───────
 * The architecture, integration, pattern, and legend ASCII diagrams in
 * the markdown are upgraded in place to designed graphics. Everything
 * rides the three protocol hues via --cf: a flow sets it per-figure for
 * a single-protocol pipeline, or per-link for the composition diagram,
 * where the EDGES are the protocols and the nodes stay neutral. */
.cmp-flow { margin: 1.8em 0; max-width: 720px; }
.cmp-flow-node {
  position: relative;
  z-index: 1;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--cf, var(--rule-2));
  border-radius: 8px;
  background: var(--paper);
  padding: 14px 18px;
}
.cmp-flow-role {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.cmp-flow-name {
  display: block;
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.2;
  color: var(--cf, var(--ink));
}
.cmp-flow-sub {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-top: 5px;
}
.cmp-flow-parts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 1px;
  padding: 0;
}
.cmp-flow-parts li {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  padding: 3px 10px;
}
/* The connector between two nodes — a vertical spine, an arrowhead, and a
 * pill label, all tinted by the link's protocol (--cf). */
.cmp-flow-link {
  position: relative;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 0;
}
.cmp-flow-link::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 50%;
  width: 1.5px;
  background: var(--cf, var(--ink-3));
}
.cmp-flow-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-inline: 4px solid transparent;
  border-top: 6px solid var(--cf, var(--ink-3));
}
.cmp-flow-link span {
  position: relative;
  max-width: 90%;
  text-align: center;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--cf, var(--ink-2));
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--cf, var(--ink-3)) 40%, transparent);
  border-radius: 999px;
  padding: 3px 11px;
}
.cmp-flow-a2a { --cf: var(--cmp-a2a); }
.cmp-flow-mcp { --cf: var(--cmp-mcp); }
.cmp-flow-owp { --cf: var(--cmp-owp); }
.cmp-flow figcaption,
.cmp-tree figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 12px;
  max-width: 64ch;
  margin-inline: auto;
}

/* Nested call tree (pattern 3). Indentation IS the call stack; each row's
 * left rail + tag take the protocol hue of the hop. */
.cmp-tree {
  margin: 1.8em 0;
  max-width: 720px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--paper);
  padding: 14px 18px;
  display: grid;
  gap: 6px;
}
.cmp-tree-row {
  --cf: var(--ink-3);
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: calc(var(--depth, 0) * clamp(14px, 3vw, 28px));
  border-left: 2px solid var(--cf);
  border-radius: 0 6px 6px 0;
  background: color-mix(in oklab, var(--cf) 6%, var(--paper));
  padding: 7px 12px;
}
.cmp-tree-row::before {
  content: '→';
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  color: var(--cf);
}
.cmp-tree-row[data-d="0"]::before { content: ''; }
.cmp-tree-tag {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--cf);
  border: 1px solid color-mix(in oklab, var(--cf) 40%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.cmp-tree-label {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink);
}
.cmp-tree-a2a { --cf: var(--cmp-a2a); }
.cmp-tree-mcp { --cf: var(--cmp-mcp); }
.cmp-tree-owp { --cf: var(--cmp-owp); }

/* Boundary legend — the closing definitions, one striped band per hue. */
.cmp-legend { margin: 1.8em 0; max-width: 720px; display: grid; gap: 10px; }
.cmp-legend-row {
  --cf: var(--ink-3);
  display: flex;
  align-items: baseline;
  gap: 14px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--cf);
  border-radius: 0 8px 8px 0;
  background:
    repeating-linear-gradient(-45deg, color-mix(in oklab, var(--cf) 8%, transparent) 0 10px, transparent 10px 20px),
    var(--paper);
  padding: 12px 16px;
}
.cmp-legend-name {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--cf);
}
.cmp-legend-def {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-2);
}
.cmp-legend-a2a { --cf: var(--cmp-a2a); }
.cmp-legend-mcp { --cf: var(--cmp-mcp); }
.cmp-legend-owp { --cf: var(--cmp-owp); }

@media (max-width: 760px) {
  .cmp-tree-row { flex-wrap: wrap; gap: 6px 8px; }
  .cmp-tree-label { font-size: 14px; }
  .cmp-legend-row { flex-direction: column; gap: 4px; }
}

/* ─── OpenExO 3.0 positioning page (/comparisons/openexo-3-openwop/) ───
 * Shares the .comparison-page / .cmp-* system. Adds one page hue: gold
 * (hue 80, the --star-glow band) for the organizational THESIS, against
 * clay for the execution PROTOCOL — vision above, runtime below. */
.comparison-page {
  --cmp-exo:      oklch(56% 0.11 78);
  --cmp-exo-rule: oklch(56% 0.11 78 / 0.40);
  --cmp-exo-wash: oklch(56% 0.11 78 / 0.07);
}
@media (prefers-color-scheme: dark) {
  :root:not(.theme-light) .comparison-page {
    --cmp-exo:      oklch(80% 0.13 80);
    --cmp-exo-rule: oklch(80% 0.13 80 / 0.45);
    --cmp-exo-wash: oklch(80% 0.13 80 / 0.10);
  }
}
:root.theme-dark .comparison-page {
  --cmp-exo:      oklch(80% 0.13 80);
  --cmp-exo-rule: oklch(80% 0.13 80 / 0.45);
  --cmp-exo-wash: oklch(80% 0.13 80 / 0.10);
}
.cmp-name-exo { color: var(--cmp-exo); }
.oxo-title { font-size: clamp(34px, 4.6vw, 56px); max-width: 24ch; }
.oxo-title em {
  font-size: 0.55em;
  vertical-align: 0.12em;
}

/* Thesis → runtime bridge */
.oxo-bridge { max-width: 760px; }
.oxo-band {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 20px;
  background: var(--paper);
}
.oxo-band-exo {
  border-color: var(--cmp-exo-rule);
  background:
    repeating-linear-gradient(-45deg, var(--cmp-exo-wash) 0 10px, transparent 10px 20px),
    var(--paper);
}
.oxo-band-owp {
  border-color: var(--cmp-owp-rule);
  background:
    repeating-linear-gradient(-45deg, var(--cmp-owp-wash) 0 10px, transparent 10px 20px),
    var(--paper);
}
.oxo-band-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.oxo-band-name { font-family: var(--serif); font-size: 24px; }
.oxo-band-exo .oxo-band-name { color: var(--cmp-exo); }
.oxo-band-owp .oxo-band-name { color: var(--cmp-owp); }
.oxo-band-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.oxo-band-terms {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  margin: 6px 0 0;
}
.oxo-bridge-link {
  position: relative;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oxo-bridge-link i {
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1.5px;
  background: linear-gradient(var(--cmp-exo), var(--cmp-owp));
}
.oxo-bridge-link i:first-of-type { left: 22%; }
.oxo-bridge-link i:last-of-type { right: 22%; }
.oxo-bridge-link i::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  border-inline: 4px solid transparent;
  border-top: 6px solid var(--cmp-owp);
}
.oxo-bridge-link span {
  position: relative;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-2);
  background: var(--paper);
  padding: 2px 14px;
}

/* Intelligence Stack ladder (replaces the ASCII diagram in the article) */
.oxo-ladder {
  margin: 1.8em 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 0;
  background: var(--paper);
  position: relative;
}
.oxo-ladder::before {
  content: '';
  position: absolute;
  top: 16px;
  bottom: 16px;
  /* 20px rung padding + 200px label column + half the 14px gap — keeps
   * the spine in the gutter between labels and descriptions at any
   * article width (percentage clamps diverged when the column widened). */
  left: 227px;
  width: 1.5px;
  background: linear-gradient(var(--cmp-exo), var(--cmp-owp));
}
.oxo-rung {
  position: relative;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 9px 20px;
}
.oxo-rung-layer {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cmp-exo);
  text-align: right;
}
.oxo-rung-layer em {
  display: block;
  font-style: normal;
  font-weight: 500;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--cmp-owp);
  margin-top: 2px;
}
.oxo-rung-what {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.45;
}
.oxo-rung-core {
  background: var(--cmp-owp-wash);
  border-block: 1px solid var(--cmp-owp-rule);
}
.oxo-rung-core .oxo-rung-layer { color: var(--cmp-owp); }
.oxo-rung-core .oxo-rung-what { color: var(--ink); }

@media (max-width: 760px) {
  .oxo-rung { grid-template-columns: 1fr; gap: 2px; }
  .oxo-rung-layer { text-align: left; }
  .oxo-ladder::before { display: none; }
  .oxo-title { font-size: clamp(30px, 8vw, 40px); }
}

/* Footnote refs on the OpenExO page — superscript markers, not inline
 * links jammed against the sentence. The target <li>s get scroll margin
 * so the sticky topbar doesn't cover them on jump. */
.oxo-fn {
  font-size: 0.62em;
  line-height: 0;
  vertical-align: super;
}
.oxo-fn a {
  font-family: var(--mono);
  color: var(--clay);
  text-decoration: none;
  padding-left: 1px;
}
.oxo-fn a:hover { text-decoration: underline; }
.comparison-doc li[id^="fn-"] { scroll-margin-top: 90px; }

/* Edge Twin pipeline (replaces the ASCII flow on the OpenExO page).
 * Three bands tell the story in the page's hue grammar: the enterprise
 * estate (neutral ink/rule), the OpenWOP-powered Edge Twin (clay), and
 * the AI-native operating unit (gold — the thesis realized). */
.oxo-flow { margin: 1.8em 0; max-width: 860px; }
.oxo-flow-node {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 18px;
  background: var(--paper);
}
.oxo-flow-name {
  display: block;
  font-family: var(--serif);
  font-size: 19px;
}
.oxo-flow-terms {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-top: 5px;
}
.oxo-flow-mothership { border-color: var(--rule-2); }
.oxo-flow-twin {
  border-color: var(--cmp-owp-rule);
  background:
    repeating-linear-gradient(-45deg, var(--cmp-owp-wash) 0 10px, transparent 10px 20px),
    var(--paper);
}
.oxo-flow-twin .oxo-flow-name { color: var(--cmp-owp); }
.oxo-flow-parts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 2px;
  padding: 0;
}
.oxo-flow-parts li {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  padding: 3px 10px;
}
.oxo-flow-unit {
  border-color: var(--cmp-exo-rule);
  background:
    repeating-linear-gradient(-45deg, var(--cmp-exo-wash) 0 10px, transparent 10px 20px),
    var(--paper);
}
.oxo-flow-unit .oxo-flow-name { color: var(--cmp-exo); }
.oxo-flow-link {
  position: relative;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0;
}
.oxo-flow-link::before {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  left: 50%;
  width: 1.5px;
  background: var(--cmp-owp);
}
.oxo-flow-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  border-inline: 4px solid transparent;
  border-top: 6px solid var(--cmp-owp);
}
.oxo-flow-link-main,
.oxo-flow-link-sub {
  position: relative;
  font-family: var(--mono);
  background: var(--paper);
  padding: 2px 10px;
}
.oxo-flow-link-main {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--cmp-owp);
  border: 1px solid var(--cmp-owp-rule);
  border-radius: 999px;
  padding: 3px 11px;
}
.oxo-flow-link-sub {
  font-size: 10px;
  color: var(--ink-3);
}
.oxo-flow figcaption,
.oxo-nest figcaption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 12px;
  max-width: 64ch;
  margin-inline: auto;
}

/* Composition nest (replaces the ASCII tree). Containment IS the message,
 * so the boxes nest: ExO 3.0 org ⊃ Intelligence Stack ⊃ OpenWOP ⊃
 * (MCP | A2A), with GOVERN / ASSURE alongside as the watchful overlay. */
.oxo-nest { margin: 1.8em 0; max-width: 860px; }
.oxo-nest-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.oxo-nest-label-exo { color: var(--cmp-exo); }
.oxo-nest-label-owp { color: var(--cmp-owp); }
.oxo-nest-label-mcp { color: var(--cmp-mcp); }
.oxo-nest-label-a2a { color: var(--cmp-a2a); }
.oxo-nest-desc {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: var(--ink-2);
}
.oxo-nest-org {
  border: 1px solid var(--cmp-exo-rule);
  border-radius: 10px;
  padding: 14px 16px 16px;
  background: var(--paper);
  display: grid;
  gap: 10px;
}
.oxo-nest-stack {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px 14px;
  background: var(--paper-2);
  display: grid;
  gap: 10px;
}
.oxo-nest-owp {
  border: 1px solid var(--cmp-owp-rule);
  border-radius: 8px;
  padding: 12px 14px 14px;
  background:
    repeating-linear-gradient(-45deg, var(--cmp-owp-wash) 0 10px, transparent 10px 20px),
    var(--paper);
  display: grid;
  gap: 10px;
}
.oxo-nest-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.oxo-nest-children {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.oxo-nest-child {
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--paper);
  display: grid;
  gap: 4px;
}
.oxo-nest-mcp { border: 1px solid var(--cmp-mcp-rule); }
.oxo-nest-a2a { border: 1px solid var(--cmp-a2a-rule); }
.oxo-nest-govern {
  border: 1px dashed var(--cmp-exo-rule);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--paper);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .oxo-nest-children { grid-template-columns: 1fr; }
  .oxo-flow-link-sub { text-align: center; }
}

/* ─── Breadcrumbs ───────────────────────────────────────────────────── */
.breadcrumbs {
  max-width: 1040px;
  margin-inline: auto;
  margin-bottom: 22px;
}
.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.breadcrumbs li + li::before {
  content: "›";
  margin-inline-end: 4px;
  color: var(--rule-2);
}
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--clay); }
.breadcrumbs [aria-current="page"] { color: var(--ink-2); }

/* ─── "See also" related-docs card ──────────────────────────────────── */
.see-also {
  margin-top: 48px;
  padding: 20px 24px;
  border: 1px solid var(--rule);
  border-left: 2px solid var(--clay-rule);
  border-radius: 6px;
  background: var(--paper-2);
}
.see-also h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin: 0 0 12px;
}
.see-also ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.see-also li { display: grid; gap: 2px; }
.see-also a { font-weight: 500; }
.see-also-desc {
  font-size: 13.5px;
  color: var(--ink-3);
}

/* ─── Topbar search button + overlay ─────────────────────────────────
 * Rules live in the marketing /styles.css (shared chrome — the homepage
 * topnav carries the same search trigger). Both surfaces load that
 * sheet before this one. */

/* ─── Heading anchor links (injected by spec-toc.js) ────────────────── */
.heading-anchor {
  margin-inline-start: 0.35em;
  color: var(--rule-2);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible { opacity: 1; }
.heading-anchor:hover { color: var(--clay); }
.heading-anchor.is-copied::after {
  content: " copied";
  font-family: var(--mono);
  font-size: 11px;
  color: var(--clay);
}

/* ─── Back-to-top (injected by spec-toc.js) ─────────────────────────── */
.back-to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 9px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px color-mix(in oklab, var(--ink) 12%, transparent);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover { border-color: var(--clay-rule); color: var(--ink); }

@media (max-width: 760px) {
  .back-to-top span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .back-to-top, .heading-anchor { transition: none; }
}
