@view-transition {
  navigation: auto;
}

:root {
  --ink: #171717;
  --muted: #656565;
  --line: #d9d9d9;
  --soft: #f5f5f6;
  --accent: #4e04eb;
}

* {
  box-sizing: border-box;
}

html {
  background: #e5e7eb;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

a {
  color: inherit;
  text-underline-offset: 2px;
}

.sheet {
  width: min(1220px, calc(100% - 40px));
  min-height: 1180px;
  margin: 20px auto;
  padding: 28px 48px 34px;
  background: #fff;
  box-shadow: 0 10px 32px rgb(17 17 17 / 9%);
}

.landing-sheet {
  min-height: 0;
  padding-top: 24px;
  padding-bottom: 24px;
}

.landing-sheet header,
.configuration-sheet header,
.guide-sheet header {
  align-items: center;
  padding-bottom: 12px;
  border-bottom-color: #b9b9bf;
}

header,
footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

header {
  position: sticky;
  z-index: 20;
  top: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
  background: #fff;
}

.brand {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.05em;
  text-decoration: none;
  view-transition-name: brand;
}

.version {
  margin-left: 6px;
  color: var(--accent);
  font-size: 10px;
}

header p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: 10px;
}

nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}

.github {
  display: inline-flex;
  width: 17px;
  height: 17px;
}

.github svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

main {
  padding-top: 24px;
}

.landing {
  padding-top: 20px;
}

.paper-copy {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12px, 0.98vw, 13.5px);
  line-height: 1.43;
}

.paper-column {
  min-width: 0;
}

.paper-column h2 {
  margin: 0 0 6px;
  color: #4317a5;
  font-size: clamp(13.5px, 1.08vw, 14.5px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-transform: none;
}

.paper-column h2:not(:first-child) {
  margin-top: 13px;
}

.paper-copy p {
  margin: 0;
  color: #29292c;
  font-size: inherit;
  line-height: inherit;
  text-align: left;
  text-align-last: left;
  text-wrap: pretty;
  hyphens: none;
  orphans: 3;
  widows: 3;
}

.paper-column p + p {
  margin-top: 10px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

h1 {
  font-size: 29px;
}

h2 {
  font-size: 18px;
}

section > p:not(.eyebrow) {
  margin: 9px 0 0;
  color: #454545;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

pre {
  margin: 10px 0 0;
  padding: 13px;
  overflow-x: auto;
  border: 0;
  border-radius: 3px;
  background: #111827;
  color: #f9fafb;
  font-size: 10px;
  line-height: 1.55;
}

table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 10px;
}

th,
td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  width: 43%;
}

td {
  color: var(--muted);
}

.sync {
  display: grid;
  grid-template-columns: minmax(0, 820px) minmax(200px, 1fr);
  gap: 18px;
  align-items: center;
  margin: 12px 0 0;
  padding: 12px 16px 10px;
  border-radius: 2px;
  background: #f7f7f9;
}

.sync-diagram {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  overflow: visible;
}

.sync figcaption {
  display: block;
  width: auto;
  margin: 0;
  padding: 4px 8px 4px 0;
  color: #626268;
  font-size: 12px;
  line-height: 1.52;
}

.caption-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  color: #4317a5;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.caption-copy {
  display: block;
  max-width: 32ch;
}

@media (max-width: 850px) {
  .sync {
    display: block;
  }

  .sync figcaption {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    margin-top: 7px;
    padding: 8px 2px 0;
  }

  .caption-label {
    display: inline-block;
    margin-bottom: 0;
    padding: 1px 0;
  }

  .caption-copy {
    max-width: 92ch;
  }
}

.sync-diagram .lane {
  fill: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.sync-diagram .box rect {
  fill: #fff;
  stroke: #aaa;
}

.sync-diagram .box.accent rect {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.sync-diagram .box text {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.sync-diagram .box .sub {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.sync-diagram .edge {
  fill: none;
  stroke: #777;
  stroke-width: 1.1;
  marker-end: url(#arrow);
}

.sync-diagram .return-edge {
  stroke-dasharray: 3 3;
}

.sync-diagram marker path {
  fill: #777;
}

.sync-diagram .edge-label {
  fill: var(--muted);
  font-size: 7px;
  text-anchor: middle;
}

footer {
  justify-content: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.2;
}

.footer-credit .heart {
  flex: 0 0 auto;
  position: relative;
  top: -2px;
  color: #6249d8;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1;
  transform-origin: center;
  transition: color 160ms ease;
}

.footer-credit:hover .heart {
  color: #f05b7f;
}

.asterisk-credit {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.asterisk-credit img {
  display: block;
  width: 112px;
  height: auto;
  opacity: 0.88;
  transition: opacity 160ms ease;
}

.asterisk-credit:hover img,
.asterisk-credit:focus-visible img {
  opacity: 1;
}

.landing-sheet footer {
  margin-top: 12px;
  border-top: 0;
}

.configuration-sheet {
  min-height: 1180px;
}

.configuration-page {
  padding-top: 28px;
}

.configuration-page .docs-layout {
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 40px;
}

.configuration-page .docs-nav {
  padding-top: 10px;
  border-top: 3px solid var(--accent);
}

.configuration-page .docs-nav p {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.configuration-page .docs-nav a {
  padding: 4px 0;
  font-size: 10px;
  line-height: 1.35;
  text-decoration: none;
}

.configuration-page .docs-nav a:hover {
  color: var(--accent);
}

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

.docs-nav {
  position: sticky;
  top: 76px;
}

.docs-nav p {
  margin: 0 0 7px;
  font-weight: 700;
}

.docs-nav a {
  display: block;
  padding: 3px 0;
  color: var(--muted);
  font-size: 10px;
}

.docs {
  min-width: 0;
  font-size: 11px;
}

.configuration-page .docs {
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12.5px, 1.1vw, 14px);
  line-height: 1.66;
}

.docs h1 {
  font-size: 28px;
}

.configuration-page .docs h1 {
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -0.055em;
}

.configuration-page .config-lede {
  max-width: 70ch;
  margin-top: 12px;
  color: #29292c;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.6;
}

.configuration-page .config-detail {
  color: var(--muted);
  font-size: 10.5px;
}

.config-priority {
  margin: 18px 0;
  padding: 12px;
  background: #f7f7f9;
}

.config-priority svg {
  display: block;
  width: 100%;
  height: auto;
}

.priority-guide {
  fill: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.priority-box rect {
  fill: #fff;
  stroke: #c8c8ce;
}

.priority-box.accent rect {
  fill: #f2eefe;
  stroke: var(--accent);
  stroke-width: 1.4;
}

.priority-box text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.priority-box .sub {
  fill: var(--muted);
  font-size: 7.5px;
  font-weight: 400;
}

.priority-edge {
  fill: none;
  stroke: #777;
  stroke-width: 1.1;
  marker-end: url(#priority-arrow);
}

#priority-arrow path {
  fill: #777;
}

.priority-note {
  fill: var(--muted);
  font-size: 8px;
  text-anchor: middle;
}

.docs h2 {
  margin-top: 34px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 17px;
}

.configuration-page .docs h2 {
  scroll-margin-top: 82px;
  margin-top: 42px;
  padding-top: 16px;
  border-top-color: #c5c5ca;
  color: #252529;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.docs p {
  color: #454545;
}

.docs table {
  font-size: 9px;
}

.configuration-page .docs table {
  table-layout: fixed;
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.52;
}

.configuration-page .docs tbody tr:nth-child(even) {
  background: #fafafd;
}

.docs th,
.docs td {
  padding: 5px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.configuration-page .docs th,
.configuration-page .docs td {
  padding: 8px 9px;
  border-color: #d7d7dc;
}

.configuration-page .docs th:first-child,
.configuration-page .docs td:first-child {
  width: 43%;
}

.configuration-page .docs td code {
  overflow-wrap: anywhere;
}

.docs th {
  background: var(--soft);
}

.configuration-page .docs th {
  background: #f0edf8;
  color: #33284d;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.docs :not(pre) > code {
  padding: 1px 3px;
  background: var(--soft);
  font-size: 0.9em;
}

.config-flow {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
}

.configuration-page .config-flow {
  margin-top: 44px;
  padding: 20px;
  border-top: 0;
  background: #f7f7f9;
}

.docs .config-flow h2 {
  margin-top: 0;
  padding-top: 0;
  border: 0;
}

.config-flow > svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 20px;
}

.config-lane {
  fill: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.config-box rect {
  fill: #fff;
  stroke: #aaa;
}

.config-box.accent rect {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.config-box text {
  fill: var(--ink);
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
}

.config-box .sub {
  fill: var(--muted);
  font-size: 8px;
  font-weight: 400;
}

.config-edge {
  fill: none;
  stroke: #777;
  stroke-width: 1.1;
  marker-end: url(#config-arrow);
}

.config-edge.dashed {
  stroke-dasharray: 4 4;
}

#config-arrow path {
  fill: #777;
}

.config-note {
  fill: var(--muted);
  font-size: 8px;
  text-anchor: middle;
}

@keyframes page-out {
  to { opacity: 0; transform: translateY(-3px); }
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(3px); }
}

::view-transition-old(root) {
  animation: 100ms ease both page-out;
}

::view-transition-new(root) {
  animation: 150ms ease both page-in;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}

@media (max-width: 700px) {
  html {
    background: #fff;
  }

  .sheet {
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 24px 18px;
    box-shadow: none;
  }

  .landing-sheet {
    min-height: 0;
  }

  .docs-layout {
    grid-template-columns: 1fr;
  }

  .configuration-page .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .config-priority {
    overflow-x: auto;
  }

  .config-priority svg {
    min-width: 620px;
  }

  .paper-copy {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .docs-layout {
    gap: 30px;
  }

  .docs-nav {
    position: static;
  }

  .sync-diagram {
    min-width: 700px;
  }

  .sync {
    overflow-x: auto;
  }

  .config-flow {
    overflow-x: auto;
  }

  .config-flow > svg {
    min-width: 620px;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    background: #fff;
  }

  .landing-sheet {
    width: 210mm;
    height: 297mm;
    margin: 0;
    box-shadow: none;
  }
}

@media (max-width: 480px) {
  nav {
    gap: 9px;
  }
}

.manual-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.manual-nav {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-size: 10px;
}

.manual-nav .here {
  margin: 0 0 3px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.manual-nav .here + p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 9px;
}

.manual-nav h4 {
  margin: 15px 0 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.manual-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.manual-nav a {
  display: grid;
  grid-template-columns: 15px 1fr;
  gap: 5px;
  padding: 2px 0;
  color: var(--muted);
  text-decoration: none;
}

.manual-nav a:hover {
  color: var(--accent);
}

.manual-nav a i {
  color: #a6a6a6;
  font-style: normal;
  text-align: right;
}

.manual {
  min-width: 0;
  font-size: 12px;
  line-height: 1.55;
}

.manual h1 {
  font-size: 30px;
}

.manual .lede {
  margin: 10px 0 0;
  color: #454545;
  font-size: 14px;
  line-height: 1.5;
}

.manual .runline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.manual .reading-note {
  margin: 18px 0 0;
  max-width: 74ch;
  padding: 12px 14px;
  background: var(--soft);
}

.manual .reading-note strong {
  font-size: 10px;
}

.manual .reading-note p {
  margin-top: 4px;
}

.manual .part {
  margin: 46px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--ink);
}

.manual .part b {
  display: block;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.manual .part strong {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.manual .part span {
  display: block;
  margin-top: 4px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 10px;
}

.manual h2 {
  margin: 30px 0 0;
  padding: 0;
  border: 0;
  font-size: 15px;
  letter-spacing: -0.03em;
}

.manual h2 i {
  margin-right: 7px;
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.manual h3 {
  margin: 20px 0 0;
  font-size: 12px;
}

.manual p {
  margin: 9px 0 0;
  max-width: 74ch;
  color: #303030;
}

.manual ul,
.manual ol.body {
  margin: 9px 0 0;
  max-width: 74ch;
  padding-left: 17px;
  color: #303030;
}

.manual li {
  margin-top: 4px;
}

.manual pre {
  max-width: none;
  font-size: 10px;
}

.manual :not(pre) > code {
  padding: 1px 3px;
  background: var(--soft);
  font-size: 0.92em;
}

.manual table {
  margin-top: 12px;
  font-size: 10px;
}

.manual th,
.manual td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.manual th {
  width: auto;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.manual td.num,
.manual th.num {
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.manual .tablewrap {
  overflow-x: auto;
}

.manual .callout {
  margin: 14px 0 0;
  max-width: 74ch;
  padding: 9px 0 9px 12px;
  border-left: 2px solid var(--line);
  color: #454545;
}

.manual .callout b {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.manual .callout p {
  margin: 0;
  max-width: none;
}

.manual .callout.mark {
  border-left-color: var(--accent);
}

.manual .callout.mark b {
  color: var(--accent);
}

.manual .source {
  margin: 5px 0 0;
  max-width: 74ch;
  color: var(--muted);
  font-size: 9px;
}

.manual .source::before {
  content: "Source ";
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.manual dl.terms {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 5px 14px;
  margin: 12px 0 0;
  max-width: 74ch;
}

.manual dl.terms dt {
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
}

.manual dl.terms dd {
  margin: 0;
  color: #454545;
}

.manual figure {
  margin: 18px 0 0;
}

.manual figure svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.manual figcaption {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.d-lane {
  fill: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.d-box rect {
  fill: #fff;
  stroke: #aaa;
}

.d-box.accent rect {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.d-box.soft rect {
  fill: var(--soft);
}

.d-box text {
  fill: var(--ink);
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.d-box .sub {
  fill: var(--muted);
  font-size: 7.5px;
  font-weight: 400;
}

.d-edge {
  fill: none;
  stroke: #777;
  stroke-width: 1.1;
  marker-end: url(#d-arrow);
}

.d-edge.dashed {
  stroke-dasharray: 4 4;
}

#d-arrow path {
  fill: #777;
}

.d-note {
  fill: var(--muted);
  font-size: 7.5px;
  text-anchor: middle;
}

.d-note.left {
  text-anchor: start;
}

.d-fill {
  fill: var(--accent);
}

.d-gap {
  fill: #d4d4d8;
}

@media (max-width: 700px) {
  .manual-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .manual-nav {
    position: static;
    max-height: none;
  }

  .manual figure {
    overflow-x: auto;
  }

  .manual figure svg {
    min-width: 620px;
  }
}

/* How Karu Reads */

.guide-sheet {
  box-shadow: 0 14px 42px rgb(21 18 28 / 7%);
}

.guide-layout {
  grid-template-columns: 190px minmax(0, 760px);
  justify-content: center;
  gap: clamp(38px, 5vw, 72px);
}

.guide-nav {
  top: 76px;
  max-height: calc(100vh - 92px);
  padding: 14px 0;
}

.guide-nav .here + p {
  margin-bottom: 22px;
}

.guide-nav .guide-route {
  position: relative;
  display: grid;
  gap: 4px;
}

.guide-nav .guide-route::before {
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 13px;
  width: 1px;
  background: #e8e5ed;
  content: "";
}

.guide-nav .guide-route a {
  position: relative;
  grid-template-columns: 27px 1fr;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 8px;
}

.guide-nav .guide-route a:hover {
  background: #f5f2fb;
}

.guide-nav .guide-route a i {
  z-index: 1;
  display: grid;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  background: #f0ebfa;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  place-items: center;
}

.guide-nav .guide-route a span {
  color: #77737e;
  font-size: 8.5px;
  line-height: 1.3;
}

.guide-nav .guide-route a b {
  display: block;
  margin-bottom: 1px;
  color: var(--ink);
  font-size: 9.5px;
}

.guide-nav-note {
  margin: 20px 4px 0 36px;
  padding-top: 4px;
  color: var(--muted);
}

.guide-nav-note b {
  color: var(--accent);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.guide-nav-note p {
  margin: 4px 0 0;
  font-size: 8.5px;
  line-height: 1.4;
}

.journey {
  width: 100%;
  max-width: 760px;
  color: #2f2f33;
  font-size: clamp(12.5px, 1.1vw, 14px);
  line-height: 1.66;
}

.journey .guide-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.journey h1 {
  max-width: 12ch;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -0.055em;
}

.journey .lede {
  max-width: none;
  margin-top: 14px;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.6;
}

.level-map {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 24px;
}

.level-map span {
  position: relative;
  padding: 10px 8px 9px;
  border-radius: 7px;
  background: #f5f4f7;
  color: #55515b;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.level-map span + span {
  border-left: 0;
}

.level-map span::after {
  display: none;
}

.level-map span:last-child {
  background: #eee8fa;
  color: var(--accent);
}

.level-map span:last-child::after {
  display: none;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 15px;
}

.process-strip > div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: #f6f5f7;
}

.process-strip b,
.process-strip span {
  display: block;
}

.process-strip b {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.process-strip span {
  color: #57525c;
  font-size: 10.5px;
  line-height: 1.48;
}

.guide-section {
  position: relative;
  margin-top: clamp(58px, 8vw, 82px);
  padding-top: 0;
  scroll-margin-top: 82px;
}

.guide-section.first {
  margin-top: 54px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 9px;
}

.section-label span {
  display: grid;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  place-items: center;
}

.section-label small {
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.journey .guide-section h2 {
  margin: 0;
  max-width: 24ch;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

.journey .guide-section h3 {
  margin-top: 30px;
  font-size: clamp(13px, 1.25vw, 15px);
  letter-spacing: -0.015em;
}

.journey .guide-section > p {
  max-width: none;
}

.journey .section-intro {
  margin-top: 10px;
  color: #4b4850;
  font-size: clamp(13.5px, 1.2vw, 15px);
  line-height: 1.6;
}

.journey .bridge {
  margin-top: 18px;
  color: #27242b;
  font-weight: 700;
}

.technical-note {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 17px 19px;
  border: 0;
  border-radius: 9px;
  background: #f5f3f7;
  box-shadow: inset 2px 0 #8d829a;
}

.technical-note > span {
  display: block;
  margin-bottom: 5px;
  color: #514959;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.technical-note p {
  margin: 0;
  max-width: none;
  color: #3f3b43;
  font-size: 12px;
  line-height: 1.55;
}

.technical-note p + p {
  margin-top: 7px;
}

.technical-note code {
  padding: 1px 3px;
  background: #efedf2;
  color: #32273e;
  font-size: 0.92em;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.definition-grid > div {
  min-height: 108px;
  padding: 14px 15px;
  border: 0;
  border-radius: 9px;
  background: #f6f5f7;
}

.definition-grid b {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.definition-grid p {
  margin: 5px 0 0;
  color: #56515c;
  font-size: 11.5px;
  line-height: 1.45;
}

.cursor-mark {
  stroke: var(--accent);
  stroke-width: 1.5;
}

.cursor-head {
  fill: var(--accent);
}

.object-range.second {
  fill: #eee9fb;
}

.protocol-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 15px;
}

.protocol-pair > div {
  min-width: 0;
  padding: 15px 16px;
  border: 0;
  border-radius: 9px;
  background: #f3f1f5;
}

.protocol-pair span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.protocol-pair code {
  display: block;
  overflow-wrap: anywhere;
  color: #39343e;
  font-size: 10.5px;
  line-height: 1.7;
}

.network-step circle {
  fill: #fff;
  stroke: #aaa5b0;
}

.network-step.accent circle {
  fill: #f1ecfc;
  stroke: var(--accent);
  stroke-width: 1.3;
}

.network-step text {
  fill: #27242b;
  font-size: 9px;
  font-weight: 800;
  text-anchor: middle;
}

.network-step .sub {
  fill: #716c77;
  font-size: 6.5px;
  font-weight: 400;
}

.network-bracket {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1;
}

.guide-glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  margin: 13px 0 0;
}

.guide-glossary > div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid #ebe8ee;
}

.guide-glossary dt {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.guide-glossary dd {
  margin: 0;
  color: #57525c;
  font-size: 11.5px;
  line-height: 1.45;
}

.credential-sources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.credential-sources > div {
  padding: 14px 15px;
  border: 0;
  border-radius: 9px;
  background: #f6f5f7;
}

.credential-sources b {
  color: var(--accent);
  font-size: 10.5px;
}

.credential-sources p {
  margin: 5px 0 0;
  color: #56515c;
  font-size: 11.5px;
  line-height: 1.45;
}

.story-figure {
  margin: 24px 0 0;
  padding: 22px 20px 16px;
  overflow-x: auto;
  border: 0;
  border-radius: 11px;
  background: #f7f6f8;
  scrollbar-color: #c8c2d0 transparent;
  scrollbar-width: thin;
}

.story-figure.compact {
  padding-top: 17px;
}

.journey .story-figure figcaption {
  margin-top: 11px;
  padding: 8px 2px 0;
  border-top: 0;
  color: #67636d;
  font-size: 11px;
  line-height: 1.5;
}

.flow-stage {
  fill: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.1px;
}

.flow-card rect,
.gate-card rect,
.outcome-card rect {
  fill: #fff;
  stroke: #d4d0d9;
}

.flow-card.accent rect,
.gate-card rect {
  stroke: var(--accent);
  stroke-width: 1.3;
}

.flow-card text,
.gate-card text,
.outcome-card text,
.wait-block text,
.decision-card text {
  fill: #252329;
  font-size: 10px;
  font-weight: 700;
  text-anchor: middle;
}

.flow-card .sub,
.gate-card .sub,
.outcome-card .sub,
.decision-card .sub {
  fill: #706b76;
  font-size: 7.5px;
  font-weight: 400;
}

.flow-arrow,
.retry-loop {
  fill: none;
  stroke: #7d7884;
  stroke-width: 1.1;
}

.retry-loop {
  stroke: var(--accent);
  stroke-dasharray: 4 3;
}

.flow-baseline,
.timeline {
  fill: none;
  stroke: #c9c6ce;
  stroke-width: 1;
}

.flow-dot {
  fill: var(--accent);
}

.flow-note,
.time-label {
  fill: #716c77;
  font-size: 7.5px;
  text-anchor: middle;
}

.flow-note.left {
  text-anchor: start;
}

.flow-note.right,
.time-label {
  text-anchor: end;
}

.object-track {
  fill: #eeedf1;
  stroke: none;
}

.object-before {
  fill: #e5e3e9;
}

.object-range {
  fill: #dfd5fa;
  stroke: var(--accent);
  stroke-width: 1;
}

.merged-range {
  fill: #e8e6ec;
  stroke: #827b8b;
  stroke-width: 1;
}

.range-tick,
.range-bracket {
  fill: none;
  stroke: #77727d;
  stroke-width: 1;
}

.range-label,
.gap-label {
  fill: #77727d;
  font-size: 7.5px;
  text-anchor: start;
}

.range-label.end {
  text-anchor: end;
}

.range-byte {
  fill: #2a2137;
  font-size: 9px;
  font-weight: 700;
  text-anchor: middle;
}

.gap-label {
  font-size: 6.5px;
  text-anchor: middle;
}

.wait-block rect {
  fill: #eeecef;
  stroke: none;
}

.wait-block.accent rect {
  fill: #e9e2fb;
  stroke: var(--accent);
}

.decision-card path {
  fill: #f2eefc;
  stroke: var(--accent);
}

.outcome-card.final rect {
  fill: #f4f3f5;
  stroke: #77727d;
}

.success-ring {
  fill: #f2eefc;
  stroke: var(--accent);
}

.success-check {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.path-pill rect {
  fill: #fff;
  stroke: none;
}

.path-pill text {
  fill: #4a4650;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 7.5px;
  text-anchor: middle;
}

.concept-grid,
.guard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.concept-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.concept-grid > div,
.guard-grid > div {
  padding: 14px 15px;
  border: 0;
  border-radius: 9px;
  background: #f6f5f7;
}

.concept-grid b,
.guard-grid span {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.concept-grid p,
.guard-grid p {
  margin: 4px 0 0;
  color: #56515c;
  font-size: 11.5px;
  line-height: 1.45;
}

.takeaway {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  margin-top: 22px;
  padding: 15px 17px;
  border: 0;
  border-radius: 9px;
  background: #f0ebfa;
}

.takeaway b {
  color: var(--accent);
  font-size: 10.5px;
}

.takeaway p {
  margin: 0;
  color: #47424d;
  font-size: 11.5px;
  line-height: 1.45;
}

.control-stack {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.control-stack > div {
  display: grid;
  grid-template-columns: 116px 1fr 1.15fr;
  gap: 13px;
  align-items: start;
  padding: 14px 16px;
  border: 0;
  border-radius: 8px;
  background: #f6f5f7;
}

.control-stack span {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
}

.control-stack p,
.control-stack small {
  margin: 0;
  color: #49454e;
  font-size: 11.5px;
  line-height: 1.45;
}

.control-stack small {
  color: #77727d;
}

@media (max-width: 60rem) {
  .guide-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .guide-nav {
    position: static;
    max-height: none;
    padding: 0 0 4px;
    overflow: hidden;
  }

  .guide-nav .here,
  .guide-nav .here + p {
    display: none;
  }

  .guide-nav .guide-route {
    display: flex;
    gap: 6px;
    padding-bottom: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline proximity;
    scrollbar-color: #d0cad8 transparent;
    scrollbar-width: thin;
  }

  .guide-nav .guide-route::before,
  .guide-nav-note {
    display: none;
  }

  .guide-nav .guide-route li {
    flex: 0 0 158px;
    scroll-snap-align: start;
  }

  .guide-nav .guide-route a {
    height: 100%;
    padding: 9px;
    background: #f6f5f7;
  }

  .guide-nav .guide-route a:hover {
    background: #efeaf8;
  }

  .journey {
    max-width: 760px;
    margin-inline: auto;
  }

  .concept-grid.three {
    grid-template-columns: 1fr;
  }

  .control-stack > div {
    grid-template-columns: 100px 1fr;
  }

  .control-stack small {
    grid-column: 2;
  }
}

/* Keep the reading rail on laptop viewports, including zoomed browser panels. */
@media (min-width: 43.751rem) and (max-width: 68rem) and (hover: hover) and (pointer: fine) {
  .guide-layout {
    grid-template-columns: 154px minmax(0, 64ch);
    justify-content: center;
    gap: clamp(24px, 3vw, 32px);
  }

  .guide-nav {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 92px);
    padding: 8px 0;
    overflow: auto;
  }

  .guide-nav .here,
  .guide-nav .here + p {
    display: block;
  }

  .guide-nav .here + p {
    margin-bottom: 15px;
  }

  .guide-nav .guide-route {
    display: grid;
    gap: 2px;
    padding-bottom: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  .guide-nav .guide-route::before,
  .guide-nav-note {
    display: block;
  }

  .guide-nav .guide-route li {
    min-width: 0;
  }

  .guide-nav .guide-route a {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 7px;
    height: auto;
    padding: 6px 4px;
    background: transparent;
  }

  .guide-nav .guide-route a:hover {
    background: #f5f2fb;
  }

  .guide-nav .guide-route a i {
    width: 24px;
    height: 24px;
  }

  .guide-nav .guide-route a b {
    font-size: 9px;
  }

  .guide-nav .guide-route a span,
  .guide-nav-note p {
    font-size: 8px;
  }

  .guide-nav-note {
    margin: 15px 2px 0 31px;
  }

  .journey {
    max-width: 64ch;
    margin-inline: 0;
    font-size: 12.5px;
    line-height: 1.62;
  }

  .journey .lede {
    max-width: none;
    font-size: 14px;
  }

  .guide-section {
    margin-top: 58px;
  }

  .guide-section.first {
    margin-top: 46px;
  }

  .journey .guide-section h2 {
    font-size: 24px;
  }

  .journey .guide-section h3 {
    margin-top: 22px;
    font-size: 13px;
  }

  .journey .section-intro {
    font-size: 13.5px;
  }

  .technical-note {
    padding: 14px 16px;
  }

  .story-figure {
    margin-top: 18px;
    padding: 18px 16px 14px;
  }

  .concept-grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .control-stack > div {
    grid-template-columns: 102px 1fr;
  }

  .control-stack small {
    grid-column: 2;
  }
}

@media (max-width: 43.75rem) {
  .guide-sheet {
    min-height: 0;
  }

  .journey h1 {
    font-size: clamp(34px, 11vw, 42px);
  }

  .level-map {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-map span:nth-child(3) {
    border-left: 0;
  }

  .level-map span:nth-child(4) {
    border-top: 0;
  }

  .concept-grid,
  .guard-grid,
  .definition-grid,
  .protocol-pair,
  .guide-glossary,
  .credential-sources {
    grid-template-columns: 1fr;
  }

  .definition-grid > div {
    min-height: 0;
  }

  .takeaway {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .control-stack > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .control-stack small {
    grid-column: 1;
  }

  .technical-note {
    padding: 15px 16px;
  }

  .story-figure {
    margin-inline: calc(clamp(18px, 5vw, 28px) * -0.45);
    padding: 18px 14px 14px;
    border-radius: 8px;
  }

  .journey .story-figure svg {
    min-width: 540px;
  }

  .journey .story-figure figcaption {
    position: sticky;
    left: 0;
    max-width: calc(100vw - 48px);
  }
}

@media (max-width: 28rem) {
  header {
    flex-wrap: wrap;
  }

  .guide-nav .guide-route li {
    flex-basis: 122px;
  }

  .guide-nav .guide-route a span {
    font-size: 0;
  }

  .guide-nav .guide-route a b {
    font-size: 9px;
  }

  .level-map {
    grid-template-columns: 1fr;
  }

  .process-strip {
    grid-template-columns: 1fr;
  }

  .level-map span {
    text-align: left;
  }

  .guide-glossary > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media print {
  .guide-nav {
    position: static;
    max-height: none;
  }

  .guide-section,
  .story-figure,
  .takeaway {
    break-inside: avoid;
  }
}
