:root {
  --page: #eceef1;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #566176;
  --line: #cdd3dc;
  --danfo: #ffc800;
  --danfo-deep: #e0b000;
  --danfo-soft: #fff1b8;
  --paid: #0b8f5a;
  --paid-soft: #d6efe3;
  --fail: #d7263d;
  --fail-soft: #fbdde1;
  --wait: #8a5a00;
  --display: "Unbounded", "Segoe UI", system-ui, sans-serif;
  --body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font: 400 1rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* the minibus stripe */
.stripe { height: 18px; background: var(--danfo); border-bottom: 3px solid var(--ink); position: relative; }
.stripe::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 3px; background: var(--ink); }

.top, .jobs, main { max-width: 1160px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }

.top { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-end; padding-top: 36px; padding-bottom: 24px; }
h1 { margin: 0; font: 700 clamp(1.9rem, 4vw, 2.6rem)/1 var(--display); letter-spacing: -0.03em; }
.tagline { margin: 10px 0 0; color: var(--muted); font-size: 1.0625rem; }

.watch label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 4px; }
.watch-row { display: flex; gap: 8px; }
.watch input {
  width: min(360px, 62vw);
  padding: 10px 12px;
  font: 0.9375rem var(--mono);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 0;
}
.watch button {
  padding: 10px 18px;
  font: 700 0.9375rem var(--body);
  color: var(--ink);
  background: var(--danfo);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.watch button:hover { background: var(--danfo-deep); }
.live { margin: 6px 0 0; min-height: 1.4em; font-size: 0.875rem; color: var(--muted); }
.live.bad { color: var(--fail); font-weight: 500; }
.hint { margin: 0; max-width: 42ch; font-size: 0.8125rem; color: var(--muted); }

/* job tabs */
.jobs { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 20px; }
.jobs:empty { display: none; }
.jobs button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px;
  font: 500 0.875rem var(--body);
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.jobs button span:last-child { color: var(--muted); }
.jobs button[aria-current="true"] { background: var(--ink); color: #fff; }
.jobs button[aria-current="true"] span:last-child { color: #c7cfdd; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.held { background: var(--danfo-deep); }
.dot.paid { background: var(--paid); }
.dot.fail { background: var(--fail); }
.dot.wait { background: var(--danfo-deep); }

main { padding-bottom: 80px; }

.empty { padding: 48px 0; color: var(--muted); max-width: 56ch; }
.empty code { font-family: var(--mono); font-size: 0.9em; color: var(--ink); }

/* ---- the money route ---- */
.route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1.25fr) 72px minmax(0, 1.2fr);
  align-items: center;
  gap: 0;
  padding: 36px 32px;
  background: var(--surface);
  border: 2px solid var(--ink);
}

.who-node h2, .payees h2 { margin: 0 0 6px; font: 500 0.9375rem var(--body); color: var(--muted); }
.who-node a { font-size: 0.8125rem; }
.mono { font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }
a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }

/* the connectors */
.link { height: 6px; position: relative; background: var(--line); }
.link::after {
  content: ""; position: absolute; right: -2px; top: -7px;
  border-left: 12px solid var(--line); border-top: 10px solid transparent; border-bottom: 10px solid transparent;
}
.link.on { background: var(--ink); }
.link.on::after { border-left-color: var(--ink); }
.link.done { background: var(--paid); }
.link.done::after { border-left-color: var(--paid); }
.link.back { background: var(--ink); }
.link.back::after { border-left-color: var(--ink); }
.link.moving {
  background: repeating-linear-gradient(90deg, var(--ink) 0 14px, transparent 14px 24px);
  background-size: 24px 6px;
}
.link.moving::after { border-left-color: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .link.moving { animation: flow 0.7s linear infinite; }
  @keyframes flow { to { background-position: 24px 0; } }
}

/* the vault */
.vault {
  position: relative;
  padding: 22px 24px 20px;
  background: var(--danfo);
  border: 3px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
}
.vault.paid { background: var(--paid); color: #fff; }
.vault.idle { background: #dfe3ea; }
.vault .lock { width: 34px; height: 34px; display: block; margin-bottom: 8px; }
.vault .amount { margin: 0; font: 700 clamp(2.6rem, 5.2vw, 3.9rem)/1 var(--display); letter-spacing: -0.04em; }
.vault .amount small { font: 500 1rem var(--display); letter-spacing: 0; margin-left: 6px; }
.vault .state { margin: 14px 0 2px; font: 700 1.0625rem/1.2 var(--display); letter-spacing: -0.01em; }
.vault .why { margin: 0; font-size: 0.9375rem; }
.vault .flag {
  display: inline-block; margin-top: 12px; padding: 3px 10px;
  font: 700 0.8125rem var(--body); color: #fff; background: var(--fail);
}
.vault.paid a { color: #fff; }

/* the payees */
.payees ul { list-style: none; margin: 0; padding: 0; }
.payees li { padding: 12px 0; border-top: 2px solid var(--ink); }
.payees li:first-child { border-top: 0; padding-top: 0; }
.payees .line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.payees .amt { font: 700 1.375rem var(--display); letter-spacing: -0.03em; white-space: nowrap; }
.payees .amt small { font: 500 0.75rem var(--display); letter-spacing: 0; margin-left: 4px; color: var(--muted); }
.payees .role { color: var(--muted); font-size: 0.8125rem; }
.state-chip { display: inline-block; margin-top: 4px; padding: 1px 8px; font-size: 0.8125rem; font-weight: 700; border: 2px solid var(--ink); }
.state-chip.paid { background: var(--paid); border-color: var(--paid); color: #fff; }
.state-chip.sending { background: var(--danfo); }
.state-chip.held { background: var(--danfo-soft); }
.state-chip.none { border-color: var(--line); color: var(--muted); }

/* ---- the details ---- */
.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  background: var(--surface);
  border: 2px solid var(--ink);
}
.details > section { padding: 26px 28px; min-width: 0; }
.details > section + section { border-left: 2px solid var(--ink); }
h2.sec { margin: 0 0 14px; font: 700 1rem var(--display); letter-spacing: -0.02em; }
.sec-gap { margin-top: 26px; padding-top: 22px; border-top: 2px solid var(--line); }

.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.steps li::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::before { display: none; }
.mark { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; font: 700 0.8125rem var(--body); color: #fff; }
.steps .done .mark { background: var(--paid); border-color: var(--paid); }
.steps .now .mark { border-color: var(--ink); background: var(--danfo); box-shadow: 0 0 0 4px var(--danfo-soft); }
.steps .bad .mark { background: var(--fail); border-color: var(--fail); }
.steps .step-title { font-weight: 700; line-height: 1.3; }
.steps .step-note { color: var(--muted); font-size: 0.875rem; }
.steps .idle .step-title { color: var(--muted); font-weight: 500; }

.reqs { list-style: none; margin: 0; padding: 0; }
.reqs li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 5px 0; }
.reqs .tick { font-weight: 700; }
.reqs .met .tick { color: var(--paid); }
.reqs .unmet .tick, .reqs .unmet { color: var(--fail); }
.reqs .unmet { font-weight: 500; }
.reqs .unknown .tick { color: var(--muted); }

.verdict { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pill { padding: 3px 12px; font: 700 0.8125rem var(--display); letter-spacing: 0.02em; color: #fff; }
.pill.pass { background: var(--paid); }
.pill.fail { background: var(--fail); }
.reasons { margin: 0; padding-left: 20px; }
.reasons li { margin-bottom: 5px; }
.evidence { margin: 12px 0 0; color: var(--muted); font-size: 0.8125rem; }
.none { color: var(--muted); margin: 0; }

.deliverable { margin: 0; padding: 10px 12px; background: var(--danfo-soft); border-left: 5px solid var(--danfo); font-size: 0.9375rem; overflow-wrap: anywhere; }
.meta { margin: 8px 0 0; color: var(--muted); font-size: 0.8125rem; }

.people { margin: 18px 4px 0; color: var(--muted); font-size: 0.8125rem; display: flex; flex-wrap: wrap; gap: 6px 28px; }

@media (max-width: 1020px) {
  .details { grid-template-columns: 1fr 1fr; }
  .details > section:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 2px solid var(--ink); }
}

@media (max-width: 860px) {
  .route { grid-template-columns: 1fr; padding: 24px 20px; gap: 0; }
  .link { width: 6px; height: 40px; margin: 14px 0 14px 22px; }
  .link::after { right: auto; left: -7px; top: auto; bottom: -2px; border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 12px solid var(--line); border-bottom: 0; }
  .link.on::after, .link.back::after, .link.moving::after { border-top-color: var(--ink); border-left-color: transparent; }
  .link.done::after { border-top-color: var(--paid); border-left-color: transparent; }
  .link.moving { background: repeating-linear-gradient(180deg, var(--ink) 0 10px, transparent 10px 18px); background-size: 6px 18px; }
  @keyframes flow-v { to { background-position: 0 18px; } }
  @media (prefers-reduced-motion: no-preference) { .link.moving { animation: flow-v 0.7s linear infinite; } }
  .vault { box-shadow: 5px 5px 0 var(--ink); }
}

@media (max-width: 640px) {
  .top, .jobs, main { padding-left: 16px; padding-right: 16px; }
  .details { grid-template-columns: 1fr; }
  .details > section + section, .details > section:nth-child(3) { border-left: 0; border-top: 2px solid var(--ink); }
  .details > section { padding: 22px 20px; }
}
