/* Utility layout: one column, numbered steps, bordered panels, tabular figures. Light only, by design. */
:root {
  --bg: #f6f7f8;
  --panel: #ffffff;
  --ink: #16191d;
  --ink-2: #4a525c;
  --ink-3: #69717b;
  --line: #d9dde2;
  --line-2: #bfc5cc;
  --accent: #1e6a4e;
  --accent-ink: #ffffff;
  --accent-soft: #e8f2ed;
  --warn: #8a5300;
  --warn-soft: #fdf3e2;
  --bad: #a3271f;
  --bad-soft: #fbeceb;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 960px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mark { display: flex; align-items: baseline; gap: 10px; text-decoration: none; color: var(--ink); }
.mark b { font-size: 17px; letter-spacing: -0.01em; }
.mark span { font-size: 13px; color: var(--ink-3); }
.top nav { display: flex; gap: 18px; font-size: 14px; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--ink); text-decoration: underline; }

main { max-width: 960px; margin: 0 auto; padding: 28px 16px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
main > *, .step .body > *, .info .cols > * { min-width: 0; }
td { overflow-wrap: break-word; }
.tablewrap > table { min-width: 560px; }
.tablewrap.bank > table { min-width: 820px; }
#results .tablewrap > table { min-width: 0; }
.intro { display: grid; gap: 10px; padding-bottom: 6px; }
.intro h1 { font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.015em; max-width: 30ch; }
.intro p { color: var(--ink-2); max-width: 70ch; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.facts span::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 6px; }

.step { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.step > header { display: flex; align-items: baseline; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.step > header .n { font: 600 13px var(--mono); color: var(--ink-3); }
.step > header h2 { font-size: 17px; }
.step > header .st { margin-left: auto; font-size: 13px; color: var(--ink-3); }
.step .body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.step.locked { opacity: .55; }
.step.locked .body { display: none; }
.step.locked > header { border-bottom: 0; }
.muted { color: var(--ink-3); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

.drop { border: 1.5px dashed var(--line-2); border-radius: 6px; padding: 22px 16px; text-align: center; display: grid; gap: 8px; justify-items: center; background: #fbfbfc; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #18573f; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: inherit; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 5px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 12px; font-weight: 600; color: var(--ink-3); background: #fafbfb; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
td.r, td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--ink-2); white-space: nowrap; }
.tag.ok { border-color: #b9d6c8; background: var(--accent-soft); color: var(--accent); }
.tag.warn { border-color: #ecd3a4; background: var(--warn-soft); color: var(--warn); }
.tag.bad { border-color: #efbdb8; background: var(--bad-soft); color: var(--bad); }

label.f { display: grid; gap: 4px; font-size: 13px; font-weight: 500; }
label.f input, label.f select { padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 5px; background: var(--panel); font-weight: 400; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px 16px; }
.err { color: var(--bad); font-size: 13px; }

.banner { border: 1px solid var(--line); border-left-width: 4px; border-radius: 5px; padding: 10px 12px; font-size: 14px; }
.banner.ok { border-left-color: var(--accent); background: var(--accent-soft); }
.banner.warn { border-left-color: #c98a1a; background: var(--warn-soft); }
.banner.bad { border-left-color: var(--bad); background: var(--bad-soft); }
.banner ul { margin: 6px 0 0; padding-left: 18px; }

.cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.cat { border: 1px solid var(--line); border-radius: 5px; padding: 12px; display: grid; gap: 6px; align-content: start; }
.cat h3 { font-size: 15px; }
.cat .rule { font-size: 12.5px; color: var(--ink-3); }
.cat ul { margin: 0; padding-left: 16px; font-size: 13.5px; }
.cat .none { font-size: 13px; color: var(--ink-3); font-style: italic; }

.price { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.price .amt { font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
.price ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); font-size: 13px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bank td input[type=text] { width: 100%; min-width: 160px; padding: 5px 7px; border: 1px solid var(--line-2); border-radius: 4px; }
.bank tr.review td { background: var(--warn-soft); }
.bank tr.out td { color: var(--ink-3); }
.confirm { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 5px; background: #fbfbfc; font-size: 14px; cursor: pointer; }
.confirm input { margin-top: 3px; }
.ask { display: grid; gap: 8px; }
.ask .item { border: 1px solid #ecd3a4; background: var(--warn-soft); border-radius: 5px; padding: 10px 12px; font-size: 14px; display: grid; gap: 8px; }

.info { display: grid; gap: 18px; padding-top: 12px; }
.info h2 { font-size: 18px; }
.info .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; }
.info h3 { font-size: 15px; margin-bottom: 4px; }
.info p, .info li { color: var(--ink-2); font-size: 14px; }
.info ol, .info ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
details.faq { border-top: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
details.faq p { margin-top: 6px; }

footer { border-top: 1px solid var(--line); background: var(--panel); }
footer .in { max-width: 960px; margin: 0 auto; padding: 18px 16px 26px; display: grid; gap: 6px; font-size: 12.5px; color: var(--ink-3); }

dialog { border: 1px solid var(--line-2); border-radius: 6px; padding: 0; max-width: min(460px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(20, 24, 28, .45); }
dialog .in { padding: 18px; display: grid; gap: 12px; }
dialog h2 { font-size: 17px; }

.acct { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.acct a { color: var(--ink-2); text-decoration: none; }
.acct a:hover { color: var(--ink); text-decoration: underline; }
.acct .credits { font-size: 12.5px; color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.btn.sm { padding: 6px 11px; font-size: 13.5px; }
td.acts { white-space: nowrap; }
a.btn.primary, a.btn.primary:hover { color: var(--accent-ink); text-decoration: none; }
.gate { position: relative; }
.gate .veil { filter: blur(6px); user-select: none; pointer-events: none; }
.gate-cta { position: absolute; top: 50%; left: 62%; transform: translate(-50%, -50%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 14px 18px; display: grid; gap: 8px; justify-items: center; text-align: center; box-shadow: 0 6px 24px rgba(20, 24, 28, .12); width: min(320px, 70%); }
.gate-cta b { font-size: 15px; }
.gate-cta .row { justify-content: center; }
.page { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.page > *, .cardgrid > * { min-width: 0; }
.authcard { width: min(440px, 100%); margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; display: grid; gap: 14px; }
.authcard h1 { font-size: 22px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 4px; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px; cursor: pointer; font-size: 14px; color: var(--ink-3); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.authcard form { display: grid; gap: 12px; }
.authcard .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.check input { margin-top: 3px; }
.code { letter-spacing: .4em; font: 600 20px var(--mono); text-align: center; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.cardbox { border: 1.5px dashed var(--line-2); border-radius: 6px; padding: 14px; font-size: 13.5px; color: var(--ink-2); background: #fbfbfc; }
.ok-msg { color: var(--accent); font-size: 14px; }
@media (max-width: 560px) {
  .step > header { flex-wrap: wrap; }
  .step > header .st { margin-left: 0; width: 100%; }
  .top nav { display: none; }
  .authcard .two { grid-template-columns: 1fr; }
  .gate-cta { left: 50%; width: 86%; }
  th, td { padding: 7px 6px; font-size: 13px; }
  .step .body { padding: 14px 12px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

#payDlg { width: min(1000px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); }
#checkoutMount { min-height: 120px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Hero: the pitch on the left, the top half of a real report on the right */
.hero { grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: center; }
.hero-text { display: grid; gap: 10px; align-content: start; }
.hero-sample { margin: 0; display: grid; gap: 8px; }
.hero-sample .paper { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 12px 32px -12px rgba(20, 24, 28, .22);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
.hero-sample img { display: block; width: 100%; height: auto; }
.paper-tag { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: var(--accent-soft); border: 1px solid #cfe3d8; border-radius: 999px; padding: 3px 9px; }
.hero-sample figcaption { font-size: 12.5px; color: var(--ink-3); }
@media (min-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 36px; }
}
@media (max-width: 879px) {
  .hero-sample .paper { max-height: 340px; }
  .paper-tag { display: none; }
  .hero-sample img { object-fit: cover; object-position: top; }
}

/* Preview-mode strip (only while the database isn't connected) */
.previewbar { background: #fff8e6; border-bottom: 1px solid #ecd3a4; color: #6b4a00; font-size: 12.5px; text-align: center; padding: 6px 16px; }

/* Visitors: files land as light chips, then one clear next step */
.filechips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.filechips li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--line); background: #fafbfb; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; }
.filechips .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechips .x { border: 0; background: none; color: var(--ink-3); font-size: 16px; line-height: 1; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; }
.filechips .x:hover { background: var(--line); color: var(--ink); }
.nudge { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border: 1px solid #cfe3d8; background: var(--accent-soft); border-radius: 6px; padding: 14px 16px; }
.nudge b { font-size: 15px; }
.nudge p { margin-top: 2px; max-width: 56ch; font-size: 13.5px; }

/* Signed in: a home, not a landing page */
body.member .hero { display: none; }
.home { display: grid; gap: 16px; }
.home-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.home-top h1 { font-size: clamp(22px, 3vw, 28px); letter-spacing: -0.01em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: grid; gap: 2px; }
.tile .tl { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.tile b { font-size: 22px; }
.tile .ts { font-size: 12.5px; color: var(--ink-3); }
.recent { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.recent:empty { display: none; }
.recent-h { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-l { list-style: none; margin: 0; padding: 0; }
.recent-l li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.recent-l li:last-child { border-bottom: 0; }
.recent-l .sub { display: block; }
.ws-title { font-size: 17px; margin-top: 6px; }
.sub { font-size: 12.5px; color: var(--ink-3); }

/* Calmer working tables */
.tablewrap.files table { font-size: 13.5px; min-width: 520px; }
.tablewrap.files td { vertical-align: middle; padding: 9px 12px; }
.tablewrap.files .fname { font-weight: 600; }
.tablewrap.files .acts { white-space: nowrap; text-align: right; }
.tablewrap.files .acts .linkbtn, .tablewrap.files .acts { color: var(--ink-3); font-size: 12.5px; }
.tablewrap.files .acts .linkbtn:hover { color: var(--accent); }
.tablewrap.bank table { font-size: 13.5px; }
.tablewrap.bank td { vertical-align: middle; padding: 7px 10px; }
.bank td.desc { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.bank td.muted { font-size: 12.5px; }
.bank td input[type=text] { font-size: 13px; padding: 4px 7px; }
.bank td.muted { overflow-wrap: anywhere; min-width: 180px; }
@media (max-width: 560px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 9px 10px; }
  .tile .tl { font-size: 10.5px; letter-spacing: .02em; }
  .tile b { font-size: 17px; }
  .tile .ts { display: none; }
}
