/* ============================================================
   Reforge Documentation — docs.css (Soft Carbon)
   Consumes Carbon role tokens via the bridge in tokens.css.
   Pages are White theme; header / homepage hero / code blocks are
   data-carbon-theme="dark" islands.
   ============================================================ */

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px; /* Carbon base */
  scroll-behavior: smooth;
}

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

img { max-width: 100%; height: auto; }

/* ── Header — Carbon masthead (g100 island) ── */
.docs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--cds-background);
  border-bottom: 1px solid var(--cds-border-subtle);
}
.docs-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 48px;
}
.docs-header__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -10px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--cds-text-primary);
  cursor: pointer;
  transition: background var(--cds-duration-fast-01) var(--cds-easing-productive);
}
.docs-header__menu-btn:hover { background: var(--cds-background-hover); }
.docs-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cds-text-primary);
  font-size: 0.875rem;
  letter-spacing: 0.16px;
  flex-shrink: 0;
  white-space: nowrap;
  text-decoration: none;
}
.docs-header__logo:hover { color: var(--cds-text-primary); text-decoration: none; }
.docs-header__logo img { height: 26px; width: auto; display: block; }
.docs-header__logo strong { font-weight: 600; }
.docs-header__tabs {
  display: flex;
  align-items: stretch;
  align-self: stretch;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.docs-header__tabs::-webkit-scrollbar { display: none; }
.docs-header__tab {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  letter-spacing: 0.16px;
  color: var(--cds-text-secondary);
  padding: 0 14px;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent; /* keep label optically centred */
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--cds-duration-fast-01) var(--cds-easing-productive),
              background var(--cds-duration-fast-01) var(--cds-easing-productive);
}
.docs-header__tab:hover {
  color: var(--cds-text-primary);
  background: var(--cds-background-hover);
  text-decoration: none;
}
.docs-header__tab--active {
  color: var(--cds-text-primary);
  border-bottom-color: var(--cds-interactive);
}

/* ── Main layout: sidebar + content + toc ── */
.docs-layout {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 32px 24px 64px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

/* ── Sidebar — Carbon side nav ── */
.docs-sidebar {
  flex: 0 0 232px;
  width: 232px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cds-border-subtle-selected) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--cds-border-subtle-selected); border-radius: 2px; }
.docs-sidebar-scrim { display: none; }

.docs-nav__section { margin-bottom: 24px; }

.docs-nav__section-title {
  font-size: 0.75rem;      /* label-01, semibold */
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.32px;
  color: var(--cds-text-primary);
  display: block;
  margin-bottom: 6px;
  padding: 0 16px;
}

.docs-nav__list,
.docs-nav__sublist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.docs-nav__sublist {
  margin-left: 16px;
  border-left: 1px solid var(--cds-border-subtle);
}

.docs-nav__item { margin: 0; }

.docs-nav__group-label {
  display: block;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.32px;
  color: var(--cds-text-helper);
  padding: 8px 16px 4px;
  cursor: default;
}

/* Carbon side-nav item: 32px, square, 3px accent when active */
.docs-nav__link {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 0.875rem;
  letter-spacing: 0.16px;
  color: var(--cds-text-secondary);
  padding: 4px 16px;
  border-left: 3px solid transparent;
  text-decoration: none;
  transition: color var(--cds-duration-fast-01) var(--cds-easing-productive),
              background var(--cds-duration-fast-01) var(--cds-easing-productive);
  line-height: 1.3;
}
.docs-nav__link:hover {
  color: var(--cds-text-primary);
  background: var(--cds-background-hover);
  text-decoration: none;
}
.docs-nav__link--active {
  color: var(--cds-text-primary);
  background: var(--cds-layer-selected-01);
  border-left-color: var(--cds-interactive);
  font-weight: 600;
}

/* ── Content area ── */
.docs-content {
  flex: 1;
  min-width: 0;
}

/* Flat editorial page — Carbon docs style (no card chrome) */
.docs-article {
  max-width: 720px;
}

/* ── Typography ── */
.docs-article h1 {
  font-size: 2rem;         /* heading-05 */
  line-height: 2.5rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.docs-article h2 {
  font-size: 1.25rem;      /* heading-03 weight-up */
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin: 2.5rem 0 1rem;
}
.docs-article h3 {
  font-size: 1rem;         /* heading-02 */
  line-height: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.75rem 0 0.6rem;
}
.docs-article h4 {
  font-size: 0.875rem;     /* heading-01 */
  line-height: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}
.docs-article p {
  color: var(--text);
  margin: 0 0 1rem;
  font-size: 1rem;         /* body-02 */
  line-height: 1.5rem;
}
.docs-article ul,
.docs-article ol { color: var(--text); padding-left: 1.5rem; margin: 0 0 1rem; font-size: 1rem; }
.docs-article li { margin-bottom: 0.35rem; line-height: 1.5rem; }
.docs-article strong { color: var(--text); font-weight: 600; }
.docs-article em { font-style: italic; }
.docs-article a { color: var(--cds-link-primary); }
.docs-article a:hover { color: var(--cds-link-primary-hover); text-decoration: underline; }

/* Anchor links on headings (headerLink mode wraps full heading text in the <a>) */
.docs-article .header-anchor {
  color: inherit;
  text-decoration: none;
}
.docs-article .header-anchor:hover {
  color: inherit;
  text-decoration: none;
}
.docs-article .header-anchor::after {
  content: '#';
  margin-left: 8px;
  font-size: 0.75em;
  color: var(--cds-link-primary);
  opacity: 0;
  transition: opacity var(--cds-duration-fast-02) var(--cds-easing-productive);
  font-family: var(--mono);
}
.docs-article h1:hover .header-anchor::after,
.docs-article h2:hover .header-anchor::after,
.docs-article h3:hover .header-anchor::after { opacity: 1; }

/* ── Inline code ── */
.docs-article :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--cds-field-01);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
}

/* ── kbd (markdown-it-kbd renders nested <kbd> for combos) ── */
.docs-article kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  background: var(--cds-layer-01);
  color: var(--text);
  border: 1px solid var(--cds-border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  padding: 0.1em 0.5em;
}
.docs-article kbd kbd {
  border: none;
  background: transparent;
  padding: 0;
}

/* ── Code blocks — g100 islands ──
   Fenced blocks get data-carbon-theme="dark" from the syntax-highlight
   plugin, so island tokens resolve. Bare <pre> (no language) gets the
   same look via explicit literals. */
.docs-article pre {
  position: relative;
  background: var(--cds-background);
  border: 1px solid var(--cds-border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
}
.docs-article pre:not([data-carbon-theme]) {
  background: #171414;
  border-color: #3c3838;
  color: #f7f3f2;
}
.docs-article pre code {
  font-family: var(--mono);
  font-size: 0.875rem;     /* code-02 */
  background: none;
  border: none;
  padding: 0;
  color: var(--cds-text-primary);
  border-radius: 0;
  line-height: 1.55;
}
.docs-article pre:not([data-carbon-theme]) code { color: #f7f3f2; }

/* Copy button (injected by docs.js — progressive enhancement) */
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.32px;
  color: #cac5c4;
  background: #272525;
  border: 1px solid #3c3838;
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--cds-duration-fast-02) var(--cds-easing-productive),
              background var(--cds-duration-fast-01) var(--cds-easing-productive),
              color var(--cds-duration-fast-01) var(--cds-easing-productive);
}
.docs-article pre:hover .code-copy,
.code-copy:focus-visible,
.code-copy--done { opacity: 1; }
.code-copy:hover { background: #3c3838; color: #f7f3f2; }
.code-copy--done { color: #42be65; border-color: #42be65; }
@media (hover: none) {
  .code-copy { opacity: 1; }
}

/* Prism token palette. Blocks are always dark, so these are checked against
   the dark ground only. Multi-hue on purpose - code needs distinguishable
   tokens - but the hues carrying the commonest tokens are warm, so a block
   reads as part of this theme rather than a foreign object. */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #8f8b8b; }
.token.punctuation { color: #cac5c4; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #ffb784; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.attr-value { color: #42be65; }
.token.operator, .token.entity, .token.url { color: #f7f3f2; }
.token.atrule, .token.keyword { color: #ffb784; }
.token.function, .token.class-name { color: #fdd13a; }
.token.variable { color: #3ddbd9; }
.token.regex, .token.important { color: #ff8389; }

/* ── Tables — Carbon data table (md rows, bordered not zebra) ── */
.docs-article table,
.home-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-none);
  margin: 0.75rem 0 1.5rem;
  font-size: 0.875rem;     /* body-01 */
}
.docs-article thead th,
.home-content thead th {
  background: var(--cds-layer-accent-01);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.16px;
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--cds-border-subtle-selected);
}
.docs-article tbody td,
.home-content tbody td {
  padding: 10px 16px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.45;
}
.docs-article tbody tr:last-child td,
.home-content tbody tr:last-child td { border-bottom: none; }
.docs-article tbody tr:hover td,
.home-content tbody tr:hover td { background: var(--cds-layer-hover-01); }

/* ── Admonitions — Carbon inline notification ── */
.admonition {
  border: 1px solid var(--border);
  border-left: 3px solid;
  border-radius: var(--radius-sm);
  background: var(--cds-layer-01);
  padding: 14px 16px;
  margin: 0.75rem 0 1.25rem;
  font-size: 0.875rem;
}
.admonition--note { border-left-color: var(--cds-interactive); }
.admonition--info { border-left-color: var(--cds-interactive); }
.admonition--tip { border-left-color: var(--cds-support-success); }
.admonition--warning { border-left-color: var(--cds-support-warning); }
.admonition--danger { border-left-color: var(--cds-support-error); }
.admonition p { color: var(--text); margin: 0; font-size: 0.875rem; line-height: 1.4rem; }
.admonition p:not(:last-child) { margin-bottom: 0.5rem; }
.admonition-title { font-weight: 600; }
.admonition--note .admonition-title,
.admonition--info .admonition-title { color: var(--cds-text-primary); }
.admonition--tip .admonition-title { color: var(--cds-text-success); }
.admonition--warning .admonition-title { color: var(--cds-text-warning); }
.admonition--danger .admonition-title { color: var(--cds-text-error); }

/* ── Horizontal rule ── */
.docs-article hr,
.home-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Blockquote ── */
.docs-article blockquote {
  border-left: 3px solid var(--cds-border-strong);
  background: var(--cds-layer-01);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0 1.25rem;
}
.docs-article blockquote p { color: var(--text-2); margin: 0; }

/* ── On this page (right rail) ── */
.docs-toc {
  flex: 0 0 200px;
  width: 200px;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  border-left: 1px solid var(--border);
  padding-left: 16px;
}
.docs-toc__title {
  display: block;
  font-size: 0.75rem;      /* label-01, semibold */
  line-height: 1rem;
  font-weight: 600;
  letter-spacing: 0.32px;
  color: var(--text);
  margin-bottom: 8px;
}
.docs-toc__list { list-style: none; margin: 0; padding: 0; }
.docs-toc__item { margin: 0; }
.docs-toc__item--h3 { padding-left: 12px; }
.docs-toc__link {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-2);
  padding: 4px 0;
  line-height: 1.3;
  text-decoration: none;
  transition: color var(--cds-duration-fast-01) var(--cds-easing-productive);
}
.docs-toc__link:hover { color: var(--cds-link-primary); text-decoration: none; }

/* ── Footer ── */
.docs-footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  margin-top: auto;
}
.docs-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.75rem;      /* legal-01 */
  letter-spacing: 0.32px;
  color: var(--text-3);
}
.docs-footer__links { display: flex; gap: 20px; }
.docs-footer__links a { color: var(--cds-link-primary); text-decoration: none; }
.docs-footer__links a:hover { color: var(--cds-link-primary-hover); text-decoration: underline; }
.docs-footer__version { font-family: var(--mono); font-size: 0.75rem; color: var(--text-3); }

/* ── HOME PAGE ── */

/* Hero — Carbon leadspace (g100 island set in home.njk) */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 5rem 24px 4.5rem;
}
.hero__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
}
.hero__text { flex: 0 0 500px; max-width: 500px; }
.hero__right {
  flex: 1;
  max-width: 460px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
/* Eyebrow + accent word keep Reforge gold — deliberate brand moments */
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.32px;
  color: var(--brand-gold);
  margin-bottom: 1.25rem;
}
.hero__eyebrow::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--brand-gold);
}
.hero__title {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 300;        /* Plex Light — Carbon display */
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero__title em { color: var(--brand-gold); font-style: normal; font-weight: 400; }
.hero__subtitle {
  font-size: 1.125rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 2rem;
}
.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  font-size: 0.8125rem;
  color: var(--text-3);
}
.hero__app-img {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--cds-shadow);
  display: block;
}

/* In-content screenshots (GUI walkthrough pages) — mirrors the hero image frame. */
.docs-figure {
  margin: 1.5rem 0 2rem;
}
.docs-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--cds-shadow);
  display: block;
}
.docs-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-3);
  text-align: center;
}

/* Buttons — Carbon primary / tertiary (island tokens make tertiary white on dark) */
.btn-p {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--cds-button-primary);
  color: var(--cds-text-on-color);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.16px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--cds-duration-fast-02) var(--cds-easing-productive);
  white-space: nowrap;
}
.btn-p:hover {
  background: var(--cds-button-primary-hover);
  color: var(--cds-text-on-color);
  text-decoration: none;
}
.btn-p:active { background: var(--cds-button-primary-active); }
.btn-p:focus-visible {
  outline: 2px solid var(--cds-focus);
  outline-offset: -3px;
  box-shadow: inset 0 0 0 1px var(--cds-focus-inset);
}
.btn-p--lg { min-height: 48px; padding: 0 24px; font-size: 0.9375rem; }

.btn-o {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--cds-button-tertiary);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.16px;
  min-height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cds-button-tertiary);
  cursor: pointer;
  text-decoration: none;
  transition: color var(--cds-duration-fast-02) var(--cds-easing-productive),
              background var(--cds-duration-fast-02) var(--cds-easing-productive),
              border-color var(--cds-duration-fast-02) var(--cds-easing-productive);
  white-space: nowrap;
}
.btn-o:hover {
  color: var(--cds-text-inverse);
  background: var(--cds-button-tertiary-hover);
  border-color: var(--cds-button-tertiary-hover);
  text-decoration: none;
}
.btn-o--lg { min-height: 48px; padding: 0 24px; font-size: 0.9375rem; }

/* Stats strip — light band, hairline dividers */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-strip__cell {
  background: var(--bg);
  padding: 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background var(--cds-duration-fast-02) var(--cds-easing-productive);
}
.stats-strip__cell:hover { background: var(--cds-layer-01); }
.stats-strip__num {
  font-size: 2rem;         /* heading-05 */
  line-height: 2.5rem;
  font-weight: 400;
  color: var(--text);
}
.stats-strip__sup { font-size: 1.25rem; color: var(--cds-interactive); font-weight: 400; }
.stats-strip__label {
  font-size: 0.75rem;      /* label-01 */
  line-height: 1rem;
  letter-spacing: 0.32px;
  color: var(--text-2);
}

/* Home content area */
.home-content {
  padding: 4rem 24px 5rem;
}
.home-content__inner {
  max-width: 960px;
  margin: 0 auto;
}
.home-content h2 {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin: 2.5rem 0 1rem;
}
.home-content p { color: var(--text); font-size: 1rem; line-height: 1.5rem; margin-bottom: 0.75rem; }
.home-content a { color: var(--cds-link-primary); }
.home-content a:hover { color: var(--cds-link-primary-hover); text-decoration: underline; }

/* Section headers (inside home content markdown) */
.rf-sh {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
}
.rf-sh__eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.32px;
  color: var(--accent);
  display: block;
  margin-bottom: 0.4rem;
}
.rf-sh__title {
  font-size: clamp(1.375rem, 2.5vw, 1.75rem);
  font-weight: 400;
  color: var(--text);
  margin: 0;
  line-height: 1.2;
}

/* Nav card grid — Carbon clickable tiles */
.rf-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 2.5rem;
}
.rf-card {
  position: relative;
  background: var(--cds-layer-01);
  padding: 24px 24px 44px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--cds-duration-fast-02) var(--cds-easing-productive);
  color: inherit;
}
.rf-card:hover { background: var(--cds-layer-hover-01); text-decoration: none; color: inherit; }
.rf-card::after {
  /* Carbon clickable-tile arrow, bottom-right */
  content: '\2192';
  position: absolute;
  right: 20px;
  bottom: 14px;
  color: var(--cds-link-primary);
  font-size: 1rem;
  transition: transform var(--cds-duration-fast-02) var(--cds-easing-productive);
}
.rf-card:hover::after { transform: translateX(4px); }
.rf-card__eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.32px;
  color: var(--accent);
  display: block;
}
.rf-card__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.rf-card__desc {
  font-size: 0.875rem;
  color: var(--text-2);
  line-height: 1.45;
  margin: 0;
  flex: 1;
}
.rf-card__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rf-chip {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.32px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--cds-field-01);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: border-color var(--cds-duration-fast-02) var(--cds-easing-productive),
              color var(--cds-duration-fast-02) var(--cds-easing-productive);
}
.rf-card:hover .rf-chip { border-color: var(--cds-border-interactive); color: var(--cds-link-primary); }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .docs-toc { display: none; }
  .hero__inner { flex-direction: column; text-align: center; gap: 36px; }
  .hero__text { flex: none; max-width: 600px; }
  .hero__eyebrow::before { display: none; }
  .hero__actions { justify-content: center; }
  .hero__trust { justify-content: center; }
  .hero__right { width: 100%; justify-content: center; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .docs-header__menu-btn { display: flex; }
  .docs-header__tabs { display: none; }

  /* Sidebar becomes an off-canvas drawer, toggled by docs.js */
  .docs-sidebar {
    position: fixed;
    top: 48px;
    left: 0;
    bottom: 0;
    width: 280px;
    max-height: none;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 16px 0;
    transform: translateX(-100%);
    transition: transform var(--cds-duration-moderate-02) var(--cds-easing-productive);
    z-index: 90;
  }
  .docs-sidebar--open { transform: translateX(0); }
  .docs-sidebar-scrim {
    display: block;
    position: fixed;
    inset: 48px 0 0 0;
    background: var(--cds-overlay);
    z-index: 80;
  }
  .docs-sidebar-scrim[hidden] { display: none; }

  .docs-layout { flex-direction: column; }
  .hero { padding: 3.5rem 24px 3rem; }
}

@media (max-width: 600px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .rf-nav-grid { grid-template-columns: 1fr; }
  .docs-layout { padding: 24px 16px 48px; }
}

/* ── Documentation search ──────────────────────────────────────────────────
   Sits in the dark header island, so it takes its colours from the theme tokens
   rather than the page ones. margin-left:auto pushes it to the trailing edge
   without disturbing the tab row's own spacing. */
.docs-search {
  position: relative;
  margin-left: auto;
  flex: 0 1 240px;
  display: flex;
  align-items: center;
}
.docs-search__label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.docs-search__icon {
  position: absolute;
  left: 10px;
  color: var(--cds-text-helper);
  pointer-events: none;
}
.docs-search input {
  width: 100%;
  height: 32px;
  padding: 0 10px 0 32px;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--cds-text-primary);
  background: var(--cds-field-01);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  outline: none;
}
.docs-search input::placeholder { color: var(--cds-text-placeholder); }
.docs-search input:focus-visible {
  border-color: var(--cds-interactive);
  outline: 2px solid var(--cds-interactive);
  outline-offset: -2px;
}
/* Cancel the WebKit default, which sits on top of our own affordances. */
.docs-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* The panel descends from the dark header island and inherits its tokens, which is
   the right result: it reads as part of the header rather than as a light card
   floating over it, and the dark theme resolves --cds-interactive to orange-40 so
   the crumb clears contrast where orange-60 would not. Measured on the rendered
   panel: title 13.83:1, crumb 6.19:1, snippet 8.92:1. */
.docs-search__results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: min(28rem, calc(100vw - 32px));
  max-height: min(28rem, calc(100vh - 96px));
  overflow-y: auto;
  background: var(--cds-layer-01);
  border: 1px solid var(--cds-border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 24px rgba(23, 20, 20, 0.28);
  z-index: 200;
}
.docs-search__list { list-style: none; margin: 0; padding: 4px; }
.docs-search__list a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
}
.docs-search__list li.is-active a,
.docs-search__list a:hover,
.docs-search__list a:focus-visible {
  background: var(--cds-layer-hover-01);
}
.docs-search__title {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cds-text-primary);
}
.docs-search__crumb {
  display: block;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cds-interactive);
  margin-top: 1px;
}
.docs-search__snippet {
  display: block;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--cds-text-secondary);
  margin-top: 3px;
}
.docs-search__empty {
  margin: 0;
  padding: 14px;
  font-size: 0.8125rem;
  color: var(--cds-text-secondary);
}

@media (max-width: 900px) {
  /* The tab row collapses into the menu at this width; search stays, because it is
     the faster route on a small screen. */
  .docs-search { flex-basis: 160px; }
}
