:root {
  --ink: #121826;
  --ink-2: #33415c;
  --muted: #6b7280;
  --line: #e3e0d8;
  --paper: #f6f4ee;
  --card: #ffffff;
  --navy: #12263f;
  --navy-2: #1d3a5f;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --green: #0f766e;
  --green-soft: #e9f5f2;
  --red: #b42318;
  --red-soft: #fdecea;
  --blue: #1d4ed8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 24, 38, .04), 0 8px 30px rgba(18, 24, 38, .06);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--ink); background: var(--paper);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; letter-spacing: -.015em; }
h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2.2rem, 4.4vw, 3.7rem); }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.3rem); }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.body { color: var(--ink-2); }
.narrow { max-width: 760px; }
.hint { color: var(--muted); font-size: .86rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700; color: var(--amber); margin-bottom: .7em; }
.hl { color: var(--amber); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: .62em 1.05em; font-weight: 600; font-size: .95rem;
  cursor: pointer; transition: .15s ease; text-decoration: none !important; white-space: nowrap;
}
.btn:hover { border-color: #c9c4b8; transform: translateY(-1px); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; }
.btn.lg { padding: .8em 1.35em; font-size: 1rem; }
.btn.small { padding: .35em .7em; font-size: .84rem; }
.btn.wide { width: 100%; }
.btn.danger { color: var(--red); border-color: #f0c9c4; background: #fff8f7; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* top bar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px;
  padding: 14px 28px; background: rgba(246, 244, 238, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.mark {
  width: 34px; height: 34px; border-radius: 9px; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .82rem; letter-spacing: -.02em;
}
.brandtext { font-weight: 750; font-size: 1.06rem; letter-spacing: -.02em; }
.brandtext em { font-style: normal; color: var(--amber); }
.brand.small .mark { width: 28px; height: 28px; font-size: .7rem; }
.topnav { display: flex; gap: 22px; font-size: .9rem; font-weight: 550; }
.topnav a { color: var(--ink-2); text-decoration: none; }
.topnav a:hover { color: var(--ink); }
.topactions { margin-left: auto; display: flex; gap: 10px; }

/* hero */
.landing { padding-bottom: 40px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; padding: 74px 28px 64px; }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 34em; margin-top: .6em; }
.hero-cta { display: flex; gap: 12px; margin: 28px 0 22px; flex-wrap: wrap; }
.trust { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .84rem; color: var(--muted); }
.trust li::before { content: "✓"; color: var(--green); font-weight: 800; margin-right: 6px; }
.hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  padding: 20px 20px 14px; transform: rotate(.6deg);
}
.hc-top { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); font-weight: 600; }
.pill { background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: .15em .6em; font-size: .74rem; font-weight: 700; }
.hc-total { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding: 14px 0 12px; }
.hc-total span { font-size: .85rem; color: var(--muted); }
.hc-total strong { font-family: var(--serif); font-size: 2rem; letter-spacing: -.02em; }
.mini { width: 100%; border-collapse: collapse; font-size: .84rem; }
.mini th { text-align: left; color: var(--muted); font-weight: 600; padding: 10px 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.mini td { padding: 8px 0; border-top: 1px dashed #ece9e1; font-family: var(--mono); font-size: .8rem; }
.mini .num { text-align: right; }
.hc-note { font-size: .72rem; color: var(--muted); margin: 10px 0 0; }
.tag { display: inline-block; border-radius: 6px; padding: .1em .45em; font-size: .7rem; font-weight: 700; font-family: var(--sans); }
.tag.missing { background: var(--red-soft); color: var(--red); }
.tag.under { background: var(--amber-soft); color: var(--amber); }

/* bands */
.band { padding-top: 66px; padding-bottom: 10px; }
.band > h2 { margin-bottom: .9em; }
.steps3 { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.steps3 li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps3 .n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 700; font-size: .85rem; margin-bottom: 14px; }
.steps3 p { margin: 0; color: var(--ink-2); font-size: .94rem; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cell { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.cell p { margin: 0; font-size: .9rem; color: var(--ink-2); }
.note-line { margin-top: 16px; font-size: .88rem; color: var(--muted); border-left: 3px solid var(--line); padding-left: 14px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; padding-top: 66px; }
.quote-card { background: var(--navy); color: #fff; border-radius: 18px; padding: 30px; }
.quote { font-family: var(--serif); font-size: 1.2rem; line-height: 1.45; }
.byline { font-size: .8rem; color: #b9c6d8; margin: 0; }
.price-card {
  margin-top: 40px; background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 34px; display: grid; grid-template-columns: 1.2fr 1fr auto; gap: 34px; align-items: center; box-shadow: var(--shadow);
}
.price-card h2 { font-size: 2.6rem; margin: 0; }
.price-card h2 span { font-size: 1rem; font-family: var(--sans); color: var(--muted); font-weight: 500; }
.checks { list-style: none; padding: 0; margin: 0; font-size: .92rem; color: var(--ink-2); }
.checks li { padding: 5px 0 5px 24px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.faq { padding-bottom: 70px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 8px; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 2px; color: var(--ink-2); font-size: .93rem; }

/* app shell */
.app { scroll-margin-top: 64px; display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: calc(100vh - 64px); background: #fbfaf6; }
.rail { border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 18px; background: #f8f6f0; position: sticky; top: 64px; height: calc(100vh - 64px); overflow: auto; }
.rail-head .period { display: block; font-size: .78rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.rail-head input[type=month] { width: 100%; margin-top: 6px; padding: .5em .6em; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.rail-hint { font-size: .76rem; color: var(--muted); margin: 6px 0 0; }
.railsteps { display: flex; flex-direction: column; gap: 3px; }
.step { display: flex; gap: 10px; align-items: flex-start; text-align: left; background: none; border: 0; border-radius: 9px; padding: 9px 10px; cursor: pointer; }
.step:hover { background: #efece4; }
.step.active { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.step .sn { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #cfc9bc; display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--muted); flex: none; margin-top: 1px; }
.step.active .sn { background: var(--navy); border-color: var(--navy); color: #fff; }
.step b { display: block; font-size: .9rem; font-weight: 620; }
.step small { display: block; color: var(--muted); font-size: .74rem; margin-top: 1px; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.rail-links { display: flex; justify-content: space-between; }
.rail-links button { background: none; border: 0; color: var(--muted); font-size: .8rem; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.trial { font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

.workspace { padding: 26px 34px 60px; min-width: 0; }
.appbar { display: flex; justify-content: space-between; gap: 20px; align-items: flex-end; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; }
.appbar h2 { margin: 0; font-size: 1.7rem; }
.appbar p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.agency-name { font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.agency-name input { display: block; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; padding: .45em .6em; font: inherit; font-size: .88rem; width: 230px; }

/* dropzone */
.drop { border: 1.5px dashed #cfc9bc; border-radius: 16px; background: #fff; padding: 44px 24px; text-align: center; transition: .15s; }
.drop.over { border-color: var(--navy); background: #f4f7fb; }
.drop-title { font-weight: 700; font-size: 1.1rem; margin: 0; }
.drop-sub { color: var(--muted); font-size: .86rem; margin: 6px 0 18px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.filecard { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.filecard small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.mapwrap { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.maphead h3 { margin: 0; }
.maphead p { color: var(--muted); font-size: .85rem; margin: 4px 0 14px; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.field { display: block; font-size: .78rem; font-weight: 650; color: var(--ink-2); }
.field span { color: var(--red); }
.field select, .field input, .field textarea {
  display: block; width: 100%; margin-top: 5px; padding: .48em .55em; font: inherit; font-size: .86rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.field textarea { font-family: var(--mono); font-size: .78rem; }
.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; min-width: 120px; }
.stat b { display: block; font-size: 1.3rem; letter-spacing: -.02em; }
.stat small { color: var(--muted); font-size: .76rem; }
.issuebox { background: #fffaf0; border: 1px solid #f0dfbd; border-radius: 12px; padding: 12px 16px; margin: 12px 0; font-size: .86rem; }
.issuebox b { color: var(--amber); }
.issuebox ul { margin: 6px 0 0; padding-left: 18px; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

/* tables */
.tablewrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: auto; margin-top: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data th { position: sticky; top: 0; background: #faf9f5; text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
table.data td { padding: 9px 12px; border-bottom: 1px solid #f1efe9; vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: #fbfaf6; }
table.data tr.open td { background: #f6f8fb; }
table.data td.num, table.data th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
table.data td.pol { font-family: var(--mono); font-size: .8rem; }
.detail-row td { background: #f8fafc; font-size: .84rem; color: var(--ink-2); }
.detail-box { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 8px 4px; }
.detail-box h4 { margin: 0 0 6px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.evidence { font-family: var(--mono); font-size: .76rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; }
.statusselect { padding: .25em .4em; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .76rem; background: #fff; }

/* findings */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.kpi span { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi b { display: block; font-size: 1.75rem; letter-spacing: -.03em; margin-top: 4px; }
.kpi.accent { background: var(--navy); color: #fff; border-color: var(--navy); }
.kpi.accent span { color: #b9c6d8; }
.split2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.card.pad { padding: 20px; }
.cardhead { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px 0; }
.cardhead h3 { margin: 0; font-size: .92rem; }
.bars { padding: 10px 16px 16px; }
.bar { margin: 10px 0; }
.bar-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.bar-track { height: 8px; background: #f0ede5; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--amber); border-radius: 99px; }
.summary { padding: 10px 16px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: .85rem; }
.summary b { font-family: var(--mono); font-weight: 600; text-align: right; }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 0; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .32em .8em; font-size: .8rem; cursor: pointer; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: .12em .5em; border-radius: 6px; white-space: nowrap; }
.badge.missing { background: var(--red-soft); color: var(--red); }
.badge.underpaid { background: var(--amber-soft); color: var(--amber); }
.badge.overpaid { background: #eef2ff; color: var(--blue); }
.badge.duplicate { background: #f3e8ff; color: #6b21a8; }
.badge.chargeback_unpaired { background: var(--red-soft); color: var(--red); }
.badge.not_in_book { background: #eef2f6; color: var(--ink-2); }
.badge.unchecked { background: #f1f0ec; color: var(--muted); }
.state { font-size: .72rem; color: var(--muted); }

/* report */
.report-tools { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.report-tools label { font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.report-tools select { display: block; margin-top: 4px; padding: .5em .6em; border: 1px solid var(--line); border-radius: 8px; font: inherit; min-width: 240px; background: #fff; }
.report { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 46px 52px; max-width: 900px; }
.report h1 { font-family: var(--sans); font-size: 1.3rem; letter-spacing: 0; margin-bottom: 2px; }
.report .meta { color: var(--muted); font-size: .82rem; margin-bottom: 26px; }
.report table { width: 100%; border-collapse: collapse; font-size: .82rem; margin: 16px 0; }
.report th { text-align: left; border-bottom: 1.5px solid var(--ink); padding: 7px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.report td { border-bottom: 1px solid var(--line); padding: 7px 6px; vertical-align: top; }
.report td.num, .report th.num { text-align: right; font-family: var(--mono); }
.report .total { font-weight: 700; border-top: 1.5px solid var(--ink); }
.report .letter { font-size: .9rem; color: var(--ink-2); }
.report .sig { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 12px; font-size: .8rem; color: var(--muted); }

/* misc */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 9px; font-size: .86rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.foot { border-top: 1px solid var(--line); background: #f1eee7; margin-top: 60px; padding: 44px 0 20px; }
.footgrid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 30px; }
.foot h4 { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.foot a { display: block; font-size: .86rem; color: var(--ink-2); margin-bottom: 5px; text-decoration: none; }
.foot .muted { font-size: .84rem; margin-top: 10px; }
.fine { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 14px; font-size: .76rem; color: var(--muted); }

/* legal pages */
.legal { max-width: 820px; margin: 0 auto; padding: 60px 28px 20px; }
.legal h1 { font-size: 2.2rem; }
.legal h2 { font-size: 1.25rem; margin-top: 1.6em; font-family: var(--sans); }
.legal p, .legal li { color: var(--ink-2); font-size: .95rem; }
.legal .updated { color: var(--muted); font-size: .82rem; }

@media (max-width: 960px) {
  .hero, .split, .price-card { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; gap: 34px; }
  .steps3, .grid4 { grid-template-columns: 1fr 1fr; }
  .topnav { display: none; }
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .railsteps { flex-direction: row; overflow: auto; }
  .step small { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .split2, .detail-box { grid-template-columns: 1fr; }
  .workspace { padding: 20px 18px 50px; }
  .footgrid { grid-template-columns: 1fr 1fr; }
  .agency-name { display: none; }
}
@media (max-width: 560px) {
  .steps3, .grid4, .kpis { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  .report { padding: 24px 18px; }
  .topactions .ghost { display: none; }
}

@media print {
  body { background: #fff; }
  .topbar, .rail, .appbar, .report-tools, .foot, .toast, .landing, .panel:not([data-panel="report"]) { display: none !important; }
  .app { display: block; }
  .workspace { padding: 0; }
  .panel[data-panel="report"] { display: block !important; }
  .report { border: 0; padding: 0; max-width: none; }
  .report table { font-size: 10.5pt; }
  @page { margin: 18mm; }
}
