:root {
  --bg: #F3F3EF; --card: #FFFFFF; --ink: #141414; --ink-2: #3A3936; --muted: #52514e; --line: #E1E0D9; --line-2: #E6E5DF; --field: #BDBCB4;
  --nav: #16191D; --nav-ink: #C9CDD2; --nav-active: #2B323B;
  --blue: #1c5cab; --blue-ink: #FFFFFF; --blue-soft: #EEF3FA; --blue-soft-ink: #1B3F6E;
  --good: #0ca30c; --good-soft: #E6F4E6; --good-ink: #1C541C;
  --warn: #fab219; --warn-soft: #FDF1D6; --warn-ink: #6B4500;
  --serious: #ec835a; --serious-soft: #FCEDE5; --serious-ink: #7A3510;
  --critical: #d03b3b; --critical-soft: #FBEAEA; --critical-ink: #7A1F1F;
  --review: #6250d6; --review-soft: #EEEBFB; --review-ink: #3D2E99;
  --neutral-soft: #EFEEE9;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 0.93em; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* layout */
#app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid #DEDDD6; position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 17px; text-decoration: none; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 13px; }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.shell { flex: 1 1 auto; display: flex; flex-wrap: wrap; }
.sidenav { flex: 1 1 220px; max-width: 240px; display: flex; flex-direction: column; gap: 4px; padding: 20px 12px 24px; background: var(--nav); color: var(--nav-ink); }
.sidenav a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--nav-ink); font-weight: 500; text-decoration: none; }
.sidenav a:hover { background: #22282f; }
.sidenav a.active { background: var(--nav-active); color: #fff; font-weight: 600; }
.sidenav .group { padding: 18px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #8E949B; }
.sidenav .foot { margin-top: auto; padding: 24px 12px 0; font-size: 12px; color: #8E949B; word-break: break-all; }
.badge { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--warn); color: var(--ink); font-size: 12px; font-weight: 700; text-align: center; }
.main { flex: 999 1 560px; min-width: 0; padding: 28px 32px 56px; }
.page { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head .sub { margin-top: 6px; color: var(--muted); }
@media (max-width: 760px) { .sidenav { max-width: none; flex-direction: row; flex-wrap: wrap; } .sidenav .foot { display: none; } .main { padding: 20px 16px 48px; } }

/* cards, tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.card.tight { padding: 16px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; }
th { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 14px; border-bottom: 1px solid #D6D5CE; white-space: nowrap; background: #FAFAF8; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #F8F8F5; }
td.sec { background: #F6F6F3; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); padding: 8px 14px; }
/* the twenty-step search sequence: compact rows, the running step highlighted */
table.wf th, table.wf td { padding: 7px 10px; font-size: 13px; }
table.wf td:first-child { width: 28px; text-align: right; }
table.wf td:nth-child(2) { min-width: 180px; }
table.wf td:nth-child(3) { min-width: 130px; }
table.wf td:nth-child(4) { min-width: 220px; overflow-wrap: anywhere; }
table.wf tr.wf-run td { background: #EEF4FC; }
table.wf tr.wf-na td { opacity: .6; }
dl.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 24px; }
dl.facts > div { flex: 1 1 200px; min-width: 0; }
dl.facts dt { font-size: 13px; color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* pills and tags */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--neutral-soft); color: var(--ink-2); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.good { background: var(--good-soft); color: var(--good-ink); } .pill.good .dot { background: var(--good); }
.pill.warning { background: var(--warn-soft); color: var(--warn-ink); } .pill.warning .dot { background: var(--warn); }
.pill.serious { background: var(--serious-soft); color: var(--serious-ink); } .pill.serious .dot { background: var(--serious); }
.pill.critical { background: var(--critical-soft); color: var(--critical-ink); } .pill.critical .dot { background: var(--critical); }
.pill.review { background: var(--review-soft); color: var(--review-ink); } .pill.review .dot { background: var(--review); }
.pill.blue { background: #E8EEF7; color: var(--blue-soft-ink); }
.pill.muted { background: var(--neutral-soft); color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid #C9C8C0; border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #F6F6F3; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #184f95; }
.btn.danger { color: var(--critical-ink); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); font-weight: 500; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.btn-link { display: inline; padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn-link.small { font-size: 12px; font-weight: 500; }
.btn-link:hover { color: #184f95; }
/* masked like a password, but a plain text field so the browser never offers to save it in its own password manager */
.inp.secret { -webkit-text-security: disc; }
.inp.secret.shown { -webkit-text-security: none; }

/* connect-a-provider wizard */
.wiz-steps { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.wiz-steps li { display: flex; align-items: center; gap: 7px; }
.wiz-steps .n { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #C9C8C0; font-size: 12px; font-weight: 700; }
.wiz-steps li.now { color: var(--ink); font-weight: 600; }
.wiz-steps li.now .n { background: var(--blue); border-color: var(--blue); color: #fff; }
.wiz-steps li.done { color: var(--good-ink); }
.wiz-steps li.done .n { background: var(--good-soft); border-color: transparent; color: var(--good-ink); }
.wiz-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.wiz-checks li { display: flex; gap: 12px; align-items: flex-start; }
.wiz-checks li.todo { opacity: .55; }
.wiz-check { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; background: var(--neutral-soft); color: var(--ink-2); }
.wiz-check.ok { background: var(--good-soft); color: var(--good-ink); }
.wiz-check.fail { background: var(--critical-soft); color: var(--critical-ink); }
.wiz-check.run { background: #E8EEF7; color: var(--blue); animation: wiz-pulse 1s ease-in-out infinite; }
@keyframes wiz-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field input[type=text], .field input[type=search], .field input[type=password], .field input[type=number], .field input[type=url], .field select, .field textarea, input.inp, select.inp { height: 46px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--card); font-size: 16px; width: 100%; }
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 90px; }
.field.sm input, .field.sm select { height: 40px; font-size: 15px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > * { flex: 1 1 200px; }
.row > .w2 { flex: 2 1 300px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--neutral-soft); }
.seg button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 36px; padding: 0 14px; border: 1px solid #C9C8C0; border-radius: 999px; background: var(--card); font-size: 14px; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.radio-card { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid #C9C8C0; border-radius: 10px; cursor: pointer; flex: 1 1 280px; }
.radio-card.on { border: 2px solid var(--blue); background: #F2F6FC; }
.radio-card input { margin-top: 4px; accent-color: var(--blue); }
.radio-card b { display: block; }
.note { padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.note.info { background: var(--blue-soft); color: #1B2A3D; }
.note.warn { background: var(--warn-soft); color: #4D3300; }
.note.good { background: var(--good-soft); color: var(--good-ink); }
.note.bad { background: var(--critical-soft); color: var(--critical-ink); }
.switch { width: 52px; height: 30px; padding: 3px; border: 0; border-radius: 999px; background: #8E8D86; display: inline-flex; align-items: center; cursor: pointer; }
.switch[aria-checked=true] { background: var(--blue); justify-content: flex-end; }
.switch span { width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.stepper { display: inline-flex; align-items: center; border: 1px solid #C9C8C0; border-radius: 8px; overflow: hidden; }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--card); font-size: 20px; cursor: pointer; }
.stepper span { min-width: 44px; text-align: center; font-weight: 700; }

/* stats */
.glance { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 150px; display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; color: inherit; text-decoration: none; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stat .d { font-size: 13px; color: var(--ink-2); }
.progress { height: 10px; border-radius: 999px; background: #cde2fb; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; background: var(--blue); }
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; }
.bar-row .lbl { width: 160px; flex: 0 0 auto; font-size: 14px; color: var(--ink-2); }
.bar-row .track { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; border-left: 1px solid #c3c2b7; }
.bar-row .fill { height: 20px; background: #2a78d6; border-radius: 0 4px 4px 0; }
.stages { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.stages li { flex: 1 1 160px; display: flex; gap: 10px; align-items: flex-start; }
.stages .ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #B8B7AF; flex: 0 0 auto; }
.stages .ring.done { background: var(--blue); border-color: var(--blue); }
.stages .ring.cur { border-color: var(--serious); background: var(--serious-soft); box-shadow: inset 0 0 0 5px var(--serious-soft), inset 0 0 0 12px var(--serious); }

/* lists */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 12px 4px; border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1 1 260px; min-width: 0; }
.list-row.link:hover { background: #F8F8F5; }
.section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.section > .sec-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 24px 12px; }
.section > .sec-head .grow { flex: 1 1 400px; min-width: 0; }
.section > .sec-body { padding: 0 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.section > .sec-more { padding: 0 24px 20px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line-2); padding-top: 16px; }
.breadcrumb { font-size: 14px; }
.breadcrumb a { font-weight: 600; text-decoration: none; }

/* needs-you popups */
.popup { background: var(--card); border: 1px solid #C9C8C0; border-radius: 12px; box-shadow: 0 10px 28px rgba(20,20,20,.16); overflow: hidden; }
.popup-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; background: var(--nav); color: #fff; font-size: 14px; font-weight: 600; }
.popup-body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.popup ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

/* toasts, modal */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; max-width: 380px; }
.toast { background: var(--nav); color: #fff; padding: 12px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; }
.toast.bad { background: #7A1F1F; }
.modal-back { position: fixed; inset: 0; background: rgba(20,20,20,.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal { background: var(--card); border-radius: 14px; padding: 24px; width: min(560px, 100%); max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.unlock-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 10px; background: var(--warn-soft); color: #4D3300; }
.unlock-bar input { height: 40px; }
.capture-thumb { display: block; max-width: 100%; border: 1px solid #D6D5CE; border-radius: 6px; max-height: 420px; object-fit: cover; object-position: top; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.log li { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.log .t { width: 92px; color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.log .a { width: 96px; font-weight: 600; flex: 0 0 auto; }
.log .m { flex: 1 1 300px; min-width: 0; overflow-wrap: anywhere; }
.log .warn { color: var(--warn-ink); } .log .error { color: var(--critical-ink); }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 8px; background: #FAFAF8; border: 1px solid var(--line-2); }

/* a row handed over from Live research */
@keyframes row-flash { 0% { background: #FFF3C4; } 100% { background: transparent; } }
tr.flash > td { animation: row-flash 4s ease-out; }
tr.active > td { background: #F2F6FC; }
