:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #626262;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --line: #d9d9cf;
  --line-strong: #b8b8ad;
  --accent: #087f7a;
  --accent-soft: #dff3ee;
  --amber: #b7791f;
  --amber-soft: #fff3d6;
  --red: #b42318;
  --red-soft: #ffe5df;
  --green: #16703f;
  --green-soft: #e3f5e8;
  --violet: #6741d9;
  --shadow: 0 16px 50px rgba(23, 23, 23, 0.08);
  font-family:
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Inter, ui-sans-serif,
    system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 247, 242, 0.8)),
    var(--paper);
}

button {
  font: inherit;
}

code,
pre {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace,
    "Noto Sans SC", "PingFang SC", "Microsoft YaHei", monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.topbar strong {
  font-size: 15px;
}

.topbar span {
  color: var(--muted);
  font-size: 13px;
}

.mode-pill {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

main {
  width: min(1920px, 100%);
  margin: 0 auto;
  padding: 22px;
}

.topology {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(600px, 1.6fr);
  gap: 24px;
  align-items: stretch;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 58px);
  line-height: 1;
  letter-spacing: 0;
}

.topology-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.node-map {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  align-items: center;
  gap: 10px;
}

.node-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-width: 0;
}

.node {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf8;
}

.node strong {
  font-size: 14px;
}

.node small {
  color: var(--muted);
  line-height: 1.35;
}

.node.ready {
  border-color: rgba(22, 112, 63, 0.4);
  background: var(--green-soft);
}

.node.current {
  border-color: rgba(8, 127, 122, 0.55);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(8, 127, 122, 0.16);
}

.node.waiting {
  opacity: 0.58;
}

.edge {
  width: 16px;
  height: 2px;
  background: var(--line-strong);
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 18px 0 12px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab,
.type-tab,
.control,
.stage {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.tab:hover,
.type-tab:hover,
.control:hover,
.stage:hover {
  border-color: var(--accent);
}

.tab {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  font-weight: 700;
}

.tab.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.type-strip {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(520px, 1.4fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.type-copy h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.type-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.type-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 8px;
}

.type-tab {
  min-height: 92px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 12px;
  border-radius: 8px;
  text-align: left;
}

.type-tab span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.type-tab strong {
  font-size: 14px;
}

.type-tab small {
  color: var(--muted);
  font-size: 12px;
}

.type-tab.selected {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.type-tab.selected span,
.type-tab.selected small {
  color: rgba(255, 255, 255, 0.72);
}

.compat-warning {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid rgba(180, 35, 24, 0.3);
  border-radius: 8px;
  color: var(--red);
  background: var(--red-soft);
  font-size: 13px;
  font-weight: 800;
}

.player {
  display: flex;
  gap: 8px;
}

.control {
  height: 38px;
  padding: 0 13px;
  border-radius: 8px;
  font-weight: 700;
}

.control.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.stagebar {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.stage {
  min-height: 72px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  text-align: left;
}

.stage span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #efefea;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stage strong {
  font-size: 12px;
}

.stage small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.stage.done {
  background: var(--green-soft);
  border-color: rgba(22, 112, 63, 0.28);
}

.stage.selected {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.panes {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf9;
}

.panel-head span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 900;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.module {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.module:last-child {
  border-bottom: 0;
}

.module h3 {
  margin-bottom: 10px;
  color: #303030;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th {
  padding: 8px 7px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  text-align: left;
}

td {
  padding: 9px 7px;
  vertical-align: top;
  border-bottom: 1px solid #ecece6;
  font-size: 12px;
}

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

td code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  color: #242424;
  line-height: 1.35;
}

.kv td:first-child {
  width: 38%;
  color: var(--muted);
  font-weight: 800;
}

.pool th:nth-child(1),
.pool td:nth-child(1) {
  width: 25%;
}

.pool th:nth-child(2),
.pool td:nth-child(2) {
  width: 16%;
}

.pool th:nth-child(3),
.pool td:nth-child(3) {
  width: 18%;
}

.trace th:nth-child(2),
.trace td:nth-child(2) {
  width: 22%;
}

.diff th:nth-child(1),
.diff td:nth-child(1) {
  width: 25%;
}

.diff th:nth-child(2),
.diff td:nth-child(2),
.diff th:nth-child(3),
.diff td:nth-child(3) {
  width: 22%;
}

tr.waiting,
li.waiting,
.finality-item.waiting,
.hash-box.waiting {
  opacity: 0.38;
}

tr.current td {
  background: var(--amber-soft);
}

tr.ready td {
  background: rgba(227, 245, 232, 0.34);
}

.hash-box {
  margin: 14px;
  padding: 12px;
  border: 1px solid rgba(103, 65, 217, 0.25);
  border-radius: 8px;
  background: #f0ecff;
}

.hash-box small {
  display: block;
  margin-bottom: 6px;
  color: var(--violet);
  font-weight: 900;
  text-transform: uppercase;
}

.hash-box code {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.event-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.event-list li.current {
  background: var(--amber-soft);
  border-color: rgba(183, 121, 31, 0.35);
}

.event-list li.ready {
  background: var(--green-soft);
  border-color: rgba(22, 112, 63, 0.25);
}

.time {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.event-list strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.event-list p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.beacon-card {
  margin: 14px;
  padding: 14px;
  border: 1px solid rgba(8, 127, 122, 0.24);
  border-radius: 8px;
  background: var(--accent-soft);
}

.beacon-card span,
.beacon-card small {
  display: block;
}

.beacon-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.beacon-card strong {
  display: block;
  margin: 5px 0;
  font-size: 24px;
}

.beacon-card small {
  color: #315a57;
  line-height: 1.35;
}

.finality {
  display: grid;
  gap: 8px;
}

.finality-item {
  display: grid;
  grid-template-columns: 82px 78px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.finality-item.current {
  background: var(--amber-soft);
  border-color: rgba(183, 121, 31, 0.35);
}

.finality-item.ready {
  background: var(--green-soft);
  border-color: rgba(22, 112, 63, 0.25);
}

.finality-item span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.finality-item strong {
  font-size: 12px;
}

.finality-item small {
  color: var(--muted);
  line-height: 1.3;
}

.json {
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid #242424;
  border-radius: 8px;
  color: #f7f7f2;
  background: #202020;
  font-size: 12px;
  line-height: 1.5;
}

.devnet {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(280px, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.devnet h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.devnet p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.devnet code {
  display: block;
  padding: 14px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f0eb;
  line-height: 1.45;
}

@media (max-width: 1380px) {
  .topology {
    grid-template-columns: 1fr;
  }

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

  .type-tabs {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .panes {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }

  .stagebar {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

@media (max-width: 820px) {
  main {
    padding: 14px;
  }

  .topbar,
  .controls,
  .devnet {
    grid-template-columns: 1fr;
    display: grid;
    align-items: start;
  }

  .topbar > div:first-child {
    display: grid;
    gap: 4px;
  }

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

  .node-wrap {
    grid-template-columns: 1fr;
  }

  .edge {
    width: 2px;
    height: 14px;
    margin: 0 auto;
  }

  .stagebar,
  .type-tabs,
  .panes {
    grid-template-columns: 1fr;
  }

  .player {
    width: 100%;
  }

  .control {
    flex: 1;
  }

  .finality-item {
    grid-template-columns: 1fr;
  }
}

/* Guided, single-step transaction walkthrough */
.walkthrough-main {
  width: min(1480px, 100%);
}

.walkthrough-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 28px;
  align-items: end;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 92% 12%, rgba(8, 127, 122, 0.1), transparent 36%),
    var(--surface);
  box-shadow: var(--shadow);
}

.walkthrough-intro h1 {
  max-width: 900px;
  margin-bottom: 12px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.04;
}

.walkthrough-intro > div > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.source-summary {
  min-width: 0;
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid rgba(8, 127, 122, 0.24);
  border-radius: 12px;
  background: rgba(223, 243, 238, 0.72);
}

.source-summary span {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.source-summary strong {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.source-summary small {
  color: #315a57;
  line-height: 1.45;
}

.scenario-bar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
}

.scenario-bar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 9px;
}

.scenario-bar > div:first-child > small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.scenario-bar .tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.scenario-bar .tab {
  flex: 0 0 auto;
}

.walkthrough-layout {
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.journey-sidebar {
  position: sticky;
  top: 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.journey-sidebar-head {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf9;
}

.journey-sidebar-head h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.journey-sidebar-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.journey-steps {
  display: grid;
  gap: 0;
  padding: 10px;
}

.journey-step {
  position: relative;
  width: 100%;
  min-height: 78px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.journey-step:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: 49px;
  bottom: -17px;
  left: 30px;
  width: 2px;
  background: var(--line);
}

.journey-step:hover {
  border-color: rgba(8, 127, 122, 0.34);
  background: #f5faf8;
}

.journey-step:focus-visible {
  outline: 3px solid rgba(8, 127, 122, 0.22);
  outline-offset: 2px;
}

.journey-step.is-current {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.journey-step.is-done .journey-index {
  color: #fff;
  background: var(--green);
}

.journey-step.is-done:not(:last-child)::after {
  background: rgba(22, 112, 63, 0.52);
}

.journey-step.is-upcoming {
  color: #555;
}

.journey-index {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: #f1f1ec;
  font-size: 12px;
  font-weight: 900;
}

.journey-step.is-current .journey-index {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(8, 127, 122, 0.12);
}

.journey-step-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.journey-step-copy strong {
  font-size: 14px;
}

.journey-step-copy small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.journey-step-copy em {
  margin-top: 2px;
  color: var(--accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-focus {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.journey-focus-head {
  padding: clamp(22px, 3vw, 36px);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(8, 127, 122, 0.98), rgba(4, 86, 83, 0.98)),
    var(--accent);
}

.focus-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 900;
}

.journey-focus-head h2 {
  margin-bottom: 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.06;
}

.journey-focus-head > p {
  max-width: 860px;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  line-height: 1.65;
}

.evidence-badge {
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.16);
  font-size: 10px;
}

.evidence-badge.observed {
  color: #d9ffe6;
}

.evidence-badge.partial,
.evidence-badge.inferred {
  color: #fff0ba;
}

.handoff-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.handoff-map > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.handoff-map small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.handoff-map strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.handoff-arrow {
  color: rgba(255, 255, 255, 0.7);
  font-size: 20px;
}

.step-explainer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf9;
}

.step-explainer article {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.step-explainer span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.step-explainer strong {
  font-size: 14px;
  line-height: 1.5;
}

.evidence-note {
  margin: 20px 20px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fbfbf9;
}

.evidence-note.observed {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.evidence-note.partial,
.evidence-note.inferred {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.evidence-note.illustrative {
  border-left-color: var(--violet);
  background: #f0ecff;
}

.evidence-note strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.evidence-note p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.step-result {
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafaf8;
}

.step-result-head,
.result-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.step-result-head {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.step-result-head .eyebrow {
  margin-bottom: 6px;
}

.step-result-head h2 {
  margin: 0;
  font-size: 21px;
}

.compact-pill {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f5f5f0;
  font-size: 11px;
  font-weight: 800;
}

.step-result-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.result-block {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.result-block h3 {
  margin-bottom: 12px;
  font-size: 13px;
}

.result-block-head h3 {
  margin-bottom: 4px;
}

.result-block-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.table-scroll {
  overflow-x: auto;
}

.step-result tr.waiting,
.step-result li.waiting,
.step-result .finality-item.waiting,
.step-result .hash-box.waiting {
  opacity: 1;
}

.step-result tr.current td,
.step-result tr.ready td {
  background: transparent;
}

.type-lesson {
  display: grid;
  gap: 14px;
}

.compact-type-tabs {
  grid-template-columns: repeat(5, minmax(105px, 1fr));
}

.compact-type-tabs .type-tab {
  min-height: 76px;
}

.compact-json {
  max-height: none;
}

.focused-hash {
  margin: 0;
}

.stage-callout {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.stage-callout.neutral {
  border-color: rgba(8, 127, 122, 0.22);
  background: var(--accent-soft);
}

.stage-callout.warning {
  border-color: rgba(183, 121, 31, 0.3);
  background: var(--amber-soft);
}

.stage-callout strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.stage-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.focused-events li,
.focused-finality .finality-item {
  opacity: 1;
}

.raw-record {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.raw-record summary {
  padding: 15px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.raw-record .json {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.focus-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
}

.focus-nav span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.control:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.journey-devnet {
  border-radius: 12px;
}

@media (max-width: 1120px) {
  .walkthrough-intro {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .walkthrough-layout {
    grid-template-columns: 260px minmax(0, 1fr);
  }

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

  .handoff-map > div:last-child {
    grid-column: 1 / -1;
  }

  .handoff-map .handoff-arrow:last-of-type {
    display: none;
  }

  .compact-type-tabs {
    grid-template-columns: repeat(3, minmax(110px, 1fr));
  }
}

@media (max-width: 900px) {
  .scenario-bar {
    display: grid;
    align-items: start;
  }

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

  .journey-sidebar {
    position: static;
  }

  .journey-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .journey-step:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 680px) {
  .walkthrough-intro {
    padding: 20px;
  }

  .scenario-bar .player,
  .scenario-bar .control {
    width: 100%;
  }

  .journey-steps,
  .step-explainer,
  .compact-type-tabs {
    grid-template-columns: 1fr;
  }

  .journey-steps {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .journey-step {
    flex: 0 0 252px;
    scroll-snap-align: start;
  }

  .journey-focus-head {
    padding: 22px 18px;
  }

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

  .handoff-map > div:last-child {
    grid-column: auto;
  }

  .handoff-arrow,
  .handoff-map .handoff-arrow:last-of-type {
    display: block;
    text-align: center;
    transform: rotate(90deg);
  }

  .step-explainer,
  .evidence-note,
  .step-result {
    margin-right: 14px;
    margin-left: 14px;
  }

  .step-explainer {
    padding: 14px;
    margin: 0;
  }

  .step-result-head,
  .result-block-head,
  .focus-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .focus-nav .control {
    width: 100%;
  }
}

/* Interactive RPC + wallet infrastructure lab */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.infra-trigger {
  min-width: 210px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.infra-trigger:hover {
  border-color: var(--accent);
}

.infra-trigger > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.topbar .infra-trigger strong {
  font-size: 11px;
}

.topbar .infra-trigger small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.infra-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(184, 184, 173, 0.18);
}

.infra-trigger.partial .infra-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.15);
}

.infra-trigger.ready .infra-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 112, 63, 0.15);
}

.infra-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(18, 22, 21, 0.38);
  backdrop-filter: blur(3px);
}

.infra-drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(680px, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: #f7f7f2;
  box-shadow: -20px 0 70px rgba(23, 23, 23, 0.2);
}

.infra-drawer-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
}

.infra-drawer-head h2 {
  margin-bottom: 7px;
  font-size: 25px;
}

.infra-drawer-head p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.drawer-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.infra-drawer-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.infra-boundary-map {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.infra-boundary-map > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 9px;
  background: #f5f5f0;
}

.infra-boundary-map span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.infra-boundary-map strong {
  overflow-wrap: anywhere;
  font-size: 11px;
}

.infra-boundary-map small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.infra-boundary-map b {
  color: var(--accent);
}

.infra-message {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  line-height: 1.45;
}

.infra-message.error {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.28);
  background: var(--red-soft);
}

.infra-message.success {
  color: var(--green);
  border-color: rgba(22, 112, 63, 0.28);
  background: var(--green-soft);
}

.infra-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.infra-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.infra-card-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.infra-card-head span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 900;
}

.infra-card-head h3 {
  margin: 0;
  font-size: 16px;
}

.infra-card-head em {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #f5f5f0;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.infra-card-head .status-connected {
  color: var(--green);
  border-color: rgba(22, 112, 63, 0.25);
  background: var(--green-soft);
}

.infra-card-head .status-error,
.infra-card-head .status-disconnected {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.25);
  background: var(--red-soft);
}

.infra-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.infra-card label {
  display: grid;
  gap: 6px;
}

.infra-card label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.infra-card input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfbf9;
  font: 12px "SFMono-Regular", Consolas, "Noto Sans SC", monospace;
}

.infra-card input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(8, 127, 122, 0.12);
}

.infra-presets,
.infra-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.infra-presets button,
.infra-actions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfbf9;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.infra-presets span {
  color: var(--muted);
  font-size: 10px;
}

.infra-primary {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.infra-primary.send {
  min-height: 46px;
}

.infra-primary:disabled,
.infra-actions button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.infra-status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.infra-status-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.infra-status-grid dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.infra-status-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 11px;
  line-height: 1.35;
}

.wallet-summary {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfbf9;
}

.wallet-summary strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.wallet-summary small {
  font-size: 11px;
}

.wallet-summary .match {
  color: var(--green);
}

.wallet-summary .mismatch {
  color: var(--red);
}

.infra-field-row {
  display: grid;
  grid-template-columns: minmax(0, 0.65fr) minmax(0, 1.35fr);
  gap: 10px;
}

.infra-safety-note {
  padding: 11px 12px;
  border: 1px solid rgba(183, 121, 31, 0.28);
  border-radius: 9px;
  background: var(--amber-soft);
}

.infra-safety-note strong {
  display: block;
  margin-bottom: 4px;
  color: var(--amber);
  font-size: 10px;
}

.infra-safety-note p {
  margin: 0;
  color: #674c1f;
  font-size: 11px;
  line-height: 1.5;
}

.infra-empty {
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  background: #fbfbf9;
  font-size: 11px;
  line-height: 1.5;
}

.infra-events {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.infra-events li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf9;
}

.infra-events li > span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
}

.infra-events li > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.infra-events strong {
  font-size: 11px;
}

.infra-events code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 820px) {
  .topbar-actions {
    width: 100%;
    display: grid;
  }

  .infra-trigger {
    width: 100%;
  }

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

  .infra-boundary-map b {
    text-align: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 560px) {
  .infra-drawer-head {
    padding: 18px;
  }

  .infra-drawer-body {
    padding: 12px;
  }

  .infra-status-grid,
  .infra-field-row {
    grid-template-columns: 1fr;
  }
}

/* Explicit input -> transform -> output view */
.artifact-transition {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.artifact-transition > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
}

.artifact-transition small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.artifact-transition strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.artifact-transition > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.transformation-shell {
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f8f4;
}

.transformation-shell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.transformation-shell-head .eyebrow {
  margin-bottom: 5px;
}

.transformation-shell-head h2 {
  margin: 0;
  font-size: 21px;
}

.transformation-board {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(310px, 1.25fr) minmax(220px, 0.9fr);
  gap: 14px;
  align-items: start;
  padding: 16px;
}

.artifact-card,
.operation-lane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.artifact-card {
  position: sticky;
  top: 76px;
}

.artifact-card.artifact-input {
  border-color: rgba(103, 65, 217, 0.28);
  background: linear-gradient(180deg, #f7f4ff, #fff 42%);
}

.artifact-card.artifact-output {
  border-color: rgba(22, 112, 63, 0.3);
  background: linear-gradient(180deg, #effaf2, #fff 42%);
}

.artifact-card > header,
.operation-lane > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.artifact-input > header {
  color: #5230bb;
  background: rgba(103, 65, 217, 0.07);
}

.artifact-output > header {
  color: var(--green);
  background: rgba(22, 112, 63, 0.07);
}

.artifact-card > header span,
.operation-lane > header span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.artifact-card > header em {
  max-width: 52%;
  overflow-wrap: anywhere;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}

.artifact-card > h3 {
  margin: 0;
  padding: 16px 14px 10px;
  font-size: 16px;
  line-height: 1.4;
}

.artifact-fields {
  display: grid;
  margin: 0;
  padding: 0 14px 14px;
}

.artifact-fields > div {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e1;
}

.artifact-fields > div:last-child {
  border-bottom: 0;
}

.artifact-fields dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.artifact-fields dd {
  min-width: 0;
  margin: 0;
}

.artifact-fields code {
  display: block;
  max-height: 112px;
  overflow: auto;
  overflow-wrap: anywhere;
  color: #232323;
  font-size: 11px;
  line-height: 1.45;
  white-space: normal;
}

.artifact-note {
  margin: 0;
  padding: 12px 14px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  line-height: 1.5;
}

.operation-lane {
  border-color: rgba(183, 121, 31, 0.3);
  background: #fffdf7;
}

.operation-lane > header {
  display: grid;
  justify-content: stretch;
  gap: 4px;
  color: var(--amber);
  background: var(--amber-soft);
}

.operation-lane > header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.transform-operations {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 12px;
  list-style: none;
}

.transform-operations li {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0 14px;
}

.transform-operations li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 37px;
  bottom: -3px;
  left: 14px;
  width: 2px;
  background: rgba(183, 121, 31, 0.28);
}

.operation-index {
  position: relative;
  z-index: 1;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  font-size: 11px;
  font-weight: 900;
}

.transform-operations strong {
  display: block;
  margin: 3px 0 5px;
  font-size: 13px;
}

.transform-operations p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.operation-result {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border: 1px solid rgba(183, 121, 31, 0.2);
  border-radius: 8px;
  background: rgba(255, 243, 214, 0.55);
}

.operation-result span {
  color: var(--amber);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.operation-result code {
  max-height: 82px;
  overflow: auto;
  overflow-wrap: anywhere;
  color: #3a2b12;
  font-size: 10px;
  line-height: 1.45;
  white-space: normal;
}

.transformation-explanation {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 14px;
  margin: 0 16px 16px;
  padding: 14px 16px;
  border: 1px solid rgba(8, 127, 122, 0.25);
  border-radius: 10px;
  background: var(--accent-soft);
}

.transformation-explanation span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.transformation-explanation p {
  margin: 0;
  color: #315a57;
  font-size: 13px;
  line-height: 1.55;
}

.evidence-drawer {
  margin: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafaf8;
}

.evidence-drawer summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  cursor: pointer;
  list-style-position: inside;
}

.evidence-drawer summary span {
  font-size: 13px;
  font-weight: 900;
}

.evidence-drawer summary small {
  color: var(--muted);
  font-size: 11px;
}

.evidence-drawer[open] summary {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

@media (max-width: 1050px) {
  .transformation-board {
    grid-template-columns: 1fr;
  }

  .artifact-card {
    position: static;
  }

  .operation-lane {
    order: 2;
  }

  .artifact-output {
    order: 3;
  }

  .artifact-input::after,
  .operation-lane::after {
    content: "↓";
    display: block;
    padding: 8px;
    color: var(--accent);
    background: #f8f8f4;
    font-size: 20px;
    font-weight: 900;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .artifact-transition {
    grid-template-columns: 1fr;
  }

  .artifact-transition > span {
    padding: 2px 0;
  }

  .transformation-shell,
  .evidence-drawer {
    margin-right: 14px;
    margin-left: 14px;
  }

  .transformation-shell-head,
  .evidence-drawer summary,
  .transformation-explanation {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .transformation-shell-head,
  .evidence-drawer summary {
    flex-direction: column;
  }

  .transformation-board {
    padding: 12px;
  }

  .transformation-explanation {
    gap: 6px;
    margin: 0 12px 12px;
  }
}
