:root {
  --bg: #e9eef3;
  --paper: #ffffff;
  --ink: #17283a;
  --muted: #5a6b7d;
  --line: #cfd8e2;
  --chain: #2f4aa8;
  --ok: #1d7a4b;
  --ok-bg: #e3f3ea;
  --bad: #b3261e;
  --bad-bg: #fbe6e4;
  --wait: #8a96a3;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "IBM Plex Sans", system-ui, sans-serif; }
h1, h2 { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, .drop:focus-within { outline: 3px solid var(--chain); outline-offset: 2px; }

.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 28px 32px 20px; max-width: 1180px; margin: 0 auto; flex-wrap: wrap; }
.brand h1 { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; }
.brand p { margin: 4px 0 0; color: var(--muted); max-width: 560px; }
.chain { font-size: 13px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.chain b { color: var(--chain); font-weight: 600; }
.chain code { font: 12px "IBM Plex Mono", monospace; }

main { max-width: 1180px; margin: 0 auto; padding: 0 32px 32px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; align-items: start; }
.gate { grid-row: span 2; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: 24px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.ledger { grid-column: 1 / -1; }
h2 { font-size: 19px; font-weight: 600; margin-bottom: 12px; }
.hint { margin: -6px 0 12px; color: var(--muted); font-size: 14px; }

.drop { display: block; border: 2px dashed var(--line); border-radius: 10px; padding: 28px 16px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--chain); background: #f3f6fc; }
.drop-main { display: block; font-weight: 600; }
.drop-sub { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.link { background: none; border: 0; color: var(--chain); padding: 8px 0; text-decoration: underline; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 16px 0; }
.facts div { min-width: 0; }
.facts .wide { grid-column: 1 / -1; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.hash { font: 12.5px "IBM Plex Mono", monospace; }

.checks { list-style: none; padding: 0; margin: 8px 0 16px; counter-reset: c; }
.checks li { counter-increment: c; display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--wait); }
.checks li::before { content: counter(c); width: 24px; height: 24px; border-radius: 50%; border: 2px solid currentColor; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.checks li.pass { color: var(--ok); }
.checks li.pass::before { content: "\2713"; }
.checks li.fail { color: var(--bad); font-weight: 600; }
.checks li.fail::before { content: "\2715"; }

.verdict { border-radius: 10px; padding: 18px; font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.verdict small { display: block; font-size: 14px; font-weight: 500; margin-top: 2px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .verdict { animation: stamp .35s ease-out; } }
@keyframes stamp { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }

.primary, .steps button, .attacks button { background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 9px 14px; font-weight: 600; white-space: nowrap; }
.primary { width: 100%; padding: 12px; font-size: 16px; }
button:disabled { background: #c3ccd6; cursor: not-allowed; }
button.done { background: var(--ok); }

.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li, .attacks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; }
.steps li > div:first-child::before { content: "Step " counter(s); display: block; font-size: 12px; color: var(--muted); }
.steps strong, .attacks strong { display: block; font-weight: 600; }
.steps span, .attacks span { display: block; color: var(--muted); font-size: 13.5px; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.attacks { list-style: none; padding: 0; margin: 0; }
.attacks .res { display: block; margin-top: 4px; font-weight: 600; font-size: 13px; }
.attacks .res.bad { color: var(--bad); }
.attacks .res.ok { color: var(--ok); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 8px; }
td { padding: 6px 8px; border-bottom: 1px solid #eef2f6; }
td.num { font: 12.5px "IBM Plex Mono", monospace; }
td .bad { color: var(--bad); font-weight: 600; }
td .ok { color: var(--ok); }
tbody:empty::after { content: "No transactions yet."; display: block; padding: 10px 8px; color: var(--muted); }

footer { max-width: 1180px; margin: 0 auto; padding: 0 32px 32px; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  main { grid-template-columns: minmax(0, 1fr); padding: 0 16px 24px; }
  .gate { grid-row: auto; }
  .top { padding: 20px 16px 16px; }
  footer { padding: 0 16px 24px; }
  .steps li, .attacks li { flex-direction: column; align-items: flex-start; }
  .btns { justify-content: flex-start; }
  .facts { grid-template-columns: 1fr; }
  table { font-size: 12px; }
}
main > * { min-width: 0; }
.ledger { overflow-x: auto; }
body { overflow-x: hidden; }

.phone { margin: 4px 0 8px; }
.phone input { width: 100%; margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.applist { list-style: none; padding: 0; margin: 8px 0 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.applist:empty { display: none; }
.applist button { width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid #eef2f6; padding: 10px 12px; color: var(--ink); }
.applist button:hover { background: #f3f6fc; }
.applist strong { display: block; font-weight: 600; }
.applist span { display: block; font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.getapp { color: var(--chain); font-weight: 600; font-size: 14px; }
@media (max-width: 860px) { .side { align-items: flex-start; } }
