/* NANDA Index, minimal monochrome theme.
   A quiet, specification-style sheet: white ground, ink text, two greys, thin
   rules, no colour. Self-contained (does not load styles.css) and styles every
   class that explore.js emits, so the catalog works decolored, unchanged. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --faint: #8d8d8d;
  --rule: rgba(17, 17, 17, .14);
  --rule-soft: rgba(17, 17, 17, .08);
  --wash: #f7f7f6;
  --sans: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad-x: clamp(20px, 5vw, 56px);
  --maxw: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
code, pre { font-family: var(--mono); }
::selection { background: var(--ink); color: #fff; }

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--pad-x);
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
  gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand-link { text-decoration: none; font-size: 17px; letter-spacing: .01em; }
.brand-link strong { font-weight: 700; }
.brand .tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.navlinks { display: flex; gap: 22px; font-size: 13.5px; align-items: center; flex-wrap: wrap; }
.navlinks a { text-decoration: none; color: var(--muted); }
.navlinks a:hover { color: var(--ink); }
.navlinks a.active { color: var(--ink); }

main { flex: 1; padding: 0 var(--pad-x) 96px; max-width: var(--maxw); margin: 0 auto; width: 100%; }

/* ---------- hero (landing) ---------- */
.hero { padding: 72px 0 40px; max-width: 60ch; }
.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 20px;
}
.hero h1 {
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 22px;
  font-weight: 600;
}
.hero .lede { font-size: 17px; color: #333; }
.hero .lede strong { font-weight: 600; }
code.tok { background: var(--wash); padding: 1px 6px; border-radius: 3px; font-size: .88em; border: 1px solid var(--rule-soft); }

.hero-cta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; align-items: center; }

/* text-first links; one outlined button max */
.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--wash); border-color: var(--ink); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #2a2a2a; }
.btn .arr { font-family: var(--mono); }
.textlink { font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.textlink .arr { font-family: var(--mono); text-decoration: none; display: inline-block; margin-left: 4px; }

/* ---------- generic section ---------- */
.section { padding: 40px 0; border-top: 1px solid var(--rule-soft); scroll-margin-top: 80px; }
.section > .sec-label { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin: 0 0 16px; }
.section h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; font-weight: 600; margin: 0 0 16px; }
.section .lead { font-size: 16px; color: #333; max-width: 70ch; margin: 0 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-head h2 { margin: 0; }

/* definition rows: "what it is" / layers / "what it is not" */
.defs { border-top: 1px solid var(--rule); margin-top: 8px; }
.def { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.def .dt { font-size: 13px; font-family: var(--mono); letter-spacing: .02em; color: var(--faint); text-transform: uppercase; }
.def h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.def p { margin: 0; font-size: 14.5px; color: #333; line-height: 1.6; }
.def p code { font-family: var(--mono); font-size: 12.5px; background: var(--wash); padding: 1px 5px; border-radius: 3px; }
@media (max-width: 640px) { .def { grid-template-columns: 1fr; gap: 6px; } }

/* prior work / link rows */
.linkrows { border-top: 1px solid var(--rule); }
.linkrow {
  display: grid;
  grid-template-columns: 150px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
}
.linkrow:hover { background: var(--wash); }
.linkrow .lr-kind { font-family: var(--mono); font-size: 11px; letter-spacing: .03em; color: var(--faint); text-transform: uppercase; }
.linkrow .lr-main h3 { margin: 0 0 3px; font-size: 15.5px; font-weight: 600; }
.linkrow .lr-main p { margin: 0; font-size: 13.5px; color: var(--muted); }
.linkrow .lr-arrow { font-family: var(--mono); font-size: 15px; color: var(--faint); }
.linkrow:hover .lr-arrow { color: var(--ink); }
@media (max-width: 720px) {
  .linkrow { grid-template-columns: 1fr auto; }
  .linkrow .lr-kind { grid-column: 1 / -1; }
}

/* code block (kept ink-on-wash, no syntax colour) */
.codeblock {
  background: var(--wash);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  padding: 16px 18px;
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  overflow-x: auto;
  margin: 18px 0 0;
}
.codeblock .c-head { color: var(--faint); margin-bottom: 8px; display: block; }
.codeblock .k, .codeblock .s, .codeblock .n, .codeblock .d, .codeblock .p { color: inherit; }
.codeblock .d, .codeblock .c-head { color: var(--faint); }

/* ---------- browse preview (landing) ---------- */
.browse-sec { padding: 40px 0; border-top: 1px solid var(--rule-soft); }
.browse-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.browse-head h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; margin: 0; font-weight: 600; }
.browse-head .browse-all { font-size: 13.5px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.browse-sec .browse-intro { font-size: 14.5px; color: var(--muted); max-width: 64ch; margin: 0 0 22px; }
.card-preview { text-decoration: none; color: inherit; }

/* ---------- footer ---------- */
.bottom {
  padding: 30px var(--pad-x);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}
.bottom a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.bottom .fl { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- shared multi-column footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 44px var(--pad-x) 30px; margin-top: 24px; }
.foot-cols { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.foot-col .foot-h { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px; }
.foot-col a { display: block; text-decoration: none; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.foot-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.foot-base { max-width: var(--maxw); margin: 30px auto 0; padding-top: 18px; border-top: 1px solid var(--rule-soft); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.foot-base a { color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
@media (max-width: 640px) { .foot-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- FAQ accordion ---------- */
.faq-group { margin: 0 0 30px; }
.faq-group .faq-gh { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 0 0 8px; }
details.faq { border-bottom: 1px solid var(--rule); }
details.faq summary { list-style: none; cursor: pointer; padding: 15px 0; display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; font-size: 15px; font-weight: 600; color: var(--ink); }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary .q-sign { font-family: var(--mono); color: var(--faint); flex: none; transition: transform .15s; }
details.faq[open] summary .q-sign { transform: rotate(45deg); color: var(--ink); }
details.faq .faq-a { padding: 0 0 18px; max-width: 74ch; }
details.faq .faq-a p { font-size: 14px; line-height: 1.7; color: #2b2b2b; margin: 0 0 10px; }
details.faq .faq-a p:last-child { margin: 0; }
details.faq .faq-a code { font-family: var(--mono); font-size: 12.5px; background: var(--wash); padding: 1px 5px; border-radius: 3px; }

/* ---------- glossary ---------- */
.gloss { border-top: 1px solid var(--rule); }
.gloss-row { display: grid; grid-template-columns: 210px 1fr; gap: 24px; padding: 15px 0; border-bottom: 1px solid var(--rule-soft); }
.gloss-term { font-family: var(--mono); font-size: 13px; color: var(--ink); font-weight: 500; line-height: 1.5; }
.gloss-def { font-size: 14px; color: #2b2b2b; line-height: 1.6; }
.gloss-def code { font-family: var(--mono); font-size: 12px; background: var(--wash); padding: 1px 4px; border-radius: 3px; }
@media (max-width: 640px) { .gloss-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- contact ---------- */
.contact-rows { border-top: 1px solid var(--rule); }
.contact-row { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 18px 0; border-bottom: 1px solid var(--rule-soft); }
.contact-row .c-k { font-size: 12px; font-family: var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.contact-row .c-v { font-size: 14.5px; color: #2b2b2b; line-height: 1.6; }
.contact-row .c-v a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
@media (max-width: 640px) { .contact-row { grid-template-columns: 1fr; gap: 4px; } }

@media (max-width: 600px) { .navlinks { display: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ============================================================
   DOCUMENT LAYOUT (index.html), two-column spec, like the
   reference: sticky section index on the left, prose on the right.
   ============================================================ */
.doc-wrap { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 0 var(--pad-x) 96px; }

.doc-hero { padding: 56px 0 28px; border-bottom: 1px solid var(--rule); }
.doc-hero .eyebrow { margin-bottom: 16px; }
.doc-hero h1 { font-size: clamp(28px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 10px; font-weight: 600; }
.doc-hero .subtitle { font-size: 17px; color: var(--muted); margin: 0 0 22px; }
.doc-hero .abstract { font-size: 15px; color: #333; line-height: 1.65; }
.doc-hero .abstract .al { font-weight: 600; color: var(--ink); }

.doc-layout { display: grid; grid-template-columns: 232px 1fr; gap: 56px; align-items: start; padding-top: 8px; }

.docnav { position: sticky; top: 90px; align-self: start; }
.docnav .docnav-title { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 26px 0 12px; }
.docnav ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.docnav li { margin: 0; }
.docnav a { display: block; text-decoration: none; color: var(--muted); font-size: 13.5px; line-height: 1.4; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; }
.docnav a:hover { color: var(--ink); border-left-color: var(--rule); }
.docnav a.current { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

.doc { min-width: 0; max-width: 74ch; }
.doc section { padding: 36px 0; border-bottom: 1px solid var(--rule-soft); scroll-margin-top: 84px; }
.doc section:last-child { border-bottom: 0; }
.doc h2 { font-size: clamp(20px, 2.6vw, 26px); letter-spacing: -.02em; font-weight: 600; margin: 0 0 18px; }
.doc h2 .secno { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: 12px; font-weight: 600; }
.doc h3 { font-size: 16px; font-weight: 600; margin: 26px 0 8px; letter-spacing: -.01em; }
.doc p { font-size: 15px; line-height: 1.7; color: #2b2b2b; margin: 0 0 14px; max-width: 72ch; }
.doc p:last-child { margin-bottom: 0; }
.doc strong { font-weight: 600; color: var(--ink); }
.doc a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; word-break: break-word; }
.doc code { font-family: var(--mono); font-size: 12.5px; background: var(--wash); padding: 1px 5px; border-radius: 3px; }
.doc ul { margin: 0 0 14px; padding-left: 1.2em; }
.doc ul li { font-size: 15px; line-height: 1.65; color: #2b2b2b; margin-bottom: 6px; }
.doc .note { border-left: 2px solid var(--ink); padding: 4px 0 4px 16px; margin: 18px 0; color: #2b2b2b; }
.doc .figcap { font-size: 13px; color: var(--faint); font-style: italic; margin: 8px 0 0; }
.doc .placeholder { border: 1px dashed var(--rule); border-radius: 6px; padding: 16px 18px; color: var(--muted); font-size: 13.5px; margin: 18px 0; }

/* resolution hop list (How section) */
.hop-list { list-style: none; margin: 18px 0; padding: 0; border-top: 1px solid var(--rule-soft); }
.hop-list li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.hop-list .hl-n { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--rule); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--ink); }
.hop-list li > div { min-width: 0; }
.hop-list strong { display: block; font-size: 14.5px; font-weight: 600; color: var(--ink); }
.hop-list .hl-api { font-family: var(--mono); font-size: 11.5px; color: var(--muted); display: inline-block; margin: 4px 0; background: var(--wash); border: 1px solid var(--rule-soft); padding: 1px 7px; border-radius: 4px; }
.hop-list p { margin: 2px 0 0; font-size: 13.5px; color: #444; line-height: 1.55; }

/* interactive Try Resolve trace */
.rsv-controls { display: flex; gap: 12px; margin: 18px 0 4px; flex-wrap: wrap; align-items: center; }
.rsv-select { font: inherit; font-size: 13px; border: 1px solid var(--rule); border-radius: 6px; padding: 9px 11px; background: #fff; color: var(--ink); min-width: 300px; max-width: 100%; cursor: pointer; }
.rsv-select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }
.rsv-trace { list-style: none; margin: 22px 0 0; padding: 0; }
.rsv-row { display: flex; gap: 14px; align-items: flex-start; }
.rsv-rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.rsv-n { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--rule); display: inline-flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--faint); transition: all .3s; }
.rsv-line { width: 2px; flex: 1; min-height: 20px; margin: 3px 0; background: var(--rule); transition: background .3s; }
.rsv-body { padding-bottom: 16px; min-width: 0; }
.rsv-title { font-size: 14px; font-weight: 600; color: var(--faint); transition: color .3s; }
.rsv-io { font-family: var(--mono); font-size: 11px; color: #aaa; margin-top: 3px; word-break: break-all; transition: color .3s; }
.rsv-row.lit .rsv-n { background: var(--ink); color: #fff; border-color: var(--ink); }
.rsv-row.lit .rsv-title { color: var(--ink); }
.rsv-row.lit .rsv-io { color: var(--muted); }
.rsv-row.lit .rsv-line { background: var(--ink); }

.doc .example { margin: 22px 0; }
.doc .example .ex-head { font-family: var(--mono); font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.doc .resolution { font-family: var(--mono); font-size: 12.5px; color: #2b2b2b; background: var(--wash); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 12px 14px; margin: 14px 0 0; line-height: 1.6; }
.doc .resolution .rl { color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; }

/* spec table */
.spec-table { width: 100%; border-collapse: collapse; margin: 6px 0 8px; font-size: 13.5px; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: 11px 14px 11px 0; border-bottom: 1px solid var(--rule); line-height: 1.5; }
.spec-table thead th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); font-weight: 600; border-bottom: 1px solid var(--rule); }
.spec-table tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; padding-right: 22px; }
.spec-table td { color: var(--muted); }
.doc .table-scroll { overflow-x: auto; margin: 12px 0 4px; }

.doc .refs { list-style: none; margin: 0; padding: 0; counter-reset: ref; }
.doc .refs li { counter-increment: ref; position: relative; padding: 10px 0 10px 34px; border-bottom: 1px solid var(--rule-soft); font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.doc .refs li::before { content: "[" counter(ref) "]"; position: absolute; left: 0; top: 10px; font-family: var(--mono); font-size: 12px; color: var(--faint); }
.doc .refs a { color: var(--ink); }

@media (max-width: 820px) {
  .doc-layout { grid-template-columns: 1fr; gap: 0; }
  .docnav { display: none; }
  .doc { max-width: none; }
}

/* ============================================================
   EXPLORE CATALOG (explore.html), monochrome
   ============================================================ */
main.explore { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 0 var(--pad-x) 96px; }
.explore-head { padding: 56px 0 26px; }
.explore-head .eyebrow { margin-bottom: 12px; }
.explore-head h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -.02em; margin: 0 0 12px; font-weight: 600; }
.explore-head .lede { font-size: 15.5px; color: var(--muted); max-width: 62ch; line-height: 1.6; }

.explore-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.explore-search { position: relative; display: flex; align-items: center; gap: 9px; flex: 1; min-width: 240px; max-width: 460px; border: 1px solid var(--rule); border-radius: 6px; padding: 9px 13px; background: #fff; }
.explore-search:focus-within { border-color: var(--ink); }
.explore-search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.explore-search input { border: 0; outline: 0; width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: transparent; }
.explore-sort { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.explore-sort select { font: inherit; font-size: 13px; color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 8px 10px; background: #fff; cursor: pointer; }
.explore-sort select:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

/* layout: left filter rail + results */
.explore-body { display: flex; align-items: flex-start; gap: 32px; }
.cat-menu { flex: none; width: 216px; position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1px; }
.cat-title { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 12px 2px; }
.cat-check { display: flex; align-items: flex-start; gap: 9px; padding: 8px 6px; cursor: pointer; border-radius: 5px; }
.cat-check:hover { background: var(--wash); }
.cat-check input { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; margin: 2px 0 0; flex: none; }
.cc-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.cc-label { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.cc-sub { font-family: var(--mono); font-size: 10px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-count { font-family: var(--mono); font-size: 11px; color: var(--faint); flex: none; margin-top: 1px; }
.cat-clear { margin: 14px 0 0 6px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.cat-results { flex: 1; min-width: 0; }

/* ---------- card grid (outline cards, decolored v0.1) ---------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: border-color .15s ease, background .15s ease;
  cursor: pointer;
  text-align: left;
}
.card:hover { border-color: var(--ink); }
.card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card .title-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.card .title-line h3 { font-size: 15.5px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verified-mark { flex: none; width: 15px; height: 15px; color: var(--muted); }
.card .identifier { font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -2px; }
.card .desc { font-size: 13.5px; line-height: 1.55; color: #333; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* chips, meta, all greyscale */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 4px; background: var(--wash); color: var(--muted); border: 1px solid var(--rule-soft); }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.meta .dot { color: var(--rule); }
.vbadge { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; font-size: 11px; color: var(--muted); }
.vbadge.ok { color: var(--ink); }
.vbadge.pending { color: var(--faint); }
.proto { font-family: var(--mono); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink); border: 1px solid var(--rule); padding: 1px 6px; border-radius: 4px; }
.divider { height: 1px; background: var(--rule-soft); margin: 2px 0; }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.actions .view { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; padding: 0; }
.iconbtn-row { display: flex; gap: 4px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border: 1px solid var(--rule-soft); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; transition: .15s; }
.iconbtn:hover { border-color: var(--ink); color: var(--ink); }
.iconbtn.copied { border-color: var(--ink); color: var(--ink); }
.iconbtn svg { width: 15px; height: 15px; }

/* category tag (outlined, was a coloured pill) */
.cat-pill { flex: none; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--rule); color: var(--muted); background: #fff; }
.cat-pill[data-cat] { background: #fff; color: var(--muted); }

/* pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; }
.pager button { min-width: 34px; height: 34px; padding: 0 10px; font: inherit; font-size: 13px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; transition: .15s; }
.pager button:hover:not(:disabled) { border-color: var(--ink); }
.pager button[disabled] { opacity: .4; cursor: not-allowed; }
.pager button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .ell { color: var(--faint); padding: 0 2px; }
.cat-empty { color: var(--muted); font-size: 14px; padding: 48px 0; text-align: center; }

@media (max-width: 980px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .explore-body { flex-direction: column; }
  .cat-menu { position: static; width: 100%; }
  .cat-title { width: 100%; margin: 0 0 6px; }
  .cat-clear { margin: 12px 0 0 6px; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Slide-out detail panel + vertical resolution trace, monochrome
   ============================================================ */
@keyframes panelIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes scrimIn { from { opacity: 0; } to { opacity: 1; } }

.panel-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(17, 17, 17, .38); animation: scrimIn .2s ease; }
.slide-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(520px, 96vw); background: #fff; box-shadow: -24px 0 60px rgba(0, 0, 0, .14); border-left: 1px solid var(--rule); overflow-y: auto; animation: panelIn .3s cubic-bezier(.2, .8, .2, 1); }

.sp-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--rule-soft); background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px); }
.sp-head .sp-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.sp-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.sp-title h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.sp-idn { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.sp-close { flex: none; width: 34px; height: 34px; border: 1px solid var(--rule-soft); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.sp-close:hover { border-color: var(--ink); color: var(--ink); }
.sp-close svg { width: 16px; height: 16px; }

.sp-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 24px; }
.sp-domain { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.sp-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--ink); }
.sp-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin: 0 0 10px; }
.sp-vrow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sp-agents { display: flex; flex-direction: column; gap: 7px; }
.sp-agent { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: #fff; border: 1px solid var(--rule); border-radius: 6px; }
.sp-agent .an { font-family: var(--mono); font-size: 13px; }
.sp-agent .al { font-family: var(--mono); font-size: 11px; color: var(--faint); white-space: nowrap; }
.sp-caps { display: flex; flex-wrap: wrap; gap: 7px; }
.sp-cap { font-family: var(--mono); font-size: 11.5px; color: var(--muted); background: #fff; border: 1px solid var(--rule); padding: 5px 10px; border-radius: 999px; }
dl.sp-meta { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13px; }
dl.sp-meta dt { color: var(--muted); font-weight: 600; }
dl.sp-meta dd { margin: 0; word-break: break-word; }
dl.sp-meta .mono { font-family: var(--mono); font-size: 12px; }
dl.sp-meta a { color: var(--ink); text-decoration: underline; }

.sp-exports { display: flex; gap: 8px; flex-wrap: wrap; }
.ebtn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--rule); background: #fff; color: var(--ink); cursor: pointer; transition: .15s; }
.ebtn:hover { border-color: var(--ink); }
.ebtn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.ebtn.primary:hover { background: #2a2a2a; }
.ebtn svg { width: 15px; height: 15px; }
.sp-cta { display: block; text-align: center; }

.sp-json .codeblock { font-family: var(--mono); font-size: 11.5px; line-height: 1.55; color: var(--ink); background: var(--wash); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 14px; overflow-x: auto; white-space: pre; margin: 0; }
.sp-json-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sp-copy { font: inherit; font-size: 11.5px; font-weight: 500; color: var(--ink); background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }

/* vertical resolution-path trace: lit = ink, done = filled ink check */
.sp-trace-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sp-trace-head .btn { padding: 6px 12px; font-size: 12px; }
.pt-row { display: flex; gap: 13px; align-items: flex-start; }
.pt-rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; }
.pt-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11.5px; font-weight: 700; background: #fff; border: 1.5px solid var(--rule); color: var(--faint); transition: all .35s; }
.pt-line { width: 2px; flex: 1; min-height: 26px; margin: 3px 0; border-radius: 2px; background: var(--rule); transition: background .35s; }
.pt-body { padding-bottom: 16px; min-width: 0; }
.pt-title { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; color: var(--faint); transition: color .35s; }
.pt-q { font-family: var(--mono); font-size: 10.5px; margin-top: 2px; word-break: break-all; color: #aaa; }
.pt-api { font-family: var(--mono); font-size: 10px; margin-top: 5px; padding: 4px 7px; border-radius: 3px; display: inline-block; background: var(--wash); color: #aaa; transition: all .35s; }
.pt-row.lit .pt-n { background: var(--ink); color: #fff; border-color: var(--ink); }
.pt-row.lit .pt-title { color: var(--ink); }
.pt-row.lit .pt-q { color: var(--muted); }
.pt-row.lit .pt-api { background: var(--wash); color: var(--ink); border: 1px solid var(--rule-soft); }
.pt-row.done .pt-n { background: var(--ink); color: #fff; border-color: var(--ink); }
.pt-row.done .pt-line { background: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .slide-panel, .panel-scrim { animation: none; }
  .card { transition: none; }
}

/* ============================================================
   SIDEBAR SHELL: persistent left page-nav on every page.
   Desktop: sticky rail beside the content column.
   Mobile: the SAME markup as a slide-in drawer behind a toggle,
   so both load identical pages.
   ============================================================ */
.nav-toggle { display: none; align-self: center; width: 34px; height: 34px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.nav-toggle svg { width: 17px; height: 17px; }
.nav-toggle:hover { border-color: var(--ink); }

.shell { max-width: var(--maxw); margin: 0 auto; width: 100%; padding: 0 var(--pad-x) 96px; display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 40px; align-items: start; flex: 1; }
body.wide { --maxw: 1280px; }

.sidebar { position: sticky; top: 90px; padding: 34px 0 24px; max-height: calc(100vh - 90px); overflow-y: auto; }
.side-group { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin: 24px 0 10px; }
.sidebar nav > .side-group:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.sidebar li { margin: 0; }
.sidebar a { display: block; text-decoration: none; color: var(--muted); font-size: 13.5px; line-height: 1.4; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 1px solid transparent; }
.sidebar a:hover { color: var(--ink); border-left-color: var(--rule); }
.sidebar a.current { color: var(--ink); border-left-color: var(--ink); font-weight: 500; }

/* the shell's content column ignores the global full-page main rules */
.shell > main.content { padding: 0; margin: 0; max-width: none; min-width: 0; }

.page-head { padding: 48px 0 24px; border-bottom: 1px solid var(--rule); }
.page-head .eyebrow { margin-bottom: 14px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 10px; font-weight: 600; }
.page-head .subtitle { font-size: 16px; color: var(--muted); margin: 0; }
.page-head.home h1 { font-size: clamp(30px, 4.2vw, 46px); }
.page-head.home { border-bottom: 0; }
.page-head .abstract { font-size: 15px; color: #333; line-height: 1.65; margin: 18px 0 0; max-width: 72ch; }

/* link rows inside prose keep their own quiet styling */
.doc a.linkrow { text-decoration: none; }

.nav-scrim { position: fixed; inset: 0; z-index: 65; background: rgba(17, 17, 17, .38); }

/* standalone pages (e.g. Browse) keep the sidebar collapsed into the
   drawer at EVERY width; the toggle is always visible */
body.standalone .nav-toggle { display: inline-flex; }
body.standalone .sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
  width: min(300px, 84vw); max-height: none;
  background: #fff; border-right: 1px solid var(--rule);
  padding: 24px 22px; transform: translateX(-100%);
  transition: transform .22s ease;
}
body.nav-open .sidebar { transform: translateX(0); }
body.nav-open { overflow: hidden; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: min(300px, 84vw); max-height: none;
    background: #fff; border-right: 1px solid var(--rule);
    padding: 24px 22px; transform: translateX(-100%);
    transition: transform .22s ease;
  }
}
@media (max-width: 680px) { .shell .card-grid { grid-template-columns: 1fr; } }
