:root {
    --brand: #66B50D;
    --brand-dark: #4C8A06;
    --brand-ink: #2F5A02;
    --brand-tint: #EEF7E3;
    --ink: #1B2420;
    --muted: #5B6661;
    --line: #DDE3DF;
    --bg: #F7F9F7;
    --card: #FFFFFF;
    --warn: #B45309;
    --warn-tint: #FEF3C7;
    --bad: #B42318;
    --bad-tint: #FEE4E2;
    --ok: #2F7D32;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .05);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--ink);
    background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
main { flex: 1; }
a { color: var(--brand-ink); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }

/* Header */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; gap: 24px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-size: 1.1rem; }
.brand b { color: var(--brand-dark); }
.logo { width: 28px; height: 28px; }
.appnav, .pubnav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.pubnav { justify-content: flex-end; align-items: center; gap: 16px; }
.appnav a, .pubnav a:not(.btn) { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 6px; }
.appnav a.active, .appnav a:hover { color: var(--ink); background: var(--brand-tint); }
.account { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.account .org { color: var(--muted); }
.account form { margin: 0; }

/* Buttons and forms */
.btn, button.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-dark); }
.btn.small { padding: 6px 12px; font-size: .9rem; }
.btn.ghost { background: transparent; color: var(--brand-ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--brand-tint); }
.btn.danger { background: var(--bad); }
button.link { background: none; border: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=url], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: var(--brand); }
.field { margin-bottom: 14px; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 3px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { font-weight: 500; display: flex; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: #fff; flex: 1; min-width: 200px; }
.choice input { margin-top: 4px; accent-color: var(--brand); }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.errors { background: var(--bad-tint); color: var(--bad); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.notice { background: var(--brand-tint); color: var(--brand-ink); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; }
.notice.warn { background: var(--warn-tint); color: var(--warn); }
.secret { font-family: ui-monospace, Consolas, monospace; background: #fff; border: 1px dashed var(--brand); padding: 8px 10px; border-radius: 6px; word-break: break-all; }

/* Cards and tables */
.app-main { padding-top: 24px; padding-bottom: 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 1.7rem; font-weight: 700; }
.stat .l { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr:hover td { background: #FAFCF9; }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; }

/* Status pills */
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #EEF1EF; color: var(--muted); white-space: nowrap; }
.pill.queued, .pill.running { background: #E8EEF9; color: #2D4E8C; }
.pill.needs_review, .pill.possible, .pill.in_review { background: var(--warn-tint); color: var(--warn); }
.pill.complete, .pill.cleared { background: var(--brand-tint); color: var(--brand-ink); }
.pill.confirmed, .pill.failed { background: var(--bad-tint); color: var(--bad); }
.pill.new { background: #F3E8FF; color: #6B21A8; }

/* Hits */
.hit { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.hit.confirmed { border-left: 4px solid var(--bad); }
.hit.possible { border-left: 4px solid var(--warn); }
.hit.cleared { border-left: 4px solid var(--brand); opacity: .85; }
.hit-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hit-name { font-weight: 700; }
.score { font-variant-numeric: tabular-nums; font-weight: 700; }
.reasons { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.reasons span { font-size: .78rem; background: #F1F4F2; border-radius: 6px; padding: 1px 7px; color: var(--muted); }
.details { font-size: .85rem; color: var(--muted); margin: 6px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; }
.details dt { font-weight: 600; }
.details dd { margin: 0; }
.review { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.review input[type=text] { flex: 1; min-width: 200px; }

/* Public pages */
.hero { background: linear-gradient(180deg, #fff 0%, var(--brand-tint) 100%); padding: 72px 0 56px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); max-width: 820px; letter-spacing: -.02em; }
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 700px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }
.band { padding: 56px 0; }
.band.alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band h2 { font-size: 1.7rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cards .card { margin: 0; }
.tier-tag { display: inline-block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-ink); background: var(--brand-tint); border-radius: 4px; padding: 1px 7px; margin-bottom: 6px; }
.price { font-size: 2rem; font-weight: 700; }
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.steps div { counter-increment: step; }
.steps div::before { content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px; }
pre.code { background: #10201A; color: #DDF5C6; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: .85rem; }
.sample { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 18px; box-shadow: var(--shadow); max-width: 560px; }
.signin-box { max-width: 420px; margin: 64px auto; }
.provider { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; margin-bottom: 10px; cursor: pointer; }
.provider:hover { background: var(--brand-tint); }
.legal { max-width: 760px; margin: 40px auto; }

/* Footer */
.foot { border-top: 1px solid var(--line); background: #fff; font-size: .82rem; color: var(--muted); padding: 18px 0; }
.foot-row { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.foot a { color: var(--muted); }

/* Report */
.report { max-width: 820px; margin: 0 auto; background: #fff; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); }
.report header { display: flex; justify-content: space-between; border-bottom: 3px solid var(--brand); padding-bottom: 12px; margin-bottom: 16px; }
.report .verdict { font-size: 1.15rem; font-weight: 700; padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.report .verdict.clear { background: var(--brand-tint); color: var(--brand-ink); }
.report .verdict.flag { background: var(--bad-tint); color: var(--bad); }
.report .verdict.open { background: var(--warn-tint); color: var(--warn); }
.report table { font-size: .85rem; }
.print-only { display: none; }
@media print {
    .top, .foot, .no-print { display: none !important; }
    body, main { background: #fff; }
    .report { border: 0; padding: 0; max-width: none; }
    .print-only { display: block; }
    a { color: var(--ink); text-decoration: none; }
}
@media (max-width: 640px) {
    .top-row { gap: 8px; padding: 8px 16px; }
    .account .org { display: none; }
    .hero { padding: 40px 0 32px; }
    .report { padding: 16px; }
}
.mt { margin-top: 14px; }
.center-items { align-items: center; }
.dev-box { margin-top: 16px; background: var(--warn-tint); box-shadow: none; }
.inline { display: inline; margin: 0; }
.right { text-align: right; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Settings › Credits: Stripe packs */
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0; }
.pack { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.pack .btn { margin-top: 4px; }
