/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  /* Channel triplets, not colours: every translucent surface in this file is built from
     these with rgba(var(--x-rgb), a), so the dark scheme at the bottom of this block can
     re-point them once instead of restating ~25 rules. */
  --white-rgb:      255,255,255;
  --line-rgb:       215,223,227;
  --brand-rgb:      22,44,91;
  --accent-rgb:     121,208,186;
  --panel-soft-rgb: 238,241,244;
  --brand-soft-rgb: 230,237,248;
  --warn-rgb:       185,108,47;
  --bg-top:         #fbfcfa;
  --bg-accent-soft: 242,247,244;
  --eyebrow-text:   #1f7862;
  --counter-text:   #fff;
  --bg:           #f6f7f4;
  --bg-accent:    #eef5f1;
  --panel:        rgba(255,255,255,0.88);
  --panel-strong: #ffffff;
  --panel-soft:   #eef1f4;
  --line:         #d7dfe3;
  --line-strong:  #c2cdd4;
  --text:         #31404f;
  --muted:        #64717d;
  --heading:      #182b4d;
  --brand:        #162c5b;
  --brand-strong: #102245;
  --brand-soft:   #e6edf8;
  --accent:       #79d0ba;
  --accent-soft:  #e9f7f2;
  --accent-strong:#3aab90;
  --warn:         #b96c2f;
  --warn-bg:      rgba(255,246,238,0.92);
  --shadow:       0 20px 45px rgba(24,43,77,0.08);
  --shadow-soft:  0 8px 22px rgba(24,43,77,0.06);
  --nav-width:    300px;
  --toc-width:    240px;
  --radius:       18px;
  --radius-sm:    12px;
  /* Light only, like the app: no dark scheme, and no browser auto-darkening. */
  color-scheme: light;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 45% at 5% 2%, rgba(var(--accent-rgb),0.2), transparent),
    radial-gradient(ellipse 40% 30% at 98% 95%, rgba(var(--brand-rgb),0.07), transparent),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 100%);
  font-family: "Avenir Next","Segoe UI",Helvetica,Arial,sans-serif;
}

a { color: var(--brand); }

/* ── Accessibility ─────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Shell layout ──────────────────────────────────────────────── */
.docs-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0,1fr) var(--toc-width);
}

/* ── Sidebar ───────────────────────────────────────────────────── */
.sidebar,
.toc {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  padding: 28px 20px;
}

.sidebar {
  background: rgba(var(--white-rgb),0.92);
  border-right: 1px solid rgba(var(--line-rgb),0.75);
  backdrop-filter: blur(14px);
}

/* Brand lockup */
.brand {
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, rgba(var(--white-rgb),0.99), rgba(var(--bg-accent-soft),0.96));
  box-shadow: var(--shadow-soft);
}

.brand-lockup {
  display: flex; align-items: center; gap: 12px;
}

.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; }

.brand-copy h1,
.hero h1,
h2, h3, h4 {
  font-family: "Iowan Old Style","Palatino Linotype",Georgia,serif;
}

.brand-copy h1 {
  margin: 0;
  color: var(--brand);
  font-size: 1.35rem;
  line-height: 1.1;
}

.brand-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.brand-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Search ────────────────────────────────────────────────────── */
.search {
  position: relative;
  margin: 18px 0 26px;
}

.search input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(var(--white-rgb),0.96);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb),0.7);
  transition: border-color 0.14s, box-shadow 0.14s;
}

.search input:focus {
  outline: none;
  border-color: rgba(var(--accent-rgb),0.6);
  box-shadow: inset 0 1px 0 rgba(var(--white-rgb),0.7), 0 0 0 3px rgba(var(--accent-rgb),0.15);
}

.search-results {
  display: none;
  position: absolute; left: 0; right: 0; z-index: 20;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 8px;
}

.search-results.active { display: block; }

.search-results a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.88rem;
  color: var(--text);
}

.search-results a:hover { background: var(--brand-soft); color: var(--brand); }

/* ── Nav groups ────────────────────────────────────────────────── */
.nav-group { margin-bottom: 22px; }

.nav-group-title {
  margin-bottom: 8px;
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
}

.nav-link {
  display: block;
  margin-bottom: 2px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.13s, color 0.13s;
}

.nav-link:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(var(--brand-soft-rgb),0.9), rgba(var(--accent-rgb),0.12));
  color: var(--brand-strong);
  font-weight: 700;
  border-color: rgba(var(--accent-rgb),0.4);
}

/* ── Content area ──────────────────────────────────────────────── */
.content-wrap {
  min-width: 0;
  background: transparent;
}

.content-header {
  padding: 22px 44px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Generated from the source page's last change — see scripts/build-docs.mjs. */
.doc-updated {
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
}

.content {
  max-width: 900px;
  padding: 22px 44px 64px;
}

/* ── Headings ──────────────────────────────────────────────────── */
h2, h3, h4 { color: var(--heading); scroll-margin-top: 24px; }

h2 {
  margin-top: 40px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
}

h3 {
  margin-top: 26px;
  font-size: 1.22rem;
  font-weight: 700;
}

.content > h2 + p { max-width: 60ch; }

p, li, td, th { line-height: 1.68; }
ul, ol { padding-left: 22px; }

/* ── Hero (inside docs pages) ──────────────────────────────────── */
.hero {
  margin-bottom: 32px;
  padding: 32px 36px;
  border: 1px solid rgba(var(--line-rgb),0.8);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(var(--white-rgb),0.98), rgba(var(--bg-accent-soft),0.92));
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -48px; bottom: -48px;
  width: 200px; height: 200px;
  border-radius: 40px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb),0.16), rgba(var(--brand-rgb),0.05));
  transform: rotate(18deg);
  pointer-events: none;
}

.hero > * { position: relative; z-index: 1; }

.hero-logo {
  display: block;
  width: min(100%, 400px);
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0 0 12px;
  color: var(--heading);
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  line-height: 1.07;
  font-weight: 700;
  max-width: 16ch;
}

.hero p {
  max-width: 60ch;
  font-size: 1rem;
  color: var(--muted);
}

/* Eyebrow — label above hero headline */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb),0.45);
  color: var(--eyebrow-text);
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-strong);
  flex-shrink: 0;
}

/* Hero grid / feature grid */
.hero-grid,
.feature-grid,
.link-grid {
  display: grid;
  gap: 14px;
}

.hero-grid,
.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-top: 28px;
}

.hero-card,
.feature-card {
  display: block;
  padding: 20px;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius-sm);
  background: rgba(var(--white-rgb),0.78);
  box-shadow: var(--shadow-soft);
  color: inherit;
  text-decoration: none;
  transition: background 0.13s, transform 0.12s;
}

.feature-card:hover {
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.hero-card strong,
.feature-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--heading);
  font-family: "Iowan Old Style","Palatino Linotype",Georgia,serif;
  font-size: 0.97rem;
}

.hero-card span,
.feature-card span {
  display: block;
  font-size: 0.88rem;
  line-height: 1.58;
  color: var(--muted);
}

/* ── Link grid ─────────────────────────────────────────────────── */
.link-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 22px;
}

.link-grid a {
  display: block;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--white-rgb),0.92);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-soft);
  transition: background 0.13s, border-color 0.13s, transform 0.12s;
}

.link-grid a:hover {
  background: var(--brand-soft);
  border-color: rgba(var(--accent-rgb),0.4);
  transform: translateY(-1px);
}

/* ── Card ──────────────────────────────────────────────────────── */
.card {
  margin: 18px 0;
  padding: 22px 24px;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

/* ── Callouts ──────────────────────────────────────────────────── */
.callout {
  margin: 18px 0;
  padding: 20px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--line-rgb),0.86);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.callout.info {
  border-color: rgba(var(--brand-rgb),0.14);
  border-left: 4px solid var(--brand);
  background: rgba(var(--brand-soft-rgb),0.42);
}

.callout.warn {
  border-color: rgba(var(--warn-rgb),0.2);
  border-left: 4px solid var(--warn);
  background: var(--warn-bg);
}

/* ── Step list ─────────────────────────────────────────────────── */
.step-list {
  margin: 18px 0;
  padding: 22px 24px 22px 20px;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  counter-reset: step-counter;
}

.step-list ol {
  list-style: none;
  padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 14px;
}

/* Block, not flex: as a flex container every run of text and every <code> in the step became
   its own flex item, so a step with a UI label in it broke into columns. */
.step-list ol li {
  position: relative;
  padding-left: 40px;
  counter-increment: step-counter;
  font-size: 0.92rem;
  line-height: 1.65;
}

.step-list ol li::before {
  content: counter(step-counter);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--counter-text);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(var(--brand-rgb),0.2);
  margin-top: 1px;
}

/* ── Glossary list ─────────────────────────────────────────────── */
.glossary-list {
  margin: 18px 0;
  padding: 22px 24px;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.glossary-list p { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.65; }
.glossary-list p:last-child { margin-bottom: 0; }
.glossary-list strong { color: var(--heading); }

/* ── Table ─────────────────────────────────────────────────────── */
.table-wrap {
  margin: 18px 0;
  overflow: auto;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%; min-width: 560px;
  border-collapse: collapse;
  background: var(--panel-strong);
}

th, td {
  border-bottom: 1px solid var(--line);
  padding: 13px 18px;
  vertical-align: top;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background: rgba(var(--panel-soft-rgb),0.82);
  color: var(--heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr:last-child td { border-bottom: 0; }

/* ── Figures (screenshots) ─────────────────────────────────────── */
.doc-figure {
  margin: 22px 0 26px;
  padding: 10px;
  border: 1px solid rgba(var(--line-rgb),0.86);
  border-radius: var(--radius-sm);
  background: rgba(var(--white-rgb),0.78);
  box-shadow: var(--shadow-soft);
}

.doc-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(var(--line-rgb),0.86);
}

.doc-figure figcaption {
  margin: 10px 4px 2px;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Code ──────────────────────────────────────────────────────── */
code {
  font-family: "SFMono-Regular","Menlo","Consolas",monospace;
  font-size: 0.93em;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(var(--brand-rgb),0.06);
  color: var(--brand);
}

/* ── TOC ───────────────────────────────────────────────────────── */
.toc {
  border-left: 1px solid rgba(var(--line-rgb),0.75);
  background: rgba(var(--white-rgb),0.72);
}

.toc h2 {
  margin-top: 0;
  font-size: 0.72rem;
  font-family: "Avenir Next","Segoe UI",Helvetica,Arial,sans-serif;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 700;
  margin-bottom: 10px;
}

.toc a {
  display: block;
  margin-bottom: 2px;
  padding: 7px 10px;
  border-radius: 9px;
  text-decoration: none;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.45;
  transition: background 0.13s, color 0.13s;
}

.toc a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.toc a.active {
  background: rgba(var(--brand-soft-rgb),0.88);
  color: var(--brand);
  font-weight: 600;
}

.search-results a.selected { background: var(--brand-soft); color: var(--brand); }

/* ── Heading links, sub-entries, the inline contents list ──────── */
.heading-anchor {
  margin-left: 0.4em;
  color: var(--muted);
  font-weight: 400;
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.14s;
}

h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus { opacity: 1; }

.toc a.toc-sub { padding-left: 22px; font-size: 0.8rem; }

.nav-toggle,
.toc-inline { display: none; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 272px minmax(0,1fr);
  }
  .toc { display: none; }

  .toc-inline {
    display: block;
    margin: 0 0 28px;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-strong);
  }

  .toc-inline summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--heading);
  }

  .toc-inline-links { margin-top: 10px; }

  .toc-inline-links a {
    display: block;
    padding: 6px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
  }

  .toc-inline-links a.toc-sub { padding-left: 16px; font-size: 0.86rem; }
}

@media (max-width: 840px) {
  .docs-shell { display: block; }

  .sidebar,
  .toc {
    position: static; height: auto; border: 0;
  }

  .content-header,
  .content {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero { padding: 22px 24px; }

  .hero h1 {
    max-width: none;
    font-size: 2rem;
  }

  .hero-logo { width: min(100%, 280px); }

  .nav-toggle {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel-strong);
    color: var(--brand);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
  }

  .sidebar nav { display: none; }
  .sidebar.nav-open nav { display: block; }
  .search { margin-bottom: 0; }
  .sidebar.nav-open .search { margin-bottom: 26px; }
}

/* ── Print ─────────────────────────────────────────────────────────
   A printed guide is the page's text and nothing else: no nav, no contents list, no search,
   no shadows, and black on white whatever the screen scheme is. */
@media print {
  :root {
    --text: #000;
    --heading: #000;
    --muted: #333;
    --brand: #000;
    --bg: #fff;
    --panel-strong: #fff;
    --panel-soft: #f2f2f2;
    --line: #999;
  }

  body { background: #fff !important; }

  .sidebar,
  .toc,
  .toc-inline,
  .heading-anchor,
  .nav-toggle { display: none !important; }

  .docs-shell { display: block; }

  .content-header,
  .content { padding: 0; max-width: none; }

  .hero,
  .card,
  .callout,
  .step-list,
  .table-wrap,
  .figure,
  figure {
    box-shadow: none !important;
    background: #fff !important;
    border-color: #999 !important;
  }

  /* Print drops backgrounds by default, which left white numbers on white paper. */
  .step-list ol li::before {
    background: none;
    color: #000;
    border: 1px solid #000;
    box-shadow: none;
  }

  h2, h3 { break-after: avoid; }
  .callout, .card, figure, tr, img { break-inside: avoid; }

  a { color: #000; }
}
