:root {
  color-scheme: light dark;

  /* Harbour ink and brass. Cool neutrals; accent is a deep sea blue, with brass
     reserved for rules and marks so the two never compete. */
  --bg: hsl(210, 22%, 99%);
  --bg-subtle: hsl(210, 18%, 96%);
  --bg-muted: hsl(210, 16%, 93%);
  --fg: hsl(214, 22%, 14%);
  --fg-secondary: hsl(214, 10%, 36%);
  --fg-muted: hsl(214, 9%, 50%);
  --fg-faint: hsl(214, 9%, 66%);
  --border: hsl(212, 18%, 86%);
  --border-light: hsl(212, 18%, 92%);
  --accent: hsl(206, 72%, 34%);
  --accent-light: hsl(206, 62%, 94%);
  --brass: hsl(38, 52%, 42%);
  --brass-soft: hsl(38, 60%, 93%);

  /* semantic colours used by diagrams and state chips */
  --pending: hsl(38, 88%, 44%);
  --pending-soft: hsl(38, 88%, 93%);
  --granted: hsl(150, 52%, 34%);
  --granted-soft: hsl(150, 48%, 93%);
  --denied: hsl(2, 68%, 50%);
  --denied-soft: hsl(2, 72%, 95%);
  --expired: hsl(214, 9%, 50%);
  --expired-soft: hsl(212, 16%, 93%);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  --display: "Charter", "Iowan Old Style", "Source Serif Pro", "Cambria", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", "Menlo", "Roboto Mono", monospace;

  --shadow-sm: 0 1px 2px hsl(214 30% 20% / 0.05);
  --shadow: 0 2px 4px hsl(214 30% 20% / 0.06), 0 4px 12px hsl(214 30% 20% / 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: hsl(214, 18%, 10%);
    --bg-subtle: hsl(214, 15%, 13%);
    --bg-muted: hsl(214, 14%, 18%);
    --fg: hsl(210, 20%, 93%);
    --fg-secondary: hsl(212, 12%, 72%);
    --fg-muted: hsl(212, 10%, 57%);
    --fg-faint: hsl(212, 10%, 43%);
    --border: hsl(214, 12%, 25%);
    --border-light: hsl(214, 12%, 20%);
    --accent: hsl(203, 85%, 65%);
    --accent-light: hsl(206, 40%, 21%);
    --brass: hsl(40, 62%, 62%);
    --brass-soft: hsl(38, 30%, 22%);
    --pending: hsl(40, 88%, 60%);
    --pending-soft: hsl(40, 38%, 22%);
    --granted: hsl(150, 52%, 55%);
    --granted-soft: hsl(150, 28%, 20%);
    --denied: hsl(2, 74%, 65%);
    --denied-soft: hsl(2, 38%, 24%);
    --expired: hsl(212, 10%, 57%);
    --expired-soft: hsl(214, 12%, 22%);
    --shadow-sm: 0 1px 2px hsl(0 0% 0% / 0.30);
    --shadow: 0 2px 4px hsl(0 0% 0% / 0.30), 0 4px 12px hsl(0 0% 0% / 0.25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent-light); color: var(--fg); }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: hsl(from var(--accent) h s l / 0.35);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.12s ease;
}
a:hover { text-decoration-color: var(--accent); }

/* Site header */
.site-header {
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  padding: 1rem 0;
  font-size: 0.875rem;
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-header .brand {
  font-family: var(--mono); font-weight: 600; font-size: 0.95rem;
  letter-spacing: 0.01em; color: var(--fg); text-decoration: none;
}
.site-header .brand:hover { color: var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-header nav a {
  font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted);
  text-decoration: none; letter-spacing: 0.02em;
}
.site-header nav a:hover { color: var(--accent); }
.site-header nav a.active { color: var(--accent); font-weight: 600; }

main.container { flex: 1; }

/* Site footer */
.site-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  padding: 1.5rem 0;
  color: var(--fg-muted);
  font-size: 0.825rem;
  margin-top: 4rem;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--fg-secondary); }
.site-footer a:hover { color: var(--accent); }

/* ---- Doc shell: left sidebar + content ---- */
.doc-shell { display: block; padding-top: 1.5rem; }
@media (min-width: 900px) {
  .doc-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 3rem; }
}
.sidebar { min-width: 0; }
@media (min-width: 900px) {
  .sidebar { position: sticky; top: 4.5rem; align-self: start; max-height: calc(100vh - 5.5rem); overflow-y: auto; padding-bottom: 2rem; }
}
.sidebar .sb-group { margin-bottom: 1.4rem; }
.sidebar .sb-label {
  font-family: var(--mono); font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-faint); margin: 0 0 0.5rem;
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar li a {
  display: block; padding: 0.28rem 0.6rem; border-radius: 6px;
  font-size: 0.875rem; color: var(--fg-secondary); text-decoration: none; line-height: 1.4;
}
.sidebar li a:hover { background: var(--bg-subtle); color: var(--fg); }
.sidebar li a.active { background: var(--accent-light); color: var(--accent); font-weight: 600; }

/* EDR / doc page */
.edr { padding: 3rem 0 2rem; }
.doc.edr { padding: 0 0 2rem; }

@media (min-width: 1140px) {
  .edr-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 3rem;
    align-items: start;
  }
}
.edr-main { min-width: 0; }

.back { margin: 0 0 1.5rem; font-family: var(--mono); font-size: 0.8rem; }
.back a { color: var(--fg-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; }
.back a:hover { color: var(--fg); }

.edr-header { margin-bottom: 2rem; }
.edr-id {
  display: inline-block; font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted);
  letter-spacing: 0.05em; margin-right: 0.75rem; vertical-align: middle;
}
.edr-header h1 {
  font-family: var(--display); font-size: 2.3rem; font-weight: 600;
  letter-spacing: -0.022em; line-height: 1.12; margin: 0.5rem 0 1rem; color: var(--fg);
}
@media (min-width: 768px) { .edr-header h1 { font-size: 2.7rem; } }

.edr-meta { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; margin: 0; font-size: 0.875rem; }
.edr-meta > div { margin: 0; }
.edr-meta dt {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 500; color: var(--fg-faint);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem;
}
.edr-meta dd { margin: 0; color: var(--fg-secondary); }

.relations {
  list-style: none; padding: 0.9rem 1.1rem; margin: 1.75rem 0 0; background: var(--bg-subtle);
  border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.9rem;
}
.relations li { margin: 0.2rem 0; color: var(--fg-secondary); }
.relations li a { color: var(--accent); }

/* Body content */
.edr-body { font-size: 1rem; line-height: 1.7; color: var(--fg-secondary); margin-top: 2rem; }
.edr-body > *:first-child { margin-top: 0; }
.edr-body h2 {
  font-family: var(--sans); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.012em;
  color: var(--fg); margin: 2.75rem 0 1rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light); scroll-margin-top: 5rem;
}
.edr-body h3 { font-family: var(--sans); font-size: 1.15rem; font-weight: 600; color: var(--fg); margin: 2rem 0 0.5rem; scroll-margin-top: 5rem; }
.edr-body h4 { font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--fg); margin: 1.5rem 0 0.5rem; scroll-margin-top: 5rem; }
.edr-body h2 .heading-link, .edr-body h3 .heading-link, .edr-body h4 .heading-link { color: inherit; text-decoration: none; }
.edr-body h2 .heading-link:hover, .edr-body h3 .heading-link:hover, .edr-body h4 .heading-link:hover { color: var(--accent); }
.edr-body p { margin: 0.75rem 0; }
.edr-body ul, .edr-body ol { padding-left: 1.5rem; margin: 0.75rem 0; }
.edr-body li { margin: 0.3rem 0; }
.edr-body li > p:first-child { margin-top: 0; }
.edr-body li > p:last-child { margin-bottom: 0; }
.edr-body strong { font-weight: 600; color: var(--fg); }
.edr-body em { font-style: italic; }
.edr-body blockquote { border-left: 3px solid var(--accent); margin: 1.25rem 0; padding: 0.25rem 1.1rem; color: var(--fg-muted); }
.edr-body code { font-family: var(--mono); font-size: 0.875em; background: var(--bg-muted); padding: 0.1em 0.4em; border-radius: 4px; color: var(--fg); }
.edr-body pre {
  background: var(--bg-subtle); border: 1px solid var(--border-light); padding: 1rem 1.1rem;
  border-radius: 8px; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; margin: 1rem 0;
}
.edr-body pre code { background: none; padding: 0; font-size: inherit; }
.edr-body table { border-collapse: collapse; margin: 1.25rem 0; font-size: 0.92rem; width: 100%; }
.edr-body th {
  text-align: left; padding: 0.55rem 0.9rem; font-family: var(--mono); font-size: 0.72rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-muted);
  background: var(--bg-subtle); border-bottom: 1px solid var(--border-light);
}
.edr-body td { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.edr-body tr:last-child td { border-bottom: 0; }
.edr-body hr { border: 0; border-top: 1px solid var(--border-light); margin: 2.5rem 0; }
.edr-body img { max-width: 100%; }

/* Inline SVG diagrams (replacing ASCII drawings) */
.edr-body svg.diagram {
  display: block;
  width: 100%;
  height: auto;
  max-width: 760px;
  margin: 1.5rem auto;
}
.edr-body svg.diagram text { font-family: var(--mono); }
.edr-body figure.diagram { margin: 1.5rem 0; }
.edr-body figure.diagram figcaption { font-size: 0.82rem; color: var(--fg-muted); text-align: center; margin-top: 0.4rem; font-family: var(--mono); }

.edr-footer {
  margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border-light);
  font-family: var(--mono); font-size: 0.78rem; color: var(--fg-muted);
}
.edr-footer a { color: var(--fg-secondary); text-decoration: none; }
.edr-footer a:hover { color: var(--accent); }
.edr-footer code { font-size: inherit; background: none; padding: 0; }

/* TOC */
.edr-toc { display: none; }
@media (min-width: 1140px) {
  .edr-toc { display: block; position: sticky; top: 4.5rem; align-self: start; font-size: 0.85rem; max-height: calc(100vh - 5.5rem); overflow-y: auto; }
}
.edr-toc-label {
  font-family: var(--mono); font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--fg-faint); margin: 0 0 0.75rem; padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
}
.edr-toc ul { list-style: none; margin: 0; padding: 0; }
.edr-toc li { margin: 0.4rem 0; line-height: 1.4; }
.edr-toc li.level-3 { padding-left: 1rem; font-size: 0.8rem; }
.edr-toc li.level-4 { padding-left: 2rem; font-size: 0.78rem; }
.edr-toc a { color: var(--fg-secondary); text-decoration: none; display: block; padding: 0.05rem 0; }
.edr-toc a:hover { color: var(--accent); }

/* Index / listing */
.intro { padding: 3rem 0 1.5rem; max-width: 44rem; }
.intro h1 { font-family: var(--display); font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 1rem; color: var(--fg); }
.intro p { font-size: 1.025rem; line-height: 1.65; color: var(--fg-secondary); margin: 0.75rem 0; }

.edr-list { list-style: none; margin: 1.5rem 0 4rem; padding: 0; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow-sm); }
.edr-row { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0 0.5rem; padding: 1rem 1.1rem; border-bottom: 1px solid var(--border-light); margin: 0; }
.edr-row:last-child { border-bottom: 0; }
.edr-row:hover { background: var(--bg-subtle); }
.edr-num { font-family: var(--mono); font-size: 0.85rem; color: var(--fg-muted); text-decoration: none; padding-top: 0.15rem; }
.edr-row .edr-body { margin: 0; font-size: inherit; }
.edr-title { margin: 0; font-size: 1rem; }
.edr-title a { color: var(--fg); text-decoration: none; font-weight: 600; }
.edr-title a:hover { color: var(--accent); text-decoration: underline; }
.edr-summary { margin: 0.3rem 0 0.45rem; font-size: 0.9rem; line-height: 1.55; color: var(--fg-secondary); max-width: 58rem; }
.edr-row .edr-meta { display: block; margin: 0; font-family: var(--mono); font-size: 0.75rem; color: var(--fg-faint); }
.edr-row .edr-meta .date { margin-right: 0.6rem; }

/* Status badges */
.badge {
  display: inline-block; padding: 0.18rem 0.6rem; border-radius: 999px; font-family: var(--mono);
  font-size: 0.72rem; font-weight: 600; text-transform: lowercase; letter-spacing: 0.03em; vertical-align: middle;
}
.badge-proposed   { background: hsl(35, 90%, 92%);  color: hsl(28, 60%, 32%);  }
.badge-accepted   { background: hsl(145, 50%, 90%); color: hsl(150, 45%, 25%); }
.badge-deprecated { background: hsl(20, 8%, 90%);   color: hsl(20, 8%, 35%);   }
.badge-superseded { background: hsl(270, 45%, 92%); color: hsl(265, 40%, 35%); }
@media (prefers-color-scheme: dark) {
  .badge-proposed   { background: hsl(35, 50%, 22%);  color: hsl(38, 85%, 80%); }
  .badge-accepted   { background: hsl(145, 35%, 18%); color: hsl(140, 60%, 78%); }
  .badge-deprecated { background: hsl(20, 8%, 22%);   color: hsl(30, 10%, 80%); }
  .badge-superseded { background: hsl(265, 30%, 22%); color: hsl(270, 60%, 85%); }
}
/* Implementation badges — what EXISTS, as opposed to what the status badge says
   was decided. Outlined rather than filled, and always drawn beside a filled
   status badge, so the two are never read as one badge saying one thing. The
   ring is an inset shadow rather than a border so both kinds keep the same
   box. */
.badge-impl { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }
.impl-shipped   { color: hsl(150, 45%, 30%); }
.impl-partial   { color: hsl(28, 60%, 34%);  }
.impl-in-flight { color: hsl(210, 55%, 38%); }
.impl-none      { color: hsl(20, 8%, 42%);   }
@media (prefers-color-scheme: dark) {
  .impl-shipped   { color: hsl(140, 55%, 72%); }
  .impl-partial   { color: hsl(38, 80%, 74%);  }
  .impl-in-flight { color: hsl(208, 70%, 76%); }
  .impl-none      { color: hsl(30, 10%, 68%);  }
}

/* Every badge names its own axis for a screen reader. "accepted / none" read
   aloud with no axis names is worse than either badge alone. */
.badge-axis {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.tag {
  display: inline-block; padding: 0.12rem 0.5rem; border-radius: 4px; background: var(--bg-muted);
  font-family: var(--mono); font-size: 0.72rem; color: var(--fg-muted); margin-right: 0.3rem; vertical-align: middle;
}

/* ---- Roadmap ---- */
.roadmap-tally { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0; }
.roadmap-tally-item {
  display: inline-flex; align-items: baseline; gap: 0.4rem; padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-light); border-radius: 8px; background: var(--bg);
  font-family: var(--mono); font-size: 0.78rem; color: var(--fg-secondary); text-decoration: none;
}
a.roadmap-tally-item:hover { border-color: var(--accent); color: var(--fg); }
.roadmap-tally-item.is-empty { color: var(--fg-faint); }
.roadmap-tally-item.is-empty .roadmap-tally-count { color: var(--fg-faint); }
.roadmap-tally-count { font-size: 1.1rem; font-weight: 600; color: var(--fg); }
.roadmap-group { margin: 2.5rem 0 0; }
.roadmap-group h2 {
  display: flex; align-items: baseline; gap: 0.6rem; margin: 0; font-family: var(--display);
  font-size: 1.15rem; font-weight: 600; scroll-margin-top: 5rem;
}
.roadmap-count { font-family: var(--mono); font-size: 0.78rem; color: var(--fg-faint); font-weight: 400; }
.roadmap-blurb { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--fg-secondary); }
.roadmap-group .edr-list { margin: 0.85rem 0 0; }
.edr-impl-note { margin: 0.3rem 0 0; font-size: 0.875rem; line-height: 1.55; color: var(--fg-secondary); max-width: 58rem; }

/* embedded interactive diagrams */
iframe.embed {
  width: 100%; height: 560px; border: 1px solid var(--border-light); border-radius: 12px;
  background: var(--bg); margin: 1.5rem 0; box-shadow: var(--shadow-sm);
}
iframe.embed.tall { height: 700px; }

/* ---- Landing ---- */
.hero { padding: 3.5rem 0 2.5rem; max-width: 50rem; }
.hero-kicker { font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 0.75rem; }
.hero h1 { font-family: var(--display); font-size: 4.5rem; font-weight: 600; letter-spacing: -0.03em; line-height: 0.95; margin: 0; color: var(--fg); }
@media (max-width: 600px) { .hero h1 { font-size: 3rem; } }
.hero-tag { font-family: var(--display); font-size: 1.5rem; color: var(--fg-secondary); margin: 0.6rem 0 1.25rem; font-style: italic; }
.hero-lede { font-size: 1.1rem; line-height: 1.7; color: var(--fg-secondary); margin: 0 0 1.75rem; }
.hero-lede b { color: var(--fg); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.5rem; }
.btn-primary, .btn-ghost { display: inline-block; font-family: var(--mono); font-size: 0.85rem; font-weight: 600; padding: 0.6rem 1.1rem; border-radius: 9px; text-decoration: none; transition: all 0.12s ease; }
.btn-primary { background: var(--accent); color: #fff; border: 1px solid transparent; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: var(--bg-subtle); color: var(--fg); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--fg-faint); }
.hero-status { font-family: var(--mono); font-size: 0.8rem; color: var(--fg-muted); border-left: 3px solid var(--accent); padding-left: 0.8rem; margin: 0; }
.hero-status b { color: var(--fg); }

.band, .explainer, .explore { padding: 2.5rem 0; border-top: 1px solid var(--border-light); }
.band h2, .explainer h2, .explore h2 { font-family: var(--display); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 1.25rem; color: var(--fg); }
.explainer p { font-size: 1.05rem; line-height: 1.75; color: var(--fg-secondary); max-width: 50rem; margin: 0 0 1rem; }
.explainer p b { color: var(--fg); }
.band-note { font-size: 1.02rem; line-height: 1.7; color: var(--fg-secondary); max-width: 50rem; margin: 1rem 0; }

.flow-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0; }
.flow-step { font-family: var(--mono); font-size: 0.82rem; color: var(--fg); background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.75rem; white-space: nowrap; }
.flow-step b { color: var(--accent); margin-right: 0.3rem; }
.flow-step.muted { color: var(--fg-muted); border-style: dashed; }
.flow-strip i { color: var(--fg-faint); font-style: normal; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.feature { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 1.2rem 1.25rem; box-shadow: var(--shadow-sm); }
.feature h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--fg); }
.feature p { font-size: 0.92rem; line-height: 1.6; color: var(--fg-secondary); margin: 0 0 0.75rem; }
.feature a { font-family: var(--mono); font-size: 0.75rem; color: var(--accent); text-decoration: none; }
.feature a:hover { text-decoration: underline; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.9rem; }
.card { display: flex; flex-direction: column; gap: 0.3rem; text-decoration: none; background: var(--bg-subtle); border: 1px solid var(--border-light); border-radius: 10px; padding: 1rem 1.1rem; transition: border-color 0.12s ease, transform 0.05s ease; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.card-t { font-weight: 600; color: var(--fg); }
.card-d { font-size: 0.88rem; color: var(--fg-secondary); }

/* ---- Changelog ---- */
.changelog-filter { margin: 1.5rem 0 2rem; }
.changelog-filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.changelog-filter-tag {
  display: inline-flex; align-items: baseline; gap: 0.4rem; text-decoration: none;
  font-family: var(--mono); font-size: 0.78rem; color: var(--fg-secondary);
  background: var(--bg-subtle); border: 1px solid var(--border-light);
  border-radius: 999px; padding: 0.25rem 0.7rem;
}
.changelog-filter-tag:hover { border-color: var(--fg-faint); color: var(--fg); }
.changelog-filter-tag[aria-pressed="true"], .changelog-filter-tag.active {
  background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600;
}
.changelog-filter-count { font-size: 0.7rem; color: var(--fg-faint); }
.changelog-filter-status { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--fg-muted); }

.changelog-entry { padding: 1.75rem 0; border-top: 1px solid var(--border-light); }
.changelog-entry:first-of-type { border-top: 0; padding-top: 0.5rem; }
.changelog-entry h2 {
  font-family: var(--sans); font-size: 1.2rem; font-weight: 600; color: var(--fg);
  margin: 0 0 0.35rem; padding: 0; border: 0; scroll-margin-top: 5rem;
}
.changelog-entry h2 .changelog-date {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 500; color: var(--fg-faint);
}
.changelog-entry h3 { font-size: 0.8rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-muted); margin: 1.25rem 0 0.4rem; }
.changelog-tags { margin: 0 0 0.75rem; }
.changelog-entry[hidden] { display: none; }

/* ---- Cast list ---- */
.cast { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.9rem; margin: 1.5rem 0; }
.cast-member { border: 1px solid var(--border); border-left: 3px solid var(--brass); border-radius: 10px; padding: 1rem 1.1rem; background: var(--bg-subtle); }
.cast-member h4 { margin: 0 0 0.3rem; font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: var(--fg); }
.cast-member .role { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brass); margin: 0 0 0.5rem; }
.cast-member p { font-size: 0.9rem; line-height: 1.6; color: var(--fg-secondary); margin: 0.4rem 0 0; }
.cast-member .never { font-size: 0.85rem; color: var(--fg-muted); }
.cast-member .never b { color: var(--fg-secondary); }

/* ---- Callouts (GitHub-style alerts authored as blockquotes) ---- */
.edr-body blockquote.note { border-left-color: var(--accent); background: var(--accent-light); border-radius: 0 8px 8px 0; }
.edr-body blockquote.warn { border-left-color: var(--pending); background: var(--pending-soft); border-radius: 0 8px 8px 0; }

/* mermaid renders inline; keep it from overflowing the column */
.edr-body pre.mermaid { background: none; border: 0; padding: 0; text-align: center; overflow-x: auto; }

/* ---- Landing extras ---- */
.hero h1 .mark { color: var(--brass); }
.rule-brass { border: 0; border-top: 2px solid var(--brass); width: 3rem; margin: 1.5rem 0; opacity: 0.8; }
.lede-note { font-size: 0.9rem; color: var(--fg-muted); border-left: 3px solid var(--brass); padding-left: 0.9rem; margin: 1.5rem 0 0; }
.lede-note b { color: var(--fg-secondary); }

/* ---- Landing: pseudo-terminal demo ---- */
.demo { padding: 2.5rem 0; border-top: 1px solid var(--border-light); }
.demo h2 { font-family: var(--display); font-size: 1.75rem; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 1.25rem; color: var(--fg); }

.term {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  background: var(--bg); box-shadow: var(--shadow); margin: 1.75rem 0 0;
}

/* Chrome: a title bar that reads as a terminal without being a skeuomorph. */
.term-chrome {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.7rem 1rem;
  background: linear-gradient(180deg, var(--bg-muted), var(--bg-subtle));
  border-bottom: 1px solid var(--border-light);
}
.term-dots { display: inline-flex; gap: 0.4rem; flex: none; }
.term-dots i { width: 10px; height: 10px; border-radius: 50%; opacity: 0.55; }
.term-dots i:nth-child(1) { background: var(--denied); }
.term-dots i:nth-child(2) { background: var(--pending); }
.term-dots i:nth-child(3) { background: var(--granted); }
.term-title {
  font-family: var(--mono); font-size: 0.76rem; color: var(--fg-muted);
  letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.term-badge {
  margin-left: auto; flex: none; font-family: var(--mono); font-size: 0.66rem;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--brass); background: var(--brass-soft);
  border: 1px solid hsl(from var(--brass) h s l / 0.3);
  border-radius: 999px; padding: 0.15rem 0.6rem;
}

/* Scene control. Numbered chips, one clear active state. */
.term-tabs {
  display: flex; gap: 0.3rem; padding: 0.6rem 0.7rem; overflow-x: auto;
  background: var(--bg-subtle); border-bottom: 1px solid var(--border-light);
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.term-tabs::-webkit-scrollbar { height: 6px; }
.term-tabs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.term-tab {
  display: inline-flex; align-items: center; gap: 0.45rem; flex: none;
  font-family: var(--mono); font-size: 0.74rem; cursor: pointer;
  color: var(--fg-muted); background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 0.32rem 0.65rem; white-space: nowrap;
  transition: color 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.term-tab-n {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.15rem; height: 1.15rem; border-radius: 4px;
  font-size: 0.64rem; font-weight: 600;
  background: var(--bg-muted); color: var(--fg-faint);
}
.term-tab:hover { color: var(--fg); background: var(--bg-muted); }
.term-tab:hover .term-tab-n { color: var(--fg-secondary); }
.term-tab[aria-selected="true"] {
  color: var(--accent); background: var(--accent-light);
  border-color: hsl(from var(--accent) h s l / 0.45); font-weight: 600;
}
.term-tab[aria-selected="true"] .term-tab-n { background: var(--accent); color: var(--bg); }
.term-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.term-caption {
  margin: 0; padding: 0.9rem 1.1rem; font-size: 0.9rem; line-height: 1.65;
  color: var(--fg-secondary); background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-light);
}

.term-body {
  margin: 0; padding: 1.1rem 0; min-height: 23rem; max-height: 36rem;
  overflow: auto; background: var(--bg); color: var(--fg-secondary);
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.7;
  white-space: pre; tab-size: 2;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.term-body::-webkit-scrollbar { width: 8px; height: 8px; }
.term-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
@media (max-width: 640px) {
  .term-body { font-size: 0.69rem; min-height: 18rem; line-height: 1.66; }
  .term-caption { font-size: 0.85rem; }
}
.term-body:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Unrevealed lines are hidden from the accessibility tree too, not just faded.
   min-width: max-content lets a line's background span the full scroll width. */
.term-body .l {
  display: block; min-width: max-content; padding: 0 1.1rem;
  visibility: hidden; opacity: 0; transform: translateY(2px);
}
.term-body .l.is-on {
  visibility: visible; opacity: 1; transform: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.term-body .l-gap { min-height: 0.55em; }

.term-body .l-cmd {
  color: var(--fg); font-weight: 600;
  background: var(--bg-subtle); padding-block: 0.12rem;
  border-left: 2px solid var(--accent); padding-left: calc(1.1rem - 2px);
}
.term-body .l-sigil { color: var(--accent); font-weight: 700; }
.term-body .l-in { color: var(--brass); font-weight: 600; }
.term-body .l-sql { color: var(--fg); }
.term-body .l-out { color: var(--fg-secondary); }
.term-body .l-dim { color: var(--fg-faint); }
.term-body .l-lbl {
  color: var(--brass); font-weight: 600; letter-spacing: 0.01em;
  margin-top: 0.15rem;
}
.term-body .l-ok { color: var(--granted); }
.term-body .l-step { color: var(--pending); }
.term-body .l-warn { color: var(--denied); font-weight: 600; }
.term-body .l-err { color: var(--denied); }
.term-body .l-meas { color: var(--accent); font-weight: 600; }
.term-body .l-modl {
  color: var(--fg-muted); font-style: italic;
  border-left: 2px solid var(--border); padding-left: calc(1.1rem - 2px);
}

/* Open-sided rule boxes: a left rail and a head/foot rule. No right edge to
   misalign, so they degrade cleanly at any width. */
.term-body .l-rule  { color: var(--brass); }
.term-body .l-ruleu { color: var(--pending); font-weight: 600; }
.term-body .l-ruled { color: var(--denied); font-weight: 600; }
.term-body .l-rail { color: var(--border); padding-right: 0.55rem; }
.term-body .rail-b .l-rail { color: hsl(from var(--brass) h s l / 0.55); }
.term-body .rail-u .l-rail { color: hsl(from var(--pending) h s l / 0.6); }
.term-body .rail-d .l-rail { color: hsl(from var(--denied) h s l / 0.6); }

.term-controls {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 0.65rem 1rem; background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}
.term-btn {
  font-family: var(--mono); font-size: 0.74rem; cursor: pointer;
  color: var(--fg-secondary); background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.32rem 0.75rem;
  transition: border-color 0.12s ease, color 0.12s ease;
}
.term-btn:hover:not(:disabled) { border-color: var(--fg-faint); color: var(--fg); }
.term-btn:disabled { opacity: 0.45; cursor: default; }
.term-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.term-status { font-family: var(--mono); font-size: 0.72rem; color: var(--fg-faint); }

@media (prefers-reduced-motion: reduce) {
  .term-body .l { visibility: visible; opacity: 1; transform: none; transition: none; }
  .term-tab { transition: none; }
}
