/* =====================================================================
   MEMBLY GUIDE — paper & ink, documentation edition
   Same voice as the landing page: editorial type, hairline rules,
   teal as the only loud colour. Light is paper; dark is the club.
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  /* raw palette — never used directly by components */
  --paper: #f2efe6;
  --paper-2: #e9e5d8;
  --ink: #141312;
  --ink-soft: #4c4a44;
  --ink-faint: #6b685e;
  --night: #0e0d0b;
  --night-2: #161410;
  --bone: #efeadb;
  --bone-soft: #b3aea0;
  --bone-faint: #8a8676;
  --teal: #17a5a6;
  --teal-text: #0f7576;
  --teal-bright: #1fd2c1;
  --violet: #8b5cf6;
  --gold: #d8b25c;

  --display: "Archivo", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(18px, 3.5vw, 44px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.45, .55, 1);

  --header-h: 62px;
  --sidebar-w: 240px;
  --measure: 78ch;
  --radius: 14px;
  --theme-t: 180ms;
}

/* Neutral set — every component reads only these. */
html[data-theme="light"] {
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --fg: var(--ink);
  --fg-soft: var(--ink-soft);
  --fg-faint: var(--ink-faint);
  --line: rgba(20, 19, 18, .16);
  --line-strong: rgba(20, 19, 18, .32);
  --accent: var(--teal);
  --accent-text: var(--teal-text);
  --panel: rgba(255, 255, 255, .55);
  --panel-2: rgba(20, 19, 18, .045);
  --tint-accent: rgba(23, 165, 166, .09);
  --tint-warn: rgba(216, 178, 92, .16);
  --tint-danger: rgba(200, 62, 46, .10);
  --warn-text: #8a6416;
  --danger: #b7362a;
  --shadow: 0 1px 2px rgba(20, 19, 18, .05), 0 14px 34px rgba(20, 19, 18, .09);
  --bar: rgba(242, 239, 230, .88);
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: var(--night);
  --bg-2: var(--night-2);
  --fg: var(--bone);
  --fg-soft: var(--bone-soft);
  --fg-faint: var(--bone-faint);
  --line: rgba(239, 234, 219, .14);
  --line-strong: rgba(239, 234, 219, .30);
  --accent: var(--teal-bright);
  --accent-text: var(--teal-bright);
  --panel: rgba(239, 234, 219, .035);
  --panel-2: rgba(239, 234, 219, .06);
  --tint-accent: rgba(31, 210, 193, .10);
  --tint-warn: rgba(216, 178, 92, .13);
  --tint-danger: rgba(224, 88, 72, .12);
  --warn-text: #e0bd6e;
  --danger: #f08a7c;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 18px 40px rgba(0, 0, 0, .45);
  --bar: rgba(14, 13, 11, .88);
  color-scheme: dark;
}

/* ----------------------------------------------------------------- reset */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--theme-t) linear, color var(--theme-t) linear;
}

::selection { background: var(--teal); color: #fff; }

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: fixed; top: -70px; left: 16px; z-index: 900;
  background: var(--fg); color: var(--bg);
  padding: 10px 18px; border-radius: 0 0 8px 8px;
  font-family: var(--mono); font-size: 13px;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky; top: 0; z-index: 500;
  display: flex; align-items: center; gap: 18px;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: var(--bar);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--theme-t) linear, border-color var(--theme-t) linear;
}

.brand {
  display: inline-flex; align-items: baseline; gap: 9px;
  text-decoration: none; flex: 0 0 auto;
}
.brand svg, .brand-mark {
  width: 24px; height: 24px; align-self: center;
  color: var(--accent);
  transition: transform .45s var(--spring);
}
.brand:hover svg { transform: rotate(-12deg) scale(1.08); }
.brand b {
  font-stretch: 115%; font-weight: 800; font-size: 18px;
  letter-spacing: .01em; text-transform: lowercase;
}
.brand span {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-faint);
  border: 1px solid var(--line);
  border-radius: 99px; padding: 3px 7px 2px;
  align-self: center;
}

.topnav {
  display: flex; gap: 4px; margin-left: auto;
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .14em; text-transform: uppercase;
}
.topnav a {
  text-decoration: none; padding: 8px 11px; border-radius: 8px;
  color: var(--fg-soft);
  transition: color .2s, background-color .2s;
}
.topnav a:hover { color: var(--fg); background: var(--panel-2); }
.topnav a[aria-current="page"] {
  color: var(--accent-text);
  background: var(--tint-accent);
}

.theme-toggle, .nav-toggle {
  flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  color: var(--fg-soft);
  transition: color .2s, border-color .2s, background-color .2s;
}
.theme-toggle:hover, .nav-toggle:hover {
  color: var(--fg); border-color: var(--line-strong); background: var(--panel-2);
}
.theme-toggle svg, .nav-toggle svg {
  width: 19px; height: 19px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  pointer-events: none;   /* the button is the target, never the icon path */
  stroke-linecap: round; stroke-linejoin: round;
}
/* One icon per theme. */
html[data-theme="light"] .theme-toggle .i-moon,
html[data-theme="dark"] .theme-toggle .i-sun { display: none; }

.nav-toggle { display: none; }

/* ----------------------------------------------------------------- shell */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100svh - var(--header-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 0 48px;
  scrollbar-width: thin;
}

.toc { display: flex; flex-direction: column; gap: 1px; }
.toc::before {
  content: "On this page";
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--fg-faint);
  padding: 0 0 12px 12px;
}
.toc a {
  text-decoration: none;
  font-size: 14px; line-height: 1.4;
  color: var(--fg-soft);
  padding: 7px 12px;
  border-left: 2px solid var(--line);
  transition: color .2s, border-color .2s, background-color .2s;
}
.toc a:hover { color: var(--fg); background: var(--panel-2); }
.toc a.is-active {
  color: var(--accent-text);
  border-left-color: var(--accent);
  background: var(--tint-accent);
  font-weight: 600;
}
/* nested entry, if a page wants h3-level anchors */
.toc a.sub { padding-left: 26px; font-size: 13px; }

.content {
  max-width: var(--measure);
  padding: 40px 0 96px;
  min-width: 0;
}

/* ------------------------------------------------------------ typography */
h1, h2, h3, h4 { font-stretch: 115%; text-wrap: balance; }

.content h1 {
  font-weight: 900; font-stretch: 122%; text-transform: uppercase;
  font-size: clamp(38px, 6.2vw, 68px);
  line-height: .94; letter-spacing: -.025em;
  margin-bottom: 22px;
}
.content h1 em, .content h2 em {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-stretch: 100%; text-transform: none; letter-spacing: 0;
  color: var(--accent-text);
}

.content h2 {
  font-weight: 900; font-stretch: 118%; text-transform: uppercase;
  font-size: clamp(25px, 3.2vw, 34px);
  line-height: 1.05; letter-spacing: -.015em;
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.content h3 {
  font-weight: 750; font-size: 19px; line-height: 1.3;
  letter-spacing: -.005em;
  margin: 34px 0 10px;
}
.content h4 {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--fg-faint);
  margin: 28px 0 8px;
}

.content > section > h2:first-child { margin-top: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }

.content p { margin: 0 0 16px; }
.content p:last-child { margin-bottom: 0; }

.lede {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.55;
  color: var(--fg-soft);
  max-width: 60ch;
  margin-bottom: 30px !important;
}

.content section[id] {
  scroll-margin-top: calc(var(--header-h) + 24px);
  margin-bottom: 68px;
}
.content section[id]:last-child { margin-bottom: 0; }

.content ul, .content ol {
  margin: 0 0 16px; padding-left: 1.35em;
}
.content li { margin-bottom: 7px; }
.content li::marker { color: var(--fg-faint); }

.content a:not(.card):not(.btn) {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  transition: text-decoration-color .2s;
}
.content a:not(.card):not(.btn):hover { text-decoration-color: currentColor; }

.content strong { font-weight: 700; color: var(--fg); }
.content em { font-style: italic; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

blockquote {
  border-left: 2px solid var(--line-strong);
  padding-left: 18px;
  margin: 0 0 20px;
  color: var(--fg-soft);
  font-family: var(--serif); font-style: italic; font-size: 19px;
}

/* ----------------------------------------------------------------- steps */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 26px;
  display: flex; flex-direction: column;
}
.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 24px 54px;
  margin: 0;
}
.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 1px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  letter-spacing: .02em;
  color: var(--accent-text);
  background: var(--tint-accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
/* connecting rail */
.steps > li::after {
  content: "";
  position: absolute; left: 17px; top: 42px; bottom: 6px;
  width: 1px; background: var(--line);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps > li > h3 { margin: 4px 0 8px; font-size: 18px; }
.steps > li > h3:first-child { margin-top: 4px; }
.steps > li > p { color: var(--fg-soft); }

/* -------------------------------------------------------------- callouts */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--tint-accent);
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 16px;
}
.callout > *:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent-text); }
.callout--tip { border-left-color: var(--accent); background: var(--tint-accent); }
.callout--tip strong { color: var(--accent-text); }
.callout--warn { border-left-color: var(--gold); background: var(--tint-warn); }
.callout--warn strong { color: var(--warn-text); }
.callout--danger { border-left-color: var(--danger); background: var(--tint-danger); }
.callout--danger strong { color: var(--danger); }

/* ----------------------------------------------------------- screenshots */
.shot {
  margin: 0 0 30px;
  display: flex; flex-direction: column; align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.shot img {
  max-width: 100%; height: auto;
  max-height: 620px;
  width: auto;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
/* Paired light/dark captures: show only the one matching the theme.
   An <img> with neither class shows in both. */
html[data-theme="light"] .shot img.s-dark,
html[data-theme="dark"] .shot img.s-light { display: none; }

/* Placeholder while no screenshot has been injected yet. */
.shot:not(:has(img))::before {
  content: attr(data-shot);
  display: grid; place-items: center;
  width: 100%; min-height: 120px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--fg-faint);
  background: var(--panel-2);
}
.shot figcaption {
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
  color: var(--fg-faint);
  text-align: center;
  max-width: 56ch;
}

/* Zoom overlay (built by guide.js) */
.zoom {
  position: fixed; inset: 0; z-index: 800;
  display: grid; place-items: center;
  padding: 4vmin;
  background: color-mix(in srgb, var(--bg) 88%, #000);
  cursor: zoom-out;
}
.zoom img {
  max-width: 100%; max-height: 92vh; width: auto; height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  cursor: zoom-out;
}

/* ---------------------------------------------------------------- tables */
.table-wrap {
  margin: 0 0 26px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.table-wrap th, .table-wrap td {
  text-align: left;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table-wrap thead th {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--fg-faint);
  white-space: nowrap;
  background: var(--panel-2);
}
.table-wrap tbody tr:nth-child(even) { background: var(--panel-2); }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap td { color: var(--fg-soft); }
.table-wrap td:first-child { color: var(--fg); font-weight: 600; }
/* Reference tables key on identifiers (env vars, commands). Breaking one mid
   token turns EXPIRY_CHECK_INTERVAL_SECONDS into two half-words, so the key
   column keeps them whole and the wrapper scrolls instead. */
.table-wrap td:first-child code { white-space: nowrap; word-break: normal; }
/* mono numerals */
.table-wrap td.num, .table-wrap th.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-wrap td { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- deflist */
.deflist {
  margin: 0 0 26px;
  display: grid;
  gap: 0;
}
.deflist dt {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-text);
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.deflist dt:first-of-type { padding-top: 0; border-top: 0; }
.deflist dd {
  margin: 6px 0 16px;
  color: var(--fg-soft);
}
.deflist dd:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- pills */
.pill {
  display: inline-block;
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  line-height: 1;
  padding: 5px 9px 4px;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--tint-accent);
  color: var(--accent-text);
  vertical-align: 2px;
  white-space: nowrap;
}
.pill--admin {
  border-color: color-mix(in srgb, var(--violet) 55%, transparent);
  background: color-mix(in srgb, var(--violet) 14%, transparent);
  color: color-mix(in srgb, var(--violet) 82%, var(--fg));
}
.pill--warn {
  border-color: color-mix(in srgb, var(--gold) 60%, transparent);
  background: var(--tint-warn);
  color: var(--warn-text);
}

/* ------------------------------------------------------ bot message quote */
.bot-msg {
  position: relative;
  margin: 0 0 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 4px 16px 16px 4px;
  background: var(--panel);
  font-size: 15.5px; line-height: 1.6;
  color: var(--fg);
}
/* Bot copy is indented inside the page source, so line breaks come from
   markup (<p> / <br>) rather than pre-wrap, which would leak indentation. */
.bot-msg p { margin: 0 0 10px; }
.bot-msg p:last-child { margin-bottom: 0; }
.bot-msg::before {
  content: "Bot message";
  display: block;
  font-family: var(--mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .24em; text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 10px;
}
.bot-msg > *:last-child { margin-bottom: 0; }
.bot-msg b, .bot-msg strong { font-weight: 700; }
.bot-msg code {
  background: var(--panel-2);
}

.btn-label {
  display: inline-block;
  font-family: var(--display); font-size: 13.5px; font-weight: 600;
  line-height: 1.25;
  padding: 6px 13px;
  margin: 4px 5px 0 0;
  border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--tint-accent);
  color: var(--accent-text);
  white-space: nowrap;
  vertical-align: middle;
}

/* -------------------------------------------------------------- code */
code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5px 6px;
  color: var(--accent-text);
  word-break: break-word;
}
pre {
  position: relative;
  margin: 0 0 26px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
pre code {
  display: block;
  background: none; border: 0; padding: 0;
  color: var(--fg);
  font-size: 13.5px; line-height: 1.7;
  white-space: pre;
  word-break: normal;
}

.copy-btn {
  position: absolute; top: 9px; right: 9px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg-faint);
  opacity: 0;
  transition: opacity .2s, color .2s, border-color .2s;
}
pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent-text); border-color: var(--accent); }
.copy-btn[data-copied] { color: var(--accent-text); border-color: var(--accent); opacity: 1; }

/* ------------------------------------------------------------------ faq */
.faq {
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.faq:first-of-type { border-top: 1px solid var(--line); }
.faq + :not(.faq) { margin-top: 26px; }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 0;
  font-weight: 650; font-size: 16.5px;
  transition: color .2s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "";
  flex: 0 0 auto;
  width: 9px; height: 9px;
  margin-top: 8px;
  border-right: 1.8px solid var(--accent);
  border-bottom: 1.8px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform .25s var(--ease);
}
.faq[open] summary::before { transform: rotate(45deg); }
.faq summary:hover { color: var(--accent-text); }
.faq > *:not(summary) {
  color: var(--fg-soft);
  padding-left: 23px;
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------- cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 14px;
  margin: 0 0 30px;
}
.card {
  display: flex; flex-direction: column; gap: 7px;
  text-decoration: none !important;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit !important;
  transition: transform .3s var(--ease), border-color .25s, box-shadow .3s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: var(--shadow);
}
.card h3 {
  margin: 0 !important;
  font-size: 17px; font-weight: 750;
  display: flex; align-items: center; gap: 8px;
}
.card h3::after {
  content: "\2192";
  font-family: var(--mono); font-weight: 400;
  color: var(--accent-text);
  transition: transform .3s var(--ease);
}
.card:hover h3::after { transform: translateX(4px); }
.card p {
  margin: 0 !important;
  font-size: 14.5px; line-height: 1.5;
  color: var(--fg-soft);
}

/* ---------------------------------------------------------------- footer */
.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 34px var(--pad);
  transition: background-color var(--theme-t) linear, border-color var(--theme-t) linear;
}
.foot-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px 34px;
  justify-content: space-between;
}
.foot-brand { display: inline-flex; align-items: center; gap: 9px; }
.foot-brand svg { width: 22px; height: 22px; color: var(--accent); }
.foot-brand b {
  font-stretch: 115%; font-weight: 800; font-size: 16px; text-transform: lowercase;
}
.foot-brand span {
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--fg-faint);
}
.foot-links {
  display: flex; flex-wrap: wrap; gap: 20px;
  font-family: var(--mono); font-size: 11.5px;
  letter-spacing: .12em; text-transform: uppercase;
}
.foot-links a { text-decoration: none; color: var(--fg-soft); transition: color .2s; }
.foot-links a:hover { color: var(--accent-text); }
.foot-meta {
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .06em; color: var(--fg-faint);
}

/* ------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .nav-toggle { display: grid; }
  /* The site nav stays put and scrolls sideways. Relocating it into the drawer
     is not possible in CSS alone (it lives in the header), and floating it as
     a panel would cover the drawer underneath. */
  .topnav {
    margin-left: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1 1 auto;
    /* flex-start, not flex-end: in a scroll container, overflow past the
       leading edge is unreachable, and the first links would be lost. */
    justify-content: flex-start;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav a { white-space: nowrap; padding: 8px 9px; }

  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }

  /* Drawer is deliberately not animated: an animating height races the
     browser's smooth-scroll to a tapped anchor and the jump lands short. */
  .sidebar {
    position: static;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border-bottom: 1px solid transparent;
  }
  body.nav-open .sidebar {
    max-height: 70svh;
    overflow-y: auto;
    padding: 20px 0;
    border-bottom-color: var(--line);
  }
  html.no-js .sidebar { max-height: none; overflow: visible; padding: 20px 0; }

  .content { padding-top: 28px; max-width: none; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .brand b, .brand span { display: none; }
  .steps > li { padding-left: 44px; }
  .steps > li::before { width: 28px; height: 28px; font-size: 11px; }
  .steps > li::after { left: 14px; top: 36px; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------- a11y/motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ------------------------------------------------------------------ print */
@media print {
  :root { --header-h: 0px; }
  html[data-theme="dark"] { --bg: #fff; --bg-2: #fff; --fg: #000; --fg-soft: #222; --fg-faint: #555; --line: #bbb; --accent-text: #000; --panel: #fff; --panel-2: #f4f4f4; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .topbar, .sidebar, .foot, .skip-link, .copy-btn, .zoom { display: none !important; }
  .shell { display: block; padding: 0; }
  .content { max-width: none; padding: 0; }
  .content section[id] { margin-bottom: 24pt; break-inside: avoid; }
  .content h2 { break-after: avoid; }
  .shot, .callout, .bot-msg, pre, .table-wrap, .card { break-inside: avoid; box-shadow: none; }
  .shot img { max-height: 400px; }
  .faq[open] > *, .faq > * { display: block !important; }
  .content a:not(.card)::after { content: " (" attr(href) ")"; font-family: var(--mono); font-size: 8pt; color: #555; }
  .content a[href^="#"]::after { content: ""; }
}
