:root {
  /* Kay Mortgage Group brand: navy #232A62 + orange #E68A1E (sampled from the logo) */
  --navy: #232a62;
  --navy-2: #39429a;
  --navy-soft: #eceef8;
  --accent: #e68a1e;
  --accent-ink: #a65d05;     /* orange dark enough for text on white (4.6:1) */
  --accent-soft: #fdf2e4;
  --bg: #f5f6fa;
  --surface: #ffffff;
  --text: #1c2433;
  --muted: #5d6677;
  --border: #dde2ea;
  --border-strong: #c6cdd8;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #a35400;
  --warn-soft: #fff4e0;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info-soft: #eaf1fb;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- top bar & layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: 59px; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: #fff; color: var(--navy); border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; font-size: 15px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 38px; width: auto; display: block; }
.brand-text { padding-left: 10px; border-left: 2px solid var(--border); letter-spacing: .01em; }
.global-search { position: relative; flex: 1; max-width: 520px; }
.global-search input { width: 100%; height: 36px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--bg); padding: 0 16px; font-size: 14px; margin: 0; }
.user-menu { position: relative; margin-left: auto; }
.user-btn { background: transparent; color: var(--navy); border: 1px solid var(--border-strong); border-radius: 18px; padding: 6px 12px; cursor: pointer; font: inherit; white-space: nowrap; }
.role-tag { font-size: 11px; opacity: .8; }
.icon-btn { background: none; border: 0; color: inherit; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.menu-btn { display: none; }
.topbar { height: 59px; }
.layout { display: flex; min-height: calc(100vh - 59px); }
.sidenav { width: 232px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; position: sticky; top: 59px; height: calc(100vh - 59px); overflow-y: auto; }
.sidenav a { display: block; padding: 8px 12px; border-radius: 6px; color: var(--text); font-weight: 500; }
.sidenav a:hover { background: var(--bg); text-decoration: none; }
.sidenav a.active { background: var(--navy-soft); color: var(--navy); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.sidenav a.nav-primary { color: var(--navy); font-weight: 700; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 4px; }
main { flex: 1; min-width: 0; padding: 24px; outline: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- dropdowns ---------- */
.dropdown { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 70vh; overflow-y: auto; z-index: 40; }
.dropdown-right { left: auto; right: 0; min-width: 200px; }
.dropdown a { display: block; padding: 8px 14px; color: var(--text); }
.dropdown a:hover, .dropdown a.focused { background: var(--bg); text-decoration: none; }
.dd-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 14px 2px; }
.dd-sub { font-size: 12px; color: var(--muted); }
.dd-empty { padding: 12px 14px; color: var(--muted); }

/* ---------- cards / grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.stats { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.warn .num { color: var(--warn); }
a.stat:hover { text-decoration: none; border-color: var(--navy-2); }
.tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); color: var(--text); }
.tile:hover { border-color: var(--navy-2); text-decoration: none; }
.tile b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--navy); }
.two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kv { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: #cf7810; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--navy-2); cursor: pointer; font: inherit; padding: 0; }
.link-btn:hover { text-decoration: underline; }
label { display: block; font-weight: 550; margin-bottom: 12px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 6px; padding: 7px 10px; width: 100%; margin-top: 4px; }
textarea { min-height: 74px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(43,76,120,.35); border-color: var(--navy-2); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; }
.check { display: flex; align-items: center; font-weight: 450; margin-bottom: 6px; cursor: pointer; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }
.form-error { color: var(--danger); min-height: 18px; margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 6px 12px; font: inherit; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.seg button + button { border-left: 1px solid var(--border-strong); }

/* ---------- badges & chips ---------- */
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe5cb; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: #f5d9a8; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: #f4c7c2; }
.badge.info { background: var(--info-soft); color: var(--navy); border-color: #c9d8ef; }
.missing { color: var(--warn); font-style: italic; }
.chip { display: inline-flex; align-items: center; gap: 4px; margin: 2px 4px 2px 0; padding: 3px 10px; border-radius: 14px; font-size: 13px; border: 1px solid var(--border); background: #fff; }
.chip.available { background: var(--ok-soft); border-color: #bfe5cb; color: #14532d; }
.chip.not_offered { background: var(--danger-soft); border-color: #f4c7c2; color: var(--danger); text-decoration: line-through; }
.chip.unverified { background: var(--warn-soft); border-color: #f5d9a8; color: var(--warn); }
.chip.unconfirmed { background: #fff; border-style: dashed; color: var(--muted); }
.cat-chip { cursor: pointer; user-select: none; }
.cat-chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--navy); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfd; }
td.lender-cell { min-width: 180px; font-weight: 600; }
.why { font-size: 12px; color: var(--accent-ink); margin-top: 3px; font-weight: 500; }
.ae-line { white-space: nowrap; }
.ae-line + .ae-line { margin-top: 4px; }
.hit { background: #fff3bf; border-radius: 3px; padding: 0 2px; }
.url-cell { max-width: 220px; word-break: break-all; }
.prog-list { font-size: 13px; }

/* ---------- search ---------- */
.search-layout > * { min-width: 0; }
.search-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.filters { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.filters h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 14px 0 6px; }
.filters h3:first-child { margin-top: 0; }
.prog-group { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.prog-group b { display: block; margin-bottom: 6px; color: var(--navy); }
.count { color: var(--muted); font-size: 12px; margin-left: 4px; }
.results-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.results-bar .left, .results-bar .right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.criteria { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.result-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.result-card h3 { display: flex; justify-content: space-between; gap: 8px; }
.result-card .kv { grid-template-columns: 110px minmax(0,1fr); font-size: 13px; gap: 4px 10px; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.filters-toggle { display: none; }
.star { cursor: pointer; color: #c3c9d4; font-size: 18px; background: none; border: 0; padding: 0 2px; line-height: 1; }
.star.on { color: #e3a008; }

/* ---------- profile ---------- */
.profile-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.profile-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; background: #fff; }
.cat-card.off { opacity: .7; }
.cat-card .card-head { margin-bottom: 8px; }
.detail-list { margin-top: 10px; font-size: 13px; }
.detail-list div { margin-bottom: 3px; }
.notes { white-space: pre-wrap; font-size: 13px; color: var(--muted); margin-top: 8px; }
.history td { font-size: 13px; }
.hist-old { color: var(--danger); text-decoration: line-through; word-break: break-word; }
.hist-new { color: var(--ok); word-break: break-word; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.alert.warn { background: var(--warn-soft); border-color: #f5d9a8; color: #7a3f00; }
.alert.info { background: var(--info-soft); border-color: #c9d8ef; color: var(--navy); }
.alert.danger { background: var(--danger-soft); border-color: #f4c7c2; color: var(--danger); }

/* ---------- compare ---------- */
.compare th:first-child, .compare td:first-child { position: sticky; left: 0; background: #f8fafc; font-weight: 600; min-width: 170px; z-index: 2; }
.compare td { min-width: 200px; }
.yes { color: var(--ok); font-weight: 700; }
.no { color: var(--danger); }
.unk { color: var(--muted); }

/* ---------- modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; z-index: 100; padding: 6vh 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; }
.modal.wide { max-width: 820px; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; max-height: 68vh; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: var(--shadow-lg); max-width: 380px; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }

/* ---------- login ---------- */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--navy), #141a45); }
.login-card { border-top: 4px solid var(--accent); }
.login-logo { width: 220px; max-width: 100%; display: block; margin: 0 auto 14px; }
.login-title { text-align: center; font-size: 18px; color: var(--navy); }
.login-card > p.muted { text-align: center; }
.login-card { background: #fff; padding: 28px; border-radius: 12px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-brand { font-size: 20px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand .brand-mark { background: var(--navy); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 8px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 550; white-space: nowrap; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--navy); }
.tabs a:hover { text-decoration: none; color: var(--navy); }
.letters { display: flex; flex-wrap: wrap; gap: 2px; margin-bottom: 12px; }
.letters button { border: 1px solid var(--border); background: #fff; border-radius: 4px; min-width: 28px; height: 28px; cursor: pointer; font: inherit; font-size: 12px; }
.letters button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.help h2 { margin-top: 18px; }
.help li { margin-bottom: 6px; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .search-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; }
  .filters-toggle { display: inline-flex; }
  .filters.collapsed { display: none; }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .sidenav { position: fixed; left: 0; top: 59px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .sidenav.open { transform: none; }
  main { padding: 16px; }
  .brand-text { display: none; }
  .brand-logo { height: 30px; }
  .global-search { min-width: 0; }
  .user-btn .role-tag { display: none; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 8px; }
  .row { flex-direction: column; gap: 0; }
  /* tables become stacked cards */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--border); padding: 10px 4px; }
  table.stack td { border: 0; padding: 3px 10px; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
  table.stack td:empty { display: none; }
  .url-cell { max-width: none; }
}
@media print {
  .topbar, .sidenav, .actions, .btn { display: none !important; }
  main { padding: 0; }
}
.results-bar select { width: auto; margin-top: 0; height: 30px; padding: 3px 8px; }
td .btn.sm { margin: 2px 0; }

/* =====================================================================
   Kay Mortgage Group – Find Lenders (scenario matching) & lender profile
   ===================================================================== */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px 6px; margin: 0 0 12px; min-width: 0; }
legend { font-weight: 650; padding: 0 4px; }
.btn.lg { height: 44px; font-size: 15px; }
.row.tight { gap: 10px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; white-space: nowrap; }
label.inline select { width: auto; margin: 0; height: 30px; padding: 3px 8px; }

.find-head { margin-bottom: 14px; }
.match-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 20px; align-items: start; }
.match-layout > * { min-width: 0; }
.scenario-form { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; border-top: 4px solid var(--accent); padding: 16px; }
.scenario-form label { margin-bottom: 10px; font-size: 13px; }
.form-title { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.form-title h2 { margin: 0; color: var(--navy); }
.type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 3px; margin-bottom: 12px; }
.type-tabs button { border: 0; background: transparent; padding: 7px 4px; border-radius: 6px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.type-tabs button.on { background: var(--navy); color: #fff; box-shadow: var(--shadow); }
.calc { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--navy-soft); border-radius: 8px; padding: 8px 12px; margin: -2px 0 12px; }
.calc div { display: flex; flex-direction: column; }
.calc span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.calc b { font-size: 18px; color: var(--navy); }
.calc-bad { grid-column: 1 / -1; color: var(--danger); font-weight: 600; }
.products-field legend { font-size: 13px; }
.small-seg { margin-bottom: 8px; }
.small-seg button { padding: 4px 10px; font-size: 12px; }
.product-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.product-checks .check { font-size: 13px; margin-bottom: 4px; }

.intro-card h2 { color: var(--navy); }
.steps { padding-left: 20px; margin: 0 0 10px; }
.steps li { margin-bottom: 8px; }
.saved-list { list-style: none; padding: 0; margin: 0; }
.saved-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); }
.saved-list li:last-child { border-bottom: 0; }

.results-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-ink); font-weight: 700; }
.match-count { font-size: 26px; margin: 2px 0 6px; color: var(--navy); }
.scen-chips .chip, .scen-banner .chip, .scen-attach .chip { background: var(--navy-soft); border-color: transparent; color: var(--navy); font-size: 12px; }
.results-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lender-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.lender-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; border-top: 3px solid var(--navy); }
.lender-card.possible { border-top-color: var(--accent); }
.lender-card:hover { border-color: var(--navy-2); }
.lc-head { display: flex; gap: 12px; align-items: center; }
.lc-title { min-width: 0; }
.lc-title h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.lc-title h3 a { color: var(--navy); }
.lender-logo { width: 48px; height: 48px; border-radius: 10px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex-shrink: 0; }
.lender-logo.mono { display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: 17px; border: 0; letter-spacing: .02em; }
.lender-logo.lg { width: 84px; height: 84px; font-size: 28px; border-radius: 14px; }
.tagline { margin: 0; color: var(--muted); font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 12px; background: var(--bg); border: 1px solid var(--border); color: var(--text); }
.tag.on { background: var(--accent-soft); border-color: #f3c58c; color: var(--accent-ink); font-weight: 650; }
.tag.more { color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; color: var(--navy); }
.confirm-line { font-size: 12px; background: var(--accent-soft); color: var(--accent-ink); padding: 6px 10px; border-radius: 6px; }
.lc-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.no-match h3 { color: var(--navy); font-size: 18px; }
.suggest { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.elim h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.elim-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 40px; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.elim-row .bar { background: var(--bg); border-radius: 4px; height: 12px; overflow: hidden; }
.elim-row .bar i { display: block; height: 100%; background: var(--navy); border-radius: 4px; }
.elim-row b { text-align: right; }
.possible-head { margin: 24px 0 12px; }
.possible-head h2 { color: var(--navy); margin-bottom: 4px; }
.show-more { text-align: center; margin-top: 14px; }

.scen-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; }
.scen-banner .back { font-weight: 650; margin-right: 8px; }
.profile-hero { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 4px solid var(--navy); }
.hero-main { display: flex; gap: 16px; align-items: flex-start; min-width: 0; flex: 1; }
.hero-main h1 { color: var(--navy); }
.hero-tagline { font-size: 15px; color: var(--text); margin: 4px 0 6px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; margin-bottom: 4px; }
.profile-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.profile-grid > * { min-width: 0; }
.prose { white-space: pre-wrap; line-height: 1.55; }
.empty-inline { background: var(--bg); border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px 14px; }
.criteria-set { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.criteria-set.inactive { opacity: .65; }
.criteria-set .card-head { margin-bottom: 6px; }
.criteria-table th { position: static; width: 170px; background: transparent; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--muted); white-space: normal; }
.criteria-table td, .criteria-table th { padding: 6px 8px; }
.cat-details summary, details summary { cursor: pointer; color: var(--navy-2); font-weight: 600; margin-bottom: 8px; }
.ae-card { border-bottom: 1px solid var(--border); padding: 10px 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; word-break: break-word; }
.ae-card:first-of-type { padding-top: 0; }
.ae-card:last-child { border-bottom: 0; }
.ae-name { font-size: 14px; color: var(--navy); }
.ae-actions { margin-top: 4px; }
.contact-card { border-top: 4px solid var(--accent); }
.contact-card label { font-size: 13px; margin-bottom: 10px; }
.scen-attach { background: var(--navy-soft); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; font-size: 13px; }
.scen-attach .chip { background: #fff; }
.check.terms { align-items: flex-start; font-size: 12px; line-height: 1.4; }
.check.terms input { margin-top: 2px; }
.sent { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.sent b { color: var(--ok); font-size: 16px; }
.logo-edit { display: flex; gap: 16px; align-items: center; }
.check-grid { display: grid; gap: 0 12px; }
.check-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.check-grid.cols-8 { grid-template-columns: repeat(8, minmax(0, 1fr)); }
.check-grid .check { font-size: 13px; margin-bottom: 5px; }
.check-grid.compact .check { margin-bottom: 2px; }
.cg-tools { margin-bottom: 6px; }
.ov-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.ov-row select { flex: 2; margin: 0; }
.ov-row input { flex: 1; margin: 0; }
.kv.mini { grid-template-columns: 120px minmax(0, 1fr); font-size: 12px; gap: 2px 10px; margin: 6px 0; }
tr.row-error td { background: var(--danger-soft); }
[data-crnote] { margin-top: 6px; font-size: 12px; padding: 4px 8px; }

@media (max-width: 1100px) {
  .match-layout { grid-template-columns: minmax(0, 1fr); }
  .scenario-form { position: static; max-height: none; }
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .check-grid.cols-8 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .check-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-main { flex-direction: column; }
  .lender-cards { grid-template-columns: minmax(0, 1fr); }
  .row.tight { flex-direction: row; }
  .row.tight > label { min-width: 0; }
  .criteria-table th { width: 120px; }
  .elim-row { grid-template-columns: 100px minmax(0, 1fr) 32px; }
}
@media (max-width: 420px) {
  .row.tight { flex-direction: column; gap: 0; }
  .product-checks { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .global-search { display: none; }
  .user-btn { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
}
.edit-toggle { display: none; }
@media (max-width: 1100px) {
  .edit-toggle { display: flex; }
  .scenario-form.collapsed form { display: none; }
  .scenario-form:not(.collapsed) .edit-toggle { margin-bottom: 12px; }
  .scenario-form.collapsed { padding: 10px; }
}
