:root {
  --navy: #12233a; --navy-2: #1b3150; --teal: #1aa38b; --teal-dark: #0f7f6c;
  --bg: #eef2f6; --card: #fff; --ink: #14202e; --muted: #5d6b7b; --line: #dde4ec;
  --green-bg: #dff5e8; --green-ink: #14653a;
  --amber-bg: #fdf0c9; --amber-ink: #7a4b00;
  --red-bg: #fde0e0; --red-ink: #9b1c1c;
  --grey-bg: #e8ecf1; --grey-ink: #46515f;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 12px; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
a { color: var(--teal-dark); }
a:focus-visible, button:focus-visible, select:focus-visible { outline: 3px solid #7fd6c6; outline-offset: 2px; border-radius: 4px; }

.side { position: sticky; top: 0; align-self: start; height: 100vh; background: var(--navy); color: #dbe5f1; padding: 22px 16px; display: flex; flex-direction: column; gap: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 700; color: #fff; }
.logo { width: 26px; height: 26px; border-radius: 7px; background: var(--navy-2); position: relative; display: inline-block; }
.logo::before, .logo::after { content: ""; position: absolute; left: 5px; right: 5px; height: 6px; border: 2.5px solid var(--teal); border-left-width: 0; border-right-width: 0; transform: skewY(0); }
.logo::before { top: 6px; } .logo::after { top: 14px; opacity: .7; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #dbe5f1; text-decoration: none; padding: 9px 12px; border-radius: 8px; font-size: 15px; }
.side nav a:hover, .side nav a:focus-visible { background: var(--navy-2); color: #fff; }
.side nav a.active { background: var(--teal); color: #fff; }
.side-note { margin: auto 0 0; font-size: 13px; color: #9fb2c8; }

main { padding: 28px clamp(16px, 3vw, 44px) 48px; max-width: 1180px; width: 100%; }
.hero h1 { font-size: clamp(24px, 3.2vw, 34px); line-height: 1.2; margin: 0 0 8px; }
.lede { font-size: 17px; margin: 0 0 14px; color: #2a3a4d; max-width: 70ch; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.run-select { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); max-width: 100%; }
.btn { font: inherit; font-size: 14px; padding: 8px 14px; border-radius: 8px; border: 0; background: var(--teal); color: #fff; cursor: pointer; font-weight: 600; }
.btn:hover { background: var(--teal-dark); }
.btn.ghost { background: transparent; color: var(--teal-dark); border: 1px solid var(--teal); padding: 4px 10px; }
.muted { color: var(--muted); font-size: 14px; }
.run-note { margin: 10px 0 0; max-width: 80ch; }

.card-wrap { margin-top: 34px; }
.card-wrap h2 { margin: 0 0 2px; font-size: 24px; }
.sub { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(18, 35, 58, .04); min-width: 0; }
.card h3 { margin: 0 0 10px; font-size: 18px; overflow-wrap: anywhere; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1fr); }

/* status chips */
.chip { display: inline-block; padding: 5px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; line-height: 1.35; }
.chip.green { background: var(--green-bg); color: var(--green-ink); }
.chip.amber { background: var(--amber-bg); color: var(--amber-ink); }
.chip.red { background: var(--red-bg); color: var(--red-ink); }
.chip.grey { background: var(--grey-bg); color: var(--grey-ink); }
.count { font-variant-numeric: tabular-nums; }

/* queue table */
.qtable { width: 100%; border-collapse: collapse; }
.qtable th { text-align: left; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.qtable td { padding: 14px 10px; vertical-align: top; border-bottom: 1px solid var(--line); }
.qtable tr:last-child td { border-bottom: 0; }
.qtable .num { width: 38px; color: var(--muted); }
.qtable .amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
.qtable .amt small { color: var(--muted); }
.ens { font-weight: 600; overflow-wrap: anywhere; }
.why { margin: 8px 0 0; padding: 8px 10px; background: #f6f8fb; border-left: 3px solid var(--line); border-radius: 0 8px 8px 0; font-size: 14px; color: #2a3a4d; }
.why b { color: var(--ink); }
.why.amber { border-left-color: #e0a100; background: #fff9e6; }
.small { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* definition lists */
dl.facts { margin: 0; display: grid; grid-template-columns: minmax(104px, 34%) minmax(0, 1fr); gap: 8px 12px; font-size: 15px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
code, .mono { font-family: var(--mono); font-size: .9em; background: #eef2f7; padding: 1px 6px; border-radius: 6px; overflow-wrap: anywhere; word-break: break-all; }

.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; background: #d7f3ec; color: var(--teal-dark); }
.tag.agent { background: #ffe9b8; color: var(--amber-ink); }
.tag.owner { background: #d9e6fb; color: #1d4a8f; }
.tag.unknown { background: var(--grey-bg); color: var(--grey-ink); }

.swap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.swap .big { font-size: 22px; font-weight: 700; }

/* ledger */
.ltable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ltable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); }
.ltable td { padding: 10px 8px 10px 0; vertical-align: top; overflow-wrap: break-word; border-bottom: 1px solid var(--line); }
.ltable tr:last-child td { border-bottom: 0; }
.log { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.log::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.log li { position: relative; padding: 0 0 14px; }
.log li::before { content: ""; position: absolute; left: -18px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 3px #fff; }
.log time { font-size: 13px; color: var(--muted); display: block; }
.log .reason { font-size: 14px; color: #2a3a4d; margin: 2px 0 0; }
.log .links { font-size: 13px; margin: 2px 0 0; }
.log .links a + a { margin-left: 10px; }

/* verify */
.vtable { width: 100%; border-collapse: collapse; font-size: 15px; }
.vtable th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
.vtable td { padding: 12px 12px 12px 0; vertical-align: top; border-bottom: 1px solid var(--line); }
.vtable tr:last-child td { border-bottom: 0; }

/* states */
.loading { color: var(--muted); }
.fail { color: var(--red-ink); background: var(--red-bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 14px; }
.fail .detail { color: #6a2a2a; font-size: 12px; flex-basis: 100%; overflow-wrap: anywhere; }
.nr { color: var(--muted); font-style: italic; }

.foot { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot p { margin: 2px 0; }
.ai { background: #4a9fd8; color: #fff; padding: 0 3px; border-radius: 3px; }
.noscript { padding: 16px; background: var(--amber-bg); }

/* narrow screens: sidebar becomes a top bar, tables become stacked cards */
@media (max-width: 860px) {
  body { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 14px; padding: 10px 14px; overflow-x: auto; }
  .side nav { flex-direction: row; gap: 2px; flex-shrink: 0; }
  .side nav a { white-space: nowrap; padding: 7px 10px; font-size: 14px; }
  .side-note { display: none; }
  .brand { font-size: 18px; flex-shrink: 0; }
  main { padding-top: 20px; }
  .qtable thead, .ltable thead, .vtable thead { display: none; }
  .qtable, .qtable tbody, .qtable tr, .qtable td, .ltable, .ltable tbody, .ltable tr, .ltable td, .vtable, .vtable tbody, .vtable tr, .vtable td { display: block; width: 100%; }
  .qtable tr, .ltable tr, .vtable tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .qtable tr:last-child, .ltable tr:last-child, .vtable tr:last-child { border-bottom: 0; }
  .qtable td, .ltable td, .vtable td { padding: 3px 0; border: 0; }
  .qtable td::before, .ltable td::before, .vtable td::before { content: attr(data-label); display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .qtable td.num::before { display: none; }
  .qtable .num { width: auto; }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  dl.facts dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.ltable td:first-child { white-space: nowrap; overflow-wrap: normal; }

.nowrap { white-space: nowrap; }
