@font-face { font-family: "Hanken Grotesk"; src: url(/static/fonts/hanken-grotesk-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/static/fonts/newsreader-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  /* Justified's LeadHouse: Justified CRM palette (justifiedcrm.com) */
  --paper: #f5f8fc;
  --surface: #ffffff;
  --sunk: #eaf0f8;
  --ink: #0f1b2d;
  --ink-2: #4a5a73;
  --muted: #6b7a92;
  --rule: #d8e1ee;
  --rule-2: #b8c6da;
  --navy: #0b2545;
  --navy-2: #13315c;
  --accent: #e2532f;
  --accent-ink: #b8401f;
  --accent-tint: #fdeee9;
  --hover: #eef3f9;
  --teal: #12b5a0;
  --amber: #8a5a0c;
  --amber-tint: #fdf3e0;
  --rust: #c0392b;
  --rust-tint: #fbe9e7;
  --display: "Inter", "Hanken Grotesk", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --sans: "Inter", "Hanken Grotesk", "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 3px rgba(11, 37, 69, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 var(--sans); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; color: var(--ink); letter-spacing: -0.012em; }
h1 { font-size: 27px; line-height: 1.15; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 15.5px; line-height: 1.3; }
p { margin: 0 0 10px; max-width: 74ch; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- shell: sections across the top, pages down the left */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: stretch; gap: 8px; height: 64px; padding: 0 24px 0 20px; background: var(--navy); color: #fff; border-bottom: 1px solid #081b34; box-shadow: 0 1px 4px rgba(15, 28, 51, .25); }
.wordmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.wordmark img { width: 40px; height: 40px; }
.wordmark span { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.topbar .wordmark { color: #fff; padding-right: 28px; margin-right: 12px; border-right: 1px solid rgba(255, 255, 255, .16); }
.topbar .wordmark:hover { color: #fff; }
.mainnav { display: flex; align-items: stretch; gap: 2px; flex: 1; min-width: 0; }
.mainnav a { position: relative; display: flex; align-items: center; padding: 0 20px; color: #c3cee0; text-decoration: none; font-weight: 600; font-size: 14.5px; letter-spacing: .01em; border-bottom: 3px solid transparent; border-top: 3px solid transparent; transition: background .12s, color .12s; }
.mainnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.mainnav a.active { color: #fff; background: rgba(255, 255, 255, .1); border-bottom-color: #fff; }
.mainnav a:focus-visible, .userbtn:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.me { position: relative; display: flex; align-items: center; }
.userbtn { display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: #fff; padding: 6px 12px 6px 6px; border-radius: 22px; box-shadow: none; }
.userbtn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); color: #fff; }
.avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; color: var(--navy); font-weight: 700; font-size: 12.5px; }
.who { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.who b { font-weight: 600; font-size: 13.5px; }
.who small { font-size: 11.5px; color: #b9c5d9; font-weight: 500; }
.caret { width: 0; height: 0; border-left: 4.5px solid transparent; border-right: 4.5px solid transparent; border-top: 5px solid #c3cee0; margin-left: 2px; }
.menu { position: absolute; right: 0; top: calc(100% - 6px); min-width: 190px; background: var(--surface); border: 1px solid var(--rule-2); border-radius: var(--r); box-shadow: 0 12px 32px rgba(15, 28, 51, .2); padding: 6px; z-index: 40; }
.menu a, .menu button { display: block; width: 100%; text-align: left; background: transparent; border: 0; box-shadow: none; color: var(--ink); font: inherit; font-weight: 500; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--hover); color: var(--accent-ink); }
.menu button { border-top: 1px solid var(--rule); border-radius: 0 0 var(--r-sm) var(--r-sm); margin-top: 4px; padding-top: 11px; }
.body { display: grid; grid-template-columns: 236px minmax(0, 1fr); flex: 1; min-height: 0; }
.side { background: var(--surface); border-right: 1px solid var(--rule); padding: 22px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; }
.side-title { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; margin-bottom: 8px; border-bottom: 1px solid var(--rule); }
.side nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; margin: 2px 0; color: var(--ink-2); text-decoration: none; font-weight: 500; border-radius: var(--r-sm); border-left: 3px solid transparent; transition: background .12s, color .12s; }
.side nav a:hover { background: var(--hover); color: var(--accent-ink); }
.side nav a.active { background: var(--accent-tint); color: var(--accent-ink); font-weight: 700; border-left-color: var(--accent); }
.badge { background: var(--amber); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11.5px; font-weight: 700; line-height: 18px; }
main { padding: 30px 40px 72px; outline: none; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.crumb { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 6px; color: var(--muted); }
.crumb a { text-decoration: none; }

/* ---------- sections */
.band { margin-bottom: 36px; }
.band > h2 { margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--accent); }
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.panel > h3 { margin: -20px -22px 16px; padding: 13px 22px; border-bottom: 1px solid var(--rule); background: var(--sunk); border-radius: var(--r) var(--r) 0 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -20px -22px 16px; padding: 11px 22px; border-bottom: 1px solid var(--rule); background: var(--sunk); border-radius: var(--r) var(--r) 0 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule-2); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a, .tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--ink-2); padding: 9px 16px; margin-bottom: -1px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; border-radius: var(--r-sm) var(--r-sm) 0 0; box-shadow: none; transition: background .12s, color .12s; }
.tabs a:hover, .tabs button:hover { color: var(--accent-ink); background: var(--hover); }
.tabs .on { color: var(--accent-ink); border-bottom-color: var(--accent); font-weight: 700; }

/* ---------- figures: one ledger row */
.figures { display: flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--r); margin-bottom: 18px; box-shadow: var(--shadow); }
.fig { flex: 1 1 150px; padding: 16px 20px; border-right: 1px solid var(--rule); min-width: 0; }
.fig:last-child { border-right: 0; }
.fig .v { font-family: var(--display); font-size: 28px; line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.fig .l { color: var(--ink-2); font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-top: 6px; }
.fig .s { color: var(--muted); font-size: 12px; }
.fig.attn .v { color: var(--amber); }

/* ---------- tables */
.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 700; color: var(--ink-2); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; background: var(--accent-tint); border-bottom: 1px solid var(--rule-2); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover td { background: var(--hover); }
td.num, th.num { text-align: right; }
.panel table th { background: transparent; border-bottom: 2px solid var(--rule-2); }
.bar { display: flex; align-items: center; gap: 8px; min-width: 150px; }
.bar i { display: block; height: 10px; background: var(--accent); border-radius: 2px; min-width: 2px; }
.bar span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }

/* ---------- list code tag */
.code { display: inline-block; font-weight: 600; font-size: 12.5px; letter-spacing: .04em; color: var(--accent-ink); background: var(--accent-tint);
  border: 1px solid #c3cfe3; border-radius: 4px; padding: 0 6px; line-height: 20px; text-decoration: none; white-space: nowrap; }
a.code:hover { background: #d3dcec; }
.code.big { font-size: 15px; padding: 2px 9px; line-height: 24px; }

/* ---------- forms */
label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 4px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--rule-2); border-radius: var(--r-sm); padding: 8px 11px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-2); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%230b2545' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; }
select[multiple] { background-image: none; padding-right: 4px; }
textarea { min-height: 90px; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 0; box-shadow: 0 0 0 3px rgba(27, 58, 107, .18); }
select[multiple] { min-height: 96px; padding: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--ink); margin: 5px 0; }
.check input { margin: 0; accent-color: var(--accent); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.row > .field { flex: 1 1 170px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.grid2 input, .filters input, .filters select { min-width: 0; }
button, .btn { font: inherit; font-weight: 600; font-size: 13.5px; border-radius: var(--r-sm); padding: 8px 16px; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; text-decoration: none; display: inline-block; line-height: 1.4; white-space: nowrap; box-shadow: 0 1px 2px rgba(15, 28, 51, .16);
  transition: background .12s, border-color .12s, box-shadow .12s, color .12s, transform .05s; }
button:hover, .btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(15, 28, 51, .28); }
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border-color: var(--rule-2); }
button.secondary:hover, .btn.secondary:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-ink); }
button.quiet { background: #fff; border-color: var(--rule-2); color: var(--accent-ink); padding: 4px 10px; font-size: 12.5px; font-weight: 600; box-shadow: none; margin-right: 4px; }
button.quiet:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }
button.danger { background: #fff; color: var(--rust); border-color: #e2b9b0; }
button.danger:hover { background: var(--rust); border-color: var(--rust); color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; padding: 2px 9px; border-radius: 12px; background: #fff; color: var(--ink-2); border: 1px solid var(--rule-2); cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-tint); }
.fchips { margin-top: 0; }
.pill.dup-exact { background: #e3f4ec; color: #1d4d33; border-color: #b9d8c5; }
.fchip { letter-spacing: 0; font-weight: 500; padding: 3px 10px; }
.fchip.has, .fchip.has:hover { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.fchip.not, .fchip.not:hover { background: var(--rust-tint); border-color: var(--rust); color: var(--rust); font-weight: 600; }

/* ---------- records workspace */
.workspace { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 6px 18px 18px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.filters fieldset { min-width: 0; border: 0; border-bottom: 1px solid var(--rule); margin: 0; padding: 14px 0; }
.filters fieldset:last-of-type { border-bottom: 0; }
.filters legend { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.resultbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.count { font-family: var(--display); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--navy); }
.count small { font-family: var(--sans); font-size: 14px; color: var(--ink-2); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 12px; }

/* ---------- status pills */
.pill { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; line-height: 20px; }
.pill.resp { background: var(--accent-tint); color: var(--accent-ink); }
.pill.sold { background: var(--accent); color: #fff; }
.pill.cancel { background: var(--rust-tint); color: var(--rust); }
.pill.dnr { background: #e6e9ef; color: var(--ink-2); }
.pill.none { background: transparent; color: var(--muted); border: 1px dashed var(--rule-2); }
.pill.custom { background: var(--amber-tint); color: var(--amber); }
.pill.warn { background: var(--amber-tint); color: var(--amber); }
.pill.off { background: #e6e9ef; color: var(--muted); }

/* ---------- lead history trail */
.trail { list-style: none; margin: 0; padding: 0 0 0 4px; }
.trail > li { position: relative; padding: 0 0 24px 30px; }
.trail > li::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: -6px; width: 1px; background: var(--rule-2); }
.trail > li:last-child::before { display: none; }
.trail > li::after { content: ""; position: absolute; left: 0; top: 4px; width: 13px; height: 13px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--accent); }
.trail > li.buy::after { background: var(--accent); }
.trail .when { font-size: 12.5px; color: var(--muted); }
.trail .what { font-family: var(--display); font-size: 16px; font-weight: 700; }
.trail .events { list-style: none; margin: 10px 0 0; padding: 0; border-left: 1px solid var(--rule); }
.trail .events li { padding: 4px 0 4px 14px; font-size: 13px; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ---------- mapping & upload */
.maptable td { vertical-align: middle; }
.maptable select { max-width: 320px; }
.maptable .sample { color: var(--muted); font-size: 12.5px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone { border: 1.5px dashed var(--rule-2); border-radius: var(--r); padding: 36px; text-align: center; background: var(--surface); }
.dropzone.over { border-color: var(--accent); background: var(--accent-tint); }
.dropzone .btn { margin: 6px 0; }
.steps { display: flex; gap: 22px; margin-bottom: 20px; counter-reset: s; font-size: 13px; }
.steps span { color: var(--muted); }
.steps span::before { counter-increment: s; content: counter(s); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--rule-2); margin-right: 7px; font-size: 11.5px; }
.steps span.on { color: var(--ink); font-weight: 600; }
.steps span.on::before { background: var(--accent); border-color: var(--accent); color: #fff; }
.steps span.done::before { background: var(--accent-tint); border-color: var(--accent-tint); color: var(--accent-ink); }

/* ---------- review */
.review-item { background: var(--surface); border: 1px solid var(--rule); border-left: 3px solid var(--amber); border-radius: var(--r); padding: 16px 20px; margin-bottom: 14px; }
.review-item.unmatched { border-left-color: var(--rule-2); }
.review-item .reason { font-weight: 600; margin-bottom: 8px; }
.kv { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 13px; margin-bottom: 10px; }
.kv b { color: var(--muted); font-weight: 500; }
.cand { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 400; color: var(--ink); margin: 0 0 2px; border: 1px solid transparent; }
.cand:hover { background: var(--sunk); }
.cand.sugg { border-color: #c3cfe3; background: #f2f5fa; }

/* ---------- permissions grid */
.permgrid td:first-child { min-width: 260px; }
.permgrid .grp td { background: var(--accent-tint); font-weight: 700; font-size: 13px; color: var(--accent-ink); }
.src { font-size: 11.5px; color: var(--muted); }
.src.custom { color: var(--amber); font-weight: 600; }

/* ---------- notices */
.notice { background: var(--amber-tint); border: 1px solid #ead7b1; color: #5d3d08; padding: 11px 15px; border-radius: var(--r); margin-bottom: 16px; }
.okbox { background: var(--surface); border: 1px solid #c3cfe3; border-top: 3px solid var(--accent); padding: 18px 22px; border-radius: var(--r); margin-bottom: 16px; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 8px 10px; word-break: break-all; user-select: all; }
.empty { padding: 48px 30px; text-align: center; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--rule-2); border-radius: var(--r); }
.empty h3 { font-size: 18px; }
.empty h3 { margin-bottom: 6px; }
.empty p { margin: 0 auto 14px; }
.loading { color: var(--muted); padding: 30px 0; }

/* ---------- sign-in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: linear-gradient(180deg, var(--navy) 0, var(--navy) 42%, var(--paper) 42%); }
.auth-card { width: min(430px, 100%); }
.auth-card .wordmark { justify-content: center; padding: 0 0 22px; }
.auth-card .wordmark img { width: 56px; height: 56px; }
.auth-card .wordmark span { font-size: 34px; color: #fff; }
.auth-card .panel { padding: 28px 30px; border-color: var(--rule-2); box-shadow: 0 18px 44px rgba(15, 28, 51, .22); }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card button[type=submit] { width: 100%; padding: 11px; margin-top: 6px; font-size: 14.5px; }
.auth-err { color: var(--rust); font-size: 13px; min-height: 18px; margin-bottom: 6px; }

#toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(16px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 50; max-width: 90vw; font-size: 13.5px; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.bad { background: var(--rust); }
dialog { border: 1px solid var(--rule-2); border-top: 4px solid var(--accent); border-radius: 8px; padding: 0; width: min(580px, 94vw); box-shadow: 0 24px 60px rgba(18, 26, 43, .22); color: var(--ink); }
dialog::backdrop { background: rgba(18, 26, 43, .32); }
#modalBody { padding: 24px 26px; }
#modalBody h2 { margin-bottom: 14px; }

@media (max-width: 960px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; position: static; }
  .topbar .wordmark { border-right: 0; padding-right: 8px; margin-right: 0; }
  .wordmark img { width: 32px; height: 32px; }
  .mainnav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .mainnav a { padding: 10px 14px; white-space: nowrap; }
  .me { margin-left: auto; }
  .who { display: none; }
  .body { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .side-title { display: none; }
  .side .sgroup { display: flex; gap: 4px; overflow-x: auto; }
  .side .sgroup[hidden] { display: none; }
  .side nav a { white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  .side nav a.active { border-bottom-color: var(--accent); }
  .fig { flex-basis: 140px; }
  main { padding: 20px 16px 60px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; }
  .grid2 { grid-template-columns: 1fr; }
  .cols { grid-template-columns: 1fr; }
  h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- list family tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 10px; padding-left: 16px; border-left: 1px solid var(--rule-2); }
.tnode { padding: 7px 10px; margin: 2px 0; border-radius: var(--r-sm); }
.tnode.here { background: var(--accent-tint); }
.trail > li.code-ev::after { border-style: dashed; }
.seller-card { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; background: var(--sunk); border: 1px solid var(--rule); border-radius: var(--r-sm); font-size: 13px; }
.live-cpl { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1.1; color: var(--navy); }

/* ---------- polish */
.resultbar select, .actions select, .pager select { width: auto; min-width: 190px; }
.filters fieldset > .field:last-child { margin-bottom: 0; }
.menu a { font-weight: 500; }
td a, .crumb a { font-weight: 600; }
.panel { overflow-x: auto; }

/* ---------- help desk */
.helpbtn { display: flex; align-items: center; gap: 7px; align-self: center; margin-right: 10px; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 18px; color: #fff; font-weight: 600; font-size: 13.5px; text-decoration: none; transition: background .12s, border-color .12s; }
.helpbtn:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .6); color: #fff; }
.helpbtn .badge { background: #fff; color: var(--navy); }
.thread { display: flex; flex-direction: column; gap: 12px; max-width: 860px; margin-bottom: 18px; }
.msg { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--rule-2); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--shadow); }
.msg.support { border-left-color: var(--accent); background: #f7f9fc; }
.msg.internal { border-left-color: var(--amber); background: var(--amber-tint); }
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.msg-head .muted { margin-left: auto; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
textarea { resize: vertical; min-height: 90px; }

/* security + backup status */
.statusdot { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12.5px; text-transform: capitalize; }
.statusdot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2e7d4f; }
.statusdot.bad::before { background: #b3261e; } .statusdot.bad { color: #8f1d17; }
.statusdot.warn::before { background: #b7791f; }
.notice.ok { background: #e8f3ec; border-color: #b9d8c5; color: #1d4d33; }
.notice.bad { background: #fbeceb; border-color: #e9bdb9; color: #7a1a15; }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; font-size: 13.5px; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; font-weight: 600; }
#secf h4 { margin: 18px 0 8px; padding-top: 12px; border-top: 1px solid var(--line, #d9dee7); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
#secf h4:first-of-type { border-top: 0; padding-top: 0; margin-top: 4px; }

/* feature switches */
.feat-h { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
.featgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 18px; }
label.feat { align-items: flex-start; } label.feat span { display: flex; flex-direction: column; } label.feat small { color: var(--muted); font-weight: 400; line-height: 1.35; margin-top: 2px; }

/* Find & Sell Leads: tick-box dropdowns (State, Vehicle year) and the More filters toggle */
.msel { border: 1px solid var(--rule-2); border-radius: var(--r-sm); background: #fff; margin-top: 10px; }
.msel > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; }
.msel > summary::-webkit-details-marker { display: none; }
.msel > summary::after { content: "▾"; color: var(--muted); }
.msel[open] > summary::after { content: "▴"; }
.msel-title { font-weight: 600; color: var(--ink-2); }
.msel-val { margin-left: auto; color: var(--ink); font-size: 13px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.msel-pop { border-top: 1px solid var(--rule); padding: 8px 10px 10px; }
.msel-find { width: 100%; margin-bottom: 6px; }
.msel-acts { display: flex; gap: 14px; margin-bottom: 4px; }
.msel-acts button { background: none; border: 0; padding: 0; color: var(--accent-ink); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.msel-list { max-height: 230px; overflow-y: auto; }
.msel-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.msel-item[hidden] { display: none; }
.msel-n { margin-left: auto; }
.msel-go { width: 100%; margin-top: 8px; }
.more-toggle { width: 100%; margin: 12px 0 14px; }
.more-filters[hidden] { display: none; }
