:root {
  --bg: #f4f2ec; --panel: #fffdf8; --ink: #17201c; --muted: #66706b; --line: #e2ded3;
  --accent: #1f6b4f; --accent-ink: #ffffff; --soft: #e6f1eb;
  --high: #b3261e; --high-bg: #fbe7e4; --low: #8a5a00; --low-bg: #fbf0d9; --ok: #1f6b4f; --ok-bg: #e2f2ea;
  --sheet: #ffffff; --shadow: 0 18px 50px -20px rgba(23, 32, 28, .35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101513; --panel: #171d1a; --ink: #e8ece9; --muted: #98a39d; --line: #29312d;
    --accent: #63c99d; --accent-ink: #0c1411; --soft: #1b2a23;
    --high: #ff8a80; --high-bg: #3a1d1b; --low: #f2c46b; --low-bg: #33290f; --ok: #63c99d; --ok-bg: #16291f;
    --sheet: #1c2420; --shadow: 0 18px 50px -20px rgba(0, 0, 0, .7);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 1040px; margin: 0 auto; padding: 40px 16px 80px; }
h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 10px; }
h2 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.01em; }
.lede { max-width: 640px; color: var(--muted); font-size: 18px; margin: 0 0 14px; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--soft); color: var(--accent); margin: 0 6px 6px 0; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; margin-top: 28px; align-items: start; }
@media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.step { display: grid; gap: 10px; margin-bottom: 14px; }
.step .num { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.ask { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ask label { font-size: 12px; color: var(--muted); display: grid; gap: 3px; }
input, textarea { font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; min-height: 44px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
button { font: inherit; font-weight: 600; border-radius: 10px; padding: 9px 14px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
button:disabled { opacity: .5; cursor: progress; }
/* The approval sheet */
.sheet-wrap { position: sticky; top: 16px; }
.sheet { background: var(--sheet); border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 20px; min-height: 420px; }
.sheet .kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sheet h3 { margin: 4px 0 2px; font-size: 18px; line-height: 1.3; }
.sheet .type { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.cue { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; letter-spacing: .06em; padding: 6px 12px; border-radius: 99px; }
.cue.high { background: var(--high-bg); color: var(--high); }
.cue.low { background: var(--low-bg); color: var(--low); }
.cue.in_line { background: var(--ok-bg); color: var(--ok); }
.cue.unknown { background: var(--soft); color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0 10px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 0 4px 6px; }
td { padding: 8px 4px; border-top: 1px solid var(--line); }
td.c-high { color: var(--high); font-weight: 700; }
td.c-low { color: var(--low); font-weight: 700; }
td.c-in_line { color: var(--ok); font-weight: 600; }
.notes { margin: 0; padding-left: 18px; font-size: 14px; color: var(--muted); }
.suggest { margin-top: 12px; background: var(--soft); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.passkey { margin-top: 16px; display: grid; gap: 8px; }
.passkey button { width: 100%; padding: 12px; }
.fine { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.empty { color: var(--muted); display: grid; place-items: center; min-height: 380px; text-align: center; padding: 20px; }
.toast { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-size: 14px; font-weight: 600; }
.toast.rej { background: var(--high-bg); color: var(--high); }
.err { color: var(--high); font-size: 14px; }
section.more { margin-top: 36px; }
.rates { overflow-x: auto; }
.rates table { min-width: 560px; }
.how { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 760px) { .how { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .how { grid-template-columns: 1fr; } }
.how div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; font-size: 14px; color: var(--muted); }
.how b { display: block; color: var(--ink); margin-bottom: 4px; }
.honest { margin-top: 12px; font-size: 14px; color: var(--muted); }
.honest li { margin-bottom: 4px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .8s linear infinite; vertical-align: -2px; }
@keyframes s { to { transform: rotate(360deg); } }
code { font-size: .9em; background: var(--soft); padding: 1px 5px; border-radius: 5px; }
/* Shared: nav */
nav.top { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 22px; }
nav.top a { font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel); }
nav.top a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: transparent; }
a { color: var(--accent); }
/* SERV panel on the card */
.serv { margin-top: 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.serv .who { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.serv .ids { font-size: 11px; color: var(--muted); margin-top: 6px; word-break: break-all; }
.kite-summary { margin-top: 10px; font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.kite-summary b { color: var(--ink); }
/* Ledger and contrast */
.wide { overflow-x: auto; }
.wide table { min-width: 720px; }
td.num, th.num { text-align: right; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--accent); }
.tag.bad { background: var(--high-bg); color: var(--high); }
.tag.good { background: var(--ok-bg); color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 18px 0; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stats b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stats span { font-size: 13px; color: var(--muted); }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; align-items: start; }
@media (max-width: 760px) { .vs { grid-template-columns: 1fr; } }
.vs .sheet { min-height: 0; }
.vs ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 10px; font-size: 14px; }
.vs li b { display: block; }
.result { margin-top: 14px; padding: 12px; border-radius: 12px; font-weight: 700; }
.result.bad { background: var(--high-bg); color: var(--high); }
.result.good { background: var(--ok-bg); color: var(--ok); }
code { word-break: break-word; }

/* ---------------------------------------------------------------------------
   Ported from Magic UI (https://magicui.design, on 21st.dev), MIT License,
   Copyright (c) Magic UI: Border Beam and Shimmer Button. See public/ui.js.
--------------------------------------------------------------------------- */
:root { --color-from: #34d399; --color-to: #2453ff; }
.beam-host { position: relative; }
.beam {
  pointer-events: none; position: absolute; inset: 0; border-radius: inherit;
  border: var(--beam-width, 2px) solid transparent;
  -webkit-mask: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
  -webkit-mask-clip: padding-box, border-box; -webkit-mask-composite: source-in;
  mask: linear-gradient(transparent, transparent), linear-gradient(#000, #000);
  mask-clip: padding-box, border-box; mask-composite: intersect;
}
.beam i {
  position: absolute; aspect-ratio: 1;
  background: linear-gradient(to left, var(--color-from), var(--color-to), transparent);
  offset-distance: 0%; animation: beam 6s linear infinite;
}
@keyframes beam { to { offset-distance: 100%; } }
@media (prefers-reduced-motion: reduce) { .beam i { animation: none; } }

/* Shimmer Button */
.shimmer {
  --spread: 90deg; --shimmer-color: #ffffff; --speed: 3s; --cut: 0.05em; --bg: var(--accent); --radius: 12px;
  position: relative; z-index: 0; overflow: hidden; isolation: isolate; border-radius: var(--radius);
  color: var(--accent-ink); background: var(--bg); border: 1px solid rgba(255,255,255,.12);
  transition: transform .3s ease-in-out;
}
.shimmer:active { transform: translateY(1px); }
.shimmer .spark-wrap { position: absolute; inset: 0; z-index: -30; filter: blur(2px); container-type: size; overflow: visible; }
.shimmer .spark { position: absolute; inset: 0; height: 100cqh; aspect-ratio: 1; animation: shimmer-slide var(--speed) ease-in-out infinite alternate; }
.shimmer .spark::before {
  content: ""; position: absolute; inset: -100%; width: auto;
  background: conic-gradient(from calc(270deg - (var(--spread) * 0.5)), transparent 0, var(--shimmer-color) var(--spread), transparent var(--spread));
  animation: spin-around calc(var(--speed) * 2) infinite linear;
}
.shimmer .backdrop { position: absolute; inset: var(--cut); z-index: -20; border-radius: var(--radius); background: var(--bg); }
.shimmer .highlight { position: absolute; inset: 0; border-radius: var(--radius); box-shadow: inset 0 -8px 10px #ffffff1f; transition: box-shadow .3s ease-in-out; pointer-events: none; }
.shimmer:hover .highlight { box-shadow: inset 0 -6px 10px #ffffff3f; }
.shimmer:active .highlight { box-shadow: inset 0 -10px 10px #ffffff3f; }
@keyframes shimmer-slide { to { transform: translate(calc(100cqw - 100%), 0); } }
@keyframes spin-around {
  0% { transform: translateZ(0) rotate(0); }
  15%, 35% { transform: translateZ(0) rotate(90deg); }
  65%, 85% { transform: translateZ(0) rotate(270deg); }
  100% { transform: translateZ(0) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) { .shimmer .spark, .shimmer .spark::before { animation: none; } }

/* Flow diagram with Animated Beams (Magic UI port, see ui.js) */
.flow-wrap { margin: 26px 0 6px; }
.flow { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 56px; padding: 22px 8px; }
.flow .node { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: 4px; }
.flow .ico { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--panel);
  border: 1px solid var(--line); box-shadow: 0 8px 24px -14px rgba(0,0,0,.35); margin-bottom: 6px; }
.flow .ico svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.flow .node b { font-size: 15px; }
.flow .node span { font-size: 12.5px; color: var(--muted); max-width: 190px; line-height: 1.35; }
.flow .serv-node .ico { width: 76px; height: 76px; background: var(--accent); border-color: transparent; box-shadow: 0 0 0 6px var(--soft), 0 12px 30px -12px rgba(31,107,79,.6); }
.flow .serv-node .ico svg { stroke: var(--accent-ink); width: 34px; height: 34px; }
.flow .serv-node b { color: var(--accent); }
.animated-beam { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 0; }
@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr 1fr; gap: 34px 20px; }
}
