/* SwMacroFlow shared design tokens and site chrome. */

:root {
  --bg: #0d0d0f;
  --bg-alt: #141417;
  --panel: #1b1b20;
  --panel-border: #303038;
  --text: #f5f2ed;
  --text-dim: #c6c0b8;
  --text-faint: #8a8379;
  --accent: #e2231a;
  --accent-2: #ff5a46;
  --accent-soft: rgba(226, 35, 26, 0.14);
  --danger: #ff5a46;
  --blue: #4386ff;
  --success: #26b476;
  --radius: 8px;
  --max-w: 1120px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f8f8f8;
  --bg-alt: #eeeeee;
  --panel: #ffffff;
  --panel-border: #d8d8d8;
  --text: #151515;
  --text-dim: #555555;
  --text-faint: #7d7d7d;
  --accent-soft: rgba(226, 35, 26, 0.08);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0d0d0f;
  --bg-alt: #141417;
  --panel: #1b1b20;
  --panel-border: #303038;
  --text: #f5f2ed;
  --text-dim: #c6c0b8;
  --text-faint: #8a8379;
  --accent-soft: rgba(226, 35, 26, 0.14);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #111114 0, var(--bg) 420px),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

code { overflow-wrap: anywhere; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--panel-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
}

/* margin-left: auto rather than leaning on the flex container's space-between: the header now has
   only the brand and these links on desktop, and this keeps them pinned right whatever else lands
   in the bar later. */
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  font-size: 14px;
  color: var(--text-dim);
}

.nav-links a {
  text-decoration: none;
  transition: color .15s ease;
}

.nav-links a:hover { color: var(--text); }
.nav-links a[aria-current="page"] { color: var(--text); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  flex: none;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform .18s ease, opacity .18s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 8px 24px 18px;
  max-width: var(--max-w);
  margin: 0 auto;
  border-top: 1px solid var(--panel-border);
  font-size: 15px;
  color: var(--text-dim);
}

.nav-mobile a {
  padding: 11px 4px;
  text-decoration: none;
}

.nav-mobile a[aria-current="page"] { color: var(--text); }

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-mobile[data-open="true"] { display: flex; }
}

@media (max-width: 620px) {
  .nav-inner { padding-inline: 24px; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-2); }

.btn-secondary {
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  color: var(--text);
  border-color: var(--panel-border);
}

.btn-secondary:hover {
  border-color: var(--text-faint);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: .55;
  cursor: default;
  transform: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--panel-border);
  padding: 36px 24px 30px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.footer-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.footer-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-links a {
  min-width: 0;
  text-decoration: none;
  transition: color .15s ease;
}

.footer-links a:hover { color: var(--text); }

.footer-copy {
  font-size: 12px;
  color: var(--text-faint);
  width: 100%;
  margin-top: 18px;
}

/* Legal pages */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.legal h1 {
  font-size: 30px;
  margin: 0 0 6px;
  letter-spacing: 0;
}

.legal .updated {
  color: var(--text-faint);
  font-size: 13px;
  margin: 0 0 36px;
}

.legal h2 {
  font-size: 19px;
  margin: 40px 0 10px;
}

.legal p,
.legal li {
  color: var(--text-dim);
  font-size: 15px;
}

.legal li { margin-bottom: 8px; }
.legal strong { color: var(--text); }
.legal a { color: var(--accent); }

.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  background: color-mix(in srgb, var(--panel) 42%, transparent);
}

.legal th,
.legal td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--panel-border);
  vertical-align: top;
  color: var(--text-dim);
}

.legal th {
  color: var(--text);
  font-weight: 700;
}

/* Macro browser */
.macros-page {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 62px 24px 96px;
}

.macros-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: 0 0 38px;
  border-bottom: 1px solid var(--panel-border);
}

.macros-hero > *,
.macro-browser,
.macro-toolbar,
.macro-index,
.macro-row {
  min-width: 0;
}

.page-eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.macros-hero h1 {
  max-width: 760px;
  margin: 0 0 14px;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
}

.macros-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--text-dim);
  font-size: 16px;
}

.macro-browser {
  padding-top: 30px;
}

.macro-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.macro-search {
  display: grid;
  min-width: min(100%, 260px);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.macro-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 72%, var(--bg));
  color: var(--text);
  font: inherit;
}

.macro-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 64%, transparent);
  outline-offset: 2px;
}

.macro-count,
.macro-status,
.macro-file {
  color: var(--text-faint);
  font-size: 13px;
}

.macro-status {
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 50%, var(--bg));
}

/* The library is an index, not a gallery. Sixteen bordered cards in a grid read as sixteen equal
   adverts; sixteen numbered rows read as a parts list, which is the document an engineer already
   knows how to scan. Rows also let a summary, a group, the document types and the file itself sit
   on one line, which a card had no room for. */
.macro-index {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: macro;
  border-top: 1px solid var(--panel-border);
}

.macro-row {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 112px auto;
  gap: 0 18px;
  align-items: center;
  padding: 16px 14px 16px 0;
  border-bottom: 1px solid var(--panel-border);
  transition: background .14s ease, box-shadow .14s ease;
}

/* Only the rows still showing, so filtering renumbers 01..N rather than leaving the gaps that make
   a filtered list look like it lost something. */
.macro-row:not([hidden]) {
  counter-increment: macro;
}

.macro-row:hover {
  background: color-mix(in srgb, var(--panel) 62%, transparent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.macro-row-n {
  align-self: start;
  padding-top: 2px;
  color: var(--text-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
}

.macro-row-n::before {
  content: counter(macro, decimal-leading-zero);
}

.macro-row:hover .macro-row-n {
  color: var(--accent);
}

.macro-row-main {
  min-width: 0;
}

.macro-row-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

/* Stretched over the whole row, so the row is the hit area while the accessible name stays just the
   macro title. The download link below sits above it on the z axis, so the one thing a reader might
   want other than the page is still reachable. */
.macro-row-link {
  color: inherit;
  text-decoration: none;
}

.macro-row-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.macro-row-link:focus-visible::after {
  outline: 2px solid color-mix(in srgb, var(--accent) 64%, transparent);
  outline-offset: -2px;
}

/* Clamped so a two-sentence summary and a one-line summary produce rows of the same height - the
   even rhythm is most of what makes a long list scannable. */
.macro-row-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.45;
}

.macro-row-summary a {
  color: var(--text-dim);
}

.macro-applies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
}

.macro-chip {
  padding: 2px 6px;
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
}

.macro-tag {
  justify-self: start;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, currentColor 34%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Four groups, four hues, all of them already in the palette - a category is a label, not a reason
   to add a brand colour. */
.macro-tag[data-tag="export"] { color: var(--accent); }
.macro-tag[data-tag="properties"] { color: var(--blue); }
.macro-tag[data-tag="drawing"] { color: var(--success); }

.macro-dl {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 74%, var(--bg));
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.macro-dl:hover {
  border-color: var(--accent);
  color: var(--text);
}

.macro-dl-arrow::before {
  content: "\2193";
  font-weight: 700;
}

/* Filter bar */
.macro-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.macro-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, background .14s ease;
}

.macro-pill:hover {
  border-color: var(--text-faint);
  color: var(--text);
}

.macro-pill.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.macro-pill-n {
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.macro-pill.is-active .macro-pill-n {
  color: var(--accent);
}

.macro-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-faint);
  font-size: 13px;
}

.macro-stats strong {
  color: var(--text);
}

/* The same tag and chips as the index row, repeated at the top of a macro's own page: someone
   arriving from search has not seen the index and still has to know whether it touches drawings. */
.macro-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 0;
}

.macro-meta .macro-tag {
  justify-self: start;
}

.macro-meta .macro-applies {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.macro-toolbar-end {
  display: flex;
  align-items: center;
  gap: 14px;
}


.btn-compact {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
}

.macro-install {
  margin: 14px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.macro-install p {
  margin: 0 0 10px;
}

.install-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.install-code-row pre {
  min-width: 0;
  overflow: auto;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: var(--bg);
}

.install-code-row code {
  color: var(--text);
  font-size: 13px;
}

.copy-path-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 70%, var(--bg));
  color: var(--text);
  cursor: pointer;
}

.copy-path-button:hover,
.copy-path-button.is-copied {
  border-color: var(--accent);
}

.copy-icon {
  position: relative;
  width: 16px;
  height: 16px;
}

.copy-icon::before,
.copy-icon::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 2px;
}

.copy-icon::before {
  left: 1px;
  top: 3px;
  opacity: .55;
}

.copy-icon::after {
  left: 5px;
  top: 0;
  background: color-mix(in srgb, var(--panel) 70%, var(--bg));
}

@media (max-width: 900px) {
  .macros-hero,
  .macro-toolbar {
    grid-template-columns: 1fr;
  }

  .macro-toolbar {
    display: grid;
    align-items: stretch;
  }

  .macro-toolbar-end {
    justify-content: space-between;
  }

  .macro-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    row-gap: 12px;
  }

  /* The category moves under the title rather than competing with the download for the right edge. */
  .macro-row .macro-tag {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
}

@media (max-width: 620px) {
  footer,
  .macros-page {
    padding-inline: 18px;
  }

  .footer-links {
    width: 100%;
    gap: 12px 18px;
  }

  .macros-hero h1 {
    font-size: 2rem;
    line-height: 1.08;
  }

  .macros-hero .btn {
    width: 100%;
  }

  .macro-row {
    grid-template-columns: minmax(0, 1fr);
    padding-inline: 0;
  }

  .macro-row-n {
    display: none;
  }

  .macro-row .macro-tag,
  .macro-row .macro-dl {
    grid-column: 1;
    grid-row: auto;
    justify-self: stretch;
    justify-content: center;
  }

  .macro-row .macro-tag {
    justify-self: start;
  }

  .macro-toolbar-end {
    flex-wrap: wrap;
  }
}

/* Documentation page */
.docs-page {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 62px 24px 96px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  padding-right: 4px;
}

.docs-search {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 700;
}

.docs-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 72%, var(--bg));
  color: var(--text);
  font: inherit;
}

.docs-search input:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 64%, transparent);
  outline-offset: 2px;
}

.docs-nav-group {
  margin: 22px 0 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.docs-nav-group:first-child { margin-top: 0; }

.docs-nav ul {
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.docs-nav a {
  display: block;
  padding: 7px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
  font-size: 14px;
  text-decoration: none;
}

.docs-nav a:hover {
  background: color-mix(in srgb, var(--panel) 60%, transparent);
  color: var(--text);
}

.docs-nav a.is-active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 700;
}

.docs-nav-status {
  margin: 0;
  color: var(--text-faint);
  font-size: 13px;
}

.docs-content {
  max-width: 760px;
  min-width: 0;
}

.docs-content h1 {
  margin: 0 0 24px;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
}

.docs-markdown h2 {
  margin: 38px 0 10px;
  font-size: 20px;
}

.docs-markdown h3 {
  margin: 28px 0 8px;
  font-size: 16px;
}

.docs-markdown h4 {
  margin: 22px 0 8px;
  font-size: 15px;
}

.docs-markdown p,
.docs-markdown li {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.65;
}

.docs-markdown li { margin-bottom: 6px; }
.docs-markdown ul,
.docs-markdown ol { padding-left: 22px; }
.docs-markdown strong { color: var(--text); }
.docs-markdown a { color: var(--accent); }

.docs-markdown code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--panel) 80%, var(--bg));
  font-size: 13.5px;
}

.docs-markdown pre {
  overflow: auto;
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--bg) 72%, var(--panel));
}

.docs-markdown pre code {
  padding: 0;
  background: none;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.docs-markdown hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--panel-border);
}

.docs-markdown table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
}

.docs-markdown th,
.docs-markdown td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--panel-border);
  text-align: left;
  vertical-align: top;
  color: var(--text-dim);
}

.docs-markdown th {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--panel-border);
  }
}

@media (max-width: 620px) {
  .docs-page { padding-inline: 18px; }
}


/* ============ Generated pages ============ */
/* Everything below styles output from tools/build-site.mjs: the per-guide and per-macro pages, and
   the two indexes that link to them. They reuse .docs-* and .macro-* above wherever the shape is
   the same; these rules only cover what the old client-rendered pages had no equivalent for. */

.crumbs {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-faint);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--panel-border);
}

.crumbs a {
  color: var(--text-dim);
  text-decoration: none;
}

.crumbs a:hover { color: var(--text); }

/* Prev/next. These exist for the links as much as the navigation: without them every generated
   page hangs off one index and nothing else on the site points at it. */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 52px 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--panel-border);
}

.pager-link {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 44%, var(--bg));
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.pager-link:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--panel-border));
  background: color-mix(in srgb, var(--panel) 68%, var(--bg));
}

.pager-next { text-align: right; }

.pager-dir {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pager-title {
  color: var(--text);
  font-weight: 700;
  overflow-wrap: break-word;
}

/* The one aside a guide or macro page gets, whether it points at the product or somewhere else
   worth sending people. Kept to a single paragraph: these pages earn their traffic by answering
   the question, not by pitching. */
.doc-cta {
  margin: 34px 0 0;
  padding: 18px 20px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
}

.doc-cta p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.doc-cta a { color: var(--accent); }

/* Docs index */
.docs-index-head {
  max-width: 760px;
  margin: 0 0 42px;
}

.docs-index-head h1 {
  margin: 0 0 14px;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
}

.docs-index-lede {
  margin: 0 0 26px;
  color: var(--text-dim);
}

.doc-group + .doc-group { margin-top: 44px; }

.doc-group h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.doc-index {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 56%, var(--bg));
  transition: border-color .15s ease, background .15s ease;
}

.doc-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--panel-border));
  background: color-mix(in srgb, var(--panel) 72%, var(--bg));
}

.doc-card h3 {
  margin: 0;
  font-size: 18px;
}

.doc-card h3 a { text-decoration: none; }

.doc-card p {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

/* Macro pages */
.macro-lede {
  margin: 0 0 24px;
  color: var(--text-dim);
  font-size: 17px;
}

.macro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 8px;
}

.macro-install-note {
  max-width: 760px;
  margin: 40px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--panel-border);
}

@media (max-width: 860px) {
  .doc-index { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .macro-actions .btn { width: 100%; }
}
