/* Lightning Payment Proof — styles. No external fonts or resources. */

:root {
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #f4f2fa;
  --surface-3: #ebe8f5;
  --text: #17142a;
  --text-2: #3b3752;
  --muted: #6d6886;
  --border: rgba(23, 20, 42, .09);
  --border-strong: rgba(23, 20, 42, .16);

  --accent: #f7931a;       /* bitcoin orange */
  --accent-2: #7c3aed;     /* lightning violet */
  --gradient-primary: linear-gradient(135deg, #f7931a, #ea580c 55%, #d9480f);
  --ok: #059669;
  --ok-bg: #e9fbf3;
  --ok-ring: rgba(5, 150, 105, .18);
  --bad: #e11d48;
  --bad-bg: #fff0f3;
  --bad-ring: rgba(225, 29, 72, .16);
  --warn: #b45309;
  --warn-bg: #fff7e8;
  --info: #4f46e5;
  --info-bg: #f0f0ff;

  /* meaning colours — used consistently in text, values and terminal commands */
  --c-hash: #7c3aed;
  --c-pre: #c2410c;
  --c-node: #0e7490;
  --c-sig: #be185d;
  --c-msg: #475569;
  --c-inv: #1d4ed8;
  --c-hash-bg: rgba(124, 58, 237, .09);
  --c-pre-bg: rgba(234, 88, 12, .10);
  --c-node-bg: rgba(8, 145, 178, .10);
  --c-entry-bg: rgba(71, 85, 105, .09);

  --code-bg: #14111f;
  --code-bar: #1d1930;
  --code-text: #e9e6f7;

  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(22, 16, 48, .04), 0 10px 34px -8px rgba(22, 16, 48, .10);
  --shadow-lg: 0 2px 4px rgba(22, 16, 48, .04), 0 24px 60px -18px rgba(22, 16, 48, .22);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0b1a;
    --surface: #171327;
    --surface-2: #1d1931;
    --surface-3: #262140;
    --text: #efedf8;
    --text-2: #cfcbe3;
    --muted: #9d97b8;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .15);
    --ok: #34d399;
    --ok-bg: rgba(52, 211, 153, .10);
    --ok-ring: rgba(52, 211, 153, .22);
    --bad: #fb7185;
    --bad-bg: rgba(251, 113, 133, .10);
    --bad-ring: rgba(251, 113, 133, .22);
    --warn: #fbbf24;
    --warn-bg: rgba(251, 191, 36, .09);
    --info: #a5b4fc;
    --info-bg: rgba(129, 140, 248, .10);
    --c-hash: #b69cff;
    --c-pre: #fdba74;
    --c-node: #5eead4;
    --c-sig: #f9a8d4;
    --c-msg: #cbd5e1;
    --c-inv: #93c5fd;
    --c-hash-bg: rgba(182, 156, 255, .12);
    --c-pre-bg: rgba(253, 186, 116, .12);
    --c-node-bg: rgba(94, 234, 212, .10);
    --c-entry-bg: rgba(203, 213, 225, .08);
    --code-bg: #0a0814;
    --code-bar: #131024;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 34px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 24px 60px -18px rgba(0, 0, 0, .7);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(247, 147, 26, .16), transparent 60%),
    radial-gradient(800px 520px at 92% -12%, rgba(124, 58, 237, .16), transparent 62%);
}
a { color: var(--info); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .88em; }
p code, li code, td code { background: var(--surface-2); border: 1px solid var(--border); padding: .08em .38em; border-radius: 6px; }
em { font-style: normal; font-weight: 600; }
b { font-weight: 650; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: fixed; left: -9999px; top: 0; opacity: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent-2) 55%, transparent); outline-offset: 2px; border-radius: 6px; }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }
.icon-sm { width: 1.05em; height: 1.05em; }
.icon-xs { width: .85em; height: .85em; vertical-align: -0.08em; }

/* colour words */
.c-hash { color: var(--c-hash); }
.c-pre { color: var(--c-pre); }
.c-node { color: var(--c-node); }
.c-inv { color: var(--c-inv); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px max(20px, calc((100vw - 900px) / 2 + 20px));
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #e8590c 45%, var(--accent-2));
  box-shadow: 0 4px 14px -4px rgba(247, 147, 26, .6);
}
.topnav { display: flex; align-items: center; gap: 14px; }
.topnav-link { color: var(--text-2); text-decoration: none; font-size: .93rem; font-weight: 550; }
.topnav-link:hover { color: var(--text); }
@media (max-width: 560px) { .brand-text { display: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: .98rem; line-height: 1;
  padding: 13px 20px; border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: 0 8px 22px -8px rgba(234, 88, 12, .65), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { box-shadow: 0 12px 28px -8px rgba(234, 88, 12, .75), inset 0 1px 0 rgba(255, 255, 255, .25); }
.btn-ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 8px 14px; font-size: .88rem; }

.btn-copy {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font: inherit; font-size: .8rem; font-weight: 600; line-height: 1;
  padding: 7px 10px; border-radius: 8px; cursor: pointer;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong);
  transition: background .15s, color .15s, border-color .15s;
}
.btn-copy:hover { background: var(--surface-2); color: var(--text); }
.btn-copy .icon { width: 1.05em; height: 1.05em; }
.btn-copy.copied { color: var(--ok); border-color: var(--ok); }
.btn-copy-dark { color: #cfcbe3; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.btn-copy-dark:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-copy-dark.copied { color: #6ee7b7; border-color: #6ee7b7; }
.btn-copy-mini { padding: 4px 7px; font-size: .72rem; }
.btn-copy.btn-copy-primary { padding: 13px 20px; font-size: .98rem; border-radius: 999px; color: #fff; border-color: transparent; background: var(--gradient-primary); }
.btn-copy.btn-copy-primary:hover { color: #fff; background: var(--gradient-primary); }
.btn-copy.btn-copy-primary.copied { color: #fff; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 22px -8px rgba(5, 150, 105, .6); }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-flat { box-shadow: none; padding: 8px 24px; }
.card-inset { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
@media (max-width: 560px) { .card { padding: 20px; border-radius: 18px; } .card-flat { padding: 4px 16px; } }

/* ---------- input view ---------- */
.hero { text-align: center; padding: 56px 0 30px; }
.hero h1 { font-size: clamp(2rem, 5.4vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; }
.grad { background: linear-gradient(100deg, #f7931a, #ea580c 35%, #7c3aed 85%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { max-width: 640px; margin: 18px auto 0; font-size: 1.1rem; color: var(--text-2); }
.eyebrow { margin: 0 0 8px; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); }
@media (prefers-color-scheme: dark) { .eyebrow { color: #c4b5fd; } }

.form-card { max-width: 720px; margin: 0 auto; box-shadow: var(--shadow-lg); padding: 32px; }
.field { margin-bottom: 22px; }
.field label, .field summary { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 8px; }
.field summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.field summary::-webkit-details-marker { display: none; }
.field-optional[open] summary { margin-bottom: 8px; }
.field-num {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: .8rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f7931a, #ea580c);
}
.field-num-muted { background: var(--surface-3); color: var(--muted); }
.field textarea, .field input {
  width: 100%; font-family: var(--mono); font-size: .92rem; line-height: 1.5; color: var(--text);
  background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 14px;
  padding: 13px 15px; resize: vertical; word-break: break-all;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea:focus, .field input:focus { outline: none; background: var(--surface); border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px rgba(247, 147, 26, .16); }
.field .invalid { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-ring); }
.field-hint { margin: 7px 2px 0; font-size: .88rem; color: var(--muted); }
.field-error { margin: 8px 2px 0; font-size: .9rem; font-weight: 600; color: var(--bad); }
.form-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; font-size: .86rem; color: var(--muted); }

.intro-steps { display: flex; align-items: stretch; justify-content: center; gap: 10px; margin: 36px auto 10px; max-width: 800px; }
.intro-step { flex: 1; display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--muted); padding: 14px; }
.intro-step strong { color: var(--text); }
.intro-arrow { align-self: center; color: var(--muted); opacity: .6; }
.intro-ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; }
.intro-ico.ico-lock { color: var(--c-hash); background: var(--c-hash-bg); }
.intro-ico.ico-bolt { color: var(--accent); background: rgba(247, 147, 26, .12); }
.intro-ico.ico-key { color: var(--c-pre); background: var(--c-pre-bg); }
@media (max-width: 680px) { .intro-steps { flex-direction: column; } .intro-arrow { display: none; } .intro-step { padding: 6px 10px; } }

/* ---------- result view ---------- */
#view-result { padding-top: 22px; }
.inputs-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding: 8px 8px 8px 16px; font-size: .86rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
}
.inputs-bar-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inputs-bar .btn .icon { width: 1em; height: 1em; }

/* verdict */
.verdict { position: relative; overflow: hidden; padding: 34px; box-shadow: var(--shadow-lg); }
.verdict::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; }
.verdict-ok::before { background: linear-gradient(90deg, #10b981, #34d399, #f7931a); }
.verdict-bad::before { background: linear-gradient(90deg, #e11d48, #fb7185); }
.verdict-neutral::before { background: linear-gradient(90deg, #6366f1, #a78bfa); }
.verdict-head { display: flex; gap: 22px; align-items: flex-start; }
.verdict-icon {
  flex: none; display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%;
  color: #fff; box-shadow: 0 0 0 8px var(--ok-ring);
  background: linear-gradient(135deg, #34d399, #059669);
}
.verdict-icon .icon { width: 34px; height: 34px; stroke-width: 3; }
.verdict-ok .verdict-icon { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
.verdict-bad .verdict-icon { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 0 0 8px var(--bad-ring); }
.verdict-neutral .verdict-icon { background: linear-gradient(135deg, #818cf8, #4f46e5); box-shadow: 0 0 0 8px rgba(99, 102, 241, .18); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.verdict-title { font-size: clamp(1.6rem, 4vw, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 8px; }
.verdict-ok .verdict-title { color: var(--ok); }
.verdict-bad .verdict-title { color: var(--bad); }
.verdict-text { font-size: 1.05rem; color: var(--text-2); max-width: 640px; }
.verdict .eyebrow { color: var(--muted); }
@media (max-width: 560px) {
  .verdict { padding: 24px 20px; }
  .verdict-head { flex-direction: column; gap: 16px; }
  .verdict-icon { width: 54px; height: 54px; }
}

.receipt {
  margin: 24px 0 0; padding: 6px 20px; border-radius: 16px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
}
.receipt-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border-strong); }
.receipt-row:last-child { border-bottom: 0; }
.receipt dt { color: var(--muted); font-size: .9rem; padding-top: 1px; }
.receipt dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.receipt-amount dd strong { font-size: 1.35rem; letter-spacing: -.02em; }
.receipt-amount { align-items: baseline; }
.desc { font-weight: 550; }
.node-inline { display: inline-flex; align-items: center; gap: 6px; color: var(--c-node); }
/* flex row: the baseline of .node-inline is the icon's bottom edge, which would push following badges down */
.receipt dd.dd-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
@media (max-width: 560px) { .receipt-row { grid-template-columns: 1fr; gap: 2px; } .receipt { padding: 4px 14px; } }

.checks { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 10px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-size: .96rem; }
.check-ok { background: var(--ok-bg); }
.check-bad { background: var(--bad-bg); }
.check-na { background: var(--surface-2); color: var(--muted); }
.check-icon { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; margin-top: 1px; }
.check-icon .icon { width: 15px; height: 15px; stroke-width: 3; }
.check-ok .check-icon { background: var(--ok); }
.check-bad .check-icon { background: var(--bad); }
.check-na .check-icon { background: var(--muted); }
.check-link { font-size: .88rem; white-space: nowrap; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* callouts */
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: .95rem; margin-top: 16px; }
.callout > .icon { margin-top: 2px; }
.callout-info { background: var(--info-bg); color: var(--text-2); }
.callout-info > .icon { color: var(--info); }
.callout-warn { background: var(--warn-bg); color: var(--text-2); }
.callout-warn > .icon { color: var(--warn); }
.callout-slim { margin: -8px 0 20px; padding: 10px 14px; }
.callout strong { color: var(--text); }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 650; line-height: 1.4; vertical-align: 1px; white-space: nowrap;
}
.badge-ok { color: var(--ok); background: var(--ok-bg); }
.badge-bad { color: var(--bad); background: var(--bad-bg); }
.badge-warn { color: var(--warn); background: var(--warn-bg); }
.badge-muted { color: var(--muted); background: var(--surface-3); }
.badge-loading { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.node-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.alias { font-weight: 700; color: var(--text); }

/* hex values */
.hex { font-family: var(--mono); font-size: .9em; letter-spacing: .01em; overflow-wrap: anywhere; }
.hex-chunk { display: inline-block; margin-right: .5ch; }
.hex-chunk:last-child { margin-right: 0; }
.hex-short { padding: 2px 8px; border-radius: 7px; white-space: nowrap; font-weight: 600; }
.hex-hash { color: var(--c-hash); }
.hex-pre { color: var(--c-pre); }
.hex-node { color: var(--c-node); }
.hex-entry { color: var(--text-2); }
.hex-muted { color: var(--muted); }
.hex-short.hex-hash { background: var(--c-hash-bg); }
.hex-short.hex-pre { background: var(--c-pre-bg); }
.hex-short.hex-node { background: var(--c-node-bg); }
.hex-short.hex-entry, .hex-short.hex-muted { background: var(--c-entry-bg); }
.hex-box { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.hex-box .hex { font-size: .92rem; line-height: 1.7; }
.hex-box-inline { padding: 8px 10px; }

/* ---------- sections ---------- */
.section { margin-top: 64px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); font-weight: 800; }
.section-lead { margin: 10px 0 0; color: var(--text-2); font-size: 1.04rem; max-width: 700px; }
.sub-head { font-size: 1.1rem; margin: 30px 0 6px; display: flex; align-items: center; gap: 8px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--surface-3); font-size: .8rem; color: var(--muted); }
.note-line { margin-top: 14px; display: flex; align-items: center; gap: 6px; }

/* story */
.story { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: s; position: relative; }
.story-step {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.story-step:not(:last-child)::after {
  content: ""; position: absolute; top: 44px; right: -17px; width: 18px; height: 2px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.story-icon { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; }
.story-icon .icon { width: 24px; height: 24px; }
.story-icon.ico-lock { color: var(--c-hash); background: var(--c-hash-bg); }
.story-icon.ico-bolt { color: var(--accent); background: rgba(247, 147, 26, .13); }
.story-icon.ico-key { color: var(--c-pre); background: var(--c-pre-bg); }
.story-num {
  position: absolute; top: -7px; right: -7px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: .72rem; font-weight: 800; background: var(--text); color: var(--surface);
}
.story-body h3 { font-size: 1.08rem; margin-bottom: 8px; }
.story-body p { font-size: .94rem; color: var(--text-2); margin-bottom: 14px; }
.story-token { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: auto; }
.story-body { display: flex; flex-direction: column; flex: 1; }
.token-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 800px) {
  .story { grid-template-columns: 1fr; }
  .story-step { flex-direction: row; }
  .story-step:not(:last-child)::after { top: auto; bottom: -17px; left: 45px; right: auto; width: 2px; height: 18px; background: var(--border-strong); }
}

.equation { margin-top: 18px; padding: 24px; }
.eq-row { display: grid; gap: 6px; }
.eq-label { font-weight: 650; font-size: .96rem; }
.eq-label .fn { font-family: var(--mono); font-weight: 700; }
.eq-hex { font-size: 1rem; line-height: 1.9; }
.eq-hex .hex-chunk { padding: 0 4px; border-radius: 5px; margin-right: .35ch; transition: background .3s; }
.eq-hex .hex-chunk.m { background: var(--c-hash-bg); }
.eq-mid { display: flex; gap: 14px; align-items: center; margin: 14px 0; }
.eq-sign { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 1.4rem; font-weight: 800; color: #fff; }
.eq-sign.ok { background: var(--ok); box-shadow: 0 0 0 6px var(--ok-ring); }
.eq-sign.bad { background: var(--bad); box-shadow: 0 0 0 6px var(--bad-ring); }
.eq-note { font-size: .88rem; color: var(--muted); font-weight: 600; }
@media (max-width: 700px) { .equation { padding: 18px; } .eq-hex { font-size: .92rem; } }

.why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.why-card { padding: 20px 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.why-card h3 { display: flex; align-items: center; gap: 8px; font-size: 1.02rem; margin-bottom: 8px; }
.why-card h3 .icon { color: var(--ok); }
.why-card p { font-size: .94rem; color: var(--text-2); margin: 0; }
@media (max-width: 700px) { .why-grid { grid-template-columns: 1fr; } }

details > summary { cursor: pointer; }
.fineprint { margin-top: 18px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.fineprint summary { display: flex; align-items: center; gap: 10px; padding: 16px 22px; font-weight: 650; list-style: none; }
.fineprint summary::-webkit-details-marker { display: none; }
.fineprint summary::after { content: "+"; margin-left: auto; font-size: 1.3rem; font-weight: 400; color: var(--muted); }
.fineprint[open] summary::after { content: "–"; }
.fineprint ul { margin: 0; padding: 0 22px 18px 44px; display: grid; gap: 10px; font-size: .94rem; color: var(--text-2); }
.fineprint li.hl { background: var(--warn-bg); border-radius: 10px; padding: 8px 12px; margin-left: -12px; }

/* receiver */
.node-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: grid; gap: 16px; }
.node-card-head { display: flex; gap: 14px; align-items: center; }
.node-avatar { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--c-node); background: var(--c-node-bg); flex: none; }
.node-avatar .icon { width: 24px; height: 24px; }
.node-card-label { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.node-card-title .alias { font-size: 1.1rem; }
.explorers { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: .84rem; font-weight: 600; color: var(--text-2); text-decoration: none;
  background: var(--surface-2); border: 1px solid var(--border);
}
.chip-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.link-ext { display: inline-flex; align-items: center; gap: 3px; }

.routes { display: grid; gap: 14px; margin-top: 14px; }
.route-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; }
.route-title { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.route-chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.route-node { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.route-entry { flex: 1 1 320px; }
.route-dest { background: var(--c-node-bg); border-color: transparent; justify-content: center; }
.route-node-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.route-node-id { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.route-node .explorers .chip-link { padding: 4px 10px; font-size: .78rem; }
.route-arrow { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 0 4px; font-size: .78rem; text-align: center; max-width: 190px; }
.route-arrow-line { color: var(--muted); }
.route-arrow-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; }
@media (max-width: 700px) {
  .route-chain { flex-direction: column; }
  .route-entry { flex: none; }
  .route-arrow { max-width: none; flex-direction: row; justify-content: flex-start; padding: 0 12px; }
  .route-arrow-line .icon { transform: rotate(90deg); }
  .route-arrow-meta { flex-direction: row; flex-wrap: wrap; }
}

/* spark */
.hex-spark { color: var(--text); font-weight: 600; }
.hex-short.hex-spark { background: var(--c-entry-bg); }
.hex-box .hex-spark { font-size: .88rem; word-break: break-all; }
.spark-card {
  margin-top: 16px; padding: 22px; display: grid; gap: 14px;
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  border: 1px solid var(--border); position: relative; overflow: hidden;
}
.spark-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, #111827, #6b7280, #111827); }
@media (prefers-color-scheme: dark) { .spark-card::before { background: linear-gradient(90deg, #e5e7eb, #6b7280, #e5e7eb); } }
.spark-card > p { margin: 0; color: var(--text-2); font-size: .95rem; }
.spark-card .callout { margin-top: 0; }
.spark-avatar { color: var(--text); background: var(--surface-3); }
.spark-field .node-card-label { margin-bottom: 6px; }
.route-card-spark { border-style: dashed; }
.route-spark { background: var(--surface-2); }
.spark-note { margin: 2px 0 0; }
.badge-info { color: var(--info); background: var(--info-bg); }
.known-node { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.known-node .small { font-size: .82rem; }

/* invoice details */
.kv { margin: 0; }
.kv-row { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); align-items: baseline; }
.kv-row:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); font-size: .92rem; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv-row { grid-template-columns: 1fr; gap: 4px; } }

.tech { margin-top: 14px; }
.tech > summary, .vcheck-adv > summary { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: .94rem; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); list-style: none; }
.tech > summary::-webkit-details-marker, .vcheck-adv > summary::-webkit-details-marker { display: none; }
.tech > summary::before, .vcheck-adv > summary::before { content: "▸"; font-size: .8em; color: var(--muted); transition: transform .15s; }
.tech[open] > summary::before, .vcheck-adv[open] > summary::before { transform: rotate(90deg); }
.tech > summary:hover, .vcheck-adv > summary:hover { background: var(--surface-2); color: var(--text); }
.tech-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .86rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: block; overflow-x: auto; }
.tech-table th, .tech-table td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tech-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.tech-table tr.unused td { opacity: .5; }
.tech-table td:nth-child(2) { white-space: nowrap; color: var(--text-2); }
.break { overflow-wrap: anywhere; }
td.break { word-break: break-all; }
.raw { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.raw-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 650; font-size: .9rem; }
.raw-text { margin: 0; word-break: break-all; color: var(--c-inv); font-size: .82rem; line-height: 1.55; }

/* verify yourself */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.howto-item { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.howto-num { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .72rem; font-weight: 800; background: var(--surface-3); color: var(--text-2); margin-top: 1px; }
@media (max-width: 760px) { .howto { grid-template-columns: 1fr; } }
.os-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 18px; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--surface-3); }
.seg-btn { font: inherit; font-size: .88rem; font-weight: 650; padding: 7px 16px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.checks-wrap { display: grid; gap: 18px; }

.vcheck { padding: 26px; }
.vcheck-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.vcheck-head h3 { font-size: 1.15rem; flex: 1; }
.vcheck-num { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #7c3aed, #4f46e5); }
.vcheck-time { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 650; color: var(--muted); background: var(--surface-2); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.vcheck > p, .vcheck-adv p { color: var(--text-2); }
.vcheck-adv { margin: 12px 0 4px; }
.vcheck-adv[open] > summary { margin-bottom: 14px; }
@media (max-width: 560px) { .vcheck { padding: 18px; } .vcheck-head { flex-wrap: wrap; } }

.legend { list-style: none; padding: 0; margin: 4px 0 16px; display: grid; gap: 8px; font-size: .92rem; color: var(--text-2); }
.legend li { display: flex; gap: 10px; align-items: flex-start; }
.dot { flex: none; width: 11px; height: 11px; border-radius: 4px; margin-top: 6px; }
.dot-node { background: var(--c-node); }
.dot-msg { background: #94a3b8; }
.dot-sig { background: var(--c-sig); }

.codeblock { border-radius: 16px; overflow: hidden; background: var(--code-bg); box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .06); margin: 6px 0 12px; }
.codeblock-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 14px; background: var(--code-bar); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.codeblock-dots { display: inline-flex; gap: 6px; }
.codeblock-dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3552; }
.codeblock-dots i:nth-child(1) { background: #ff5f57; }
.codeblock-dots i:nth-child(2) { background: #febc2e; }
.codeblock-dots i:nth-child(3) { background: #28c840; }
.codeblock-title { flex: 1; font-size: .78rem; color: #8f8aa8; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.codeblock pre { margin: 0; padding: 16px 18px; color: var(--code-text); font-family: var(--mono); font-size: .84rem; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock-tall pre { max-height: 360px; overflow: auto; }
.codeblock code { font-size: inherit; background: none; border: 0; padding: 0; }
.tok { font-weight: 600; word-break: break-all; }
.tok-pre { color: #fdba74; }
.tok-hash { color: #c4b5fd; }
.tok-node { color: #5eead4; }
.tok-msg { color: #cbd5e1; font-weight: 400; }
.tok-sig { color: #f9a8d4; }
.tok-inv { color: #93c5fd; }
.tok-muted { color: #8f8aa8; font-weight: 400; }

.expect { border-radius: 14px; background: var(--ok-bg); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent); padding: 10px 14px 12px; margin: 0 0 12px; }
.expect-label { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ok); margin-bottom: 6px; }
.expect pre { margin: 0; font-family: var(--mono); font-size: .86rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.expect .tok-hash { color: var(--c-hash); }
.expect .tok-node { color: var(--c-node); }
.file-variant { margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.file-variant > p { color: var(--text-2); }
.other-tools { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: .94rem; }
.other-tools ul { margin: 6px 0 10px; padding-left: 20px; display: grid; gap: 4px; }

/* share */
.share-box { display: grid; gap: 16px; }
.share-url { font-size: .82rem; word-break: break-all; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; max-height: 120px; overflow: auto; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* footer */
.footer { margin-top: 80px; padding-top: 26px; padding-bottom: 40px; border-top: 1px solid var(--border); font-size: .86rem; color: var(--muted); text-align: center; }
.footer p { margin: 0 0 6px; }
.footer a { color: var(--text-2); }

/* print: a clean receipt */
@media print {
  .topbar, .bg-glow, .btn, .btn-copy, .inputs-bar, .seg, .os-row, .share-box, .explorers, .footer { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .story-step, .node-card, .why-card { box-shadow: none; }
  .codeblock-tall pre { max-height: none; }
  details:not([open]) > *:not(summary) { display: none; }
}
