:root {
  --paper: #f4efe6;
  --ink: #1c1916;
  --muted: #5c564c;
  --line: #ddd4c4;
  --card: #fffaf3;
  --public: #1e3a5f;
  --public-bg: #e7eef6;
  --ok: #1b5c3a;
  --ok-bg: #e5f3ea;
  --hidden: #7a3b08;
  --hidden-bg: #f8e6c8;
  --button: #1c1916;
  --button-ink: #fffaf3;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.45;
}
.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 64px; }
.kicker {
  margin: 28px 0 0;
  color: var(--public);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1 {
  margin: 8px 0 12px;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
h2 { margin: 0 0 6px; font-size: 22px; }
.lede, .actions-head p, .callout p { max-width: 62ch; }
h1, p { overflow-wrap: break-word; }
.lede { font-size: 20px; margin: 0 0 22px; }
.callout, .pod, .note, .result, .hub {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.callout { padding: 18px 18px 8px; margin-bottom: 18px; }
.callout details { margin: 8px 0 12px; }
summary { cursor: pointer; font-weight: 700; }
.stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 28px;
  align-items: start;
  min-width: 0;
  margin: 6px 0 28px;
}
.chain-link {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 120px;
  margin: 0;
  text-align: center;
  pointer-events: none;
}
.chain-link-line {
  position: relative;
  display: block;
  width: 100%;
  height: 2px;
  background: var(--public);
}
.chain-link-line::before,
.chain-link-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--public);
  transform: translateY(-50%);
}
.chain-link-line::before { left: 0; }
.chain-link-line::after { right: 0; }
.chain-link-label,
.chain-link-note { margin: 0; }
.chain-link-label {
  color: var(--public);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--paper);
  padding: 0 4px;
}
.chain-link-note {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--paper);
  padding: 0 4px;
}
.chain-pane, .pod-pane { min-width: 0; }
.pane-head h2 { margin-bottom: 0; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pane-lead { margin: 6px 0 0; color: var(--muted); max-width: 42ch; }
.pulse-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pulse-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.8s ease-in-out infinite;
}
.pulse-label.stale { color: var(--hidden); }
.orbit {
  --ring: 34%;
  position: relative;
  width: min(460px, 100%);
  min-width: 0;
  max-width: 100%;
  aspect-ratio: 1;
  margin: 10px auto 8px;
}
.live-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.ring-track, .ring-flow { fill: none; }
.ring-track { stroke: #d9d0c2; stroke-width: 1.4; }
.ring-flow {
  stroke: var(--public);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 16 197;
  transform-box: fill-box;
  transform-origin: center;
  animation: orbit-spin 14s linear infinite;
}
.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: max-content;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 12px 14px 10px;
  text-align: center;
  transform: translate(-50%, -50%);
}
.hub .role { margin-bottom: 2px; }
.block {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", serif;
  font-size: clamp(22px, 3vw, 36px);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}
.orbit.tick .block { animation: pop 0.45s ease; }
.validators {
  position: absolute;
  inset: 0;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}
.validators li {
  position: absolute;
  left: calc(50% + cos(var(--angle)) * var(--ring));
  top: calc(50% + sin(var(--angle)) * var(--ring));
  width: 108px;
  margin: 0;
  padding: 8px 8px 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 18px rgba(28, 25, 22, 0.07);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: background 0.35s ease, color 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.validators li strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.validators li .addr {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.validators li.sealing {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--button-ink);
  box-shadow: 0 10px 22px rgba(28, 25, 22, 0.22);
}
.validators li.sealing .addr { color: #e4d8c6; }
.validators li.sealing::after {
  content: "Writing";
  display: block;
  margin-top: 3px;
  color: #e4d8c6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pod-pane { display: grid; gap: 10px; align-content: start; }
.member-well {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #cfe0d4;
  border-radius: 20px;
  background: #f3f7f4;
}
.pod {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
}
.pod h3 { margin: 0; font-size: 22px; }
.note { padding: 14px 16px; text-align: center; }
.outsider { border-style: dashed; }
.dot {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 50%;
  background: #c8c0b4;
}
.pod.up .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(27, 92, 58, 0.16); }
.pod.down .dot { background: #a33b24; box-shadow: 0 0 0 4px rgba(163, 59, 36, 0.14); }
.node-name {
  margin: 0;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12px;
}
#ledger[data-tone="public"] .hub,
.pod[data-tone="public"] { background: var(--public-bg); border-color: #b7cbe4; }
.pod[data-tone="ok"], .note.seen { background: var(--ok-bg); border-color: #b7dcc6; }
#ledger[data-tone="hidden"] .hub,
.pod[data-tone="hidden"] { background: var(--hidden-bg); border-color: #e2c48a; }
.role {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status, .live-line { margin: 0; color: var(--muted); }
.live-line { margin-top: 2px; font-size: 13px; }
.chain-pane > .live-line, .chain-pane > .status { text-align: center; }
.amount {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes pop {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .ring-flow, .pulse-label::before, .orbit.tick .block { animation: none; }
  .validators li { transition: none; }
}
.actions-head { margin-bottom: 12px; }
.actions-head p { margin: 0; color: var(--muted); }
.run-all, .steps button {
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.run-all {
  width: 100%;
  margin-bottom: 12px;
  border: 0;
  background: var(--button);
  color: var(--button-ink);
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps button {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.run-all:focus-visible, .steps button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--public);
  outline-offset: 2px;
}
button:disabled { opacity: 0.6; cursor: wait; }
.result { margin-top: 8px; padding: 14px; }
.result[hidden] { display: none; }
.result h3 { margin: 0 0 6px; font-size: 20px; }
.result p { margin: 0 0 10px; }
.facts { display: grid; grid-template-columns: 14rem 1fr; gap: 4px 12px; margin: 0 0 10px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.links a {
  color: var(--public);
  font-weight: 700;
}
.command { margin-top: 8px; }
.command summary { color: var(--public); }
.code, .command pre {
  overflow: auto;
  padding: 12px;
  border-radius: 10px;
  background: #241f1b;
  color: #f6f1e8;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
}
.waiting { color: var(--muted); }
.error { color: var(--hidden); font-weight: 700; }
@media (max-width: 1100px) {
  .stage { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .chain-link {
    position: static;
    width: auto;
    margin: 0 auto;
  }
  .chain-link-line { width: 2px; height: 28px; }
  .chain-link-line::before { left: 50%; top: 0; transform: translate(-50%, 0); }
  .chain-link-line::after { left: 50%; right: auto; top: auto; bottom: 0; transform: translate(-50%, 0); }
}
@media (max-width: 720px) {
  h1 { font-size: 34px; }
  .lede, .actions-head p, .callout p, .pane-lead { max-width: 100%; }
  .orbit { --ring: 36%; width: 100%; }
  .validators li { width: 92px; padding: 6px 4px 5px; }
  .validators li strong { font-size: 11px; }
  .validators li .addr { font-size: 10px; }
  .hub { max-width: none; padding: 8px 8px 6px; }
  .block { font-size: 22px; }
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 8px; }
}
