:root {
  --paper-ink: #3a2410;
  --paper-copy: #4c3a29;
  --paper-soft: #7a5a3a;
  --paper-muted: #8e8e93;
  --paper-line: #eadfd3;
  --paper-orange: #d87a0a;
  --paper-tint: #fffaf4;
  --cell-orange: #ffa500;
  --cell-cream: #ffeed1;
}

body {
  overflow-x: hidden;
}

.paper-shell {
  padding: clamp(72px, 10vw, 128px) max(24px, env(safe-area-inset-right)) 120px max(24px, env(safe-area-inset-left));
}

.paper {
  width: min(100%, 720px);
  margin: 0 auto;
}

.paper-header {
  margin-bottom: 64px;
}


.paper-header h2 {
  max-width: 680px;
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.paper-reference {
  margin: 12px 0 0;
  color: var(--paper-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.paper-reference a {
  display: inline;
  min-height: 0;
  color: var(--paper-ink);
  font-size: inherit;
  letter-spacing: inherit;
}

.paper-lead {
  margin: 0 0 30px;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
}

.paper-closing {
  margin: 80px 0 0;
  padding-top: 36px;
  border-top: 1px solid var(--paper-line);
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

.paper-closing a {
  color: var(--paper-ink);
  font-weight: 700;
  text-decoration-color: var(--paper-orange);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.principle-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: principle;
}

.principle-list li {
  display: grid;
  padding: 14px 0;
  counter-increment: principle;
  grid-template-columns: 28px 180px 1fr;
  gap: 16px;
}

.principle-list li + li {
  margin-top: 8px;
}

.principle-list li::before {
  color: var(--paper-orange);
  content: "0" counter(principle);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.principle-list strong {
  color: var(--paper-ink);
  font-size: 16px;
}

.principle-list p {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.paper > section + section {
  margin-top: 80px;
}

.paper > section > h2 {
  margin: 0 0 24px;
  color: var(--paper-ink);
  font-size: clamp(27px, 4vw, 34px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.paper > section > p {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.75;
}

.paper > section > p + p {
  margin-top: 1.6em;
}

.paper code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--paper-tint);
  color: var(--paper-ink);
  font-size: 0.88em;
}

.message-example {
  margin-top: 36px;
}

.message-example > p:not(.chapter-label) {
  margin: 0 0 14px;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.message-example pre {
  overflow-x: auto;
  margin: 0;
  padding: 20px;
  border: 1px solid var(--paper-line);
  border-radius: 12px;
  background: var(--paper-tint);
  color: var(--paper-ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  tab-size: 2;
}

.message-example pre code {
  padding: 0;
  background: transparent;
  font-size: inherit;
}

.paper > section > .message-conclusion {
  margin-top: 1.6em;
}

.paper p + p {
  margin-top: 1.6em;
}

.component-graph {
  width: min(calc(100vw - 48px), 1120px);
  margin: 48px 0 0 50%;
  transform: translateX(-50%);
}

.component-graph-scroll {
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.component-graph img {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.component-graph figcaption {
  margin: 14px 8px 2px;
  color: #735b40;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.component-list {
  margin: 56px 0 0;
}

.component-list > div {
  display: grid;
  padding: 10px 0;
  grid-template-columns: 190px 1fr;
  gap: 28px;
}

.component-list > div + div {
  margin-top: 24px;
}

.component-list dt {
  color: var(--paper-ink);
  font-size: 15px;
  font-weight: 700;
}

.component-list dt span {
  display: block;
  margin-bottom: 7px;
  color: var(--paper-orange);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.component-list dd {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.65;
}

.component-list dd p {
  margin: 0;
}

.component-list dd p + p,
.component-list dd ul + p {
  margin-top: 1.6em;
}

.component-list dd ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.component-list dd li + li {
  margin-top: 8px;
}

.evolution-figure {
  display: grid;
  width: min(calc(100vw - 48px), 980px);
  margin: 44px 0 40px 50%;
  align-items: center;
  transform: translateX(-50%);
  grid-template-columns: repeat(3, minmax(130px, 1fr) minmax(28px, 0.18fr)) minmax(130px, 1fr);
}

.evolution-figure > div {
  display: flex;
  min-height: 176px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 18px;
  border-radius: 14px;
  background: var(--paper-tint);
}

.generation-grid {
  display: grid;
  margin-bottom: 15px;
  grid-template-columns: repeat(5, 10px);
  gap: 3px;
}

.generation-grid span {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.generation-grid .live {
  background: var(--cell-orange);
}

.generation-grid .echo {
  background: var(--cell-cream);
}

.evolution-figure > div > span {
  color: var(--paper-orange);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.06em;
}

.evolution-figure strong {
  color: var(--paper-ink);
  font-size: 15px;
}

.evolution-figure small {
  color: var(--paper-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.4;
}

.evolution-figure > b {
  color: var(--paper-orange);
  grid-row: auto;
  justify-self: center;
  text-align: center;
}

.evolution-figure figcaption {
  margin-top: 8px;
  grid-column: 1 / -1;
  color: var(--paper-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.library-console {
  width: min(calc(100vw - 48px), 920px);
  box-sizing: border-box;
  margin: 42px 0 42px 50%;
  padding: 16px;
  border-radius: 18px;
  background: #c9b18f;
  box-shadow: inset 0 2px #f3e3ca, inset 0 -4px #9a8364, 0 16px 32px rgb(58 36 16 / 13%);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  transform: translateX(-50%);
}

.library-console-heading {
  display: flex;
  padding: 10px 12px 14px;
  align-items: center;
  justify-content: space-between;
  color: #4d3926;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.library-console-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.library-console-grid > div {
  display: flex;
  min-width: 0;
  min-height: 116px;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  border-radius: 10px;
  background: #eadbc4;
  box-shadow: inset 0 0 0 1px #b19a79, inset 0 -3px #c8b18e;
}

.library-console-grid small {
  color: #95672d;
  font-family: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.library-console-grid strong {
  color: #3f2e1d;
  font-size: 12px;
}

.library-console-grid span {
  color: #806b50;
  font-family: inherit;
  font-size: 9px;
  line-height: 1.5;
}

.library-console-grid > .library-featured {
  background: #28261b;
  box-shadow: inset 0 0 28px rgb(0 0 0 / 62%), inset 0 0 0 1px #9c7a44;
  text-shadow: 0 0 5px rgb(255 165 0 / 24%);
}

.library-console-grid > .library-featured small {
  color: #c69548;
}

.library-console-grid > .library-featured strong {
  color: #ffbf4a;
}

.library-console-grid > .library-featured span {
  color: #d0a65f;
}

.library-console figcaption {
  margin: 15px 8px 2px;
  color: #735b40;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.paper-contents {
  margin: 0 0 72px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #f0e3cf;
  box-shadow: inset 0 0 0 1px #c4ad8d, inset 0 -3px #decbb0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.paper-contents > p {
  margin: 0;
  color: #795d3c;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.paper-contents ol {
  margin: 14px 0 0;
  padding: 0;
  columns: 2;
  column-gap: 48px;
  list-style: none;
  counter-reset: contents;
}

.paper-contents li {
  position: relative;
  break-inside: avoid;
  padding: 4px 0 4px 24px;
  color: #806b53;
  font-size: 11px;
  line-height: 1.4;
  counter-increment: contents;
}

.paper-contents li::before {
  position: absolute;
  left: 0;
  color: #b47a31;
  content: "0" counter(contents);
  font-size: 8px;
  font-weight: 700;
}

.paper-contents a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.paper-contents a:hover {
  color: var(--paper-orange);
}

.paper > section {
  scroll-margin-top: 32px;
}

.paper-disclosure {
  margin: 28px 0;
  border-radius: 13px;
  background: #f0e3cf;
  box-shadow: inset 0 0 0 1px #c4ad8d, inset 0 -3px #decbb0;
  color: var(--paper-copy);
}

.paper-disclosure + .paper-disclosure {
  margin-top: 12px;
}

.paper-disclosure summary {
  display: grid;
  min-height: 70px;
  box-sizing: border-box;
  align-items: center;
  padding: 16px 52px 16px 20px;
  grid-template-columns: 1fr;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.paper-disclosure summary::-webkit-details-marker {
  display: none;
}

.paper-disclosure summary::after {
  display: grid;
  position: absolute;
  top: 50%;
  right: 18px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #6a5947;
  color: #f0a52b;
  content: "+";
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #4c3e31, 0 0 0 3px #d2bd9e;
  transform: translateY(-50%);
}

.paper-disclosure[open] summary::after {
  content: "−";
}

.paper-disclosure[open] summary {
  box-shadow: inset 0 -1px #c9b394;
}

.paper-disclosure summary > span {
  color: #3f2e1d;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.paper-disclosure summary > small {
  margin-top: 5px;
  color: #806b53;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  line-height: 1.5;
}

.paper-disclosure summary code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.disclosure-body {
  min-width: 0;
  padding: 20px;
  overflow: hidden;
}

.disclosure-body > p {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.disclosure-body > p + p {
  margin-top: 1.6em;
}

.disclosure-body code,
.paper-disclosure summary {
  overflow-wrap: anywhere;
}

.disclosure-body > *,
.disclosure-body td,
.disclosure-body th {
  min-width: 0;
}

.disclosure-body .table-scroll {
  width: 100%;
  max-width: 100%;
  margin-right: 0;
  margin-left: 0;
  transform: none;
}

.disclosure-body .table-scroll {
  box-sizing: border-box;
  overflow-x: auto;
}

.disclosure-body > .table-scroll:first-child,
.disclosure-body > .grammar-view:first-child {
  margin-top: 0;
}

.disclosure-body > .table-scroll:last-child,
.disclosure-body > .bridge-flow:last-child,
.disclosure-body > .grammar-view:last-child,
.disclosure-body > p:last-child {
  margin-bottom: 0;
}

.paper-list {
  margin: 20px 0;
  padding-left: 24px;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.paper-list li + li {
  margin-top: 8px;
}

.table-scroll {
  width: min(calc(100vw - 48px), 1080px);
  margin: 36px 0 36px 50%;
  overflow-x: auto;
  transform: translateX(-50%);
}

.table-scroll table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--paper-tint);
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
}

.table-scroll th,
.table-scroll td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--paper-line);
  vertical-align: top;
}

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

.table-scroll th {
  color: var(--paper-ink);
  font-size: 11px;
  font-weight: 700;
}

.limit-groups {
  display: grid;
  width: min(calc(100vw - 48px), 960px);
  margin: 40px 0 40px 50%;
  transform: translateX(-50%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.limit-groups > div {
  padding: 22px;
  border-radius: 14px;
  background: var(--paper-tint);
}

.capability-groups small {
  color: var(--paper-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
}

.host-routing-view,
.capability-terminal {
  width: min(calc(100vw - 48px), 920px);
  margin: 42px 0 42px 50%;
  transform: translateX(-50%);
}

.host-routing-view {
  box-sizing: border-box;
  padding: 16px;
  border-radius: 18px;
  background: #c9b18f;
  box-shadow: inset 0 2px #f3e3ca, inset 0 -4px #9a8364, 0 16px 32px rgb(58 36 16 / 13%);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.routing-heading,
.capability-terminal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.routing-heading {
  padding: 10px 12px 14px;
  color: #4d3926;
}

.routing-panel {
  padding: 14px;
  border-radius: 12px;
  background: #ded0ba;
  box-shadow: inset 0 0 0 1px #ad9574, inset 0 -3px #c2ab89;
}

.routing-stage {
  display: grid;
  min-height: 72px;
  box-sizing: border-box;
  align-items: center;
  padding: 15px 18px;
  border-radius: 9px;
  background: #eadbc4;
  box-shadow: inset 0 0 0 1px #b19a79, inset 0 -3px #c8b18e;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 18px;
}

.routing-stage > small {
  color: #95672d;
  font-family: inherit;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.routing-stage > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.routing-stage strong {
  color: #3f2e1d;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.routing-stage span {
  color: #806b50;
  font-family: inherit;
  font-size: 8px;
  line-height: 1.5;
}

.routing-stage.routing-host {
  background: #5d5041;
  box-shadow: inset 0 0 0 1px #44392e, inset 0 2px #7e6d58, inset 0 -3px #453a2f;
}

.routing-stage.routing-host > small {
  color: #efae3e;
}

.routing-stage.routing-host strong {
  color: #f3dfc0;
}

.routing-stage.routing-host span {
  color: #d1b996;
}

.routing-link {
  display: flex;
  position: relative;
  min-height: 42px;
  align-items: center;
  justify-content: center;
}

.routing-link::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #a9814a;
  content: "";
}

.routing-link span {
  position: relative;
  padding: 5px 10px;
  border: 1px solid #b99d75;
  border-radius: 999px;
  background: #ded0ba;
  color: #775a37;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.host-routing-view figcaption,
.capability-terminal figcaption {
  margin-top: 18px;
  color: var(--paper-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.host-routing-view figcaption {
  margin: 15px 8px 2px;
  color: #735b40;
}

.execution-pipeline,
.bridge-flow {
  margin: 36px 0;
  padding: 0;
  list-style: none;
  counter-reset: pipeline;
}

.execution-pipeline li,
.bridge-flow li {
  display: grid;
  position: relative;
  padding: 0 0 28px 42px;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  counter-increment: pipeline;
}

.execution-pipeline li::before,
.bridge-flow li::before {
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--paper-orange);
  content: "0" counter(pipeline);
  font-size: 10px;
  font-weight: 750;
}

.execution-pipeline strong,
.bridge-flow strong,
.failure-view strong {
  color: var(--paper-ink);
  font-size: 14px;
}

.execution-pipeline p,
.bridge-flow span {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

.state-strip {
  display: grid;
  margin: 30px 0;
  padding: 20px;
  border-radius: 12px;
  background: var(--paper-tint);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  list-style: none;
}

.state-strip li {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.state-strip span {
  color: var(--paper-orange);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.state-strip strong {
  color: var(--paper-ink);
  font-size: 13px;
}

.state-strip small {
  color: var(--paper-soft);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  line-height: 1.45;
}

.outcome-list {
  margin: 0;
}

.outcome-list > div,
.limit-groups dl > div {
  display: grid;
  padding: 8px 0;
  grid-template-columns: 150px 1fr;
  gap: 16px;
}

.outcome-list dt,
.limit-groups dt {
  color: var(--paper-ink);
  font-size: 12px;
  font-weight: 700;
}

.outcome-list dd,
.limit-groups dd {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.5;
}

.capability-groups {
  display: grid;
  margin: 0;
  padding: 24px 28px 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 34px;
}

.capability-groups > div {
  padding: 14px 0;
}

.capability-groups > div > strong {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
}

.capability-groups > div > strong code {
  padding: 0;
  background: none;
  color: #ffbf4a;
  font-size: inherit;
}

.capability-groups p {
  margin: 0 0 8px;
  color: #e4bb72;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.7;
}

.capability-groups small {
  color: #aa8752;
  font-family: inherit;
  font-size: 9px;
}

.capability-terminal {
  box-sizing: border-box;
  padding: 24px 28px 20px;
  border-radius: 20px;
  background: #202116;
  box-shadow: inset 0 0 42px rgb(0 0 0 / 72%), 0 0 0 10px #c9b18f, 0 18px 34px rgb(58 36 16 / 16%);
  color: #ffd888;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-shadow: 0 0 6px rgb(255 165 0 / 25%);
}

.capability-terminal-heading {
  color: #d6a452;
}

.capability-prompt {
  display: flex;
  margin: 16px 0 0;
  align-items: center;
  color: #ffd888;
  font-size: 11px;
  gap: 8px;
}

.capability-prompt span {
  color: #ffae24;
}

.capability-prompt i {
  width: 7px;
  height: 12px;
  background: #ffae24;
  box-shadow: 0 0 8px rgb(255 174 36 / 46%);
}

.capability-terminal figcaption {
  color: #ae956c;
  text-shadow: none;
}

.antique-computer,
.antique-directory {
  width: min(calc(100vw - 48px), 880px);
  margin: 44px 0 44px 50%;
  transform: translateX(-50%);
}

.antique-computer figcaption,
.antique-directory figcaption {
  margin-top: 18px;
  color: var(--paper-muted);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.computer-case {
  box-sizing: border-box;
  width: min(100%, 570px);
  margin: 0 auto;
  padding: 30px 30px 18px;
  border-radius: 34px 34px 22px 22px;
  background: #dfceb4;
  box-shadow: inset 0 2px 0 #f8eddb, inset 0 -5px 0 #b9a386, 0 16px 30px rgb(58 36 16 / 14%);
}

.computer-screen {
  min-height: 300px;
  box-sizing: border-box;
  padding: 30px;
  border-radius: 24px;
  background: #202116;
  box-shadow: inset 0 0 34px rgb(0 0 0 / 78%), 0 0 0 8px #6a5c4d;
  color: #ffc04f;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  text-shadow: 0 0 7px rgb(255 165 0 / 36%);
}

.terminal-heading,
.directory-titlebar,
.directory-path,
.directory-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-heading {
  margin-bottom: 28px;
  color: #d6a452;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.computer-screen dl {
  margin: 0;
}

.computer-screen dl > div {
  display: grid;
  padding: 8px 0;
  grid-template-columns: 100px 1fr;
  gap: 14px;
}

.computer-screen dt {
  color: #d6a452;
  font-size: 11px;
}

.computer-screen dd {
  margin: 0;
  color: #ffd888;
  font-size: 12px;
}

.computer-screen > p {
  display: flex;
  margin: 30px 0 0;
  align-items: center;
  color: #ffd888;
  font-size: 12px;
  gap: 8px;
}

.computer-screen > p > span {
  color: #ffae24;
}

.computer-screen > p > i {
  width: 7px;
  height: 13px;
  background: #ffae24;
  box-shadow: 0 0 8px rgb(255 174 36 / 46%);
}

.computer-panel {
  display: flex;
  height: 30px;
  margin-top: 18px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.computer-panel i {
  width: 7px;
  height: 7px;
  margin-right: auto;
  border-radius: 50%;
  background: #e88b16;
  box-shadow: 0 0 7px rgb(232 139 22 / 54%);
}

.computer-panel span {
  width: 74px;
  height: 8px;
  border-radius: 5px;
  background: #8f7d67;
  box-shadow: inset 0 2px 3px rgb(58 36 16 / 36%);
}

.computer-panel span:last-child {
  width: 24px;
}

.computer-base {
  width: min(84%, 480px);
  height: 22px;
  margin: 0 auto;
  border-radius: 0 0 48% 48%;
  background: #b9a386;
  box-shadow: 0 9px 16px rgb(58 36 16 / 12%);
}

.computer-base span {
  display: block;
  width: 44%;
  height: 7px;
  margin: 0 auto;
  border-radius: 0 0 8px 8px;
  background: #927e65;
}

.directory-window {
  overflow: hidden;
  border-radius: 15px;
  background: #f0e3cf;
  box-shadow: inset 0 0 0 1px #bca789, 0 16px 32px rgb(58 36 16 / 13%);
  color: #4b3928;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.directory-titlebar {
  padding: 12px 18px;
  background: #6a5947;
  color: #f6e5c9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.directory-titlebar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #efa221;
  box-shadow: 0 0 7px rgb(239 162 33 / 62%);
}

.directory-path {
  padding: 13px 18px;
  background: #ded0ba;
  color: #6b5035;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.directory-path code,
.vfs-view code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.directory-path code {
  color: #3a2b1d;
  font-weight: 700;
}

.vfs-view {
  margin: 0;
  background: #f8eddc;
}

.vfs-view > div {
  display: grid;
  min-height: 50px;
  box-sizing: border-box;
  align-items: center;
  padding: 10px 18px;
  grid-template-columns: 22px 120px minmax(160px, 1fr) minmax(180px, 0.8fr);
  gap: 14px;
  box-shadow: inset 0 -1px #ddcfbb;
}

.vfs-view > div:last-child {
  box-shadow: none;
}

.vfs-view > div::before {
  width: 16px;
  height: 14px;
  background: #d6891e;
  content: "";
}

.vfs-view > div[data-kind="folder"]::before {
  clip-path: polygon(0 22%, 36% 22%, 44% 5%, 100% 5%, 100% 92%, 0 92%);
}

.vfs-view > div[data-kind="file"]::before {
  background: #ab8e68;
  clip-path: polygon(0 0, 68% 0, 100% 32%, 100% 100%, 0 100%);
}

.vfs-view code {
  color: #422e1c;
  font-size: 12px;
  font-weight: 700;
}

.grammar-view > div > strong,
.limit-groups > div > strong {
  display: block;
  color: var(--paper-ink);
  font-size: 13px;
  font-weight: 700;
}

.vfs-view span {
  color: #5f4933;
  font-size: 11px;
}

.vfs-view small {
  color: #806b53;
  font-family: inherit;
  font-size: 10px;
  line-height: 1.4;
}

.directory-status {
  padding: 11px 18px;
  background: #ded0ba;
  color: #806548;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.failure-view > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 12px;
  background: var(--paper-tint);
}

.grammar-view,
.failure-view {
  display: grid;
  margin: 34px 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.grammar-view > div > strong,
.limit-groups > div > strong {
  margin: 0 0 12px;
}

.grammar-view ul {
  margin: 0;
  padding-left: 18px;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.6;
}

.grammar-view li + li {
  margin-top: 7px;
}

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

.limit-groups dl {
  margin: 0;
}

.failure-view {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.failure-view span {
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.55;
}

.chapter-label {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 7px 10px;
  border-radius: 7px;
  background: #6a5947;
  box-shadow: inset 0 1px #8c7963, inset 0 -2px #4c3e31;
  color: #f3dfc0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.component-detail,
.resource-detail {
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--paper-line);
}

.component-detail > p:not(.chapter-label),
.resource-detail > p:not(.chapter-label) {
  margin: 0;
  color: var(--paper-copy);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

.component-detail > p:not(.chapter-label) + p:not(.chapter-label),
.resource-detail > p:not(.chapter-label) + p:not(.chapter-label) {
  margin-top: 1.6em;
}

.component-detail .computer-case {
  width: min(100%, 780px);
}

.component-detail .computer-screen {
  min-height: 460px;
}

#protocol-resources > .resource-detail:first-of-type {
  margin-top: 32px;
  padding-top: 0;
  border-top: 0;
}

.service-repository-graph {
  width: min(calc(100vw - 48px), 960px);
  box-sizing: border-box;
  margin: 44px 0 0 50%;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  transform: translateX(-50%);
}

.repository-graph-scroll {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.service-repository-graph svg {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.repository-edges path {
  fill: none;
  stroke: #9d7541;
  stroke-dasharray: 5 7;
  stroke-linecap: round;
  stroke-width: 2;
}

.repository-node rect {
  fill: var(--paper-tint);
  stroke: #c4ad8d;
  stroke-width: 1.5;
}

.repository-node text,
.ox-node text {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.repository-node text {
  dominant-baseline: hanging;
  fill: var(--paper-copy);
}

.repository-node .repository-node-name {
  fill: var(--paper-orange);
  font-size: 12px;
}

.repository-node .repository-node-count {
  fill: var(--paper-ink);
  font-size: 11px;
  font-weight: 600;
}

.repository-node .repository-node-meta {
  fill: var(--paper-soft);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.ox-node circle:first-child {
  fill: #eadbc4;
  stroke: #d88720;
  stroke-width: 3;
}

.ox-node .ox-node-light {
  fill: #f0a52b;
  stroke: #6a5947;
  stroke-width: 2;
}

.ox-node text {
  fill: #4d3926;
  text-anchor: middle;
}

.service-repository-graph figcaption {
  margin: 15px 8px 2px;
  color: #735b40;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.compatibility-switchboard {
  max-width: 960px;
}

.compatibility-panel {
  display: grid;
  min-width: 0;
  padding: 18px;
  border-radius: 12px;
  background: #ded0ba;
  box-shadow: inset 0 0 0 1px #ad9574, inset 0 -3px #c2ab89;
  grid-template-columns: minmax(130px, 1fr) 70px minmax(180px, 1.2fr) 70px minmax(130px, 1fr);
  gap: 0;
}

.compatibility-bank {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.compatibility-bank > small,
.compatibility-contract > small {
  color: #95672d;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.compatibility-bank > div {
  display: flex;
  min-width: 0;
  box-sizing: border-box;
  flex-direction: column;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #eadbc4;
  box-shadow: inset 0 0 0 1px #b19a79, inset 0 -2px #c8b18e;
}

.compatibility-bank strong {
  color: #3f2e1d;
  font-size: 10px;
}

.compatibility-bank span {
  color: #806b50;
  font-size: 8px;
  line-height: 1.4;
}

.compatibility-routes {
  display: grid;
  padding: 31px 0 9px;
  grid-template-rows: repeat(4, 1fr);
}

.compatibility-routes i {
  position: relative;
  height: 3px;
  align-self: center;
  background: #d68620;
  box-shadow: 0 0 5px rgb(214 134 32 / 20%);
}

.compatibility-routes i::before,
.compatibility-routes i::after {
  position: absolute;
  top: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #6a5947;
  box-shadow: inset 0 0 0 2px #f0a52b;
  content: "";
}

.compatibility-routes i::before {
  left: -4px;
}

.compatibility-routes i::after {
  right: -4px;
}

.compatibility-contract {
  display: flex;
  min-width: 0;
  box-sizing: border-box;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px 18px;
  border-radius: 12px;
  background: #5d5041;
  box-shadow: inset 0 0 0 1px #44392e, inset 0 2px #7e6d58, inset 0 -3px #453a2f;
  text-align: center;
}

.compatibility-contract > small {
  color: #efae3e;
}

.compatibility-contract strong {
  color: #f3dfc0;
  font-size: 13px;
}

.compatibility-contract span {
  color: #d1b996;
  font-size: 8px;
  line-height: 1.5;
}

.compatibility-contract em {
  color: #efae3e;
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.disclosure-body .limit-groups,
.disclosure-body .failure-view {
  width: 100%;
  margin: 0;
  transform: none;
}

@media (min-width: 1400px) {
  .component-graph,
  .table-scroll {
    width: min(calc(100vw - 400px), 1000px);
  }
}

@media (max-width: 760px) {
  .paper-shell {
    padding-top: 64px;
    padding-bottom: 96px;
  }

  .paper-header {
    margin-bottom: 52px;
  }

  .paper-contents {
    margin-bottom: 64px;
  }

  .paper > section + section {
    margin-top: 68px;
  }

  .principle-list li,
  .component-list > div {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .evolution-figure {
    grid-template-columns: repeat(3, minmax(0, 1fr) 12px) minmax(0, 1fr);
    align-items: stretch;
  }

  .evolution-figure > div {
    min-width: 0;
    min-height: 0;
    justify-content: flex-start;
    gap: 6px;
    padding: 12px 6px;
    border-radius: 10px;
  }

  .evolution-figure .generation-grid {
    grid-template-columns: repeat(5, 5px);
    gap: 2px;
    margin-bottom: 8px;
  }

  .evolution-figure .generation-grid span {
    width: 5px;
    height: 5px;
    border-radius: 1px;
  }

  .evolution-figure strong {
    font-size: clamp(10px, 2.8vw, 14px);
  }

  .evolution-figure small {
    font-size: 10px;
    overflow-wrap: anywhere;
  }

  .evolution-figure > b {
    align-self: center;
    font-size: 12px;
  }

  .paper-contents ol {
    columns: 1;
  }

  .limit-groups {
    grid-template-columns: 1fr;
  }

  .execution-pipeline li,
  .bridge-flow li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .state-strip {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .capability-groups,
  .library-console-grid,
  .grammar-view,
  .failure-view {
    grid-template-columns: 1fr;
  }

  .compatibility-panel {
    grid-template-columns: 1fr;
  }

  .compatibility-routes {
    min-height: 58px;
    padding: 0 22px;
    grid-template-rows: 1fr;
    grid-template-columns: repeat(4, 1fr);
  }

  .compatibility-routes i {
    width: 3px;
    height: 100%;
    justify-self: center;
  }

  .compatibility-routes i::before,
  .compatibility-routes i::after {
    top: auto;
    left: -3px;
  }

  .compatibility-routes i::before {
    top: -4px;
  }

  .compatibility-routes i::after {
    right: auto;
    bottom: -4px;
  }

  .computer-case {
    padding: 24px 24px 16px;
  }

  .computer-screen {
    min-height: 280px;
    padding: 26px 22px;
  }

  .vfs-view > div {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 6px 12px;
  }

  .vfs-view > div::before {
    grid-row: 1 / 4;
  }

  .vfs-view span,
  .vfs-view small {
    grid-column: 2;
  }

  .capability-terminal {
    padding: 22px;
  }

  .component-graph-scroll {
    scrollbar-color: #9a8364 #eadbc4;
  }

  .component-graph img {
    width: 900px;
    max-width: none;
  }

  .table-scroll {
    width: calc(100vw - 32px);
    margin-top: 26px;
    margin-bottom: 26px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .table-scroll table {
    min-width: 680px;
  }

}

@media (max-width: 520px) {
  .paper-shell {
    padding: 52px max(16px, env(safe-area-inset-right)) 80px max(16px, env(safe-area-inset-left));
  }

  .paper-header {
    margin-bottom: 44px;
  }

  .paper-header h2 {
    font-size: 22px;
    line-height: 1.42;
  }

  .paper-lead,
  .paper > section > p {
    font-size: 16px;
    line-height: 1.7;
  }

  .paper-contents {
    margin-bottom: 56px;
    padding: 16px;
  }

  .paper > section + section {
    margin-top: 62px;
  }

  .paper > section > h2 {
    font-size: 27px;
  }

  .paper code,
  .paper a {
    overflow-wrap: anywhere;
  }

  .paper-disclosure {
    margin: 20px 0;
  }

  .paper-disclosure summary {
    min-height: 66px;
    padding: 14px 50px 14px 16px;
  }

  .paper-disclosure summary::after {
    right: 15px;
  }

  .paper-disclosure summary > span {
    font-size: 13px;
  }

  .disclosure-body {
    padding: 16px;
  }

  .disclosure-body > p {
    font-size: 13px;
  }

  .component-graph,
  .evolution-figure,
  .library-console,
  .host-routing-view,
  .antique-computer,
  .antique-directory,
  .capability-terminal,
  .limit-groups,
  .table-scroll {
    width: calc(100vw - 32px);
  }

  .computer-case {
    padding: 20px 20px 14px;
    border-radius: 28px 28px 18px 18px;
  }

  .computer-screen {
    min-height: 270px;
    padding: 24px 18px;
    border-radius: 19px;
    box-shadow: inset 0 0 30px rgb(0 0 0 / 78%), 0 0 0 6px #6a5c4d;
  }

  .computer-screen dl > div {
    grid-template-columns: 78px 1fr;
  }

  .computer-panel span {
    width: 54px;
  }

  .routing-heading,
  .capability-terminal-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .routing-stage {
    padding: 14px;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .routing-link span {
    max-width: 75%;
    text-align: center;
  }

  .capability-groups {
    padding: 22px 0 8px;
  }

  .library-console {
    padding: 12px;
  }

  .library-console-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .library-console-grid > div {
    min-height: 100px;
  }

  .capability-terminal {
    padding: 18px;
    box-shadow: inset 0 0 36px rgb(0 0 0 / 72%), 0 0 0 6px #c9b18f, 0 14px 26px rgb(58 36 16 / 15%);
  }

}

@media (prefers-reduced-motion: no-preference) {
  .computer-screen > p > i,
  .capability-prompt i {
    animation: terminal-cursor 1.1s steps(1) infinite;
  }
}

@keyframes terminal-cursor {
  50% {
    opacity: 0;
  }
}
