@font-face { font-family: "Bodoni Moda"; font-style: normal; font-weight: 400 600; font-display: swap; src: url("fonts/BodoniModa-normal-latin.woff2") format("woff2"); }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 300 600; font-display: swap; src: url("fonts/AlbertSans-normal-latin.woff2") format("woff2"); }

:root {
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Albert Sans", "Helvetica Neue", Arial, sans-serif;
  --up-base: #5bd6a0;
  --k-base: #7fa9ff;
  --radius: 14px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #0d1626;
  --muted: #4a5873;
  --line: rgba(13, 22, 38, 0.1);
  --card: rgba(255, 255, 255, 0.82);
  --card-border: rgba(13, 22, 38, 0.08);
  --shadow: 0 1px 2px rgba(13, 22, 38, 0.04), 0 8px 24px rgba(13, 22, 38, 0.06);
  --up: #13845a;           /* text-safe green on white */
  --k: #2f5fcc;            /* text-safe blue on white */
  --accent-strong: #0d1626;
  --tint-green: rgba(91, 214, 160, 0.18);
  --tint-blue: rgba(127, 169, 255, 0.2);
  --btn-bg: #0d1626; --btn-ink: #ffffff;
  --warn: #9a5a00; --warn-base: #e39b2d; --warn-bg: rgba(227, 155, 45, 0.14); --warn-line: rgba(227, 155, 45, 0.55);
  --brass: #8a6a1f;          /* site brass #c9a45c darkened for 5:1 contrast on white */
  --brass-line: rgba(201, 164, 92, 0.55); --brass-bg: rgba(201, 164, 92, 0.12);
  --edge-idle: rgba(13, 22, 38, 0.14); --node-a: #ffffff; --node-b: #eaf1ff; --node-ring: rgba(47, 95, 204, 0.35);
  --badge-open: #e8eefc; --badge-open-ink: #2f5fcc;
  --badge-paid: #ddf6ea; --badge-paid-ink: #0f6e4a;
  --badge-warn: #fff1d6; --badge-warn-ink: #8a5300;
  --badge-bad: #fde4e1; --badge-bad-ink: #a2301f;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1626;
  --ink: #ece6d8;
  --muted: #9aa6bb;
  --line: rgba(236, 230, 216, 0.12);
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(236, 230, 216, 0.1);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --up: #5bd6a0;
  --k: #7fa9ff;
  --accent-strong: #ece6d8;
  --tint-green: rgba(91, 214, 160, 0.12);
  --tint-blue: rgba(127, 169, 255, 0.14);
  --btn-bg: #5bd6a0; --btn-ink: #0d1626;
  --warn: #f2b45a; --warn-base: #f2b45a; --warn-bg: rgba(242, 180, 90, 0.12); --warn-line: rgba(242, 180, 90, 0.5);
  --brass: #c9a45c;          /* site brass, ~7:1 on navy */
  --brass-line: rgba(201, 164, 92, 0.5); --brass-bg: rgba(201, 164, 92, 0.1);
  --edge-idle: rgba(236, 230, 216, 0.14); --node-a: #1b2a44; --node-b: #0f1b30; --node-ring: rgba(127, 169, 255, 0.45);
  --badge-open: rgba(127, 169, 255, 0.16); --badge-open-ink: #a9c4ff;
  --badge-paid: rgba(91, 214, 160, 0.16); --badge-paid-ink: #7fe3b7;
  --badge-warn: rgba(255, 196, 92, 0.16); --badge-warn-ink: #ffd27f;
  --badge-bad: rgba(236, 117, 99, 0.18); --badge-bad-ink: #ff9d8e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 55% 40% at 8% 0%, var(--tint-green), transparent 70%),
    radial-gradient(ellipse 50% 45% at 100% 10%, var(--tint-blue), transparent 70%),
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--tint-blue), transparent 75%),
    var(--bg);
  background-attachment: fixed;
}
button { font-family: inherit; }
a { color: var(--k); }
:focus-visible { outline: 2px solid var(--k); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ---- Title line (same treatment as worldvest.ai) ---- */
.titlebar {
  display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); flex-wrap: wrap;
  padding: 22px clamp(16px, 4vw, 56px) 18px; border-bottom: 1px solid var(--line);
}
.titlebar .brand { display: flex; flex-direction: column; gap: 6px; }
.titlebar h1 { display: flex; align-items: baseline; gap: clamp(12px, 2vw, 22px); flex-wrap: wrap; margin: 0; }
.wordmark { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 6.4vw, 92px); line-height: 0.95; letter-spacing: -0.03em; }
.subtitle { font-family: var(--body); font-weight: 300; font-size: clamp(17px, 1.9vw, 26px); color: var(--up); }
.product { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--k); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-test { color: var(--brass); border: 1px solid var(--brass-line); background: var(--brass-bg); border-radius: 999px; padding: 1px 9px; font-size: 11px; letter-spacing: .14em; }
.titlebar .links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; flex-wrap: wrap; }
.titlebar .links a { color: var(--muted); text-decoration: none; }
.titlebar .links a:hover { color: var(--ink); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--muted);
  background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; padding: 6px 14px;
}
.theme-toggle:hover { color: var(--ink); }
.theme-toggle .dot { width: 10px; height: 10px; border-radius: 50%; background: linear-gradient(135deg, var(--up-base), var(--k-base)); }

main { padding: 28px clamp(16px, 4vw, 56px) 56px; max-width: 1320px; margin: 0 auto; }
h2 { font-family: var(--body); font-weight: 600; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 12px; }
h3 { font-family: var(--body); font-weight: 600; font-size: 17px; margin: 0; }
.lede { color: var(--muted); max-width: 68ch; margin: 0 0 18px; }

.card { background: var(--card); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; backdrop-filter: blur(6px); }
.grid { display: grid; gap: 18px; }
.hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; margin-bottom: 26px; }
.hero .steps { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.btn {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; font-weight: 600; font-size: 15px; background: var(--btn-bg); color: var(--btn-ink);
  box-shadow: 0 6px 18px rgba(13, 22, 38, 0.18); transition: transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 14px; border: 1px solid var(--card-border); color: var(--muted); }
.step.done .n { background: var(--up-base); color: #0d1626; border-color: transparent; }
.step.active .n { border-color: var(--k); color: var(--k); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--tint-blue); } }
.step .t { font-weight: 600; }
.step .d { color: var(--muted); font-size: 14px; word-break: break-word; }
.msg { margin-top: 12px; font-size: 14px; color: var(--badge-bad-ink); }

.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat .label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--body); font-weight: 600; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--muted); }

.biz { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
@media (max-width: 1000px) { .biz { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .biz, .stats { grid-template-columns: 1fr; } }
.biz .name { font-weight: 600; }
.biz .bal { font-family: var(--body); font-weight: 600; font-size: 24px; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.biz .unit { font-family: var(--body); font-size: 13px; color: var(--muted); margin-left: 4px; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.kind { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--up); }

.two { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 1000px) { .two { grid-template-columns: minmax(0, 1fr); } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 8px; border-bottom: 1px solid var(--line); }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; }
.badge.open { background: var(--badge-open); color: var(--badge-open-ink); }
.badge.paid { background: var(--badge-paid); color: var(--badge-paid-ink); }
.badge.partial, .badge.overpaid { background: var(--badge-warn); color: var(--badge-warn-ink); }
.badge.mismatched { background: var(--badge-bad); color: var(--badge-bad-ink); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.feed li:last-child { border-bottom: 0; }
.feed .ev { font-weight: 600; }
.feed .ev.InvoicePaid { color: var(--up); }
.feed .ev.Minted, .feed .ev.WalletApproved { color: var(--k); }
.feed .meta { color: var(--muted); font-size: 12px; }
.empty { color: var(--muted); font-size: 14px; padding: 8px 0; }
.scroll { overflow-x: auto; }

footer { border-top: 1px solid var(--line); padding: 22px clamp(16px, 4vw, 56px) 36px; color: var(--muted); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--muted); }

/* ---- Payment flow chart (pure SVG) ---- */
.flow-card { display: flex; flex-direction: column; }
.flow-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flow { width: 100%; height: auto; display: block; margin-top: 6px; flex: 1; min-height: 260px; overflow: visible; }
.flow .stop-a { stop-color: var(--node-a); }
.flow .stop-b { stop-color: var(--node-b); }
.flow .stop-up { stop-color: var(--up-base); }
.flow .stop-k { stop-color: var(--k-base); }
.fc-edge { fill: none; stroke: var(--edge-idle); stroke-linecap: round; transition: stroke-width .6s ease, opacity .3s; }
.fc-edge.idle { stroke-dasharray: 2 7; }
.fc-edge.active { stroke: url(#edge-grad); opacity: .75; }
.fc-edge.hot { opacity: 1; filter: url(#glow); }
.fc-node circle.body { fill: url(#node-fill); stroke: var(--node-ring); stroke-width: 1.5; }
.fc-node.hub circle.body { stroke: var(--brass-line); stroke-width: 2; }
.fc-node circle.ring { fill: none; stroke: var(--up-base); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.fc-node.pulse circle.ring { animation: ring 1.2s ease-out 1; }
@keyframes ring { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
.fc-node text { fill: var(--ink); font-family: var(--body); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.fc-node .nm { font-size: 15px; font-weight: 600; }
.fc-node .bl { font-size: 12.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.fc-node .ini { font-size: 15px; font-weight: 600; fill: var(--k); letter-spacing: .04em; }
.fc-node.hub .ini { fill: var(--brass); }
.fc-dot { fill: var(--up-base); filter: url(#glow); }
.fc-amt { font-family: var(--body); font-size: 13px; font-weight: 600; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.spark { width: 100%; height: 34px; margin-top: 8px; display: block; }
.spark polyline { fill: none; stroke: var(--up); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
@media (max-width: 560px) { .fc-node .bl { display: none; } .flow { min-height: 220px; } }
@media (prefers-reduced-motion: reduce) { .fc-node.pulse circle.ring { opacity: .85; } }

/* ---- Phase 3: scenarios, flags, clearer flow chart ---- */
.scenarios { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.scenarios legend { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 8px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; align-items: center; border: 1px solid var(--card-border); border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--ink); background: transparent; transition: border-color .15s, background .15s; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill:hover { border-color: var(--k); }
.pill:has(input:checked) { border-color: var(--k); background: rgba(127, 169, 255, 0.14); font-weight: 600; }
.pill.warn:has(input:checked) { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn); }
.pill:has(input:focus-visible) { outline: 2px solid var(--k); outline-offset: 2px; }
.scenario-desc { font-size: 13px; color: var(--muted); margin-top: 8px; min-height: 1.4em; }
.step.is-flag .n { background: var(--warn-base); color: #0d1626; border-color: transparent; }
.flag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); white-space: nowrap; }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--warn-base); }
.section-lede { color: var(--muted); margin: -4px 0 14px; max-width: 70ch; }
.biz .blurb { font-size: 13.5px; color: var(--muted); margin: 6px 0 4px; line-height: 1.45; min-height: 3.9em; }
.biz .card.treasury .kind { color: var(--brass); }

.fsteps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; font-size: 12px; flex-wrap: wrap; }
.fsteps li { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--card-border); color: var(--muted); position: relative; }
.fsteps li + li::before { content: "→"; position: absolute; left: -11px; color: var(--muted); }
.fsteps li { margin-left: 6px; }
.fsteps li:first-child { margin-left: 0; }
.fsteps li.active { border-color: var(--k); color: var(--k); animation: pulse 1.4s ease-in-out infinite; }
.fsteps li.done { background: rgba(91, 214, 160, 0.16); border-color: var(--up-base); color: var(--up); }
.fsteps li.is-flag { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.flow-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.flow-legend .sw { display: inline-block; }
.flow-legend .sw.line { width: 28px; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--up-base), var(--k-base)); }
.flow-legend .sw.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--up-base); box-shadow: 0 0 6px var(--up-base); }
.flow-legend .sw.flag { width: 10px; height: 10px; border-radius: 50%; background: var(--warn-base); }
.flow-caption { margin-top: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); min-height: 4.2em; }
.flow-caption.flagged { border-color: var(--warn-line); background: var(--warn-bg); }
.cap-flags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cap-kicker { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-right: 2px; }
.cap-text { margin: 4px 0 2px; font-size: 14.5px; line-height: 1.45; }
.cap-links { font-size: 13px; color: var(--muted); }

.flow .arr-fill { fill: var(--k-base); }
.flow .arr-pending { fill: var(--muted); }
.fc-node .rl { font-size: 12px; fill: var(--muted); }
.fc-node:focus { outline: none; }
.fc-node:focus-visible circle.body, .fc-node.focus circle.body { stroke: var(--k); stroke-width: 2.5; }
.fc-node.pulse-flag circle.ring { stroke: var(--warn-base); animation: ring 1.2s ease-out 1; }
.fc-edge.hot-flag { stroke: var(--warn-base); opacity: 1; filter: url(#glow); }
.flagged .fc-dot, .fc-dot.flagged { fill: var(--warn-base); }
.flagged .fc-amt, .fc-amt.flagged { fill: var(--warn); }
.fc-pending { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 6; opacity: .8; }
.fc-pending.inflight { stroke: var(--k-base); stroke-width: 2.5; animation: dash 0.9s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -24; } }
.fc-pending-label { font-family: var(--body); font-size: 12.5px; font-weight: 600; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { .fc-node.pulse-flag circle.ring { opacity: .85; } }
@media (max-width: 560px) { .fc-node .rl { font-size: 13px; } .fsteps { width: 100%; } }

/* ---- Receipt page ---- */
.wordmark.small { font-size: clamp(34px, 4vw, 52px); }
.receipt-page main { max-width: 980px; }
.receipt { position: relative; overflow: hidden; padding: 28px 30px; }
.receipt.flagged { border-color: var(--warn-line); }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; font-family: var(--body); font-weight: 700; font-size: clamp(48px, 9vw, 120px); letter-spacing: .12em; text-transform: uppercase; color: var(--brass); opacity: .1; transform: rotate(-18deg); white-space: nowrap; }
.r-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; position: relative; }
.r-head h2 { margin: 4px 0 8px; }
.r-amount { text-align: right; }
.r-amount .label { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.r-amount .value { font-weight: 600; font-size: clamp(28px, 3.4vw, 40px); font-variant-numeric: tabular-nums; }
.r-amount .sub { font-size: 13px; color: var(--muted); }
.receipt .cap-text { position: relative; max-width: 75ch; }
.r-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin-top: 18px; position: relative; }
@media (max-width: 760px) { .r-grid { grid-template-columns: minmax(0, 1fr); } .r-amount { text-align: left; } }
.r-grid h3 { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.r-grid dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 14px; }
.r-grid dt { color: var(--muted); }
.r-grid dd { margin: 0; word-break: break-word; }
.r-note { position: relative; margin-top: 22px; }
@media print {
  .titlebar .links, footer { display: none; }
  body, .receipt-page { background: #fff !important; color: #0d1626; }
  .card { box-shadow: none; backdrop-filter: none; border: 1px solid #ccd; background: #fff; }
  .watermark { opacity: .12; color: #8a6a1f; }
  a { color: #0d1626; }
}
@media print {
  :root[data-theme] { --bg: #ffffff; --ink: #0d1626; --muted: #4a5873; --line: rgba(13, 22, 38, 0.12); --card: #ffffff; --card-border: #ccd3e0; --up: #13845a; --k: #2f5fcc; --brass: #8a6a1f; --warn: #9a5a00; --warn-bg: #fff3df; --warn-line: #e3b36a;
    --badge-open: #eef3ff; --badge-open-ink: #2f5fcc; --badge-paid: #e3f7ee; --badge-paid-ink: #13845a; --badge-warn: #fff1d6; --badge-warn-ink: #8a5300; --badge-bad: #fde8e8; --badge-bad-ink: #a32020; }
}
