:root {
  --bg: #f6f7f9; --panel: #fff; --ink: #1b2330; --muted: #5f6b7b; --line: #e3e7ee;
  --brand: #1f5eff; --brand-ink: #fff; --brand-soft: #e8efff;
  --ok: #12805c; --ok-soft: #e3f5ee; --warn: #9a6400; --warn-soft: #fff4d6; --bad: #b42318; --bad-soft: #fde9e7;
  --radius: 10px; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid #8db0ff; outline-offset: 3px;
}
.skip-link { position: fixed; left: 16px; top: 10px; z-index: 100; padding: 9px 14px; border-radius: 7px; background: var(--ink); color: #fff; font-weight: 650; transform: translateY(-160%); transition: transform .15s; }
.skip-link:focus { transform: translateY(0); }
#main-content:focus { outline: none; }
[id] { scroll-margin-top: 78px; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
code, .mono { font-family: var(--mono); font-size: 13px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 28px; padding-bottom: 48px; min-height: 70vh; }
.footer { padding: 24px 20px 40px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--bad); }

/* top bar */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 58px; }
.brand { font-weight: 700; font-size: 17px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 16px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-right { justify-content: flex-end; align-items: center; gap: 14px; }
.nav a { color: var(--muted); padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.nav a:hover { color: var(--ink); background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.nav-right a.btn { color: var(--brand-ink); }
.userbox { display: flex; gap: 12px; align-items: center; font-size: 13px; margin: 0; }

/* layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card + .card { margin-top: 0; }
@media (max-width: 860px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } .topbar-inner { gap: 10px; overflow-x: auto; } .userbox .muted { display: none; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-tight { padding: 0; overflow: hidden; }
.card-tight > h2, .card-tight > .card-head { padding: 16px 20px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* stats */
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:hover { background: #fafbff; }
tfoot td { font-weight: 650; border-top: 2px solid var(--line); border-bottom: none; }
tr:last-child td { border-bottom: none; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.empty > strong { display: block; color: var(--ink); margin-bottom: 3px; }
.empty > .btn { margin-top: 14px; }

/* forms */
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.field-error { display: block; color: var(--bad); font-size: 12px; margin-top: 4px; }
.field-error:empty { display: none; }
input[type=text], input[type=email], input[type=password], input[type=number], input:not([type]), select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd5df; border-radius: 7px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
input.input-validation-error, select.input-validation-error, textarea.input-validation-error { border-color: var(--bad); }
input[type=file] { font: inherit; font-size: 13px; }
.field { margin-bottom: 14px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 450; font-size: 14px; margin: 0; }
.check input { width: auto; }
.form-narrow { max-width: 420px; margin: 40px auto; }
.inline-form { display: inline; margin: 0; }
td input, td select { padding: 6px 8px; font-size: 13px; }

/* buttons */
.btn, button.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn.btn-secondary { background: #fff; color: var(--ink); border-color: #cfd5df; }
.btn.btn-danger { background: #fff; color: var(--bad); border-color: #f0b9b3; }
.btn-link { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }

/* alerts, badges */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-bad { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--brand-soft); color: #1d3f99; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef0f4; color: var(--muted); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-brand { background: var(--brand-soft); color: #174fd6; }

/* tabs & chips */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 20px 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.chip.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* landing */
.hero { padding: 40px 0 28px; max-width: 760px; }
.hero h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 14px; }
.hero p { font-size: 18px; color: var(--muted); }
.steps { counter-reset: s; }
.step { position: relative; padding-left: 62px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.price { font-size: 26px; font-weight: 700; }
.plan-list { padding-left: 18px; margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* mapping */
.preview { font-size: 12px; }
.preview td, .preview th { padding: 6px 8px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.conf { font-size: 11px; }
.source-card { border-left: 4px solid var(--line); }
.role-Primary { border-left-color: var(--brand); }
.role-Deduction { border-left-color: var(--bad); }
.role-Addition { border-left-color: var(--ok); }
.role-ReferenceOnly { border-left-color: #8b5cf6; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
details summary { cursor: pointer; font-weight: 550; }

/* ===================== v2 UI ===================== */
:root { --ai: #7c3aed; --ai-soft: #f1eafe; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06); }
.card, .stat { box-shadow: var(--shadow); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.center { text-align: center; }
.ok-ink { color: var(--ok); }
.warn-ink { color: var(--warn); }
.btn.btn-lg { padding: 11px 20px; font-size: 15px; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; filter: none; }
.btn-spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input[type=search] { width: 100%; padding: 8px 10px; border: 1px solid #cfd5df; border-radius: 7px; font: inherit; }

/* nav: mobile */
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 7px; font-size: 18px; padding: 4px 10px; cursor: pointer; }
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; height: auto; min-height: 58px; padding-top: 10px; padding-bottom: 10px; overflow: visible; }
  .topbar .brand { order: 1; margin-right: auto; }
  .nav-toggle { display: block; order: 2; margin-left: 0; }
  .topbar .nav:not(.nav-right), .topbar .userbox { display: none; order: 3; width: 100%; flex-basis: 100%; }
  .topbar .userbox { order: 4; }
  body.nav-open .topbar .nav:not(.nav-right) { display: flex; flex-direction: column; }
  body.nav-open .topbar .userbox { display: flex; }
  body.nav-open .userbox .muted { display: inline; }
  .page-head h1 { font-size: 22px; }
}

/* toast */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: #102a43; color: #fff; padding: 12px 44px 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 420px; font-size: 14px; transition: opacity .3s, transform .3s; }
.toast button { position: absolute; right: 8px; top: 6px; background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; opacity: .7; }
.toast-hide { opacity: 0; transform: translateY(10px); pointer-events: none; }

/* stats */
.stat-hero { background: linear-gradient(135deg, #1f5eff, #3b7bff); color: #fff; border: none; }
.stat-hero .stat-label, .stat-hero .stat-sub { color: rgba(255,255,255,.8); }
.progress { height: 8px; background: #e9edf3; border-radius: 99px; overflow: hidden; }
.progress-sm { height: 5px; margin-top: 10px; }
.progress-bar { height: 100%; background: var(--brand); border-radius: 99px; transition: width .6s ease; }
.progress-ok { background: var(--ok); }

/* progress card */
.progress-card { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.progress-card h2 { margin-bottom: 12px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--brand-soft); border-top-color: var(--brand); border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
.dot-pulse { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.2s infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .3; } }

/* callout */
.callout { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--warn-soft); border: 1px solid #f3d999; border-radius: var(--radius); color: #6b4700; margin-bottom: 18px; }
.callout:hover { text-decoration: none; filter: brightness(.98); }
.callout-icon { width: 26px; height: 26px; border-radius: 50%; background: #f5b400; color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.callout-cta { margin-left: auto; font-weight: 650; white-space: nowrap; }
.tab-count { font-size: 11px; background: #eef0f4; color: var(--muted); border-radius: 99px; padding: 1px 7px; margin-left: 4px; }
.tabs button.active .tab-count { background: var(--brand-soft); color: var(--brand); }

/* tables */
table.clickable tbody tr[data-href] { cursor: pointer; }
tr.is-reviewed td { background: #fbfcfd; }
tr.is-reviewed td:not(:last-child) { opacity: .62; }
tr.is-excluded td { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.2); }
tr.is-excluded td:last-child { text-decoration: none; }
.chip b { font-weight: 700; margin-left: 3px; }
.chip-warn.active { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.chip-bad.active { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.help-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; margin: 0 20px 14px; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.help-box[hidden] { display: none; }
.empty-icon { width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 22px; }

/* segmented control (exception decision) */
.review-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.seg { display: inline-flex; border: 1px solid #cfd5df; border-radius: 7px; overflow: hidden; flex: none; }
.seg-opt { margin: 0; font-weight: 500; font-size: 12px; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: block; padding: 5px 9px; color: var(--muted); }
.seg-opt + .seg-opt span { border-left: 1px solid #cfd5df; }
.seg-opt input:checked + span { color: #fff; background: var(--muted); }
.seg-Accepted input:checked + span { background: var(--brand); }
.seg-Resolved input:checked + span { background: var(--ok); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.review-form .note { flex: 1; min-width: 90px; padding: 5px 8px; font-size: 13px; }
.review-meta { margin-top: 4px; min-height: 16px; }

/* dropzones */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 20px; border: 2px dashed #c4cede; border-radius: 12px; background: #fbfcff; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; margin: 0 0 16px; font-weight: 400; }
.dropzone:hover, .dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .dz-icon { font-size: 26px; color: var(--brand); line-height: 1; }
.dropzone-sm { padding: 18px; flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; }
.dropzone.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-soft); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.upload-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.upload-steps span { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px; background: #f3f6fc; }
.upload-steps b { display: grid; flex: none; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; background: var(--brand); font-size: 12px; }
.upload-error { margin-top: -6px; }
.slot { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); transition: border-color .2s, box-shadow .2s; }
.slot.has-file { border-color: #9fd8c2; }
.slot.is-over { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.slot.flash.has-file { box-shadow: 0 0 0 3px var(--ok-soft); }
.slot-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.slot-head > div { min-width: 0; }
.slot-head .badge { flex: none; }
.slot-drop { display: block; border: 1px dashed #cfd5df; border-radius: 8px; padding: 12px; font-weight: 400; font-size: 13px; color: var(--muted); cursor: pointer; margin: 0; word-break: break-word; }
.slot-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.slot.has-file .slot-drop { border-style: solid; border-color: #9fd8c2; background: var(--ok-soft); color: var(--ink); }
.slot-check { color: var(--ok); font-weight: 800; }
.demo-card { display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(180deg, #fff, #f8faff); }
.preset-picker { min-width: 0; margin: 0 0 10px; padding: 0; border: 0; }
.preset-picker legend { margin-bottom: 8px; font-weight: 650; }
.preset-option { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-weight: 400; }
.preset-option:hover { border-color: #9eb7f3; }
.preset-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(31,94,255,.08); }
.preset-option input { margin-top: 3px; }
.preset-option span { display: flex; flex-direction: column; gap: 3px; }
.preset-option small { color: var(--muted); font-weight: 400; }
.saved-check-actions { white-space: nowrap; }
.file-technical { margin-top: 5px; max-width: 360px; }
.file-technical summary { color: var(--muted); cursor: pointer; font-size: 11px; }
.file-technical code { display: block; margin-top: 4px; overflow-wrap: anywhere; white-space: normal; font-size: 10px; }

/* role colours */
.role-badge.role-Primary { background: var(--brand-soft); color: var(--brand); }
.role-badge.role-Deduction { background: var(--bad-soft); color: var(--bad); }
.role-badge.role-Addition { background: var(--ok-soft); color: var(--ok); }
.role-badge.role-ReferenceOnly { background: var(--ai-soft); color: var(--ai); }
.role-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.role-option { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 12px 12px 36px; position: relative; cursor: pointer; font-weight: 400; margin: 0; }
.role-option input { position: absolute; left: 12px; top: 15px; }
.role-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }

/* step cards (mapping page) */
.setup-intro { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0 26px; }
.setup-intro > div { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; border: 1px solid #cddcff; border-radius: 10px; background: var(--brand-soft); }
.setup-intro strong { color: var(--brand); font-size: 14px; }
.setup-intro span { color: var(--muted); font-size: 12px; }
.source-purpose { margin: 0 0 12px; }
.advanced-panel { padding: 0; overflow: hidden; }
.advanced-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; cursor: pointer; list-style-position: inside; }
.advanced-panel > summary:hover { background: #fafbfe; }
.advanced-panel > summary span { display: inline-flex; flex-direction: column; gap: 3px; vertical-align: middle; }
.advanced-panel > summary small { color: var(--muted); font-weight: 400; }
.advanced-panel[open] > summary { border-bottom: 1px solid var(--line); }
.advanced-body { padding: 20px; }
.nested-panel { margin-top: 8px; border: 1px solid var(--line); border-radius: 9px; }
.nested-panel .advanced-body { padding: 18px; }
.field-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 16px; padding: 10px 12px; border-radius: 8px; background: #f5f7fa; color: var(--muted); }
.step-card { display: flex; gap: 16px; }
.step-num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; }
.step-body { flex: 1; min-width: 0; }
.card-flush .table-wrap { margin: 0 -20px -20px -66px; border-top: 1px solid var(--line); }
.card-flush .map-table th:first-child, .card-flush .map-table td:first-child { padding-left: 66px; }
.map-table td { vertical-align: middle; }
.samples { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sugg { display: flex; gap: 4px; margin-top: 5px; }
.badge-ai { background: var(--ai-soft); color: var(--ai); }
.preview-wrap { margin-top: 14px; }
.preview-wrap .table-wrap { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 0; margin-top: 8px; background: linear-gradient(180deg, rgba(246,247,249,0), var(--bg) 35%); }
@media (max-width: 860px) { .setup-intro { grid-template-columns: 1fr; } .card-flush .table-wrap { margin-left: -20px; } .card-flush .map-table th:first-child, .card-flush .map-table td:first-child { padding-left: 12px; } .step-card { flex-direction: column; } }

/* dense result tables become readable cards on small screens */
@media (max-width: 700px) {
  .upload-steps { grid-template-columns: 1fr; }
  table.responsive-table, table.responsive-table tbody, table.responsive-table tr, table.responsive-table td { display: block; width: 100%; }
  table.responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  table.responsive-table tbody tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.responsive-table tbody td { display: grid; grid-template-columns: minmax(92px, 35%) 1fr; gap: 10px; align-items: start; padding: 6px 0; border: 0; text-align: left !important; white-space: normal; }
  table.responsive-table tbody td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
  table.responsive-table .result-arrow { display: none; }
  table.responsive-table tfoot { display: block; padding: 6px 12px; background: #f5f7fa; }
  table.responsive-table tfoot tr { display: table; width: 100%; }
  table.responsive-table tfoot td:not(:first-child):not(:nth-last-child(3)) { display: none; }
  table.responsive-table tfoot td { border: 0; }
  table.issues-table tbody td[data-label="Decision"] { grid-template-columns: 1fr; padding-top: 10px; }
  table.issues-table tbody td[data-label="Decision"]::before { margin-bottom: 2px; }
  table.issues-table .review-form { align-items: stretch; }
  table.issues-table .seg { flex-wrap: wrap; }
  table.issues-table .note { width: 100%; }
  table.saved-checks-table .saved-check-actions { white-space: normal; }
}

/* onboarding */
.onboarding { margin-bottom: 20px; border-color: #cddcff; background: linear-gradient(180deg, #fff, #f7f9ff); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.checklist li { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.checklist li.done { opacity: .65; }
.checklist li.next { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.checklist .btn { align-self: flex-start; }
.check-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: #eef0f4; color: var(--muted); }
.checklist li.done .check-dot { background: var(--ok); color: #fff; }
.checklist li.next .check-dot { background: var(--brand); color: #fff; }
@media (max-width: 860px) { .checklist { grid-template-columns: 1fr 1fr; } }

/* settings status */
.status-line { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-weight: 550; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #c4cad4; flex: none; }
.dot-ok { background: var(--ok); } .dot-warn { background: #f5b400; } .dot-bad { background: var(--bad); }

/* statement */
.statement { max-width: 900px; margin: 0 auto; padding: 32px; }
.statement-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); flex-wrap: wrap; }
.statement-who { text-align: right; }
.statement-id { font-size: 22px; font-weight: 700; font-family: var(--mono); }
.statement-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0 8px; }
.statement-totals > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #f8fafc; border-radius: 8px; }
.statement-totals strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.statement-net { background: var(--ink) !important; color: #fff; }
.statement-net strong { font-size: 22px; }
.statement-section { margin-top: 26px; }
.statement-section h3 { font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.statement-section table { font-size: 13px; }
.statement-section td, .statement-section th { padding: 7px 10px; }
.statement-notes { padding-left: 0; list-style: none; font-size: 13px; }
.statement-notes li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.statement-foot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
@media print {
  body { background: #fff; font-size: 12px; }
  .no-print, .toast { display: none !important; }
  .main { padding: 0; }
  .statement { box-shadow: none; border: none; padding: 0; max-width: none; }
  .statement-net { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
}
@media (max-width: 860px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-value { font-size: 20px; } }
/* billing */
.current-plan { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.plan-card { display: flex; flex-direction: column; }
.plan-card .plan-list { flex: 1; margin-bottom: 16px; }
.plan-current { border-color: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.plan-actions { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.plan-actions .btn { justify-content: center; flex-direction: column; gap: 0; line-height: 1.3; }
.plan-actions .btn .small { font-weight: 400; opacity: .85; font-size: 11px; }
.banner { background: var(--warn-soft); color: #6b4700; text-align: center; padding: 8px 16px; font-size: 14px; }

/* ===================== marketing site ===================== */
.site-nav { justify-content: center; }
.hero-split { display: grid; grid-template-columns: 1.08fr .92fr; gap: 52px; align-items: center; max-width: none; padding: 56px 0 34px; }
.hero-split h1 { font-size: 46px; line-height: 1.08; max-width: 700px; margin-top: 13px; }
.hero-copy > p { max-width: 680px; }
.hero-actions { margin-top: 24px; }
.hero-reassurance { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 15px 0 0; color: var(--muted); font-size: 13px; }
.hero-reassurance li { position: relative; padding-left: 16px; }
.hero-reassurance li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }
.hero-visual { background: linear-gradient(160deg, #0f1b3d, #1d3a8a); border-radius: 18px; padding: 24px; color: #fff; box-shadow: 0 20px 50px rgba(31,94,255,.25); }
.visual-label { margin-bottom: 14px; color: rgba(255,255,255,.78); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.mock-files { display: flex; flex-wrap: wrap; gap: 8px; }
.mock-files span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 10px; font-family: var(--mono); font-size: 12px; }
.mock-arrow { text-align: center; font-size: 22px; opacity: .7; margin: 10px 0; }
.mock-result { background: #fff; color: var(--ink); border-radius: 12px; padding: 12px; font-size: 13px; }
.mock-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; padding: 6px 4px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.mock-row span:not(:first-child), .mock-row b { text-align: right; }
.mock-head { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mock-flags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.result-summary { background: #fff; color: var(--ink); border-radius: 12px; padding: 16px; }
.result-ready { display: flex; align-items: center; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.result-ready > span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--ok); background: var(--ok-soft); font-weight: 800; }
.result-ready div { display: flex; flex-direction: column; }
.result-ready small { color: var(--muted); }
.result-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 0 6px; }
.result-counts div { display: flex; flex-direction: column; min-width: 0; }
.result-counts strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.result-counts span { color: var(--muted); font-size: 11px; line-height: 1.25; }
.section { margin: 56px 0; }
.section-title { font-size: 24px; letter-spacing: -0.01em; margin-bottom: 18px; }
.section-heading { max-width: 720px; margin-bottom: 22px; }
.section-heading .section-title { font-size: 30px; line-height: 1.15; margin: 6px 0 10px; }
.section-heading > p { color: var(--muted); font-size: 17px; }
.eyebrow, .use-case-kicker { color: var(--brand); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.outcome { padding: 8px 14px 8px 0; }
.outcome h3 { font-size: 18px; margin-top: 12px; }
.outcome p, .step p, .use-case p { color: var(--muted); }
.outcome-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: #174fd6; font-size: 18px; font-weight: 800; }
.section-action { margin-top: 20px; font-weight: 600; }
.use-case { padding: 24px; }
.use-case h3 { margin-top: 8px; font-size: 18px; }
.trust-panel { align-items: center; padding: 32px; border: 1px solid #cddcff; border-radius: 18px; background: linear-gradient(135deg, #f7f9ff, #fff); }
.trust-panel h2 { font-size: 28px; margin-top: 6px; }
.pricing-note { color: var(--muted); max-width: 720px; margin: 18px auto 0; }
.hero-note { margin-top: 14px !important; font-size: 13px !important; }
.solution-flow { padding: 32px; border-radius: 18px; background: #f7f9ff; border: 1px solid #dce5fb; }
.flow-line { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 12px; }
.flow-line > div { display: flex; flex-direction: column; justify-content: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.flow-line > b { display: grid; place-items: center; color: var(--brand); font-size: 20px; }
.flow-line strong { font-size: 16px; }
.flow-line span { color: var(--muted); font-size: 13px; margin-top: 3px; }
.flow-line .flow-result { color: #fff; background: var(--brand); border-color: var(--brand); }
.flow-line .flow-result span { color: rgba(255,255,255,.82); }
.flow-four { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr); }
.feature-grid { gap: 0 40px; }
.feature { padding: 20px 0; border-top: 1px solid var(--line); }
.feature h3 { font-size: 17px; }
.feature p, .solution-detail p { color: var(--muted); }
.solution-detail { align-items: center; }
.solution-detail h2 { font-size: 28px; margin-top: 6px; }
.resource-feature { display: grid; grid-template-columns: 1.35fr .65fr; gap: 32px; align-items: center; padding: 32px; border-color: #cddcff; background: linear-gradient(135deg, #fff, #f2f6ff); }
.resource-feature h2 { margin: 6px 0 8px; font-size: 28px; }
.resource-feature p { color: var(--muted); max-width: 650px; }
.resource-sheet { display: grid; gap: 7px; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.resource-sheet span, .resource-sheet strong { padding: 8px 10px; border-radius: 6px; background: #f5f7fa; font-size: 13px; }
.resource-sheet strong { color: var(--ok); background: var(--ok-soft); }
.resource-card { min-height: 210px; display: flex; flex-direction: column; align-items: flex-start; }
.resource-card h3 { margin-top: 8px; font-size: 19px; }
.resource-card p { flex: 1; color: var(--muted); }
.resource-type { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.resource-wide { max-width: 760px; min-height: 0; }
.security-summary { margin: 10px 0 56px; }
.security-item { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.security-item > span { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 10px; color: var(--brand); background: var(--brand-soft); font-size: 18px; }
.security-item strong { font-size: 16px; }
.security-item p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.data-journey { padding: 30px; border-radius: 18px; color: #fff; background: #10254e; }
.data-journey .eyebrow { color: #9fbbff; }
.data-journey .section-heading { margin-bottom: 18px; }
.data-journey ol { list-style: none; padding: 0; margin: 0; }
.data-journey li { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 10px; background: rgba(255,255,255,.08); }
.data-journey li span { color: rgba(255,255,255,.75); font-size: 13px; }
.contact-card { min-height: 230px; }
.contact-card h2 { margin: 14px 0 8px; font-size: 19px; color: var(--ink); }
.contact-card p { color: var(--muted); }
.contact-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: var(--brand); background: var(--brand-soft); font-size: 18px; font-weight: 800; }
.company-contact { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 18px; }
.company-links { grid-column: 1 / -1; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-link { color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.card-link h3 { color: var(--brand); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 6px 0 6px 28px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 8px; }
.faq summary { font-size: 15px; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, #1f5eff, #3b7bff); color: #fff; border-radius: 16px; padding: 32px; margin: 56px 0 8px; }
.cta-band h2 { margin: 0 0 6px; font-size: 24px; }
.cta-band p { margin: 0; opacity: .9; }
.btn.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.cta-band .btn:not(.btn-ghost) { background: #fff; color: var(--brand); border-color: #fff; }
.page-hero { text-align: center; max-width: 780px; margin: 10px auto 32px; }
.page-hero h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; margin: 12px 0; }
.page-hero p { font-size: 18px; color: var(--muted); }
.page-hero .row { margin-top: 20px; }
.prose { max-width: 760px; margin-left: auto; margin-right: auto; font-size: 16px; line-height: 1.7; }
.prose h2 { font-size: 22px; margin: 34px 0 10px; }
.prose h3 { font-size: 17px; margin: 22px 0 8px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose pre { background: #0f1b3d; color: #e6edff; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.6; }
.prose pre code { font-size: 13px; }
.prose :not(pre) > code { background: #eef1f6; padding: 1px 5px; border-radius: 4px; }
.lead { font-size: 18px; color: #3a4558; }
.guide-hero h1 { font-size: 34px; }
.sticky-card { position: sticky; top: 80px; }
table.mini td, table.mini th { padding: 6px 8px; font-size: 13px; }
.tool-card { display: flex; flex-direction: column; gap: 14px; }
.tool-card .dropzone { margin: 0; }
.tool-card .dropzone .dz-icon { font-weight: 800; }
.tool-options { align-items: flex-end; }
.tool-options .field { margin: 0; min-width: 160px; flex: 1; }
.cta-inline { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--brand-soft); border-color: #cddcff; }
.pricing-grid .plan-card { position: relative; }
.pricing-grid .plan-card .btn { justify-content: center; }
.plan-featured { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.plan-flag { position: absolute; top: -10px; right: 14px; }
.site-footer { border-top: 1px solid var(--line); background: var(--panel); margin-top: 48px; padding: 36px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.footer-grid h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 4px 0 10px; }
.footer-grid a:not(.brand) { display: block; color: var(--ink); font-size: 14px; padding: 3px 0; }
.footer-bottom { margin-top: 24px; }
@media (max-width: 860px) {
  .hero-split { grid-template-columns: 1fr; gap: 24px; }
  .hero-split h1, .page-hero h1 { font-size: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .topbar .site-nav { display: none; }
  body.nav-open .topbar .site-nav { display: flex; flex-direction: column; width: 100%; }
  .sticky-card { position: static; }
  .flow-line, .flow-four { grid-template-columns: 1fr; }
  .flow-line > b { min-height: 20px; transform: rotate(90deg); }
  .resource-feature { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .main { padding-top: 18px; }
  .hero-split { padding-top: 28px; }
  .hero-split h1 { font-size: 34px; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-reassurance { display: grid; gap: 6px; }
  .hero-visual { padding: 16px; border-radius: 14px; }
  .result-counts { grid-template-columns: 1fr 1fr; }
  .section { margin: 42px 0; }
  .section-heading .section-title { font-size: 26px; }
  .grid-4, .checklist { grid-template-columns: 1fr; }
  .trust-panel { padding: 22px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .cta-band { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .solution-flow, .data-journey { padding: 22px; }
  .resource-feature { padding: 22px; }
  .security-summary { margin-bottom: 42px; }
  .company-contact { grid-template-columns: 1fr; }
  .company-links { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.nav a { white-space: nowrap; } .site-nav { gap: 2px; }
.error-page { text-align: center; max-width: 560px; margin: 60px auto; }
.error-code { font-size: 64px; font-weight: 800; color: var(--brand-soft); -webkit-text-stroke: 2px var(--brand); line-height: 1; margin-bottom: 12px; }
.legal h2 { font-size: 19px; }
.contact-email { font-size: 20px; font-weight: 650; }
.consent { font-size: 12px; color: var(--muted); margin-top: 12px; }
.download-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: 760px; margin: 0 auto 28px; border-color: #cddcff; background: linear-gradient(180deg, #fff, #f7f9ff); }
.callout-inline { background: var(--brand-soft); border-radius: 8px; padding: 10px 14px; font-size: 15px; }
