/* Milton onboarding guide: the Start-here dark system.
   Palette, type and focus treatment are taken from the static hub at
   docs/onboarding-guide/index.html so every page on the estate reads as one
   site. Fonts are the platform's own; nothing here loads a webfont. */

:root {
  color-scheme: dark;

  /* Surfaces and text, from hub --bg / --card / --card-2 / --border / --text / --muted */
  --ink: #e6edf3;
  --ink-soft: #c9d1d9;
  --ink-mute: #9da7b3;
  --ink-faint: #8b949e;
  --rule: #30363d;
  --rule-soft: #242b34;
  --paper: #0d1117;
  --paper-2: #1c2129;
  --card: #161b22;

  /* Accent: hub --blue, with a brighter tone for link text on a card */
  --primary: #58a6ff;
  --primary-deep: #79c0ff;
  --primary-soft: #21436b;
  --primary-tint: #17253a;
  --ring: rgba(88, 166, 255, .30);

  /* Selected / current state, from hub --on-accent-bg / --on-accent-fg */
  --on-accent-bg: #21436b;
  --on-accent-fg: #cfe5ff;

  /* Neutral chip, matching the hub's inline-code fill */
  --chip-bg: #21262d;

  /* Orange is the hub's focus colour and is reserved for focus */
  --focus: #f7a14f;

  --warn-bg: #33260f;
  --warn-fg: #f0b866;
  --warn-rule: #9c7526;

  --tip-bg: #10281e;
  --tip-fg: #5eead4;
  --tip-rule: #358c69;

  --info-bg: #17253a;
  --info-fg: #79c0ff;
  --info-rule: #3d72ad;

  --code-bg: #010409;
  --code-fg: #e6edf3;
  --code-mute: #8b949e;
  --code-accent: #79c0ff;

  /* On a dark ground a light-ink shadow is invisible; depth comes from the
     border, so the shadow token resolves to none everywhere it is consumed. */
  --shadow-sm: none;

  /* Negative cues (the don'ts grid, the warn rule card) */
  --danger-bg: #2b1416;
  --danger-fg: #ff9a9a;
  --danger-rule: #5c2a2e;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Type: the hub's system stacks. No webfont, and no serif anywhere. */
  --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

/* CJK font tweaks */
:root[lang="zh-Hans"], :root[lang="zh-Hant"] {
  --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", Helvetica, Arial, sans-serif;
}
:root[lang="zh-Hant"] {
  --f-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", "Hiragino Sans CNS", "Noto Sans CJK TC", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

::selection { background: var(--primary-soft); color: var(--ink); }

a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-deep); }

code.ic, code {
  font-family: var(--f-mono);
  font-size: .88em;
  background: var(--chip-bg);
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--rule);
  color: var(--ink);
  word-break: break-word;
}

/* ---------- Header ---------- */
.page-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(13, 17, 23, .92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--rule);
}
.page-head-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.brand-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: .02em;
}

/* Lang toggle */
.lang { display: flex; align-items: center; gap: 12px; }
.lang-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.lang-segments {
  display: inline-flex;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
}
.lang-seg {
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink-mute);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  min-width: 58px;
  white-space: nowrap;
}
.lang-seg-label { white-space: nowrap; }
.lang-seg:hover { color: var(--ink); background: var(--rule-soft); }
.lang-seg.is-on {
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
}

/* ---------- Hero ---------- */
.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px 28px;
}
/* Heading and lede run full width; the step list and the diagram share the row
   below it, the list kept narrow so the diagram gets the space it needs. */
.hero-lower {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: start;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.badge {
  background: var(--chip-bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .04em;
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.hero-time, .hero-aud { white-space: nowrap; }
.hero-time {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--ink-soft);
}
.hero-aud {
  font-size: 13px;
  color: var(--ink-mute);
}
.hero-title {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 0 0 18px;
  color: var(--ink);
  text-wrap: balance;
  max-width: 620px;
}
.hero-lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 840px;
  margin: 0 0 30px;
}
.hero-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 2px solid var(--rule);
  padding-left: 16px;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  padding: 7px 12px 7px 0;
  border-radius: var(--r-md);
  transition: all .15s ease;
  margin-left: -2px;
  border-left: 2px solid transparent;
  padding-left: 14px;
}
.hero-pill:hover {
  border-left-color: var(--primary);
  color: var(--primary-deep);
}
.hero-pill-n {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: .04em;
}
.hero-pill-l {
  font-weight: 500;
  font-size: 14.5px;
}

/* ---------- Diagram ---------- */
.diagram {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}
.diagram-title {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
}
.diagram-figure { min-width: 0; }
.diagram-svg { width: 100%; height: auto; display: block; }

.diagram-svg .zone-laptop { fill: var(--rule-soft); }
.diagram-svg .zone-cloud {
  fill: var(--primary-tint);
  stroke: var(--primary-soft);
  stroke-width: 1;
}
.diagram-svg .zone-label {
  fill: var(--ink-mute);
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.diagram-svg .zone-label-mine { fill: var(--primary-deep); }

.diagram-svg .node {
  fill: var(--card);
  stroke: var(--rule);
  stroke-width: 1.2;
}
.diagram-svg .node-door { stroke: var(--primary-soft); stroke-width: 1.4; }
.diagram-svg .node-frame { fill: none; stroke: var(--primary); stroke-width: 1.4; }
.diagram-svg .node-claude { fill: var(--primary-soft); stroke: var(--primary); stroke-width: 1.4; }
.diagram-svg .node-files { stroke: var(--primary-soft); stroke-width: 1.4; }

.diagram-svg .node-title {
  font-family: var(--f-sans);
  font-weight: 600;
  font-size: 14px;
  fill: var(--ink);
  text-anchor: middle;
}
.diagram-svg .node-sub {
  font-family: var(--f-sans);
  font-size: 11.5px;
  fill: var(--ink-mute);
  text-anchor: middle;
}
.diagram-svg .node-sub-claude { fill: var(--primary-deep); }

.diagram-svg .arrow {
  stroke: var(--ink-faint);
  stroke-width: 1.5;
  fill: none;
}
.diagram-svg .ah { fill: var(--ink-faint); }
.diagram-svg .arrow-back {
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
  fill: none;
}
.diagram-svg .ah-back { fill: var(--primary); }
.diagram-svg .arrow-label {
  font-family: var(--f-sans);
  font-weight: 500;
  font-size: 10.5px;
  fill: var(--ink-mute);
  text-anchor: middle;
}
.diagram-svg .arrow-label-back { fill: var(--primary-deep); }

/* "What this means for you" — the plain-language payoff under the drawing */
.diagram-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 22px;
}
.diagram-note { border-top: 2px solid var(--primary); padding-top: 11px; }
.diagram-note h4 {
  margin: 0 0 5px;
  font: 600 13.5px/1.35 var(--f-sans);
  color: var(--ink);
}
.diagram-note p {
  margin: 0;
  font: 400 12.5px/1.5 var(--f-sans);
  color: var(--ink-mute);
}

/* ---------- Page grid ---------- */
.page-grid {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 32px 96px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 124px;
  align-self: start;
}
.toc-label {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 14px;
  padding: 0 12px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  border-left: 1px solid var(--rule);
}
.toc-list li {
  position: relative;
}
.toc-list li a {
  display: block;
  padding: 6px 12px;
  text-decoration: none;
  font-size: 13.5px;
  color: var(--ink-mute);
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: all .15s ease;
}
.toc-list li a:hover { color: var(--ink); }
/* Setup is an ordered list, so the numbers are the list's own, not baked into
   the labels. Tips is a <ul> and gets none. */
ol.toc-list { counter-reset: toc-step; }
ol.toc-list li a::before {
  counter-increment: toc-step;
  content: counter(toc-step, decimal-leading-zero) "\00a0\00a0";
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
}
ol.toc-list li.is-active a::before { color: var(--primary); }
.toc-list li.is-active a {
  color: var(--primary-deep);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* ---------- Atoms ---------- */
.kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Step blocks ---------- */
.main { min-width: 0; }

.step, .block {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 124px;
}

.step-head {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 22px;
  margin-bottom: 22px;
}
.step-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.step-time {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-left: auto;
  background: var(--rule-soft);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.step-meta .kicker { white-space: nowrap; }
.step-title {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.22;
  letter-spacing: -0.008em;
  margin: 0 0 10px;
  color: var(--ink);
  text-wrap: balance;
}
.step-why {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
  max-width: 60ch;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  counter-reset: stepc;
  display: grid;
  gap: 14px;
}
.step-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 16px;
  align-items: start;
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}
.step-item:first-child { border-top: 0; padding-top: 0; }

.step-bullet {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--rule);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-mute);
  margin-top: 1px;
}
.step-item-body h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
  letter-spacing: -.005em;
}
.step-item-body p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Block-style sections (daily, stop, etc.) */
.block-head { margin-bottom: 20px; }
.block-head h2 {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 25px;
  line-height: 1.22;
  letter-spacing: -0.008em;
  margin: 6px 0 8px;
  color: var(--ink);
  text-wrap: balance;
}
.block-lede {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.55;
  max-width: 64ch;
}

/* ---------- Callouts ---------- */
.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  border-radius: var(--r-md);
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid;
}
.callout-tag {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  align-self: start;
  margin-top: 2px;
}

.callout-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-rule); }
.callout-warn .callout-tag { background: var(--warn-fg); color: var(--warn-bg); }

.callout-tip { background: var(--tip-bg); color: var(--tip-fg); border-color: var(--tip-rule); }
.callout-tip .callout-tag { background: var(--tip-fg); color: var(--tip-bg); }

.callout-info { background: var(--info-bg); color: var(--info-fg); border-color: var(--info-rule); }
.callout-info .callout-tag { background: var(--info-fg); color: var(--info-bg); }

.callout-body { color: inherit; }

/* ---------- Cmd ---------- */
.cmd {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 14px 0;
  font-family: var(--f-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow-x: auto;
  border: 1px solid var(--rule);
}
.cmd-line { display: grid; grid-template-columns: 28px 18px 1fr; align-items: baseline; }
.cmd-gutter { color: var(--code-mute); user-select: none; font-size: 11.5px; }
.cmd-prompt { color: var(--code-accent); }
.cmd-text { color: var(--code-fg); white-space: pre; }
/* Cheatsheet plain-English prompts can wrap so long sentences don't overflow */
.cheat .cmd-text { white-space: pre-wrap; word-break: break-word; }

/* ---------- Screenshot slots ---------- */
.ss-figure {
  margin: 22px 0 0;
  padding: 0;
  display: block;
  --aspect: 16/10;
}
.ss-figure image-slot {
  display: block;
  width: 100%;
  /* <image-slot> sets height:160px on :host; an explicit height beats
     aspect-ratio, so reset it or every standalone slot collapses to a short
     band with the image shrunk inside it. */
  height: auto;
  aspect-ratio: var(--aspect);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--paper-2) 0%, var(--paper) 100%);
  border: 1.5px dashed var(--rule);
  outline: none;
}
/* When a real screenshot is loaded, give the slot a plain dark mat instead of
   the dashed placeholder frame. The slot keeps its aspect-ratio so layout is
   stable; with fit="contain" any extra space becomes intentional matting,
   not awkward empty bands. */
.ss-figure.ss-has-image image-slot {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.ss-figure image-slot { color: var(--ink-mute); }

/* Screenshot pairs, captions heading each image. Stacked by default so each
   image gets the full column; `split` sets them side by side. */
.ss-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin: 22px 0 0;
  align-items: stretch;
}
.ss-pair-split { grid-template-columns: var(--ss-cols, 1fr 1fr); gap: 20px; }
.ss-pair .ss-figure { margin-top: 0; display: flex; flex-direction: column; }
.ss-pair .ss-figure image-slot { flex: 1; }
/* Side by side, reserve two lines so a caption that wraps doesn't push its image
   out of line with the one beside it. */
.ss-pair-split .ss-caption { min-height: 34px; align-items: flex-start; }
/* Two columns of this width stop being legible on a phone */
@media (max-width: 720px) {
  .ss-pair-split { grid-template-columns: 1fr; }
  .ss-pair-split .ss-caption { min-height: 0; }
}

.ss-caption {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--ink-mute);
}
.ss-marker {
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: var(--chip-bg);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 3px 8px;
  border-radius: 4px;
}
.ss-label { color: var(--ink-soft); font-weight: 500; }
.ss-hint { color: var(--ink-faint); }

/* ---------- Path tabs (Claude step A/B) ---------- */
.path-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 18px;
}
.path-tab {
  appearance: none;
  border: 1.5px solid var(--rule);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 16px 18px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  color: var(--ink);
}
.path-tab:hover {
  border-color: var(--primary);
  background: var(--card);
}
.path-tab.is-on {
  border-color: var(--primary);
  background: var(--primary-tint);
  box-shadow: 0 0 0 4px var(--ring);
}
.path-tab-letter {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--chip-bg);
  color: var(--ink);
  display: grid; place-items: center;
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 14px;
}
.path-tab.is-on .path-tab-letter {
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
}
.path-tab-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.path-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 24px 26px;
  margin-bottom: 18px;
}
.path-note {
  margin: 0 0 16px;
  padding: 0 0 14px;
  border-bottom: 1px dashed var(--rule);
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.trouble-mini {
  margin-top: 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--primary);
  border-radius: var(--r-md);
  padding: 14px 18px;
}
.trouble-mini-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.trouble-mini .cmd { margin: 8px 0 0; }

/* ---------- Daily / ways ---------- */
.ways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 4px 0 24px;
}
.way {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.way-num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.way-name {
  font-family: var(--f-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--primary-deep);
}
.way-role {
  font-size: 12px;
  color: var(--ink-mute);
  margin: 2px 0 10px;
}
.way-desc {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.git-config {
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}
.git-config h4 {
  font-size: 15.5px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--ink);
}
.git-config p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* ---------- Stop flow ---------- */
.stop-flow {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin: 20px 0 24px;
}
.stop-node {
  flex: 1 1 0;
  min-width: 130px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stop-node-i {
  font-family: var(--f-mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: .12em;
}
.stop-node-l {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.stop-node.is-running { border-color: var(--tip-rule); background: var(--tip-bg); }
.stop-node.is-running .stop-node-l { color: var(--tip-fg); }
.stop-node.is-stopped { border-color: var(--rule); background: var(--rule-soft); }
.stop-node.is-stopped .stop-node-l { color: var(--ink-mute); }
.stop-node.is-resumed { border-color: var(--primary); background: var(--primary-tint); }
.stop-node.is-resumed .stop-node-l { color: var(--primary-deep); }

.stop-arrow {
  display: grid; place-items: center;
  color: var(--ink-faint);
  font-size: 18px;
  padding: 0 2px;
}

.bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.bullets li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
  border-top: 1px dashed var(--rule);
}
.bullets li:first-child { border-top: 0; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: 16px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

/* ---------- Table ---------- */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}
.tbl th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--rule);
  background: var(--paper-2);
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  color: var(--ink-soft);
  line-height: 1.55;
}
.tbl tr:hover td { background: var(--paper-2); }
.tbl td:first-child { color: var(--ink); font-weight: 500; width: 36%; }

/* ---------- Don'ts ---------- */
.donts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dont {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 16px 18px;
}
.dont-x {
  width: 26px; height: 26px;
  border-radius: 6px;
  background: var(--danger-bg);
  color: var(--danger-fg);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--danger-rule);
}
.dont h4 {
  margin: 0 0 4px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
}
.dont p {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-lower { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .diagram-notes { grid-template-columns: 1fr 1fr; }
  .page-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .toc-list { display: flex; flex-direction: row; flex-wrap: wrap; border-left: 0; gap: 4px; }
  .toc-list li a { border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; }
  .toc-list li.is-active a { border-color: var(--primary); background: var(--primary-tint); }
  .ways { grid-template-columns: 1fr; }
  .donts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-head-inner { flex-wrap: wrap; padding: 12px 18px; }
  .hero { padding: 36px 20px 16px; }
  .diagram { padding: 22px 20px; }
  /* The drawing has a floor below which its labels stop being readable —
     let it scroll sideways inside its own box rather than shrink further. */
  .diagram-figure { overflow-x: auto; }
  .diagram-svg { min-width: 600px; }
  .diagram-notes { grid-template-columns: 1fr; gap: 18px; }
  .page-grid { padding: 16px 20px 64px; gap: 24px; }
  .step, .block { padding: 24px 22px; }
  .step-title { font-size: 22px; }
  .block-head h2 { font-size: 21px; }
  .path-tabs { grid-template-columns: 1fr; }
  .stop-flow { flex-direction: column; }
  .stop-arrow { transform: rotate(90deg); padding: 4px 0; }
  .lang-label { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   HOW-IT-WORKS SECTIONS
   Tools / Saving / GitHub / Workflow / Rules / Commands / Setup
   ───────────────────────────────────────────────────────────── */

.hiw-block .sub-h {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.004em;
  margin: 28px 0 14px;
  color: var(--ink);
}

/* Tools */
.tools-groups { display: flex; flex-direction: column; gap: 28px; }
.tools-group-name {
  font: 500 11px/1 var(--f-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.tool-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 16px 16px 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 8px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.tool-card:hover {
  border-color: var(--primary);
}
.tool-glyph {
  grid-row: 1 / span 2;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--primary-tint);
  color: var(--primary-deep);
  border-radius: 9px;
  font-size: 20px;
  line-height: 1;
}
.tool-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-name { font: 600 14.5px/1.3 var(--f-sans); color: var(--ink); }
.tool-role { font: 500 11.5px/1.3 var(--f-sans); color: var(--primary-deep); letter-spacing: 0.01em; }
.tool-desc { grid-column: 1 / -1; font: 400 13px/1.55 var(--f-sans); color: var(--ink-soft); }

a.tool-card-link { text-decoration: none; color: inherit; cursor: pointer; }
a.tool-card-link:hover .tool-name { color: var(--primary-deep); }

.claude-ways {
  margin-top: 32px;
  padding: 20px 22px 22px;
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-lg);
}
.ways-title {
  font-family: var(--f-sans);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 14px;
  color: var(--primary-deep);
}
.claude-ways-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.claude-way {
  background: var(--card);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 10px;
  row-gap: 4px;
}
.claude-way-glyph {
  grid-row: 1 / span 2;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 16px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-radius: 7px;
  line-height: 1;
}
.claude-way-name { font: 600 13.5px/1.3 var(--f-sans); color: var(--ink); }
.claude-way-desc { font: 400 12.5px/1.55 var(--f-sans); color: var(--ink-soft); grid-column: 1 / -1; }

/* Saving */
.two-kinds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
.two-kind {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
  position: relative;
}
.two-kind-0 { border-left: 4px solid #484f58; }
.two-kind-1 { border-left: 4px solid var(--primary); background: linear-gradient(180deg, var(--primary-tint) 0%, var(--card) 60%); }
.two-kind-tag {
  font: 600 13px/1.2 var(--f-sans);
  color: var(--ink);
  margin-bottom: 4px;
}
.two-kind-trigger {
  font: 500 11.5px/1.2 var(--f-mono);
  color: var(--ink-mute);
  margin-bottom: 10px;
  letter-spacing: 0;
}
.two-kind-desc { font: 400 14px/1.55 var(--f-sans); color: var(--ink-soft); margin: 0; }

.analogy-box {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 14px 0;
}
.analogy-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
}
.analogy-box p {
  margin: 0;
  font: 500 14px/1.5 var(--f-sans);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.save-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 10px;
  margin: 14px 0 18px;
}
.save-flow-node {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 12px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 88px;
  justify-content: center;
}
.save-flow-node-0 { border-color: var(--rule); }
.save-flow-node-1 { border-color: var(--primary-soft); background: var(--primary-tint); }
.save-flow-node-2 { border-color: var(--warn-rule); background: var(--warn-bg); }
.save-flow-node-3 { border-color: var(--info-rule); background: var(--info-bg); }
.save-flow-node-4 { border-color: var(--tip-rule); background: var(--tip-bg); }
.save-flow-i {
  font: 600 10px/1 var(--f-mono);
  color: var(--ink-mute);
  letter-spacing: 0.1em;
}
.save-flow-tag { font: 600 13px/1.3 var(--f-sans); color: var(--ink); }
.save-flow-note { font: 400 11.5px/1.35 var(--f-sans); color: var(--ink-mute); }
.save-flow-arrow {
  display: grid; place-items: center;
  font: 400 18px/1 var(--f-sans);
  color: var(--ink-faint);
  padding: 0 2px;
}

/* GitHub & PRs */
.vs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin: 14px 0 4px;
}
.vs-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 18px 18px 16px;
}
.vs-card-0 { border-top: 3px solid #484f58; }
.vs-card-1 { border-top: 3px solid var(--primary); background: var(--primary-tint); }
.vs-card-tag { font: 600 14px/1.3 var(--f-sans); color: var(--ink); margin-bottom: 6px; }
.vs-card p { margin: 0; font: 400 13.5px/1.55 var(--f-sans); color: var(--ink-soft); }
.vs-divider {
  display: grid;
  place-items: center;
  position: relative;
}
.vs-divider span {
  font: 600 11px/1 var(--f-sans);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--card);
  padding: 6px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  z-index: 1;
}
.vs-divider::before {
  content: "";
  position: absolute;
  top: 50%; left: -2px; right: -2px;
  height: 1px;
  background: var(--rule);
}

.branches-card {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 14px 0 0;
}
.branches-svg { width: 100%; height: auto; max-height: 240px; display: block; }
.branch-main { stroke: var(--tip-fg); stroke-width: 3; stroke-linecap: round; }
.branch-feature { stroke: var(--primary-deep); stroke-width: 2; stroke-linecap: round; fill: none; }
.branch-feature.dashed { stroke-width: 1.5; stroke-dasharray: 5,3; }
.branch-dot { fill: var(--tip-fg); }
.branch-dot.feature { fill: var(--primary-deep); }
.branch-dot.merge { stroke: var(--card); stroke-width: 2; }
.branch-label { font: 700 12px/1 var(--f-mono); fill: var(--ink); }
.branch-label.main { fill: var(--tip-fg); }
.branch-label.feature { fill: var(--primary-deep); }
.branch-sub { font: 400 10px/1 var(--f-sans); fill: var(--ink-mute); }
.branch-merge-label { font: 600 10px/1 var(--f-sans); fill: var(--tip-fg); text-anchor: middle; }

/* Workflow pipeline */
.wf-pipeline {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}
.wf-group {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: stretch;
}
.wf-group-rail {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 12px;
  position: relative;
  display: flex;
  align-items: flex-start;
}
.wf-group-label {
  font: 700 12px/1 var(--f-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-mute);
  writing-mode: horizontal-tb;
}
.wf-group-plan .wf-group-rail { border-left: 3px solid var(--primary); background: var(--primary-tint); }
.wf-group-plan .wf-group-label { color: var(--primary-deep); }
.wf-group-build .wf-group-rail { border-left: 3px solid var(--tip-rule); background: var(--tip-bg); }
.wf-group-build .wf-group-label { color: var(--tip-fg); }
.wf-group-ship .wf-group-rail { border-left: 3px solid var(--warn-rule); background: var(--warn-bg); }
.wf-group-ship .wf-group-label { color: var(--warn-fg); }

.wf-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wf-step {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: start;
}
.wf-step-n {
  font: 700 13px/1 var(--f-mono);
  color: var(--ink-mute);
  letter-spacing: 0.05em;
  padding-top: 3px;
  text-align: center;
}
.wf-step-body h4 {
  margin: 0 0 4px;
  font: 600 14.5px/1.35 var(--f-sans);
  color: var(--ink);
}
.wf-step-body p {
  margin: 0;
  font: 400 13px/1.55 var(--f-sans);
  color: var(--ink-soft);
}

.wf-strip {
  margin-top: 22px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 16px 16px 18px;
}
.wf-strip-title {
  font: 600 12px/1 var(--f-sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.wf-strip-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.wf-strip-cell {
  font: 600 12px/1.2 var(--f-sans);
  color: var(--ink);
  padding: 8px 12px;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  white-space: nowrap;
}
.wf-strip-cell:nth-of-type(8n+1),
.wf-strip-cell:nth-of-type(8n+2) { background: var(--primary-tint); border-color: var(--primary-soft); color: var(--primary-deep); }
.wf-strip-cell:nth-of-type(8n+3) { background: var(--tip-bg); border-color: var(--tip-rule); color: var(--tip-fg); }
.wf-strip-cell:nth-of-type(8n+4) { background: var(--warn-bg); border-color: var(--warn-rule); color: var(--warn-fg); }
.wf-strip-cell:last-of-type { background: var(--on-accent-bg); color: var(--on-accent-fg); border-color: #3d6398; }
.wf-strip-arrow {
  font: 500 14px/1 var(--f-sans);
  color: var(--ink-faint);
}

/* Best practices */
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.rule {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 16px 16px 14px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  border-left: 3px solid var(--rule);
}
.rule-plan  { border-left-color: var(--primary); }
.rule-build { border-left-color: var(--tip-fg); }
.rule-ship  { border-left-color: var(--warn-fg); }
.rule-warn  { border-left-color: var(--danger-fg); }
.rule-glyph {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  background: var(--paper-2);
  border-radius: 9px;
  font: 700 18px/1 var(--f-mono);
  color: var(--ink);
}
.rule-plan  .rule-glyph { background: var(--primary-tint); color: var(--primary-deep); }
.rule-build .rule-glyph { background: var(--tip-bg); color: var(--tip-fg); }
.rule-ship  .rule-glyph { background: var(--warn-bg); color: var(--warn-fg); }
.rule-warn  .rule-glyph { background: var(--warn-bg); color: var(--warn-fg); }
.rule-body h4 {
  margin: 0 0 4px;
  font: 600 14px/1.35 var(--f-sans);
  color: var(--ink);
}
.rule-body p {
  margin: 0;
  font: 400 13px/1.55 var(--f-sans);
  color: var(--ink-soft);
}

/* Cheatsheet */
.cheats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.cheat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cheat-name {
  font: 600 13px/1 var(--f-sans);
  letter-spacing: 0.05em;
  color: var(--ink);
}
.cheat .cmd { margin: 0; }
.cmd.cmd-rich .cmd-line.is-comment .cmd-text { color: var(--code-mute); font-style: italic; }
.cmd.cmd-rich .cmd-line.is-prompt .cmd-prompt { color: var(--code-accent); }
.cmd.cmd-rich .cmd-line.is-prompt .cmd-text { color: var(--code-accent); }

/* Setup */
.rule-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 6px 0 8px;
}
.rule-type {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rule-type-0 { border-left: 4px solid #484f58; }
.rule-type-1 { border-left: 4px solid var(--primary); background: linear-gradient(180deg, var(--primary-tint) 0%, var(--card) 70%); }
.rule-type-tag { font: 600 14px/1.2 var(--f-sans); color: var(--ink); }
.rule-type-path {
  font: 500 12.5px/1 var(--f-mono);
  color: var(--primary-deep);
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
  border-radius: 6px;
  padding: 4px 8px;
  align-self: flex-start;
}
.rule-type p { margin: 0; font: 400 13px/1.55 var(--f-sans); color: var(--ink-soft); }

.does-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
.does {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 14px 14px 12px;
  border-top: 2px solid var(--primary);
}
.does-tag { font: 600 13.5px/1.2 var(--f-sans); color: var(--primary-deep); margin-bottom: 4px; }
.does p { margin: 0; font: 400 12.5px/1.55 var(--f-sans); color: var(--ink-soft); }

/* Mobile / narrow */
@media (max-width: 880px) {
  .save-flow { grid-template-columns: 1fr; }
  .save-flow-arrow { transform: rotate(90deg); padding: 4px 0; }
  .two-kinds, .vs-row, .rule-types, .cheats { grid-template-columns: 1fr; }
  .vs-divider { transform: rotate(0); padding: 4px 0; }
  .vs-divider::before { display: none; }
  .wf-group { grid-template-columns: 1fr; }
  .wf-group-rail { padding: 8px 12px; }
}

/* Print. The screen palette is dark; on paper that is a full-bleed black page,
   so the tokens are restated light for print only. */
@media print {
  :root {
    color-scheme: light;
    --ink: #15161a;
    --ink-soft: #3b3d44;
    --ink-mute: #55585f;
    --ink-faint: #6b6e77;
    --rule: #c9c9c9;
    --rule-soft: #e8e8e8;
    --paper: #ffffff;
    --paper-2: #f4f4f4;
    --card: #ffffff;
    --chip-bg: #f0f0f0;
    --on-accent-bg: #e6effb;
    --on-accent-fg: #10365f;
    --primary: #1f5fbf;
    --primary-deep: #12447f;
    --primary-soft: #dde8f8;
    --primary-tint: #f2f6fd;
    --warn-bg: #fdf3e0; --warn-fg: #6b4300; --warn-rule: #d9b463;
    --tip-bg: #e7f5ef; --tip-fg: #0c5a45; --tip-rule: #8ec7b0;
    --info-bg: #eaf2fd; --info-fg: #12447f; --info-rule: #9cbde8;
    --code-bg: #f4f4f4; --code-fg: #15161a; --code-mute: #6b6e77; --code-accent: #12447f;
    --danger-bg: #fceeee; --danger-fg: #b23a3a; --danger-rule: #f0d2d2;
  }
  .page-head, .sidebar { display: none; }
  body { background: var(--paper); color: var(--ink); }
  .step, .block { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  .page-grid { grid-template-columns: 1fr; padding: 0 24px; }
  .hiw-block { page-break-inside: avoid; }
  .wf-step, .tool-card, .rule, .vs-card, .save-flow-node { page-break-inside: avoid; }
}

/* 3D git-flow walkthrough link card (gh section) */
.flow3d-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 14px 0;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.flow3d-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.flow3d-glyph {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-radius: 50%;
  font-size: 14px;
}
.flow3d-title { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.flow3d-desc { margin: 0; font-size: 13.5px; color: var(--ink-mute); line-height: 1.5; }
.flow3d-cta {
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--primary-deep);
}
@media (max-width: 720px) {
  .flow3d-card { grid-template-columns: 36px 1fr; }
  .flow3d-cta { grid-column: 2; }
}

/* Mei architecture explainer link card (quality section) */
.mei-card {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--primary-tint);
  border: 1px solid var(--primary-soft);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 14px 0;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mei-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.mei-glyph {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary-deep);
  border-radius: 50%;
  font-size: 14px;
}
.mei-title { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.mei-desc { margin: 0; font-size: 13.5px; color: var(--ink-mute); line-height: 1.5; }
.mei-cta {
  white-space: nowrap;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--primary-deep);
}
@media (max-width: 720px) {
  .mei-card { grid-template-columns: 36px 1fr; }
  .mei-cta { grid-column: 2; }
}

/* ---------- Track nav ---------- */
.page-head-tracks {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px 12px;
}
.tracks ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.tracks a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
}
.tracks a:hover { border-color: var(--primary); color: var(--primary-deep); }
.tracks a[aria-current="page"] {
  background: var(--on-accent-bg);
  color: var(--on-accent-fg);
  border-color: #3d6398;
  font-weight: 600;
}
.tracks .ext { color: var(--ink-faint); font-size: 12px; }
.tracks a[aria-current="page"] .ext { color: var(--on-accent-fg); }

/* ---------- Landmarks and focus ---------- */
main:focus { outline: none; }

/* /tips has no diagram, so its head is the title block alone. */
.hero-tips { padding-bottom: 8px; }

/* The pre-Babel placeholder heading, replaced the moment the app mounts. */
.boot-h1 { max-width: 1280px; margin: 56px auto 0; padding: 0 32px; }

.skipLink {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  text-decoration: none;
}
.skipLink:focus { top: 8px; }

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

/* Jumping from the contents list moves focus to the heading, which is not in
   the tab order. Without a ring, a sighted keyboard user loses their place. */
.step-title[tabindex="-1"]:focus,
.block-head h2[tabindex="-1"]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 6px;
  border-radius: 4px;
}

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

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

/* The two-hop diagram in the coder-claude deep dive. Three boxes, two labelled arrows. */
.hop { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 12px; align-items: center; margin: 18px 0 14px; }
.hop-box { background: var(--paper-2); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 16px; font-size: 14px; line-height: 1.55; }
.hop-k { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 6px; }
.hop-arrow { font-family: var(--f-mono); font-size: 12px; color: var(--ink-mute); text-align: center; }
@media (max-width: 640px) { .hop { grid-template-columns: 1fr; } .hop-arrow { padding: 2px 0; } }
