* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    15px/1.5 Arial,
    Helvetica,
    sans-serif;
}
.measure {
  max-width: 1192px;
  margin: auto;
  padding: 0 36px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 80px;
  border-bottom: 1px solid var(--line);
}
.identity {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.identity span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}
.identity #testril-server {
  font-size: 10px;
  overflow-wrap: anywhere;
}
.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
}
.demo-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.demo-actions button {
  font-size: 13px;
}
.identity {
  text-align: right;
}
.demo-context {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
}
.mode-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  margin: 0;
  padding: 0;
}
.mode-switch label {
  margin: 0;
  font-size: 12px;
  cursor: pointer;
}
.mode-switch label:has(input:checked) {
  color: var(--accent);
  font-weight: 600;
}
.mode-switch label:has(input:disabled) {
  opacity: 0.55;
  cursor: default;
}
.mode-switch label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.sr-only,
.mode-switch input[type="radio"],
.wallet-choice input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  margin: 0;
  white-space: nowrap;
}
.intro {
  padding: 8px 0 28px;
}

h1 {
  font-size: 58px;
  line-height: 1.06;
  letter-spacing: -0.04em;
  font-weight: 400;
  margin: 0 0 16px;
}
.intro > p.subtitle {
  font-size: 26px;
  color: var(--muted);
  margin: 0;
}
h2 {
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.025em;
  margin: 0;
  line-height: 1.25;
}
h3 {
  font-size: 19px;
  font-weight: 400;
  margin: 0;
}
p {
  margin: 12px 0;
}
.small {
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.badge {
  border: 1px solid var(--visual-line);
  border-radius: 4px;
  background: var(--visual);
  color: var(--accent);
  font-size: 11px;
  padding: 4px 8px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.demo-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  margin-bottom: 32px;
}
.workspace {
  position: sticky;
  top: 24px;
  padding: 0;
  overflow: hidden;
}
.transfer-panel,
.balances-section {
  padding: 20px;
}
.balances-section {
  background: var(--visual);
  border-top: 1px solid var(--line);
}
.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.workspace .section-top {
  margin-bottom: 16px;
}
.workspace h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 12px;
}
.wallet-choice {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.wallet-choice legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 12px;
}
.wallet-options {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}
.wallet-options label {
  margin: 0;
  cursor: pointer;
}
.wallet-options label + label {
  border-left: 1px solid var(--line);
}
.wallet-options span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}
.wallet-options input:checked + span {
  background: var(--accent);
  color: var(--button-ink);
  font-weight: 600;
}
.wallet-options input:disabled + span {
  opacity: 0.4;
  cursor: default;
}
.wallet-options input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}
.amount-control {
  grid-column: 1 / -1;
}
.amount-send {
  display: flex;
  align-items: center;
  gap: 12px;
}
.amount-send input {
  flex: 1;
}
.amount-send #transfer {
  flex: 0 0 84px;
}
label {
  display: block;
  font-size: 12px;
  margin-bottom: 8px;
}
input,
select,
button {
  font: inherit;
}
select,
input:not([type="range"]) {
  height: 44px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 8px 10px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
}
button {
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  background: var(--accent);
  color: var(--button-ink);
  padding: 10px 16px;
  cursor: pointer;
  transition: opacity 150ms;
}
button:hover {
  opacity: 0.85;
}
button:disabled {
  opacity: 0.55;
  cursor: default;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
.secondary {
  background: var(--panel);
  color: var(--accent);
  border-color: var(--line);
}
.text-button {
  background: none;
  color: var(--accent);
  border-color: transparent;
  padding: 8px;
  font-size: 12px;
}
#status {
  font-size: 12px;
  min-height: 18px;
  margin: 0 0 12px;
  color: var(--muted);
}
#status:empty {
  display: none;
}
#status.error {
  color: #803f32;
}
.wallet-grid {
  display: grid;
  gap: 8px;
}
.wallet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 8px;
  padding: 10px 12px;
  color: var(--ink);
  text-align: left;
  font-family: Arial, Helvetica, sans-serif;
}
.wallet:hover {
  opacity: 1;
  border-color: var(--accent);
}
.wallet-name {
  font-size: 12px;
}
.wallet-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 23px;
  font-weight: 400;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.wallet-value strong {
  font-weight: inherit;
}
.wallet-value small {
  font-size: 10px;
  color: var(--muted);
}
.wallet-value.precise-value {
  font-size: 17px;
}
.wallet-share {
  grid-column: 1 / -1;
  margin-top: 6px;
}
.wallet-address {
  grid-column: 1 / -1;
  font-size: 9px;
  color: var(--muted);
  font-family: monospace;
  overflow-wrap: anywhere;
  margin-top: 4px;
}
.wallet meter {
  width: 100%;
  height: 4px;
}
meter::-webkit-meter-bar {
  background: var(--visual);
  border: 0;
  border-radius: 2px;
}
meter::-webkit-meter-optimum-value {
  background: var(--accent);
}
meter::-moz-meter-bar {
  background: var(--accent);
}
.balance-help {
  margin: 16px 0 0;
}
.histories {
  min-width: 0;
}
.history-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 20px;
  margin-bottom: 20px;
}
.history-tabs [role="tab"] {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 0;
  font-size: 15px;
}
.history-tabs [aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-count {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  background: var(--visual);
  font-size: 11px;
  border-radius: 3px;
}
.payment-history .payment-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  font-size: 12px;
  color: var(--muted);
}
.payment-total strong {
  font-size: 23px;
  font-weight: 400;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.payment-operation {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--visual);
}
.payment-operation h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}
.payment-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}
.payment-grid {
  margin-top: 0;
}
.history-section {
  margin: 0;
}
.eyebrow {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 6px;
}
#history-note {
  font-size: 12px;
  color: var(--muted);
}
.replay-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.history-layout {
  min-width: 0;
}
.illustration {
  background: var(--visual);
}
.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 12px 0;
  text-align: center;
}
.diagram-scroll {
  overflow-x: auto;
  margin: 20px 0;
}
.transfer-diagram {
  display: block;
  width: 100%;
  min-width: 640px;
}
.diagram-wallet rect {
  fill: var(--map-fill);
  stroke: var(--map-stroke);
}
.diagram-wallet text {
  fill: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
.diagram-wallet-name {
  font-size: 15px;
}
.diagram-wallet-balance {
  font-size: 23px;
}
.treasury-node rect {
  fill: var(--accent);
  stroke: var(--accent);
}
.treasury-node text {
  fill: var(--button-ink);
}
.diagram-lifeline {
  fill: none;
  stroke: var(--visual-line);
  stroke-dasharray: 4 6;
}
.diagram-row-rule {
  fill: none;
  stroke: var(--visual-line);
}
.diagram-row-background {
  fill: transparent;
  cursor: pointer;
}
.transfer-edge.selected .diagram-row-background,
.transfer-edge:hover .diagram-row-background,
.transfer-edge:focus-within .diagram-row-background {
  fill: var(--map-fill);
}
.diagram-line {
  fill: none;
  stroke: var(--map-stroke);
  stroke-width: 1.5;
  cursor: pointer;
}
.diagram-arrow {
  fill: var(--map-stroke);
  cursor: pointer;
}
.transfer-edge.selected .diagram-line,
.transfer-edge:focus-within .diagram-line,
.transfer-edge:hover .diagram-line {
  stroke: var(--accent);
  stroke-width: 3;
}
.diagram-transfer {
  display: grid;
  grid-template-rows: 24px 18px 1fr 18px;
  width: 100%;
  height: 96px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  text-align: center;
}
.diagram-transfer:hover {
  opacity: 1;
  border-color: var(--map-stroke);
}
.diagram-amount {
  font-size: 16px;
}
.diagram-time,
.diagram-block {
  font: 12px/18px monospace;
  color: var(--muted);
}
.diagram-block {
  grid-row: 4;
}

.illustration-help {
  margin-bottom: 0;
}
.modal,
.provenance {
  width: min(640px, calc(100% - 36px));
  max-height: calc(100dvh - 48px);
  margin: auto;
  overflow-y: auto;
  color: var(--ink);
}
dialog::backdrop {
  background: rgb(37 43 37 / 45%);
}
.transfer-progress {
  width: min(480px, calc(100% - 36px));
  padding: 32px;
}
.transfer-progress h2 {
  font-size: 28px;
}
#progress-heading:focus {
  outline: none;
}
#progress-summary {
  font-size: 14px;
  margin: 12px 0 24px;
  overflow-wrap: anywhere;
}
.progress-phase + .progress-phase {
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}
.progress-phase-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}
.progress-phase-heading h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.progress-phase-heading span {
  font-variant-numeric: tabular-nums;
}
.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.progress-steps li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  color: var(--muted);
}
.progress-steps li.active,
.progress-steps li.complete {
  color: var(--accent);
}
.progress-steps li.active > span:nth-child(2) {
  font-weight: 600;
}
.progress-state {
  font-size: 11px;
}
.progress-icon {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
}
.active .progress-icon {
  border-color: var(--line);
  border-top-color: var(--accent);
  animation: progress-spin 850ms linear infinite;
}
.complete .progress-icon {
  display: grid;
  place-items: center;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--button-ink);
  font-size: 11px;
}
.complete .progress-icon::after {
  content: "✓";
}
.progress-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
}
#progress-elapsed {
  font-variant-numeric: tabular-nums;
}
@keyframes progress-spin {
  to {
    transform: rotate(360deg);
  }
}
.provenance .section-top {
  margin-bottom: 8px;
}
.mock-source {
  color: var(--accent);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.provenance dl {
  margin: 16px 0 0;
}
.provenance dt {
  color: var(--muted);
  font-size: 11px;
  margin-top: 16px;
}
.provenance dd {
  margin: 4px 0 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.provenance dd.hash {
  font: 11px/1.7 monospace;
}
.payment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin: 24px 0;
}
.payment-grid span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.payment-grid strong {
  display: block;
  font-size: 23px;
  font-weight: 400;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
details {
  border-top: 1px solid var(--line);
  margin-top: 16px;
}
summary {
  cursor: pointer;
  font-size: 13px;
  padding: 16px 0 0;
  min-height: 44px;
}
#reset-sweeps {
  font-size: 12px;
  padding-left: 20px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
th {
  background: var(--visual);
  font-size: 11px;
  font-weight: 400;
}
th,
td {
  text-align: right;
  white-space: nowrap;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
th:first-child,
td:first-child {
  text-align: left;
}
.cost {
  padding: 0 4px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 4px;
}
.cost-breakdown {
  position: fixed;
  z-index: 10;
  max-width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--visual);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-line;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
footer div {
  display: flex;
  gap: 24px;
}
a {
  color: var(--accent);
  text-underline-offset: 4px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1120px) {
  .demo-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .workspace {
    position: static;
  }
}
@media (max-width: 700px) {
  .measure {
    padding: 0 18px;
  }
  .masthead {
    min-height: 64px;
  }
  .masthead img {
    width: 108px;
  }
  .identity {
    font-size: 12px;
  }
  .demo-actions button {
    font-size: 11px;
    padding: 8px;
  }
  .history-tabs {
    gap: 20px;
  }
  .history-tabs [role="tab"] {
    font-size: 13px;
  }
  .demo-context {
    gap: 16px;
  }
  .intro {
    padding: 8px 0 24px;
  }

  h1 {
    font-size: 42px;
  }
  .intro > p.subtitle {
    font-size: 14px;
    max-width: 360px;
  }
  .transfer-panel,
  .balances-section {
    padding: 20px;
  }
  .balances-section {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .section-top {
    margin-bottom: 16px;
  }
  .form-grid {
    gap: 12px;
  }
  .replay-controls {
    gap: 8px;
  }
  .panel {
    padding: 20px;
  }
  .workspace {
    padding: 0;
  }
  .payment-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .payment-grid strong {
    margin: 0;
    font-size: 22px;
  }
  footer {
    min-height: 96px;
    flex-wrap: wrap;
    gap: 4px;
    padding-top: 16px;
    padding-bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
